Documentation ¶
Index ¶
- func Save(filename string, configuration *Configuration) error
- type Configuration
- func (config *Configuration) Account(name string) (*account.Account, error)
- func (config *Configuration) AddIdentity(name string, description string, seed string, password string) error
- func (config *Configuration) AddReceiveOnlyIdentity(name string, description string, acc string) error
- func (config *Configuration) Identity(name string) (*Identity, error)
- func (config *Configuration) Private(password string, name string) (*Private, error)
- type Identity
- type Private
- type Salt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Save ¶
func Save(filename string, configuration *Configuration) error
Save - update configuration file with current data
Types ¶
type Configuration ¶
type Configuration struct { DefaultIdentity string `json:"default_identity"` TestNet bool `json:"testnet"` Connections []string `json:"connections"` Identities map[string]Identity `json:"identities"` }
Configuration - configuration file data format
func Load ¶ added in v0.11.0
func Load(filename string) (*Configuration, error)
Load - read the configuration
func (*Configuration) Account ¶ added in v0.11.0
func (config *Configuration) Account(name string) (*account.Account, error)
Account - find identity for a given name and convert to an account
func (*Configuration) AddIdentity ¶ added in v0.11.0
func (config *Configuration) AddIdentity(name string, description string, seed string, password string) error
AddIdentity - store encrypted identity
func (*Configuration) AddReceiveOnlyIdentity ¶ added in v0.11.0
func (config *Configuration) AddReceiveOnlyIdentity(name string, description string, acc string) error
AddReceiveOnlyIdentity - store public-only identity
type Identity ¶ added in v0.11.0
type Identity struct { Description string `json:"description"` Account string `json:"account"` Data string `json:"data"` Salt string `json:"salt"` }
Identity - mix of plain and encrypted data
type Private ¶ added in v0.11.0
type Private struct { PrivateKey *account.PrivateKey `json:"privateKey"` Seed string `json:"seed"` Description string `json:"description"` }
type Salt ¶ added in v0.11.0
type Salt [saltSize]byte
Salt - type to hold a salt value
func (*Salt) MarshalText ¶ added in v0.11.0
MarshalText - convert salt to little endian hex text
***** possibly use NewEncoder and byte buffer to save copy
func (Salt) String ¶ added in v0.11.0
String - convert a binary salt to little endian hex string for use by the fmt package (for %s)
func (*Salt) UnmarshalText ¶ added in v0.11.0
UnmarshalText - convert little endian hex text into a salt
Click to show internal directories.
Click to hide internal directories.