integrity

package
v0.0.0-...-f98e9bb Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(module common.Module)

Types

type ChainLink struct {
	Head Hash
	Tail Hash
}

func (*ChainLink) Hash

func (link *ChainLink) Hash() Hash

type ChainRecord

type ChainRecord struct {
	Hash Hash
	Head Hash
	Tail *Hash
}

type ChainService

type ChainService interface {
	Put(local *common.Ulid, head *ChainLink) (Hash, error)
	Get(local *common.Ulid, hash Hash) (*ChainLink, error)
	Chain(local *common.Ulid, head Hash) iter.Seq[common.ErrorOr[*ChainLink]]
}

func NewChainService

func NewChainService(repo *Repository) ChainService

type Hash

type Hash []byte

func (*Hash) String

func (hash *Hash) String() string

type KV

type KV struct {
	Inline   bool
	Lifetime time.Duration
	Key      []byte
	Value    []byte
	Ref      Hash
}

type KVStore

type KVStore interface {
	Put(local *common.Ulid, key, value []byte)
}

type ObjectRecord

type ObjectRecord struct {
	Hash   Hash
	Object []byte
}

type ObjectService

type ObjectService interface {
	Put(localId *common.Ulid, object []byte) (hash Hash, err error)
	Get(localId *common.Ulid, hash Hash) ([]byte, error)
}

func NewObjectService

func NewObjectService(repo *Repository) ObjectService

type RefRecord

type RefRecord struct {
	Name string
	Ref  Hash
}

type RefService

type RefService interface {
	Put(local *common.Ulid, name string, link Hash) error
	Get(local *common.Ulid, name string) (Hash, error)
}

func NewRefService

func NewRefService(repo *Repository) RefService

type Repository

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

func NewRepository

func NewRepository(proxy database.Proxy) *Repository

func (*Repository) FindChain

func (repo *Repository) FindChain(tx *sql.Tx, localId string, hash Hash) (*ChainRecord, error)

func (*Repository) FindObject

func (repo *Repository) FindObject(tx *sql.Tx, localId string, hash Hash) (*ObjectRecord, error)

func (*Repository) FindRef

func (repo *Repository) FindRef(tx *sql.Tx, localId string, name string) (*RefRecord, error)

func (*Repository) HasObject

func (repo *Repository) HasObject(tx *sql.Tx, localId string, hash Hash) (bool, error)

func (*Repository) PutChain

func (repo *Repository) PutChain(tx *sql.Tx, localId string, record *ChainRecord) error

func (*Repository) PutObject

func (repo *Repository) PutObject(tx *sql.Tx, localId string, record *ObjectRecord) error

func (*Repository) PutRef

func (repo *Repository) PutRef(tx *sql.Tx, localId string, record *RefRecord) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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