Documentation
¶
Index ¶
- Constants
- Variables
- type Connection
- func (c *Connection) AuthIdentity(ctx context.Context) (*Response, error)
- func (c *Connection) AuthMethod(ctx context.Context) (*Response, error)
- func (c *Connection) BranchGet(ctx context.Context, poolID ksuid.KSUID, branchName string) (*Response, error)
- func (c *Connection) BranchPost(ctx context.Context, poolID ksuid.KSUID, payload api.BranchPostRequest) (*Response, error)
- func (c *Connection) ClientHostURL() string
- func (c *Connection) Delete(ctx context.Context, poolID ksuid.KSUID, branchName string, ids []ksuid.KSUID, ...) (*Response, error)
- func (c *Connection) Do(ctx context.Context, method, url string, body interface{}) (*resty.Response, error)
- func (c *Connection) IndexPost(ctx context.Context, id ksuid.KSUID, post api.IndexPostRequest) error
- func (c *Connection) Load(ctx context.Context, poolID ksuid.KSUID, branchName string, r io.Reader, ...) (*Response, error)
- func (c *Connection) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch string, ...) (*Response, error)
- func (c *Connection) Ping(ctx context.Context) (time.Duration, error)
- func (c *Connection) PoolPost(ctx context.Context, payload api.PoolPostRequest) (*Response, error)
- func (c *Connection) PoolPut(ctx context.Context, id ksuid.KSUID, req api.PoolPutRequest) error
- func (c *Connection) PoolRemove(ctx context.Context, id ksuid.KSUID) error
- func (c *Connection) PoolStats(ctx context.Context, id ksuid.KSUID) (*Response, error)
- func (c *Connection) Query(ctx context.Context, head *lakeparse.Commitish, src string, ...) (*Response, error)
- func (c *Connection) Request(ctx context.Context) *resty.Request
- func (c *Connection) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, ...) (*Response, error)
- func (c *Connection) SetAuthToken(token string)
- func (c *Connection) SetTimeout(to time.Duration)
- func (c *Connection) SetURL(u string)
- func (c *Connection) SetUserAgent(useragent string)
- func (c *Connection) URL() string
- func (c *Connection) Version(ctx context.Context) (string, error)
- type ErrorResponse
- type Response
Constants ¶
View Source
const ( // DefaultPort zqd port to connect with. DefaultPort = 9867 DefaultUserAgent = "zqd-client-golang" )
Variables ¶
View Source
var ( // ErrPoolNotFound is returned when the specified pool does not exist. ErrPoolNotFound = errors.New("pool not found") // ErrPoolExists is returned when the specified the pool already exists. ErrPoolExists = errors.New("pool exists") // ErrBranchNotFound is returned when the specified branch does not exist. ErrBranchNotFound = errors.New("branch not found") // ErrBranchExists is returned when the specified the branch already exists. ErrBranchExists = errors.New("branch exists") )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection() *Connection
NewConnection creates a new connection with the given useragent string and a base URL set up to talk to http://localhost:defaultport
func NewConnectionTo ¶
func NewConnectionTo(hostURL string) *Connection
NewConnectionTo creates a new connection with the given useragent string and a base URL derived from the hostURL argument.
func (*Connection) AuthIdentity ¶
func (c *Connection) AuthIdentity(ctx context.Context) (*Response, error)
func (*Connection) AuthMethod ¶
func (c *Connection) AuthMethod(ctx context.Context) (*Response, error)
func (*Connection) BranchPost ¶
func (c *Connection) BranchPost(ctx context.Context, poolID ksuid.KSUID, payload api.BranchPostRequest) (*Response, error)
func (*Connection) ClientHostURL ¶
func (c *Connection) ClientHostURL() string
ClientHostURL allows us to print the host in log messages and internal error messages
func (*Connection) IndexPost ¶
func (c *Connection) IndexPost(ctx context.Context, id ksuid.KSUID, post api.IndexPostRequest) error
func (*Connection) MergeBranch ¶
func (c *Connection) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch string, message api.CommitMessage) (*Response, error)
func (*Connection) Ping ¶
Ping checks to see if the server and measure the time it takes to get back the response.
func (*Connection) PoolPost ¶
func (c *Connection) PoolPost(ctx context.Context, payload api.PoolPostRequest) (*Response, error)
func (*Connection) PoolPut ¶
func (c *Connection) PoolPut(ctx context.Context, id ksuid.KSUID, req api.PoolPutRequest) error
func (*Connection) PoolRemove ¶
func (*Connection) SetAuthToken ¶
func (c *Connection) SetAuthToken(token string)
func (*Connection) SetTimeout ¶
func (c *Connection) SetTimeout(to time.Duration)
SetTimeout sets the underlying http request timeout to the given duration
func (*Connection) SetURL ¶
func (c *Connection) SetURL(u string)
func (*Connection) SetUserAgent ¶
func (c *Connection) SetUserAgent(useragent string)
func (*Connection) URL ¶
func (c *Connection) URL() string
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
func (*ErrorResponse) Unwrap ¶
func (e *ErrorResponse) Unwrap() error
Click to show internal directories.
Click to hide internal directories.