Documentation
¶
Overview ¶
Package client is the Go client for a vx server: typed service clients plus batched object transfer between a local blob store and the server.
Index ¶
- func Code(err error) connect.Code
- func Message(err error) string
- type Client
- func (c *Client) Download(ctx context.Context, repo string, local blob.Store, hashes []hash.Hash) error
- func (c *Client) FetchTree(ctx context.Context, repo string, local blob.Store, root hash.Hash) error
- func (c *Client) Upload(ctx context.Context, repo string, local blob.Store, hashes []hash.Hash) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Auth vxv1connect.AuthServiceClient
Objects vxv1connect.ObjectServiceClient
Repos vxv1connect.RepoServiceClient
Efforts vxv1connect.EffortServiceClient
Workspaces vxv1connect.WorkspaceServiceClient
Ships vxv1connect.ShipServiceClient
Board vxv1connect.BoardServiceClient
Coord vxv1connect.CoordinationServiceClient
Orgs vxv1connect.OrgServiceClient
Rules vxv1connect.RulesServiceClient
Reviews vxv1connect.ReviewServiceClient
Public vxv1connect.PublicServiceClient // needs no token
}
Client talks to one vx server as one principal.
func New ¶
New returns a client for baseURL that sends token on every call (none when token is empty: only Public works then) and this vx's version, so the server can refuse versions it no longer works with.
func (*Client) Download ¶
func (c *Client) Download(ctx context.Context, repo string, local blob.Store, hashes []hash.Hash) error
Download fetches objects of repo into local, skipping those already there. Every object is verified against its hash on the way in.
func (*Client) FetchTree ¶
func (c *Client) FetchTree(ctx context.Context, repo string, local blob.Store, root hash.Hash) error
FetchTree downloads every tree and blob under root, a tree of repo, that local lacks, level by level.
func (*Client) Upload ¶
func (c *Client) Upload(ctx context.Context, repo string, local blob.Store, hashes []hash.Hash) (int, error)
Upload sends the objects in hashes that are not part of repo on the server yet. Objects are scoped to repositories: content the server stores for another repository is sent again (storage dedupes it), which proves the caller has it.