Documentation
¶
Index ¶
- Variables
- func NewClientAPI(address string) api.Client
- func NewCustomClientAPI(address string, client *http.Client) api.Client
- func NewCustomReplicatorAPI(address string, client *http.Client) api.Replicator
- func NewReplicatorAPI(address string) api.Replicator
- type Error
- type FileInfo
- type Request
- type RequestBuilder
- type Response
- type Stat
Constants ¶
This section is empty.
Variables ¶
View Source
var (
APIPath = "/api/v1"
)
Functions ¶
func NewClientAPI ¶
New creates new apiHttp.Client from given address and default http.Client
func NewCustomClientAPI ¶
NewCustomClientAPI creates new apiHttp.Client from given address and custom http.Client
func NewCustomReplicatorAPI ¶
func NewCustomReplicatorAPI(address string, client *http.Client) api.Replicator
NewCustomReplicatorAPI creates new api.Client from given address and custom http.Client
func NewReplicatorAPI ¶
func NewReplicatorAPI(address string) api.Replicator
NewReplicatorAPI creates new api.Client from given address and default http.Client
Types ¶
type Request ¶
type Request struct { Ctx context.Context ApiBase string Command string Args []string Opts map[string]string Body io.Reader Headers map[string]string }
func NewRequest ¶
type RequestBuilder ¶
type RequestBuilder interface { Arguments(args ...string) RequestBuilder BodyString(body string) RequestBuilder BodyBytes(body []byte) RequestBuilder Body(body io.Reader) RequestBuilder FileBody(file files.Node) RequestBuilder Option(key string, value interface{}) RequestBuilder Header(name, value string) RequestBuilder Send(ctx context.Context) (*Response, error) Exec(ctx context.Context, res interface{}) error }
Click to show internal directories.
Click to hide internal directories.