|
|
@ -9,15 +9,25 @@ import ( |
|
|
|
"gopkg.in/yaml.v2" |
|
|
|
"gopkg.in/yaml.v2" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// endpoints
|
|
|
|
// GalleryModel is the struct used to represent a model in the gallery returned by the endpoint.
|
|
|
|
|
|
|
|
// It is used to install the model by resolving the URL and downloading the files.
|
|
|
|
|
|
|
|
// The other fields are used to override the configuration of the model.
|
|
|
|
type GalleryModel struct { |
|
|
|
type GalleryModel struct { |
|
|
|
URL string `json:"url" yaml:"url"` |
|
|
|
URL string `json:"url,omitempty" yaml:"url,omitempty"` |
|
|
|
Name string `json:"name" yaml:"name"` |
|
|
|
Name string `json:"name,omitempty" yaml:"name,omitempty"` |
|
|
|
Overrides map[string]interface{} `json:"overrides" yaml:"overrides"` |
|
|
|
Description string `json:"description,omitempty" yaml:"description,omitempty"` |
|
|
|
AdditionalFiles []File `json:"files" yaml:"files"` |
|
|
|
License string `json:"license,omitempty" yaml:"license,omitempty"` |
|
|
|
Gallery Gallery `json:"gallery" yaml:"gallery"` |
|
|
|
URLs []string `json:"urls,omitempty" yaml:"urls,omitempty"` |
|
|
|
Installed bool `json:"installed" yaml:"installed"` |
|
|
|
Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Overrides are used to override the configuration of the model
|
|
|
|
|
|
|
|
Overrides map[string]interface{} `json:"overrides,omitempty" yaml:"overrides,omitempty"` |
|
|
|
|
|
|
|
// AdditionalFiles are used to add additional files to the model
|
|
|
|
|
|
|
|
AdditionalFiles []File `json:"files,omitempty" yaml:"files,omitempty"` |
|
|
|
|
|
|
|
// Gallery is a reference to the gallery which contains the model
|
|
|
|
|
|
|
|
Gallery Gallery `json:"gallery,omitempty" yaml:"gallery,omitempty"` |
|
|
|
|
|
|
|
// Installed is used to indicate if the model is installed or not
|
|
|
|
|
|
|
|
Installed bool `json:"installed,omitempty" yaml:"installed,omitempty"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|