shardlite

package module
v0.0.0-...-fac28aa Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

shardlite

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Functions

This section is empty.

Types

type Config

type Config struct {
	Name          string
	Url           string
	DbPath        string
	MigrateCb     func(*sql.DB) error
	ActivationTtl time.Duration
	SaveInterval  time.Duration
	Storage       Storer
	Leaser        LockerMaker
}

type ErrAlreadyActive

type ErrAlreadyActive struct {
	Url string
}

func (*ErrAlreadyActive) Error

func (e *ErrAlreadyActive) Error() string

type Locker

type Locker interface {
	TryLock() error
	TryUnlock() error
}

type LockerMaker

type LockerMaker interface {
	MakeLock(kind string, id string, url string) Locker
}

type Pile

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

func NewPile

func NewPile(config *Config) *Pile

func (*Pile) Shard

func (p *Pile) Shard(id string) *Shard

func (*Pile) Start

func (p *Pile) Start() error

func (*Pile) Stop

func (p *Pile) Stop()

type Shard

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

func (*Shard) Activate

func (s *Shard) Activate() (*sql.DB, error)

func (*Shard) Deactivate

func (s *Shard) Deactivate()

func (*Shard) Save

func (s *Shard) Save()

type Storer

type Storer interface {
	Upload(kind string, id string, file io.ReadSeeker) error
	Download(kind string, id string) (io.ReadCloser, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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