charmhub

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

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

type Backend interface {
	ModelConfig() (*config.Config, error)
}

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

Find queries the CharmHub API with a given entity ID.

func (*CharmHubAPI) Info

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

type ClientFactory interface {
	Client(string) (Client, error)
}

ClientFactory defines a factory for creating clients from a given url.

Jump to

Keyboard shortcuts

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