types

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	// ID is the unique key in service.
	ID string
	// name is the relative path towards service's WorkDir.
	Name string
	// type should be one of "file", "stream", "dir" or "invalid".
	Type ObjectType

	// Size is the size of this object.
	// If the ObjectMeta 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.
	//
	// The difference between `struct value` and `metadata` is:
	//
	// - All value in `struct` are required, caller can use them safely.
	// - All value in `metadata` are optional, caller need to check them before using.
	//
	// Two requirement must be satisfied in order to add struct value, or they need to be
	// a Metadata.
	//
	// - All storage services can provide this value in same way.
	// - User need to access this value.
	info.ObjectMeta
}

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 ObjectMeta.

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.

func (*Pair) String added in v0.8.0

func (p *Pair) String() string

Directories

Path Synopsis
Code generated by go generate internal/cmd; DO NOT EDIT.
Code generated by go generate internal/cmd; 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