storage

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-3-Clause Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	ProjectId     string
	ApplicationId string
	Matcher       string
	Config        *structureSpec.Storage
}

type Meta

type Meta interface {
	Get() (io.ReadSeekCloser, error)
	Cid() cid.Cid
	Version() int
}

type Service

type Service interface {
	components.ServiceComponent
	Storages() map[string]Storage
	Get(context Context) (Storage, error)
	Storage(context Context) (Storage, error)
	Add(r io.Reader) (cid.Cid, error)
	GetFile(context.Context, cid.Cid) (peer.ReadSeekCloser, error)
}

type Storage

type Storage interface {
	AddFile(ctx context.Context, r io.ReadSeeker, name string, replace bool) (int, error)
	DeleteFile(ctx context.Context, name string, version int) error
	Meta(ctx context.Context, name string, version int) (Meta, error)
	ListVersions(ctx context.Context, name string) ([]string, error)
	GetLatestVersion(ctx context.Context, name string) (int, error)
	List(ctx context.Context, prefix string) ([]string, error)
	Close()
	Used(ctx context.Context) (int, error)
	Capacity() int
	Id() string
	Kvdb() kvdb.KVDB
	ContextConfig() Context
	UpdateCapacity(size uint64)
	Config() *structureSpec.Storage
}

Jump to

Keyboard shortcuts

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