cfg

package
v0.0.0-...-3ef0e5c Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FileNotFound = errors.New("No configuration file")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	*ini.File
	// contains filtered or unexported fields
}

func LooseLoad

func LooseLoad(source interface{}, others ...interface{}) (Config, error)

Wrapper around https://godoc.org/gopkg.in/go-ini/ini.v1#LooseLoad

func LooseLoadGlob

func LooseLoadGlob(pattern string) (Config, error)

Helper loads multiple config files

func (Config) AccountFromArg

func (config Config) AccountFromArg(arg string) (*data.Account, *uint32, error)

Helper to parse a command line argument into a fully-qualifed account.

func (Config) AmountFromArg

func (config Config) AmountFromArg(arg string) (*data.Amount, error)

func (Config) FormatAccountName

func (config Config) FormatAccountName(account data.Account) string

Return account's nickname, if any. Otherwise return account's address. Format helper lives in config because this is where nicknames are known.

func (Config) FormatAmount

func (config Config) FormatAmount(amount data.Amount) string

func (Config) GetAccountByNickname

func (config Config) GetAccountByNickname(nickname string) (account *data.Account, tag *uint32, ok bool)

func (Config) GetAccountKeypair

func (config Config) GetAccountKeypair(account data.Account) (util.Keypair, error)

TODO support ECDSA and ed25519

func (Config) GetAccountNickname

func (config Config) GetAccountNickname(account data.Account) (string, bool)

func (Config) GetAccountXXX

func (config Config) GetAccountXXX() string

func (Config) GetDefaultAccount

func (config Config) GetDefaultAccount() (*data.Account, *uint32, bool)

func (Config) GetRippled

func (config Config) GetRippled() string

Jump to

Keyboard shortcuts

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