Documentation
¶
Index ¶
- type Bundle
- type BundleCharm
- type Channel
- type Charm
- type Client
- type FindOption
- func WithFindCategory(category string) FindOption
- func WithFindChannel(channel string) FindOption
- func WithFindPlatforms(platforms string) FindOption
- func WithFindPublisher(publisher string) FindOption
- func WithFindRelationProvides(relationProvides string) FindOption
- func WithFindRelationRequires(relationRequires string) FindOption
- func WithFindType(charmType string) FindOption
- type FindResponse
- type InfoOption
- type InfoResponse
- type Platform
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
Charms []BundleCharm `json:"charms,omitempty"`
}
type BundleCharm ¶
type Charm ¶
type Charm struct {
Config *charm.Config `json:"config,omitempty"`
Relations map[string]map[string]string `json:"relations,omitempty"`
Subordinate bool `json:"subordinate,omitempty"`
UsedBy []string `json:"used-by,omitempty"` // bundles which use the charm
}
Charm matches a params.CharmHubCharm
type Client ¶
type Client struct {
base.ClientFacade
// contains filtered or unexported fields
}
Client allows access to the CharmHub API end point.
func NewClient ¶
func NewClient(callCloser base.APICallCloser) *Client
NewClient creates a new client for accessing the CharmHub API.
func (*Client) Find ¶
func (c *Client) Find(query string, options ...FindOption) ([]FindResponse, error)
Find queries the CharmHub API finding potential charms or bundles for the given query.
func (*Client) Info ¶
func (c *Client) Info(name string, options ...InfoOption) (InfoResponse, error)
Info queries the CharmHub API for information for a given name.
type FindOption ¶
type FindOption func(*findOptions)
FindOption to be passed to Find to customize the resulting request.
func WithFindCategory ¶
func WithFindCategory(category string) FindOption
WithFindCategory sets the category on the option.
func WithFindChannel ¶
func WithFindChannel(channel string) FindOption
WithFindChannel sets the channel on the option.
func WithFindPlatforms ¶
func WithFindPlatforms(platforms string) FindOption
WithFindPlatforms sets the charmPlatforms on the option.
func WithFindPublisher ¶
func WithFindPublisher(publisher string) FindOption
WithFindPublisher sets the publisher on the option.
func WithFindRelationProvides ¶
func WithFindRelationProvides(relationProvides string) FindOption
WithFindRelationProvides sets the relationProvides on the option.
func WithFindRelationRequires ¶
func WithFindRelationRequires(relationRequires string) FindOption
WithFindRelationRequires sets the relationRequires on the option.
func WithFindType ¶
func WithFindType(charmType string) FindOption
WithFindType sets the charmType on the option.
type FindResponse ¶
type FindResponse struct {
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Publisher string `json:"publisher"`
Summary string `json:"summary"`
Version string `json:"version"`
Arches []string `json:"architectures,omitempty"`
OS []string `json:"os,omitempty"`
Series []string `json:"series,omitempty"`
StoreURL string `json:"store-url"`
}
type InfoOption ¶
type InfoOption func(*infoOptions)
InfoOption to be passed to Info to customize the resulting request.
func WithInfoChannel ¶
func WithInfoChannel(ch string) InfoOption
WithInfoChannel sets the channel on the option.
type InfoResponse ¶
type InfoResponse struct {
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Publisher string `json:"publisher"`
Summary string `json:"summary"`
Series []string `json:"series,omitempty"`
StoreURL string `json:"store-url"`
Tags []string `json:"tags,omitempty"`
Charm *Charm `json:"charm,omitempty"`
Bundle *Bundle `json:"bundle,omitempty"`
Channels map[string]Channel `json:"channel-map"`
Tracks []string `json:"tracks"`
}