Documentation ¶
Index ¶
- Constants
- func GenTLSConfig(key, cert, ca string) (*tls.Config, error)
- func NewHTTPClient(u *url.URL, tlsConfig *tls.Config, dialTimeout time.Duration) *http.Client
- func ParseHost(host string) (*url.URL, string, string, error)
- type APIClient
- func (client *APIClient) BaseURL() string
- func (client *APIClient) GetAPIPath(path string, query url.Values) string
- func (client *APIClient) PeerCreate(ctx context.Context, config *types.PeerCreateRequest) (*types.PeerCreateResponse, error)
- func (client *APIClient) PeerDelete(ctx context.Context, id string) error
- func (client *APIClient) PeerInfo(ctx context.Context, id string) (*types.PeerInfo, error)
- func (client *APIClient) PeerList(ctx context.Context, id string) ([]*types.PeerInfo, error)
- func (client *APIClient) Ping(ctx context.Context) (string, error)
- func (client *APIClient) PreheatCreate(ctx context.Context, config *types.PreheatCreateRequest) (*types.PreheatCreateResponse, error)
- func (client *APIClient) PreheatInfo(ctx context.Context, id string) (*types.PreheatInfo, error)
- func (client *APIClient) PreheatList(ctx context.Context, id string) ([]*types.PreheatInfo, error)
- func (client *APIClient) UpdateClientVersion(v string)
- type CommonAPIClient
- type PreheatAPIClient
- type RespError
- type Response
- type TLSConfig
Constants ¶
const HTTPSScheme = "https"
HTTPSScheme is a scheme for HTTPS.
const HTTPScheme = "http"
HTTPScheme is a scheme for HTTP.
const TCPScheme = "tcp"
TCPScheme is a scheme for TCP.
const UnixScheme = "unix"
UnixScheme is a scheme for unix.
Variables ¶
This section is empty.
Functions ¶
func GenTLSConfig ¶
GenTLSConfig returns a tls config object according to inputting parameters.
func NewHTTPClient ¶
NewHTTPClient creates a http client using url and tlsconfig
Types ¶
type APIClient ¶
APIClient is a API client that performs all operations against a server
func (*APIClient) GetAPIPath ¶
GetAPIPath returns the versioned request path to call the api. It appends the query parameters to the path if they are not empty.
func (*APIClient) PeerCreate ¶
func (client *APIClient) PeerCreate(ctx context.Context, config *types.PeerCreateRequest) (*types.PeerCreateResponse, error)
PeerCreate creates a peer node in supernode.
func (*APIClient) PeerDelete ¶
PeerDelete deletes the specified peer in supernode.
func (*APIClient) PreheatCreate ¶
func (client *APIClient) PreheatCreate(ctx context.Context, config *types.PreheatCreateRequest) (*types.PreheatCreateResponse, error)
PreheatCreate creates a preheat task.
func (*APIClient) PreheatInfo ¶
PreheatInfo get detailed information of a preheat task.
func (*APIClient) PreheatList ¶
PreheatList lists detailed information of preheat tasks.
func (*APIClient) UpdateClientVersion ¶
UpdateClientVersion sets client version new value.
type CommonAPIClient ¶
type CommonAPIClient interface { PreheatAPIClient }
CommonAPIClient defines common methods of api client
func NewAPIClient ¶
func NewAPIClient(host string, tls TLSConfig) (CommonAPIClient, error)
NewAPIClient initializes a new API client for the given host
type PreheatAPIClient ¶
type PreheatAPIClient interface {
PreheatCreate(ctx context.Context, config *types.PreheatCreateRequest) (*types.PreheatCreateResponse, error)
}
PreheatAPIClient defines methods of Container client.
type RespError ¶
type RespError struct {
// contains filtered or unexported fields
}
RespError defines the response error.
type Response ¶
type Response struct { StatusCode int Status string Body io.ReadCloser }
Response wraps the http.Response and other states.
type TLSConfig ¶
type TLSConfig struct { CA string `json:"tlscacert,omitempty"` Cert string `json:"tlscert,omitempty"` Key string `json:"tlskey,omitempty"` VerifyRemote bool `json:"tlsverify,omitempty"` ManagerWhiteList string `json:"manager-whitelist,omitempty"` }
TLSConfig contains information of tls which users can specify