braidhttp

package
v0.0.0-...-2c4dd60 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransportName string = "braidhttp"
)

Variables

View Source
var (
	RangeTypeBytes = RangeType{"bytes"}
	RangeTypeJSON  = RangeType{"json"}
)
View Source
var (
	ErrBadCookie = errors.New("bad cookie")
)

Functions

func NewTransport

func NewTransport(
	listenAddr string,
	listenAddrSSL string,
	ownURLs types.Set[string],
	defaultStateURI string,
	controllerHub tree.ControllerHub,
	keyStore identity.KeyStore,
	blobStore blob.Store,
	peerStore swarm.PeerStore,
	tlsCertFilename, tlsKeyFilename string,
	tlsCerts []tls.Certificate,
	jwtSecret []byte,
	devMode bool,
) (*transport, error)

Types

type AcceptHeader

type AcceptHeader types.Set[string]

func (AcceptHeader) Contains

func (h AcceptHeader) Contains(s string) bool

func (*AcceptHeader) UnmarshalHTTPHeader

func (h *AcceptHeader) UnmarshalHTTPHeader(header string) error

type HeadResponse

type HeadResponse struct {
	StateURI       string
	Parents        []state.Version
	ContentType    string
	ContentLength  int64
	ResourceLength int64
	Peers          []swarm.PeerDialInfo
}

type LightClient

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

func NewLightClient

func NewLightClient(dialAddr string, sigkeys *crypto.SigKeypair, enckeys *crypto.AsymEncKeypair, tls bool) (*LightClient, error)

func (*LightClient) Authorize

func (c *LightClient) Authorize() error

func (*LightClient) FetchTx

func (c *LightClient) FetchTx(stateURI string, txID state.Version) (*tree.Tx, error)

func (*LightClient) Get

func (c *LightClient) Get(stateURI string, version *state.Version, keypath state.Keypath, rangeReq *RangeRequest, raw bool) (io.ReadCloser, int64, []state.Version, error)

func (*LightClient) HaveBlob

func (c *LightClient) HaveBlob(blobID blob.ID) (bool, error)

func (*LightClient) Head

func (c *LightClient) Head(stateURI string, keypath state.Keypath) (HeadResponse, error)

func (*LightClient) Put

func (c *LightClient) Put(ctx context.Context, tx tree.Tx) error

func (*LightClient) StoreBlob

func (c *LightClient) StoreBlob(file io.Reader) (StoreBlobResponse, error)

func (*LightClient) Subscribe

func (c *LightClient) Subscribe(ctx context.Context, stateURI string) (chan MaybeTx, error)

type MaybeTx

type MaybeTx struct {
	*tree.Tx
	Err error
}

type ParentsHeader

type ParentsHeader types.Set[state.Version]

func (ParentsHeader) Slice

func (h ParentsHeader) Slice() []state.Version

func (*ParentsHeader) UnmarshalHTTPHeader

func (h *ParentsHeader) UnmarshalHTTPHeader(header string) error

type RangeRequest

type RangeRequest struct {
	RangeType RangeType    `json:"rangeType"`
	Range     *types.Range `json:"range"`
	OpenEnded bool         `json:"openEnded"`
}

func (*RangeRequest) BytesRange

func (r *RangeRequest) BytesRange() *types.Range

func (*RangeRequest) JSONRange

func (r *RangeRequest) JSONRange() *types.Range

func (*RangeRequest) MarshalHTTPHeader

func (r *RangeRequest) MarshalHTTPHeader() (string, bool, error)

func (*RangeRequest) UnmarshalHTTPHeader

func (r *RangeRequest) UnmarshalHTTPHeader(header string) error

type RangeType

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

type StoreBlobResponse

type StoreBlobResponse struct {
	SHA1 types.Hash `json:"sha1"`
	SHA3 types.Hash `json:"sha3"`
}

Jump to

Keyboard shortcuts

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