config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAccountFile = ".accounts.yaml"
)
View Source
const DefaultContractFile = ".contracts.yaml"

Variables

This section is empty.

Functions

func ChangeKey

func ChangeKey(file string, key string, value string) (err error)

func LoadYamlConfig

func LoadYamlConfig(file string, typeName string, elements interface{}) error

func SaveYamlConfig

func SaveYamlConfig(file string, elements interface{}) error

Types

type AccountRepo

type AccountRepo struct {
	Accounts []types.Account
	Selected string
}

func NewAccountRepo

func NewAccountRepo(selected string) (*AccountRepo, error)

func (*AccountRepo) AccountExists

func (r *AccountRepo) AccountExists(name string) (bool, error)

func (*AccountRepo) AddAccount

func (r *AccountRepo) AddAccount(a types.Account) error

func (*AccountRepo) GetAccount

func (r *AccountRepo) GetAccount(name string) (types.Account, error)

func (*AccountRepo) GetCurrentAccount

func (r *AccountRepo) GetCurrentAccount() (types.Account, error)

func (*AccountRepo) GetNextName

func (r *AccountRepo) GetNextName() string

func (*AccountRepo) ListAccounts

func (r *AccountRepo) ListAccounts() ([]types.Account, error)

type ChainRepo

type ChainRepo struct {
	Chains     []types.ChainConfig
	ConfigFile string
	Selected   string
}

func NewChainRepo

func NewChainRepo(selected string) (*ChainRepo, error)

func (*ChainRepo) AddChain

func (c *ChainRepo) AddChain(config types.ChainConfig) error

func (*ChainRepo) GetCurrentChain

func (c *ChainRepo) GetCurrentChain() (types.ChainConfig, error)

func (*ChainRepo) ListChains

func (c *ChainRepo) ListChains() ([]types.ChainConfig, error)

type ContractRepo

type ContractRepo struct {
	Contracts  []*types.Contract
	Selected   string
	DefaultAbi string
}

func NewContractRepo

func NewContractRepo(selected string, abi string, all bool) (*ContractRepo, error)

func (ContractRepo) AddContract

func (c ContractRepo) AddContract(contract types.Contract) error

func (ContractRepo) GetContract

func (c ContractRepo) GetContract(name string) (types.Contract, error)

func (ContractRepo) GetCurrentContract

func (c ContractRepo) GetCurrentContract() (types.Contract, error)

func (ContractRepo) ListContracts

func (c ContractRepo) ListContracts() ([]*types.Contract, error)

type YamlConfig

type YamlConfig struct {
	File string
}

Jump to

Keyboard shortcuts

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