Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultPaths() []string
- func Exists(path string) bool
- func GlobalPath() string
- func IsDefaultPath(paths []string) bool
- func ProcessorRun(raw []byte) ([]byte, map[string]string)
- func StringToAddress(value string) (*flow.Address, error)
- func StringToHexKey(key string, sigAlgo string) (crypto.PrivateKey, error)
- func StringToKeyIndex(value string) (int, error)
- type Account
- type AccountKey
- type Accounts
- type Config
- type Contract
- type ContractDeployment
- type Contracts
- func (c *Contracts) AddOrUpdate(name string, contract Contract)
- func (c *Contracts) ByName(name string) (*Contract, error)
- func (c *Contracts) ByNameAndNetwork(name string, network string) (*Contract, error)
- func (c *Contracts) ByNetwork(network string) Contracts
- func (c *Contracts) Remove(name string) error
- type Deployment
- type Deployments
- type Emulator
- type Emulators
- type KeyType
- type Loader
- type Network
- type Networks
- type Parser
- type Parsers
- type ReaderWriter
Constants ¶
const ( KeyTypeHex KeyType = "hex" KeyTypeGoogleKMS KeyType = "google-kms" DefaultEmulatorConfigName = "default" DefaultEmulatorServiceAccountName = "emulator-account" )
const DefaultPath = "flow.json"
Variables ¶
var ErrDoesNotExist = errors.New("missing configuration")
ErrDoesNotExist is error to be returned when config file does not exists.
var ErrOutdatedFormat = errors.New("you are using old configuration format")
Functions ¶
func DefaultPaths ¶
func DefaultPaths() []string
DefaultPaths determines default paths for configuration.
func IsDefaultPath ¶ added in v0.28.0
func ProcessorRun ¶
ProcessorRun all pre-processors.
func StringToAddress ¶
StringToAddress converts string to valid Flow address.
func StringToHexKey ¶
func StringToHexKey(key string, sigAlgo string) (crypto.PrivateKey, error)
StringToHexKey converts string private key and signature algorithm to private key.
func StringToKeyIndex ¶
StringToKeyIndex converts string key index to valid key index integer.
Types ¶
type Account ¶
type Account struct { Name string Address flow.Address Key AccountKey }
Account defines the configuration for a Flow account.
type AccountKey ¶
type AccountKey struct { Type KeyType Index int SigAlgo crypto.SignatureAlgorithm HashAlgo crypto.HashAlgorithm ResourceID string PrivateKey crypto.PrivateKey }
AccountKey represents account key and all their possible configuration formats.
type Accounts ¶
type Accounts []Account
func (*Accounts) AddOrUpdate ¶
AddOrUpdate add new or update if already present.
type Config ¶
type Config struct { Emulators Emulators Contracts Contracts Networks Networks Accounts Accounts Deployments Deployments }
Config contains all the configuration for CLI and implements getters and setters for properties. Config is agnostic to format from which it is built and it doesn't provide persistence functionality.
Emulators contains all the emulator config Contracts contains all contracts definitions and their sources Networks defines all the Flow networks addresses Accounts defines Flow accounts and their addresses, private key and more properties Deployments describes which contracts should be deployed to which accounts
type Contract ¶
Contract defines the configuration for a Cadence contract.
type ContractDeployment ¶
ContractDeployment defines the deployment of the contract with possible args.
type Contracts ¶
type Contracts []Contract
func (*Contracts) AddOrUpdate ¶
AddOrUpdate add new or update if already present.
func (*Contracts) ByNameAndNetwork ¶
ByNameAndNetwork get contract array for account and network.
type Deployment ¶
type Deployment struct { Network string // network name to deploy to Account string // account name to which to deploy to Contracts []ContractDeployment // contracts to deploy }
Deployment defines the configuration for a contract deployment.
func StringToDeployment ¶
func StringToDeployment(network string, account string, contracts []string) Deployment
StringToDeployment converts string to deployment.
type Deployments ¶
type Deployments []Deployment
func (*Deployments) AddOrUpdate ¶
func (d *Deployments) AddOrUpdate(deployment Deployment)
AddOrUpdate add new or update if already present.
func (*Deployments) ByAccountAndNetwork ¶
func (d *Deployments) ByAccountAndNetwork(account string, network string) Deployments
ByAccountAndNetwork get deploy by account and network.
func (*Deployments) ByNetwork ¶
func (d *Deployments) ByNetwork(network string) Deployments
ByNetwork get all deployments by network.
type Emulators ¶
type Emulators []Emulator
func DefaultEmulators ¶
func DefaultEmulators() Emulators
DefaultEmulators gets all default emulators.
func (*Emulators) AddOrUpdate ¶
AddOrUpdate add new or update if already present.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader contains actions for composing and modifying configuration.
func (*Loader) AddConfigParser ¶
AddConfigParser adds a new configuration parser.
type Network ¶
Network defines the configuration for a Flow network.
func DefaultEmulatorNetwork ¶
func DefaultEmulatorNetwork() Network
DefaultEmulatorNetwork get default emulator network.
func DefaultMainnetNetwork ¶
func DefaultMainnetNetwork() Network
DefaultMainnetNetwork get default mainnet network.
func DefaultTestnetNetwork ¶
func DefaultTestnetNetwork() Network
DefaultTestnetNetwork get default testnet network.
func StringToNetwork ¶
StringToNetwork converts string to network.
type Networks ¶
type Networks []Network
func (*Networks) AddOrUpdate ¶
AddOrUpdate add new network or update if already present.
type Parser ¶
type Parser interface { Serialize(*Config) ([]byte, error) Deserialize([]byte) (*Config, error) SupportsFormat(string) bool }
Parser is interface for any configuration format parser to implement.
type Parsers ¶
type Parsers []Parser
Parsers is a list of all configuration parsers.
func (*Parsers) FindForFormat ¶
FindForFormat finds a parser that can parse a specific format based on extension.