storage

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(srv storageIface.Service, factory kvdb.Factory, storageContext storageIface.Context, logger log.StandardLogger, matches map[string]kvdb.KVDB) (storageIface.Storage, error)

Types

type Meta

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

func (*Meta) Cid

func (m *Meta) Cid() cid.Cid

func (*Meta) Get

func (m *Meta) Get() (io.ReadSeekCloser, error)

func (*Meta) Version

func (m *Meta) Version() int

type Store

type Store struct {
	kvdb.KVDB
	// contains filtered or unexported fields
}

func (*Store) AddFile

func (s *Store) AddFile(ctx context.Context, r io.ReadSeeker, name string, replace bool) (version int, err error)

TODO: Version/timestamp:: What happens when 2 nodes try to update version at same time?

func (*Store) Application

func (s *Store) Application() string

func (*Store) Capacity

func (s *Store) Capacity() (capacity int)

func (*Store) Close

func (s *Store) Close()

func (*Store) Config

func (s *Store) Config() *structureSpec.Storage

func (*Store) Context

func (s *Store) Context() context.Context

func (*Store) ContextConfig

func (s *Store) ContextConfig() storageIface.Context

func (*Store) DeleteFile

func (s *Store) DeleteFile(ctx context.Context, name string, version int) error

version 0 for latest version, -1 for all

func (*Store) Event

func (s *Store) Event() interface{}

func (*Store) GetLatestVersion

func (s *Store) GetLatestVersion(ctx context.Context, name string) (int, error)

func (*Store) Id

func (s *Store) Id() string

func (*Store) Kvdb

func (s *Store) Kvdb() kvdb.KVDB

func (*Store) List

func (s *Store) List(ctx context.Context, prefix string) ([]string, error)

func (*Store) ListVersions

func (s *Store) ListVersions(ctx context.Context, name string) ([]string, error)

func (*Store) Meta

func (s *Store) Meta(ctx context.Context, name string, version int) (storageIface.Meta, error)

version 0 for latest storage

func (*Store) Project

func (s *Store) Project() string

func (*Store) SmartOps

func (s *Store) SmartOps() (uint32, error)

func (*Store) Type

func (s *Store) Type() uint32

func (*Store) UpdateCapacity

func (s *Store) UpdateCapacity(size uint64)

func (*Store) Used

func (s *Store) Used(ctx context.Context) (used int, err error)

Jump to

Keyboard shortcuts

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