Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TimeoutDuration represents how long we should wait before a response back // from the API before timing out. TimeoutDuration = time.Second * 30 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
Backend defines the state methods this facade needs, so they can be mocked for testing.
type CharmHubAPI ¶
type CharmHubAPI struct {
// contains filtered or unexported fields
}
CharmHubAPI API provides the CharmHub API facade for version 1.
func NewFacade ¶
func NewFacade(ctx facade.Context) (*CharmHubAPI, error)
NewFacade creates a new CharmHubAPI facade.
func (*CharmHubAPI) Find ¶
func (api *CharmHubAPI) Find(ctx context.Context, arg params.Query) (params.CharmHubEntityFindResult, error)
Find queries the CharmHub API with a given entity ID.
func (*CharmHubAPI) Info ¶
func (api *CharmHubAPI) Info(ctx context.Context, arg params.Info) (params.CharmHubEntityInfoResult, error)
Info queries the CharmHub API with a given entity ID.
type Client ¶
type Client interface { URL() string Info(ctx context.Context, name string, options ...charmhub.InfoOption) (transport.InfoResponse, error) Find(ctx context.Context, query string, options ...charmhub.FindOption) ([]transport.FindResponse, error) }
Client represents a CharmHub Client for making queries to the CharmHub API.
type ClientFactory ¶
ClientFactory defines a factory for creating clients from a given url.
Click to show internal directories.
Click to hide internal directories.