Documentation
¶
Index ¶
- Constants
- func ErrorConnectionFailed(host string) error
- func IsErrConfigNotFound(err error) booldeprecated
- func IsErrConnectionFailed(err error) bool
- func IsErrContainerNotFound(err error) booldeprecated
- func IsErrImageNotFound(err error) booldeprecated
- func IsErrNetworkNotFound(err error) booldeprecated
- func IsErrNodeNotFound(err error) booldeprecated
- func IsErrNotFound(err error) bool
- func IsErrNotImplemented(err error) bool
- func IsErrPluginNotFound(err error) booldeprecated
- func IsErrPluginPermissionDenied(err error) bool
- func IsErrSecretNotFound(err error) booldeprecated
- func IsErrServiceNotFound(err error) booldeprecated
- func IsErrTaskNotFound(err error) booldeprecated
- func IsErrUnauthorized(err error) bool
- func IsErrVolumeNotFound(err error) booldeprecated
- func ParseHostURL(host string) (*url.URL, error)
- type Client
- func (cli *Client) Balance(ctx context.Context, req *types.Status) (exitResp *types.ChanExitResp, err error)
- func (cli *Client) ChannelCreate(ctx context.Context, req *types.ChanCreate) (nodeID string, err error)
- func (cli *Client) ChannelExit(ctx context.Context, req *types.ChanExit) (exitResp *types.ChanExitResp, err error)
- func (cli *Client) ChannelJoin(ctx context.Context, req *types.ChanJoin) (nodeID string, err error)
- func (cli *Client) Close() error
- func (cli *Client) Health(ctx context.Context) (*types.Health, error)
- func (cli *Client) Shutdown(ctx context.Context) error
- func (cli *Client) Status(ctx context.Context, status *types.Status) error
- func (cli *Client) Trade(ctx context.Context, trade *types.Trade) error
- type HealthResponse
Constants ¶
const ( // HTTP string HTTP = "http" // HTTPS string HTTPS = "https" )
const DefaultOceHost = "http://127.0.0.1:12309/api/v1"
DefaultOceHost default oce server host
Variables ¶
This section is empty.
Functions ¶
func ErrorConnectionFailed ¶
ErrorConnectionFailed returns an error with host in the error message when connection to oce daemon failed.
func IsErrConnectionFailed ¶
IsErrConnectionFailed returns true if the error is caused by connection failed.
func IsErrNotFound ¶
IsErrNotFound returns true if the error is a NotFound error, which is returned by the API when some object is not found.
func IsErrNotImplemented ¶
IsErrNotImplemented returns true if the error is a NotImplemented error. This is returned by the API when a requested feature has not been implemented.
func IsErrPluginPermissionDenied ¶
IsErrPluginPermissionDenied returns true if the error is caused when a user denies a plugin's permissions
func IsErrUnauthorized ¶
IsErrUnauthorized returns true if the error is caused when a remote registry authentication fails
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API client that performs all operations against a oce server.
func NewClient ¶
NewClient initializes a new API client for the given host. It uses the given http client as transport. It also initializes the custom http headers to add to each request.
func (*Client) Balance ¶
func (cli *Client) Balance(ctx context.Context, req *types.Status) (exitResp *types.ChanExitResp, err error)
Balance balance of channel
func (*Client) ChannelCreate ¶
func (cli *Client) ChannelCreate(ctx context.Context, req *types.ChanCreate) (nodeID string, err error)
ChannelCreate create channel
func (*Client) ChannelExit ¶
func (cli *Client) ChannelExit(ctx context.Context, req *types.ChanExit) (exitResp *types.ChanExitResp, err error)
ChannelExit exit channel
func (*Client) ChannelJoin ¶
ChannelJoin join channel
func (*Client) Health ¶
Health check oce deamon health
func (*Client) Shutdown ¶
Shutdown shutdown oce deamon
func (*Client) Status ¶
Status status