Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTypedNotFound = errors.New("typed not found") ErrVersionNotFound = errors.New("version not found") ErrVersionIncomplete = errors.New("version incomplete") ErrPlatformNotFound = errors.New("platform not found") ErrPlatformIncomplete = errors.New("platform incomplete") ErrPlatformsIncomplete = errors.New("platforms incomplete") )
Functions ¶
This section is empty.
Types ¶
type GetPlatformOptions ¶
type GetPlatformOptions struct { Hostname string Namespace string Type string Version string OS string Arch string }
GetPlatformOptions holds the options of getting provider platform.
type GetVersionOptions ¶
GetVersionOptions holds the options of getting provider version.
type GetVersionsOptions ¶
GetVersionsOptions holds the options of listing provider versions.
type Platform ¶
type Platform struct { OS string `json:"os"` Arch string `json:"arch"` Filename string `json:"filename"` Shasum string `json:"shasum"` DownloadURL string `json:"download_url"` }
Platform holds the information of provider platform.
type QueryOptions ¶
type QueryOptions struct { Hostname string Namespace string Type string Version string OS string Arch string }
QueryOptions holds the options of querying provider versions.
type Service ¶
type Service interface { // GetVersions gets the list provider version. GetVersions(context.Context, GetVersionsOptions) ([]Version, error) // GetVersion gets a specified provider version. GetVersion(context.Context, GetVersionOptions) (Version, error) // GetPlatform gets detail of a specified provider version. GetPlatform(context.Context, GetPlatformOptions) (Platform, error) // Sync does synchronization from remote to local. Sync(context.Context) error }
Service holds the operation of providers. Value always be json.RawBytes, takes a look of the bucket structure:
BUCKET(providers) BUCKET({hostname}/{namespace}/{type}) KEY(modified): string, RFC3339 * BUCKET({version}): KEY(data): struct{ version: string protocols: []string platforms: []struct{ os: string arch: string } } BUCKET({platform}): KEY(modified): string, RFC3339 * KEY(data): { protocols: []string os: string arch: string filename: string download_url: string shasums_url: string shasums_signature_url: string shasum: string signing_keys: { gpg_public_keys: []{ key_id: string ascii_armor: string trust_signature: string source: string source_url: string } } }
func NewService ¶
func NewService(boltDriver database.BoltDriver) (Service, error)
NewService returns a new metadata service.
Click to show internal directories.
Click to hide internal directories.