censusdbmodel

package
v0.0.0-...-e18bc7f Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Name           string `model:"name,VARCHAR(4095) PRIMARY KEY"`
	Size           int64  `model:"size,BIGINT NOT NULL"`
	ModTime        int64  `model:"mod_time,BIGINT NOT NULL"`
	Hash           string `model:"hash,VARCHAR(2047) NOT NULL"`
	ParityHash     string `model:"parity_hash,VARCHAR(2047) NOT NULL"`
	HeaderHash     string `model:"header_hash,VARCHAR(2047) NOT NULL"`
	LastVerifiedAt int64  `model:"last_verified_at,BIGINT NOT NULL"`
}

Model is a content tree model

type Repo

type Repo interface {
	New(name string, size int64, modtime int64, hash, parityHash, headerHash string) *Model
	Exists(ctx context.Context, name string) (bool, error)
	List(ctx context.Context, limit int, after string) ([]Model, error)
	Get(ctx context.Context, name string) (*Model, error)
	Insert(ctx context.Context, m *Model) error
	Update(ctx context.Context, m *Model) error
	Delete(ctx context.Context, name string) error
	Setup(ctx context.Context) error
}

Repo is a content tree repository

func New

func New(database sqldb.Executor, fileTable string) Repo

Jump to

Keyboard shortcuts

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