models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(pgdb *pg.DB) error

func MaxBlockNumber

func MaxBlockNumber(db *pg.DB) uint64

Types

type Depository

type Depository struct {
	Index         string `json:"index" pg:"index"`
	KID           string `json:"kid" pg:"kid,pk"`
	Platform      string `json:"platform" pg:"platform"`
	Operator      string `json:"operator" pg:"operator"`
	Owner         string `json:"owner" pg:"owner"`
	BlockNumber   uint64 `json:"blockNumber" pg:"blockNumber"`
	TransactionID string `json:"transactionID" pg:"transactionID"`

	// Content related
	Name             string `json:"name" pg:"name"`
	ContentName      string `json:"contentName" pg:"contentName"`
	ContentID        string `json:"contentID" pg:"contentID"`
	ContentType      string `json:"contentType" pg:"contentType"`
	TrustedTimestamp int64  `json:"trustedTimestamp" pg:"trustedTimestamp"`
	ContentSize      int64  `json:"contentSize" pg:"contentSize"`
	Description      string `json:"description" pg:"description"`
}

Depository defines valuable fields for a depository

func (*Depository) AfterQuery

func (*Depository) AfterQuery(context.Context, *pg.QueryEvent) error

func (*Depository) BeforeQuery

func (*Depository) BeforeQuery(ctx context.Context, event *pg.QueryEvent) (context.Context, error)

Jump to

Keyboard shortcuts

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