client

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2022 License: BSD-3-Clause Imports: 24 Imported by: 1

Documentation

Index

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) AddIndexRules added in v0.32.0

func (c *Connection) AddIndexRules(ctx context.Context, rules []index.Rule) error

func (*Connection) ApplyIndexRules added in v0.32.0

func (c *Connection) ApplyIndexRules(ctx context.Context, poolID ksuid.KSUID, branchName, rule string, oids []ksuid.KSUID) (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) 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) DeleteIndexRules added in v0.32.0

func (c *Connection) DeleteIndexRules(ctx context.Context, ids []ksuid.KSUID) (api.IndexRulesDeleteResponse, error)

func (*Connection) Do

func (c *Connection) Do(req *Request) (*Response, error)

func (*Connection) Load

func (c *Connection) Load(ctx context.Context, poolID ksuid.KSUID, branchName string, r io.Reader, message api.CommitMessage) (api.CommitResponse, error)

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

func (c *Connection) Ping(ctx context.Context) (time.Duration, error)

Ping checks to see if the server and measure the time it takes to get back the response.

func (*Connection) PoolStats

func (c *Connection) PoolStats(ctx context.Context, id ksuid.KSUID) (lake.PoolStats, error)

func (*Connection) Query

func (c *Connection) Query(ctx context.Context, head *lakeparse.Commitish, src string, filenames ...string) (*Response, error)

func (*Connection) RemovePool added in v0.32.0

func (c *Connection) RemovePool(ctx context.Context, id ksuid.KSUID) error

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) UpdateIndex added in v0.32.0

func (c *Connection) UpdateIndex(ctx context.Context, poolID ksuid.KSUID, branchName string, rules []string) (api.CommitResponse, error)

func (*Connection) Version

func (c *Connection) Version(ctx context.Context) (string, error)

Version retrieves the version string from the service.

type ErrorResponse

type ErrorResponse struct {
	*http.Response
	Err error
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

func (*ErrorResponse) Unwrap

func (e *ErrorResponse) Unwrap() error

type Request added in v0.32.0

type Request struct {
	Header http.Header
	Method string
	Path   string
	Body   interface{}
	// contains filtered or unexported fields
}

func (*Request) Duration added in v0.32.0

func (r *Request) Duration() time.Duration

func (*Request) HTTPRequest added in v0.32.0

func (r *Request) HTTPRequest() (*http.Request, error)

type Response

type Response struct {
	*http.Response
	Duration time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL