tarus_store

package
v0.0.0-...-5379b69 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitStatusIdle = iota
	CommitStatusFinished
)
View Source
const MinTimestamp = -62135596800

Variables

This section is empty.

Functions

func WithTransactionContext

func WithTransactionContext(ctx context.Context, tx *bolt.Tx) context.Context

WithTransactionContext returns a new context holding the provided bolt transaction. Functions which require a bolt transaction will first check to see if a transaction is already created on the context before creating their own.

Types

type DB

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

DB represents a metadata database backed by a bolt database. The database is fully namespaced and stores image, container, namespace, snapshot, and content data while proxying data shared across namespaces to backend datastores for content and snapshots.

func NewDB

func NewDB(db *bolt.DB) *DB

NewDB creates a new metadata database using the provided bolt database.

func (*DB) Update

func (m *DB) Update(fn func(*bolt.Tx) error) error

Update runs a writable transaction on the metadata store.

func (*DB) View

func (m *DB) View(fn func(*bolt.Tx) error) error

View runs a readonly transaction on the metadata store.

type JudgeSessionStore

type JudgeSessionStore interface {
	SetJudgeSession(ctx context.Context, key []byte, meta *tarus.OCIJudgeSession) error
	GetJudgeSession(ctx context.Context, key []byte) (*tarus.OCIJudgeSession, error)

	// FinishSession requires transactionCb is idempotent
	FinishSession(ctx context.Context, key []byte, transactionCb func() error) error
}

func NewJudgeSessionStore

func NewJudgeSessionStore(db *DB) JudgeSessionStore

Jump to

Keyboard shortcuts

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