model

package
v0.0.0-...-8c125ef Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	table.GatewayAccount
	// contains filtered or unexported fields
}

func AccountCreate

func AccountCreate(ctx context.Context, address common.Address, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Account, error)

func AccountGetByAddress

func AccountGetByAddress(ctx context.Context, address common.Address, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Account, bool, error)

func AccountGetOrCreate

func AccountGetOrCreate(ctx context.Context, address common.Address, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Account, error)

func (*Account) GetBalance

func (acc *Account) GetBalance(ctx context.Context) (int64, error)

func (*Account) GetKey

func (acc *Account) GetKey(ctx context.Context, keyID uint64) (*Key, bool, error)

func (*Account) GetUsage

func (acc *Account) GetUsage(ctx context.Context) (int64, int64, int64, int64, error)

func (*Account) GetUsageByDate

func (acc *Account) GetUsageByDate(ctx context.Context, since time.Time, until time.Time) (*[]schema.UsageByDate, error)

func (*Account) ListKeys

func (acc *Account) ListKeys(ctx context.Context) ([]*Key, error)

type Key

type Key struct {
	table.GatewayKey
	// contains filtered or unexported fields
}

func KeyCreate

func KeyCreate(ctx context.Context, accountAddress common.Address, keyName string, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Key, error)

func KeyGetByID

func KeyGetByID(ctx context.Context, keyID uint64, activeOnly bool, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Key, bool, error)

func (*Key) ConsumeRu

func (k *Key) ConsumeRu(ctx context.Context, ru int64) error

func (*Key) Delete

func (k *Key) Delete(ctx context.Context) error

func (*Key) GetAccount

func (k *Key) GetAccount(_ context.Context) (*Account, error)

func (*Key) Rotate

func (k *Key) Rotate(ctx context.Context) error

func (*Key) UpdateInfo

func (k *Key) UpdateInfo(ctx context.Context, name string) error

Jump to

Keyboard shortcuts

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