stores

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact added in v0.3.0

type Artifact struct {
	Name     string     `json:"name"`
	URL      string     `json:"url"`
	Releases []*Release `json:"releases"`
	Channels []string   `json:"channels"`
	Tracks   []string   `json:"tracks"`
}

Artifact holds information about an artifact in a Canonical store (e.g. a snap or charm).

func NewArtifact added in v0.3.0

func NewArtifact(name string, details *ArtifactDetails) *Artifact

NewArtifact returns a representation of an artifact with its releases/tracks/channels populated.

type ArtifactDetails added in v0.4.0

type ArtifactDetails struct {
	StoreURL     string
	Tracks       []gjson.Result
	Channels     []gjson.Result
	ReleaseTimes []gjson.Result
	Revisions    []gjson.Result
	Bases        []gjson.Result
}

ArtifactDetails is used for storing the raw info fetched about an artifact from the store.

func FetchCharmDetails added in v0.3.0

func FetchCharmDetails(ctx context.Context, name string) (*ArtifactDetails, error)

FetchCharmDetails fetches the Json representing charm information by querying the Charmhub API.

func FetchSnapDetails added in v0.3.0

func FetchSnapDetails(ctx context.Context, name string) (*ArtifactDetails, error)

FetchSnapDetails fetches the Json representing charm information by querying the Snapcraft API.

type Release added in v0.3.0

type Release struct {
	Track     string `json:"track"`
	Channel   string `json:"channel"`
	Revision  int64  `json:"revision"`
	Timestamp int64  `json:"timestamp"`
	Base      string `json:"base"`
}

Release represents a given Release of an artifact in a Canonical Store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL