types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// user handleable error
	ErrConfigIncorrect  = errors.New("config incorrect")
	ErrPermissionDenied = errors.New("permission denied")

	// caller handleable error
	ErrPairRequired    = errors.New("pair required")
	ErrObjectNotExist  = errors.New("object not exist")
	ErrDirAlreadyExist = errors.New("dir already exist")
	ErrDirNotEmpty     = errors.New("dir not empty")

	// unhandleable error
	ErrUnhandledError = errors.New("unhandled error")
)

All possible error could be return by services.

Functions

func NewErrPairRequired

func NewErrPairRequired(pair string) error

NewErrPairRequired will create a new pair required error.

Types

type Object

type Object struct {
	// name must a complete path instead of basename in POSIX.
	Name string
	// type should be one of "file", "stream", "dir" or "invalid".
	Type ObjectType

	// Size is the size of this Object.
	// If the Object do not have a Size, it will be 0.
	Size int64
	// UpdatedAt is the update time of this Object.
	// If the Object do not have a UpdatedAt, it will be time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}
	UpdatedAt time.Time

	// metadata is the metadata of the object.
	metadata.Metadata
}

Object may be a *File, *Dir or a *Stream.

type ObjectFunc added in v0.4.0

type ObjectFunc func(object *Object)

ObjectFunc will handle an Object.

type ObjectType added in v0.3.0

type ObjectType string

ObjectType is the type for object, under layer type is string.

const (
	ObjectTypeFile    ObjectType = "file"
	ObjectTypeStream  ObjectType = "stream"
	ObjectTypeDir     ObjectType = "dir"
	ObjectTypeInvalid ObjectType = "invalid"
)

All available type for object.

type Pair

type Pair struct {
	Key   string
	Value interface{}
}

Pair will store option for storage service.

Directories

Path Synopsis
Code generated by go generate internal/cmd/metadata; DO NOT EDIT.
Code generated by go generate internal/cmd/metadata; DO NOT EDIT.
Package pairs intend to provide all available pairs.
Package pairs intend to provide all available pairs.

Jump to

Keyboard shortcuts

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