pairs

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package pairs intend to provide all available pairs.

Code generated by go generate internal/cmd; DO NOT EDIT.

Index

Constants

View Source
const (
	// Checksum will specify checksum for this request, could be used as content md5 or etag
	Checksum = "checksum"
	// Context will context in all request
	Context = "context"
	// Credential will specify how to provide credential for service or storage
	Credential = "credential"
	// DirFunc will specify what todo with a dir object
	DirFunc = "dir_func"
	// Endpoint will specify how to provide endpoint for service or storage
	Endpoint = "endpoint"
	// Expire will specify when the url returned by reach will expire
	Expire = "expire"
	// FileFunc will specify what todo with a file object
	FileFunc = "file_func"
	// HTTPClientOptions will sepcify the options for the http client
	HTTPClientOptions = "http_client_options"
	// Index will specify the index of this segment
	Index = "index"
	// Location will specify the location for service or storage
	Location = "location"
	// Name will specify the storage name
	Name = "name"
	// ObjectFunc will specify what todo with an object
	ObjectFunc = "object_func"
	// Offset will specify offset for this request, storage will seek to this offset before read
	Offset = "offset"
	// Project will specify project name/id for this service or storage
	Project = "project"
	// ReadCallbackFunc will specify what todo every time we read data from source
	ReadCallbackFunc = "read_callback_func"
	// SegmentFunc will specify what todo with a segment
	SegmentFunc = "segment_func"
	// Size will specify size for this request, storage will only read limited content data
	Size = "size"
	// StoragerFunc will specify what todo with a storager
	StoragerFunc = "storager_func"
	// WorkDir will specify the work dir for service or storage, every operation will be relative to this dir. work_dir MUST start with / for every storage services. work_dir will be default to / if not set.
	// For fs storage service on windows platform, the behavior is undefined.
	WorkDir = "work_dir"
)

All available pairs.

Variables

View Source
var (
	// ErrPairTypeMismatch means the pair's type is not match
	ErrPairTypeMismatch = errors.New("pair type mismatch")
)

Functions

func Parse added in v1.0.0

func Parse(m map[string]interface{}) ([]*types.Pair, error)

Parse will parse a k-v map to pairs slice.

func WithChecksum

func WithChecksum(v string) *types.Pair

WithChecksum will apply checksum value to Options This pair is used to specify checksum for this request, could be used as content md5 or etag

func WithContext added in v0.6.0

func WithContext(v context.Context) *types.Pair

WithContext will apply context value to Options This pair is used to context in all request

func WithCredential

func WithCredential(v *credential.Provider) *types.Pair

WithCredential will apply credential value to Options This pair is used to specify how to provide credential for service or storage

func WithDirFunc

func WithDirFunc(v types.ObjectFunc) *types.Pair

WithDirFunc will apply dir_func value to Options This pair is used to specify what todo with a dir object

func WithEndpoint

func WithEndpoint(v endpoint.Provider) *types.Pair

WithEndpoint will apply endpoint value to Options This pair is used to specify how to provide endpoint for service or storage

func WithExpire

func WithExpire(v int) *types.Pair

WithExpire will apply expire value to Options This pair is used to specify when the url returned by reach will expire

func WithFileFunc

func WithFileFunc(v types.ObjectFunc) *types.Pair

WithFileFunc will apply file_func value to Options This pair is used to specify what todo with a file object

func WithHTTPClientOptions added in v1.1.0

func WithHTTPClientOptions(v *httpclient.Options) *types.Pair

WithHTTPClientOptions will apply http_client_options value to Options This pair is used to sepcify the options for the http client

func WithIndex added in v0.9.0

func WithIndex(v int) *types.Pair

WithIndex will apply index value to Options This pair is used to specify the index of this segment

func WithLocation

func WithLocation(v string) *types.Pair

WithLocation will apply location value to Options This pair is used to specify the location for service or storage

func WithName

func WithName(v string) *types.Pair

WithName will apply name value to Options This pair is used to specify the storage name

func WithObjectFunc added in v0.7.2

func WithObjectFunc(v types.ObjectFunc) *types.Pair

WithObjectFunc will apply object_func value to Options This pair is used to specify what todo with an object

func WithOffset

func WithOffset(v int64) *types.Pair

WithOffset will apply offset value to Options This pair is used to specify offset for this request, storage will seek to this offset before read

func WithProject added in v0.5.0

func WithProject(v string) *types.Pair

WithProject will apply project value to Options This pair is used to specify project name/id for this service or storage

func WithReadCallbackFunc added in v0.7.0

func WithReadCallbackFunc(v func([]byte)) *types.Pair

WithReadCallbackFunc will apply read_callback_func value to Options This pair is used to specify what todo every time we read data from source

func WithSegmentFunc

func WithSegmentFunc(v segment.Func) *types.Pair

WithSegmentFunc will apply segment_func value to Options This pair is used to specify what todo with a segment

func WithSize

func WithSize(v int64) *types.Pair

WithSize will apply size value to Options This pair is used to specify size for this request, storage will only read limited content data

func WithStoragerFunc

func WithStoragerFunc(v storage.StoragerFunc) *types.Pair

WithStoragerFunc will apply storager_func value to Options This pair is used to specify what todo with a storager

func WithWorkDir

func WithWorkDir(v string) *types.Pair

WithWorkDir will apply work_dir value to Options This pair is used to specify the work dir for service or storage, every operation will be relative to this dir. work_dir MUST start with / for every storage services. work_dir will be default to / if not set. For fs storage service on windows platform, the behavior is undefined.

Types

type Error added in v1.0.0

type Error struct {
	Op  string
	Err error

	Key   string
	Type  string
	Value interface{}
}

Error represents error related to a pair.

func (*Error) Error added in v1.0.0

func (e *Error) Error() string

func (*Error) Unwrap added in v1.0.0

func (e *Error) Unwrap() error

Unwrap implements xerrors.Wrapper

Jump to

Keyboard shortcuts

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