postgres

package
v0.0.0-...-9d201ce Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	*postgres.Table[*storage.Address]
}

Address -

func NewAddress

func NewAddress(db *database.Bun) *Address

NewAddress -

func (*Address) GetByHash

func (a *Address) GetByHash(ctx context.Context, hash []byte) (address storage.Address, err error)

GetByHash -

type Domain

type Domain struct {
	*postgres.Table[*storage.Domain]
}

Domain -

func NewDomain

func NewDomain(db *database.Bun) *Domain

NewDomain -

type Field

type Field struct {
	*postgres.Table[*storage.Field]
}

Field -

func NewField

func NewField(db *database.Bun) *Field

NewField -

type StarknetId

type StarknetId struct {
	*postgres.Table[*storage.StarknetId]
}

StarknetId -

func NewStarknetId

func NewStarknetId(db *database.Bun) *StarknetId

NewStarknetId -

type State

type State struct {
	*postgres.Table[*storage.State]
}

State -

func NewState

func NewState(db *database.Bun) *State

NewState -

func (*State) ByName

func (s *State) ByName(ctx context.Context, name string) (state storage.State, err error)

ByName -

type Storage

type Storage struct {
	*postgres.Storage

	Addresses   models.IAddress
	Domains     models.IDomain
	Subdomains  models.ISubdomain
	StarknetIds models.IStarknetId
	Fields      models.IField
	State       models.IState
}

Storage -

func Create

func Create(ctx context.Context, cfg config.Database) (Storage, error)

Create -

type Subdomain

type Subdomain struct {
	*postgres.Table[*storage.Subdomain]
}

Subdomain -

func NewSubdomain

func NewSubdomain(db *database.Bun) *Subdomain

NewSubdomain -

func (*Subdomain) GetByResolverId

func (s *Subdomain) GetByResolverId(ctx context.Context, resolverId uint64) (result storage.Subdomain, err error)

GetByResolverId -

type Transaction

type Transaction struct {
	storage.Transaction
}

Transaction -

func BeginTransaction

func BeginTransaction(ctx context.Context, tx storage.Transactable) (Transaction, error)

BeginTransaction -

func (Transaction) SaveAddress

func (t Transaction) SaveAddress(ctx context.Context, addresses ...*models.Address) error

func (Transaction) SaveState

func (t Transaction) SaveState(ctx context.Context, state *models.State) error

SaveState -

Jump to

Keyboard shortcuts

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