SearchPath is the url path to the search API in monocular.
const SearchPath = "api/chartsvc/v1/charts/search"
ErrHostnameNotProvided indicates the url is missing a hostname
var ErrHostnameNotProvided = errors.New("no hostname provided")
ArtifactHub represents data specific to Artifact Hub instances
type ArtifactHub struct { PackageURL string `json:"packageUrl"` }
Chart is the attributes for the chart
type Chart struct { Name string `json:"name"` Repo Repo `json:"repo"` Description string `json:"description"` Home string `json:"home"` Keywords []string `json:"keywords"` Maintainers []chart.Maintainer `json:"maintainers"` Sources []string `json:"sources"` Icon string `json:"icon"` }
ChartVersion provides the specific data on the chart version
type ChartVersion struct { Version string `json:"version"` AppVersion string `json:"app_version"` Created time.Time `json:"created"` Digest string `json:"digest"` Urls []string `json:"urls"` Readme string `json:"readme"` Values string `json:"values"` }
Client represents a client capable of communicating with the Monocular API.
type Client struct { // The base URL for requests BaseURL string // The internal logger to use Log func(string, ...interface{}) }
func New(u string) (*Client, error)
New creates a new client
func (c *Client) Search(term string) ([]SearchResult, error)
Search performs a search against the monocular search API
LatestChartVersion provides the details on the latest version of the chart
type LatestChartVersion struct { Data ChartVersion `json:"data"` Links Links `json:"links"` }
Links provides a set of links relative to the chartsvc base
type Links struct { Self string `json:"self"` }
Relationships provides information on the latest version of the chart
type Relationships struct { LatestChartVersion LatestChartVersion `json:"latestChartVersion"` }
Repo contains the name in monocular the url for the repository
type Repo struct { Name string `json:"name"` URL string `json:"url"` }
SearchResult represents an individual chart result
type SearchResult struct { ID string `json:"id"` ArtifactHub ArtifactHub `json:"artifactHub"` Type string `json:"type"` Attributes Chart `json:"attributes"` Links Links `json:"links"` Relationships Relationships `json:"relationships"` }