pool

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocks

type Blocks map[common.BlockID]*SynchronizedBlock

type Note

type Note struct {
	sync.Mutex

	ID common.BlockID
	// contains filtered or unexported fields
}

func NewNote

func NewNote(db *sql.DB, replicaID common.ReplicaID, path string, interval time.Duration) (*Note, error)

func (*Note) Contribute

func (note *Note) Contribute(ctx context.Context, bytes []byte) error

func (*Note) FlagSyncFromFS

func (note *Note) FlagSyncFromFS(ctx context.Context, blockID *uuid.UUID) error

func (*Note) Json

func (note *Note) Json() ([]byte, error)

type Path

type Path = string

type Pool

type Pool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPool

func NewPool(config *config.Config) *Pool

func (*Pool) Close

func (pool *Pool) Close() error

func (*Pool) Contribute

func (pool *Pool) Contribute(ctx context.Context, notePath string, bytes []byte) error

func (*Pool) Open

func (pool *Pool) Open(ctx context.Context, path string) (*Note, error)

func (*Pool) Wait

func (pool *Pool) Wait()

type SynchronizedBlock

type SynchronizedBlock struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewEmptySynchronizedBlock

func NewEmptySynchronizedBlock(blockPath string) (*SynchronizedBlock, error)

func NewUnSynchronizedBlock added in v1.1.0

func NewUnSynchronizedBlock(blockPath string, block *block.Block) (*SynchronizedBlock, error)

func (*SynchronizedBlock) Apply

func (sb *SynchronizedBlock) Apply(ctrb block.Contribution) error

func (*SynchronizedBlock) Sync

func (sb *SynchronizedBlock) Sync(db *sql.DB, note *Note) (*block.Block, error)

Jump to

Keyboard shortcuts

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