pairs

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 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 // Checksum specify checksum for this request, could be used as content md5 or etag
	Checksum = "checksum"
	// Context will // Context context in all request
	Context = "context"
	// Credential will // Credential specify how to provide credential for service or storage
	Credential = "credential"
	// DirFunc will // DirFunc specify what todo with a dir object
	DirFunc = "dir_func"
	// Endpoint will // Endpoint specify how to provide endpoint for service or storage
	Endpoint = "endpoint"
	// Expire will // Expire specify when the url returned by reach will expire
	Expire = "expire"
	// FileFunc will // FileFunc specify what todo with a file object
	FileFunc = "file_func"
	// HTTPClientOptions will // HTTPClientOptions sepcify the options for the http client
	HTTPClientOptions = "http_client_options"
	// Index will // Index specify the index of this segment
	Index = "index"
	// Location will // Location specify the location for service or storage
	Location = "location"
	// Name will // Name specify the storage name
	Name = "name"
	// ObjectFunc will // ObjectFunc specify what todo with an object
	ObjectFunc = "object_func"
	// Offset will // Offset specify offset for this request, storage will seek to this offset before read
	Offset = "offset"
	// Project will // Project specify project name/id for this service or storage
	Project = "project"
	// ReadCallbackFunc will // ReadCallbackFunc specify what todo every time we read data from source
	ReadCallbackFunc = "read_callback_func"
	// SegmentFunc will // SegmentFunc specify what todo with a segment
	SegmentFunc = "segment_func"
	// Size will // Size specify size for this request, storage will only read limited content data
	Size = "size"
	// StoragerFunc will // StoragerFunc specify what todo with a storager
	StoragerFunc = "storager_func"
	// WorkDir will // WorkDir 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 // Checksum 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 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 // Credential 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 // DirFunc 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 // Endpoint 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 // Expire 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 // FileFunc 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 // HTTPClientOptions 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 // Index 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 // Location 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 // Name 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 // ObjectFunc 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 // Offset 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 // Project 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 // ReadCallbackFunc 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 // SegmentFunc 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 // Size 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 // StoragerFunc 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 // WorkDir 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