client

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package client implements repository REST client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rest.Client
	Short string
}

Client is a Repository that dispatches requests to a server implementing the Repository REST API.

func (*Client) Collect

func (c *Client) Collect(ctx context.Context, live liveset.Liveset) error

Collect instructs the repository collect all objects not in the liveset.

func (*Client) CollectWithThreshold

func (c *Client) CollectWithThreshold(ctx context.Context, live liveset.Liveset, dead liveset.Liveset, threshold time.Time, dryRun bool) error

CollectWithThreshold removes from this repository any objects not in the Liveset and whose creation times are not more recent than the threshold time.

func (*Client) Get

func (c *Client) Get(ctx context.Context, id digest.Digest) (io.ReadCloser, error)

Get retrieves the object with digest id.

func (*Client) Put

func (c *Client) Put(ctx context.Context, body io.Reader) (digest.Digest, error)

Put writes the object in body to the repository.

func (*Client) ReadFrom

func (c *Client) ReadFrom(ctx context.Context, id digest.Digest, u *url.URL) error

ReadFrom reads the object with digest id directly from the repository at URL u.

func (*Client) ShortString

func (c *Client) ShortString() string

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, id digest.Digest) (reflow.File, error)

Stat queries the repository for the file metadata for the given object.

func (*Client) String

func (c *Client) String() string

func (*Client) WriteTo

func (c *Client) WriteTo(ctx context.Context, id digest.Digest, u *url.URL) error

WriteTo writes the object with digest id directly to the repository at URL u.

Jump to

Keyboard shortcuts

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