Documentation ¶
Index ¶
- func ListMaintenance(registries []*url.URL) ([]couchdb.JSONDoc, error)
- func ParseSlug(raw json.RawMessage) string
- func Proxy(req *http.Request, registries []*url.URL, cache CacheControl) (*http.Response, error)
- type Application
- type AppsPaginated
- type CacheControl
- type MaintenanceOptions
- type PageInfo
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListMaintenance ¶
ListMaintenance will proxy the given request to the registries to fetch all the apps in maintenance. It takes care to ignore maintenance for apps present in another registry space with higher priority.
func ParseSlug ¶
func ParseSlug(raw json.RawMessage) string
Types ¶
type Application ¶
type Application struct { Slug string `json:"slug"` Type string `json:"type"` MaintenanceActivated bool `json:"maintenance_activated,omitempty"` MaintenanceOptions MaintenanceOptions `json:"maintenance_options"` }
An Application describe an application on the registry
func GetApplication ¶
func GetApplication(slug string, registries []*url.URL) (*Application, error)
GetApplication returns an application from his slug
type AppsPaginated ¶
type AppsPaginated struct { Apps []map[string]json.RawMessage `json:"data"` PageInfo PageInfo `json:"meta"` }
AppsPaginated is a struct for listing apps manifest from the registry, with pagination.
type CacheControl ¶
type CacheControl int
CacheControl defines whether or not to use caching for the request made to the registries.
const ( // WithCache specify caching WithCache CacheControl = iota // NoCache disables any caching NoCache )
type MaintenanceOptions ¶
type MaintenanceOptions struct { FlagInfraMaintenance bool `json:"flag_infra_maintenance"` FlagShortMaintenance bool `json:"flag_short_maintenance"` FlagDisallowManualExec bool `json:"flag_disallow_manual_exec"` }
A MaintenanceOptions defines options about a maintenance
type Version ¶
type Version struct { Slug string `json:"slug"` Version string `json:"version"` URL string `json:"url"` Sha256 string `json:"sha256"` CreatedAt time.Time `json:"created_at"` Size string `json:"size"` Manifest json.RawMessage `json:"manifest"` TarPrefix string `json:"tar_prefix"` }
A Version describes a specific release of an application.
func GetLatestVersion ¶
GetLatestVersion returns the latest version available from the list of registries by resolving them in sequence using the specified application slug and channel name.