Documentation
¶
Index ¶
- Variables
- func AddDefaultRegistry(queries *model.Queries) error
- func AddNewRegistry(queries *model.Queries, name string, url string) error
- func FindPluginVersionCandidate(plugin Plugin) (PluginFile, PluginVersion, error)
- func GetCurrentPlatform() string
- func InstallPlugin(queries *model.Queries, registry string, plugin string) (string, error)
- func UninstallPlugin(queries *model.Queries, registry string, plugin string) error
- func UpdatePlugin(queries *model.Queries, registry string, plugin string) error
- func UpdateRegistry(queries *model.Queries, name string) error
- func ValidateSchema(registry []byte) error
- type Plugin
- type PluginFile
- type PluginVersion
- type Registry
- type UserConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultRegistryBasePath = "https://registry.anyquery.dev/"
Functions ¶
func AddDefaultRegistry ¶
func AddNewRegistry ¶
Add a new registry to the list of registries in the database.
It ensures the registry is valid, does not already exist, and then adds it to the list of registries.
func FindPluginVersionCandidate ¶
func FindPluginVersionCandidate(plugin Plugin) (PluginFile, PluginVersion, error)
Find the highest version of a plugin that is compatible with the current version of Anyquery and with the user's system
func GetCurrentPlatform ¶
func GetCurrentPlatform() string
func InstallPlugin ¶
func UninstallPlugin ¶
func UpdateRegistry ¶
Update the JSON content in the database of the given registry.
If the registry does not exist, it returns an error. If the registry has not changed, it does nothing.
func ValidateSchema ¶
Validates the given JSON string against the schema_registry.json schema.
Types ¶
type Plugin ¶
type Plugin struct { Name string `json:"name"` Description string `json:"description"` PageContent string `json:"page_content"` Author string `json:"author"` Homepage string `json:"homepage"` License string `json:"license"` Registry string // This is not a field in the registry, but can be filled for easier access // If type is different than anyquery or SharedObject, it will be ignored Type string `json:"type"` Versions []PluginVersion `json:"versions"` }
func ListInstallablePlugins ¶
Return a list of all the plugins installable from the registries It does not check if the plugin is already installed, neither if the plugin is compatible with the current version of Anyquery nor if the plugin has a file for the current platform
type PluginFile ¶
type PluginVersion ¶
type PluginVersion struct { Version string `json:"version"` MinimumRequiredVersion string `json:"minimum_required_version"` Files map[string]PluginFile `json:"files"` // Platform -> File UserConfig []UserConfig `json:"user_config"` Tables []string `json:"tables"` }
type UserConfig ¶
type UserConfig struct { Name string `json:"name"` Required bool `json:"required"` // The type of the variable prompted to the user // Can be: string, int, float, bool, []string, []int, []float, []bool Type string `json:"type"` Description string `json:"description"` Validation string `json:"validation"` }