client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) connect.Code

Code returns the connect code of err, or 0.

func Message

func Message(err error) string

Message returns the server's message for a connect error, without the "code:" prefix, for showing to people.

Types

type Client

Client talks to one vx server as one principal.

func New

func New(baseURL, token string) *Client

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.

Jump to

Keyboard shortcuts

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