file

package
v0.0.0-...-112cc7f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLimitWriteCloser

func NewLimitWriteCloser(w io.WriteCloser, c int64) io.WriteCloser

NewLimitWriteCloser creates a new LimitWriteCloser.

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

NopWriteCloser returns a new io.WriteCloser with the given writer as io.Writer.

func SetLogger

func SetLogger(cmd *cobra.Command, verbosityString string) (logger logging.Logger, err error)

Types

type APIStore

type APIStore struct {
	Client *http.Client
	// contains filtered or unexported fields
}

APIStore provies a storage.Putter that adds chunks to swarm through the HTTP chunk API.

func (*APIStore) Get

func (a *APIStore) Get(ctx context.Context, mode storage.ModeGet, address swarm.Address) (ch swarm.Chunk, err error)

Get implements storage.Getter.

func (*APIStore) Put

func (a *APIStore) Put(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) (exist []bool, err error)

Put implements storage.Putter.

type LimitWriteCloser

type LimitWriteCloser struct {
	io.WriteCloser
	// contains filtered or unexported fields
}

LimitWriteCloser limits the output from the application.

func (*LimitWriteCloser) Write

func (l *LimitWriteCloser) Write(b []byte) (int, error)

Write implements io.Writer.

type PutGetter

type PutGetter interface {
	storage.Putter
	storage.Getter
}

PutGetter wraps both storage.Putter and storage.Getter interfaces

func NewAPIStore

func NewAPIStore(host string, port int, tls bool) PutGetter

NewAPIStore creates a new APIStore.

Jump to

Keyboard shortcuts

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