storage

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 ForEachFunc added in v1.11.0

type ForEachFunc func(resource KeyedResource, err error) 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 Walker added in v1.11.0

type Walker interface {
	ForEach(ctx context.Context, keyed Keyed, forEachFn ForEachFunc) 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