| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | package repo | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-30 17:48:52 +08:00
										 |  |  | import "archive/zip" | 
					
						
							| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | type PluginArchive struct { | 
					
						
							|  |  |  | 	File *zip.ReadCloser | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-30 17:48:52 +08:00
										 |  |  | type PluginArchiveInfo struct { | 
					
						
							|  |  |  | 	URL      string | 
					
						
							|  |  |  | 	Version  string | 
					
						
							|  |  |  | 	Checksum string | 
					
						
							| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:46:26 +08:00
										 |  |  | // PluginVersions is the JSON response from /api/plugins/$pluginID/versions
 | 
					
						
							|  |  |  | type PluginVersions struct { | 
					
						
							|  |  |  | 	Versions []Version `json:"items"` | 
					
						
							| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Version struct { | 
					
						
							| 
									
										
										
										
											2024-08-22 19:47:00 +08:00
										 |  |  | 	Version           string              `json:"version"` | 
					
						
							|  |  |  | 	Arch              map[string]ArchMeta `json:"packages"` | 
					
						
							|  |  |  | 	URL               string              `json:"url"` | 
					
						
							|  |  |  | 	CreatedAt         string              `json:"createdAt"` | 
					
						
							|  |  |  | 	IsCompatible      *bool               `json:"isCompatible,omitempty"` | 
					
						
							|  |  |  | 	GrafanaDependency string              `json:"grafanaDependency"` | 
					
						
							| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type ArchMeta struct { | 
					
						
							| 
									
										
										
										
											2024-08-22 19:47:00 +08:00
										 |  |  | 	SHA256      string `json:"sha256"` | 
					
						
							|  |  |  | 	MD5         string `json:"md5"` | 
					
						
							|  |  |  | 	PackageName string `json:"packageName"` | 
					
						
							|  |  |  | 	DownloadURL string `json:"downloadUrl"` | 
					
						
							| 
									
										
										
										
											2022-08-23 17:50:50 +08:00
										 |  |  | } |