client

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = "objects/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	roundtrip.Client
}

Client is HTTP client to BLOB storage

func NewAuthenticatedClient

func NewAuthenticatedClient(addr, username, password string, params ...roundtrip.ClientParam) (*Client, error)

NewAuthenticatedClient returns client authenticated as a user with given password

func NewClient

func NewClient(addr string, params ...roundtrip.ClientParam) (*Client, error)

NewClient returns HTTP client communicating to cluster BLOB service

func NewPeerAuthenticatedClient

func NewPeerAuthenticatedClient(addr, username, password string, params ...roundtrip.ClientParam) (*Client, error)

NewPeerAuthenticatedClient returns client authenticated as a user with given password

func NewPeerClient

func NewPeerClient(addr string, params ...roundtrip.ClientParam) (*Client, error)

NewPeerClient returns new client that communicates with peer-local interface

func (*Client) Close

func (c *Client) Close() error

func (*Client) Delete

func (c *Client) Delete(u string) (*roundtrip.Response, error)

Delete issues http DELETE Request to the server

func (*Client) DeleteBLOB

func (c *Client) DeleteBLOB(hash string) error

func (*Client) Get

func (c *Client) Get(u string, params url.Values) (*roundtrip.Response, error)

Get issues http GET request to the server

func (*Client) GetBLOBEnvelope

func (c *Client) GetBLOBEnvelope(hash string) (*blob.Envelope, error)

func (*Client) GetBLOBs

func (c *Client) GetBLOBs() ([]string, error)

func (*Client) OpenBLOB

func (c *Client) OpenBLOB(hash string) (blob.ReadSeekCloser, error)

func (*Client) PostForm

func (c *Client) PostForm(
	endpoint string,
	vals url.Values,
	files ...roundtrip.File) (*roundtrip.Response, error)

PostForm is a generic method that issues http POST request to the server

func (*Client) WriteBLOB

func (c *Client) WriteBLOB(data io.Reader) (*blob.Envelope, error)

type Pool

type Pool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Pool manages pool of authenticated HTTP peer clients, used by BLOB cluster storage to replicate data

func NewPool

func NewPool(username, password string) (*Pool, error)

NewPool returns new instance of the pool managing connections to the peers

func (*Pool) GetPeer

func (p *Pool) GetPeer(peer storage.Peer) (blob.Objects, error)

GetPeer returns new instance of the Objects client

Jump to

Keyboard shortcuts

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