httpstor

package
v0.0.0-...-c9fddc1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(s storage.Storage, urlPref string) http.Handler

NewServer creates a CAS HTTP server for a given URL path.

Types

type Client

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

Client is a HTTP client for CAS.

func NewClient

func NewClient(addr string) *Client

NewClient creates a CAS HTTP client with a given base address.

Example:

NewClient("https://domain.com/cas")

func (*Client) BeginBlob

func (c *Client) BeginBlob(ctx context.Context) (storage.BlobWriter, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DeletePin

func (c *Client) DeletePin(ctx context.Context, name string) error

func (*Client) FetchBlob

func (c *Client) FetchBlob(ctx context.Context, ref types.Ref) (io.ReadCloser, uint64, error)

func (*Client) GetPin

func (c *Client) GetPin(ctx context.Context, name string) (types.Ref, error)

func (*Client) IterateBlobs

func (c *Client) IterateBlobs(ctx context.Context) storage.Iterator

func (*Client) IteratePins

func (c *Client) IteratePins(ctx context.Context) storage.PinIterator

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(cli *http.Client)

SetHTTPClient allows to set a custom HTTP client that will be used to send requests.

func (*Client) SetPin

func (c *Client) SetPin(ctx context.Context, name string, ref types.Ref) error

func (*Client) StatBlob

func (c *Client) StatBlob(ctx context.Context, ref types.Ref) (uint64, error)

type Config

type Config struct {
	URL string `json:"url"`
}

func (*Config) OpenStorage

func (c *Config) OpenStorage(ctx context.Context) (storage.Storage, error)

func (*Config) References

func (c *Config) References() []types.Ref

Jump to

Keyboard shortcuts

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