object

package
v0.0.0-...-03ee3a8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromModel

func FromModel(obj *models.Object) io.Object

FromModel converts model data to the object

func ToModel

func ToModel(inObj io.Object) (*models.Object, error)

ToModel converts object interface to model

Types

type Object

type Object struct {
	// contains filtered or unexported fields
}

Object is the main item for storing the file sets in the collection.

Object can be represented like a container where stored some subfile objects Object also contain some additional information in `meta` and `manifest` sections. Meta contains information about all related to the object subfiles like thumbs or postprocessed files

func NewObject

func NewObject(id io.ObjectIDType, bucket, filepath string) *Object

NewObject liked to bucket and object codename

func (*Object) Bucket

func (f *Object) Bucket() string

Bucket name where stored the object Like: videos, images, documents, etc.

func (*Object) CreatedAt

func (f *Object) CreatedAt() time.Time

CreatedAt returns time of the object

func (*Object) ID

func (f *Object) ID() io.ObjectIDType

ID of the object in the storage

func (*Object) IsOriginal

func (f *Object) IsOriginal(name string) bool

IsOriginal filename

func (*Object) Manifest

func (f *Object) Manifest() *models.Manifest

Manifest information of the object

func (*Object) MarshalJSON

func (f *Object) MarshalJSON() ([]byte, error)

MarshalJSON implements method of json.Marshaler

func (*Object) Meta

func (f *Object) Meta() *models.Meta

Meta information of the object

func (*Object) MustManifest

func (f *Object) MustManifest() *models.Manifest

MustManifest information returns from the object or creates new if not exists

func (*Object) MustMeta

func (f *Object) MustMeta() *models.Meta

MustMeta information returns from the object or creates new if not exists

func (*Object) Path

func (f *Object) Path() string

Path returns unical name of the object in the paticular `bucket`

func (*Object) PrepareName

func (f *Object) PrepareName(name string) string

PrepareName of the subfile

func (*Object) Revision

func (f *Object) Revision() int64

Revision shows count of changes in the object

func (*Object) Status

func (f *Object) Status() io.Status

Status returns the object status

func (*Object) StatusMessage

func (f *Object) StatusMessage() string

StatusMessage returns common message of all items

func (*Object) StatusUpdate

func (f *Object) StatusUpdate(status io.Status)

StatusUpdate state

func (*Object) String

func (f *Object) String() string

func (*Object) ToModel

func (f *Object) ToModel() (*models.Object, error)

ToModel object

func (*Object) UnmarshalJSON

func (f *Object) UnmarshalJSON(data []byte) error

UnmarshalJSON implements method of json.Unmarshaler

func (*Object) UpdatedAt

func (f *Object) UpdatedAt() time.Time

UpdatedAt returns time of the object

Jump to

Keyboard shortcuts

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