ops

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormStore

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

func (*GormStore) ListAccountsWithMissingVault

func (s *GormStore) ListAccountsWithMissingVault(tokenName string) (res *[]accounts.Account, err error)

ListAccountsWithMissingVault lists accounts that are not initialized for the given token name.

type OpsInitFungibleVaultsJob

type OpsInitFungibleVaultsJob struct {
	Func      OpsInitFungibleVaultsJobFunc
	Address   string
	TokenList []string
}

type OpsInitFungibleVaultsJobFunc

type OpsInitFungibleVaultsJobFunc func(address string, tokenList []string) error

type OpsWorkerPoolService

type OpsWorkerPoolService interface {
	Start()
	Stop()
	AddFungibleInitJob(job OpsInitFungibleVaultsJob)
	NumWorkers() uint
}

func NewWorkerPool

func NewWorkerPool(
	numWorkers uint,
	capacity uint,
) OpsWorkerPoolService

type Service

type Service interface {
	// Retroactive fungible token vault initialization
	GetMissingFungibleTokenVaults() ([]TokenCount, error)
	InitMissingFungibleTokenVaults() (string, error)
	GetWorkerPool() OpsWorkerPoolService
}

Service lists all functionality provided by ops service

func NewService

func NewService(
	cfg *configs.Config,
	store Store,
	temps templates.Service,
	txs transactions.Service,
	tokens tokens.Service,
) Service

NewService initiates a new ops service.

type ServiceImpl

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

ServiceImpl implements the ops Service

func (*ServiceImpl) GetMissingFungibleTokenVaults

func (s *ServiceImpl) GetMissingFungibleTokenVaults() ([]TokenCount, error)

GetMissingFungibleTokenVaults returns number of accounts that are missing a configured fungible token vault.

func (*ServiceImpl) GetWorkerPool

func (s *ServiceImpl) GetWorkerPool() OpsWorkerPoolService

func (*ServiceImpl) InitMissingFungibleTokenVaults

func (s *ServiceImpl) InitMissingFungibleTokenVaults() (string, error)

InitMissingFungibleTokenVaults starts job to init missing fungible token vaults.

type Store

type Store interface {
	ListAccountsWithMissingVault(tokenName string) (*[]accounts.Account, error)
}

Store defines what ops needs from the database

func NewGormStore

func NewGormStore(db *gorm.DB) Store

type TokenCount

type TokenCount struct {
	TokenName string `json:"token"`
	Count     uint   `json:"count"`
}

Jump to

Keyboard shortcuts

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