plan

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: AGPL-3.0 Imports: 11 Imported by: 10

Documentation

Overview

Package plan contains the plan service API client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIRoot

func APIRoot(url string) func(h *client) error

APIRoot sets the base url for the api client.

func HTTPClient

func HTTPClient(c httpClient) func(h *client) error

HTTPClient returns a function that sets the http client used by the API (e.g. if we want to use TLS).

func NewClient

func NewClient(options ...ClientOption) (*client, error)

NewClient returns a new client for plan management.

Types

type AuthorizationClient

type AuthorizationClient interface {
	// Authorize returns the authorization macaroon for the specified environment, charm url and service name.
	Authorize(environmentUUID, charmURL, serviceName, plan string, visitWebPage func(*url.URL) error) (*macaroon.Macaroon, error)
}

AuthorizationClient defines the interface available to clients of the public plan api.

func NewAuthorizationClient

func NewAuthorizationClient(options ...ClientOption) (AuthorizationClient, error)

NewAuthorizationClient returns a new public authorization client.

type Client

type Client interface {
	// GetAssociatedPlans returns the plans associated with the charm.
	GetAssociatedPlans(charmURL string) ([]wireformat.Plan, error)
}

Client defines the interface available to clients of the plan api.

type ClientOption

type ClientOption func(h *client) error

ClientOption defines a function which configures a Client.

Jump to

Keyboard shortcuts

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