estuary

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

estuary allows Git Annex remotes to work with the Estuary service

Index

Constants

View Source
const DefaultEndpoint = "https://api.estuary.tech/"

DefaultEndpoint is the default base URL for the Estuary API.

View Source
const DefaultPSAEndpoint = DefaultEndpoint + "pinning"

DefaultPSAEndpoint is the default base URL for the Estuary Pinning Service API.

View Source
const DefaultUploadEndpoint = "https://upload.estuary.tech/"

DefaultUploadEndpoint is the default base URL for the Estuary upload endpoint

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for the Estuary API for use by Git Annex remotes.

func New

func New(opts ...NewOpt) (*Client, error)

func (*Client) Equal

func (cl *Client) Equal(other *Client) bool

func (*Client) IsPresent

func (cl *Client) IsPresent(ctx context.Context, c cid.Cid) (bool, error)

func (*Client) Pin

func (cl *Client) Pin(ctx context.Context, c cid.Cid, key string) error

func (*Client) Unpin

func (cl *Client) Unpin(ctx context.Context, c cid.Cid) error

func (*Client) Upload

func (cl *Client) Upload(ctx context.Context, fi fs.File, pro *progress.Tracker) (cid.Cid, error)

Upload stores the contents of fi on Estuary, returning the CID. fi & pro should be closed by the caller.

type NewOpt

type NewOpt func(options *config) error

NewOpt is an option for the New() function.

func WithEndpoint

func WithEndpoint(ep string) NewOpt

WithEndpoint is an option for the New() function which sets the HTTP endpoint for the Estuary API; by default DefaultEndpoint is used

func WithHTTPClient

func WithHTTPClient(c *http.Client) NewOpt

WithHTTPClient is an option for the New() function which sets the http.Client with which to access the endpoint. By default, a new retryablehttp.Client is used.

func WithPSAEndpoint

func WithPSAEndpoint(ep string) NewOpt

WithPSAEndpoint is an option for the New() function which sets the HTTP endpoint for the Estuary PSA API; by default DefaultPSAEndpoint is used

func WithToken

func WithToken(tok string) NewOpt

WithToken is an option for the New() function which sets the JSON Web Token to authenticate with the endpoint.

func WithUploadEndpoint

func WithUploadEndpoint(ep string) NewOpt

WithUploadEndpoint is an option for the New() function which sets the HTTP endpoint for the Estuary upload API; by default DefaultUploadEndpoint is used

Jump to

Keyboard shortcuts

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