storage

package
v0.0.0-...-d8b21ba Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootKey = NewKey("/")

RootKey isa Locatable to the root of the FileSystem

Functions

This section is empty.

Types

type ArchiveService

type ArchiveService interface {
	Get(ctx context.Context, id string) (KeyedResource, error)
	ResourceWriter
	ResourceLocator
}

type Deleter

type Deleter interface {
	Delete(resource Locatable) error
}

type Formatted

type Formatted interface {
	Format() string
}

type GenericResource

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

func NewKeyedGenericResource

func NewKeyedGenericResource(data []byte, format string, key ...string) *GenericResource

NewKeyedGenericResource creates a new GenericResource with the provided data, format and keys

func (*GenericResource) Data

func (g *GenericResource) Data() []byte

func (*GenericResource) Format

func (g *GenericResource) Format() string

func (*GenericResource) Key

func (g *GenericResource) Key() []string

type Getter

type Getter interface {
	Get(ctx context.Context, resource Locatable) (resourceWithData *GenericResource, err error)
}

type Image

type Image struct {
	Image  []byte `json:"image"`
	Format string `json:"format"`
}

func NewImage

func NewImage(img []byte, imageType string) *Image

type ImageService

type ImageService interface {
	ResourceWriter
	ResourceLocator
	GetByRecordId(ctx context.Context, id string) (map[string]*Image, error)
	Copy(ctx context.Context, fromId string, toId string) error
}

type Keyed

type Keyed interface {
	Key() []string
}

type KeyedResource

type KeyedResource interface {
	Keyed
	Resource
}

type Locatable

type Locatable interface {
	Keyed
	Formatted
}

func NewKey

func NewKey(key ...string) Locatable

NewKey creates a new Locatable only with the provided keys set. Can be used as an identifier

func NewLocator

func NewLocator(format string, key ...string) Locatable

NewLocator creates a new Locatable only the provided keys and format. Can be used as an identifier

type Resource

type Resource interface {
	Data() []byte
	Formatted
}

type ResourceLocator

type ResourceLocator interface {
	Locate(locatable Locatable) string
}

type ResourceReadWriter

type ResourceReadWriter interface {
	Deleter
	Writer
	Getter
}

type ResourceWriter

type ResourceWriter interface {
	Deleter
	Writer
}

type Statter

type Statter interface {
	Stat(name string) (os.FileInfo, error)
}

type Writer

type Writer interface {
	Write(resource KeyedResource) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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