Documentation ¶
Index ¶
- Constants
- Variables
- type Connection
- func (c *Connection) AddVectors(ctx context.Context, pool, revision string, objectIDs []ksuid.KSUID, ...) (api.CommitResponse, error)
- func (c *Connection) AuthIdentity(ctx context.Context) (api.AuthIdentityResponse, error)
- func (c *Connection) AuthMethod(ctx context.Context) (api.AuthMethodResponse, error)
- func (c *Connection) BranchGet(ctx context.Context, poolID ksuid.KSUID, branchName string) (api.CommitResponse, error)
- func (c *Connection) ClientHostURL() string
- func (c *Connection) Compact(ctx context.Context, poolID ksuid.KSUID, branchName string, ...) (api.CommitResponse, error)
- func (c *Connection) CreateBranch(ctx context.Context, poolID ksuid.KSUID, payload api.BranchPostRequest) (branches.Config, error)
- func (c *Connection) CreatePool(ctx context.Context, payload api.PoolPostRequest) (lake.BranchMeta, error)
- func (c *Connection) Delete(ctx context.Context, poolID ksuid.KSUID, branchName string, ids []ksuid.KSUID, ...) (api.CommitResponse, error)
- func (c *Connection) DeleteVectors(ctx context.Context, pool, revision string, objectIDs []ksuid.KSUID, ...) (api.CommitResponse, error)
- func (c *Connection) DeleteWhere(ctx context.Context, poolID ksuid.KSUID, branchName, src string, ...) (api.CommitResponse, error)
- func (c *Connection) Do(req *Request) (*Response, error)
- func (c *Connection) Load(ctx context.Context, poolID ksuid.KSUID, branchName, contentType string, ...) (api.CommitResponse, error)
- func (c *Connection) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch string, ...) (api.CommitResponse, error)
- func (c *Connection) NewRequest(ctx context.Context, method, path string, body interface{}) *Request
- func (c *Connection) Ping(ctx context.Context) (time.Duration, error)
- func (c *Connection) PoolStats(ctx context.Context, id ksuid.KSUID) (exec.PoolStats, error)
- func (c *Connection) Query(ctx context.Context, head *lakeparse.Commitish, src string, ...) (*Response, error)
- func (c *Connection) RemovePool(ctx context.Context, id ksuid.KSUID) error
- func (c *Connection) RenamePool(ctx context.Context, id ksuid.KSUID, put api.PoolPutRequest) error
- func (c *Connection) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, ...) (api.CommitResponse, error)
- func (c *Connection) SetAuthStore(store *auth0.Store) error
- func (c *Connection) SetAuthToken(token string)
- func (c *Connection) SetUserAgent(useragent string)
- func (c *Connection) SubscribeEvents(ctx context.Context) (*EventsClient, error)
- func (c *Connection) Vacuum(ctx context.Context, pool, revision string, dryrun bool) (api.VacuumResponse, error)
- func (c *Connection) Version(ctx context.Context) (string, error)
- type ErrorResponse
- type EventsClient
- type Request
- type Response
Constants ¶
const ( // DefaultPort zqd port to connect with. DefaultPort = 9867 DefaultUserAgent = "zqd-client-golang" )
Variables ¶
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) AddVectors ¶ added in v1.9.0
func (c *Connection) AddVectors(ctx context.Context, pool, revision string, objectIDs []ksuid.KSUID, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) AuthIdentity ¶
func (c *Connection) AuthIdentity(ctx context.Context) (api.AuthIdentityResponse, error)
func (*Connection) AuthMethod ¶
func (c *Connection) AuthMethod(ctx context.Context) (api.AuthMethodResponse, error)
func (*Connection) BranchGet ¶
func (c *Connection) BranchGet(ctx context.Context, poolID ksuid.KSUID, branchName string) (api.CommitResponse, 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) Compact ¶ added in v1.2.0
func (c *Connection) Compact(ctx context.Context, poolID ksuid.KSUID, branchName string, objects []ksuid.KSUID, writeVectors bool, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) CreateBranch ¶ added in v0.32.0
func (c *Connection) CreateBranch(ctx context.Context, poolID ksuid.KSUID, payload api.BranchPostRequest) (branches.Config, error)
func (*Connection) CreatePool ¶ added in v0.32.0
func (c *Connection) CreatePool(ctx context.Context, payload api.PoolPostRequest) (lake.BranchMeta, error)
func (*Connection) Delete ¶
func (c *Connection) Delete(ctx context.Context, poolID ksuid.KSUID, branchName string, ids []ksuid.KSUID, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) DeleteVectors ¶ added in v1.9.0
func (c *Connection) DeleteVectors(ctx context.Context, pool, revision string, objectIDs []ksuid.KSUID, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) DeleteWhere ¶ added in v1.3.0
func (c *Connection) DeleteWhere(ctx context.Context, poolID ksuid.KSUID, branchName, src string, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) Do ¶
func (c *Connection) Do(req *Request) (*Response, error)
Do sends an HTTP request and returns an HTTP response, refreshing the auth token if necessary.
As for net/http.Client.Do, if the returned error is nil, the user is expected to call Response.Body.Close.
func (*Connection) Load ¶
func (c *Connection) Load(ctx context.Context, poolID ksuid.KSUID, branchName, contentType string, r io.Reader, message api.CommitMessage) (api.CommitResponse, error)
Load loads data from r. contentType is a media type for r or the empty string, in which case the server will attempt to detect r's format.
func (*Connection) MergeBranch ¶
func (c *Connection) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch string, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) NewRequest ¶ added in v0.32.0
func (c *Connection) NewRequest(ctx context.Context, method, path string, body interface{}) *Request
func (*Connection) Ping ¶
Ping checks to see if the server and measure the time it takes to get back the response.
func (*Connection) Query ¶
func (c *Connection) Query(ctx context.Context, head *lakeparse.Commitish, src string, filenames ...string) (*Response, error)
Query assembles a query from src and filenames and runs it.
As for Connection.Do, if the returned error is nil, the user is expected to call Response.Body.Close.
func (*Connection) RemovePool ¶ added in v0.32.0
func (*Connection) RenamePool ¶ added in v0.32.0
func (c *Connection) RenamePool(ctx context.Context, id ksuid.KSUID, put api.PoolPutRequest) error
func (*Connection) Revert ¶
func (c *Connection) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, commitID ksuid.KSUID, message api.CommitMessage) (api.CommitResponse, error)
func (*Connection) SetAuthStore ¶ added in v1.0.0
func (c *Connection) SetAuthStore(store *auth0.Store) error
func (*Connection) SetAuthToken ¶
func (c *Connection) SetAuthToken(token string)
func (*Connection) SetUserAgent ¶
func (c *Connection) SetUserAgent(useragent string)
func (*Connection) SubscribeEvents ¶ added in v1.3.0
func (c *Connection) SubscribeEvents(ctx context.Context) (*EventsClient, error)
func (*Connection) Vacuum ¶ added in v1.8.0
func (c *Connection) Vacuum(ctx context.Context, pool, revision string, dryrun bool) (api.VacuumResponse, error)
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
func (*ErrorResponse) Unwrap ¶
func (e *ErrorResponse) Unwrap() error
type EventsClient ¶ added in v1.3.0
type EventsClient struct {
// contains filtered or unexported fields
}
func (*EventsClient) Close ¶ added in v1.3.0
func (l *EventsClient) Close() error
func (*EventsClient) Recv ¶ added in v1.3.0
func (l *EventsClient) Recv() (string, interface{}, error)