Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCustomCacheDirFor(customHome string, relDirPath CachePath) (string, error)
- func CreateCustomCachePathFor(customHome string, relFilePath CachePath) (string, error)
- func CreateCustomConfigDirFor(customHome string, relDirPath ConfigPath) (string, error)
- func CreateCustomConfigPathFor(customHome string, relFilePath ConfigPath) (string, error)
- func CreateCustomDataDirFor(customHome string, relDirPath DataPath) (string, error)
- func CreateCustomDataPathFor(customHome string, relFilePath DataPath) (string, error)
- func CreateCustomStateDirFor(customHome string, relDirPath StatePath) (string, error)
- func CreateCustomStatePathFor(customHome string, relFilePath StatePath) (string, error)
- func CreateDefaultCacheDirFor(relDirPath CachePath) (string, error)
- func CreateDefaultCachePathFor(relFilePath CachePath) (string, error)
- func CreateDefaultConfigDirFor(relDirPath ConfigPath) (string, error)
- func CreateDefaultConfigPathFor(relFilePath ConfigPath) (string, error)
- func CreateDefaultDataDirFor(relDirPath DataPath) (string, error)
- func CreateDefaultDataPathFor(relFilePath DataPath) (string, error)
- func CreateDefaultStateDirFor(relDirPath StatePath) (string, error)
- func CreateDefaultStatePathFor(relFilePath StatePath) (string, error)
- func CustomCachePathFor(customHome string, relPath CachePath) string
- func CustomConfigPathFor(customHome string, relPath ConfigPath) string
- func CustomDataPathFor(customHome string, relPath DataPath) string
- func CustomStatePathFor(customHome string, relPath StatePath) string
- func DefaultCachePathFor(relPath CachePath) string
- func DefaultConfigPathFor(relPath ConfigPath) string
- func DefaultDataPathFor(relPath DataPath) string
- func DefaultStatePathFor(relPath StatePath) string
- func Explain(name string) (string, error)
- func FetchStructuredFile(url string, v interface{}) error
- func JoinCachePathStr(p CachePath, elem ...string) string
- func JoinConfigPathStr(p ConfigPath, elem ...string) string
- func JoinDataPathStr(p DataPath, elem ...string) string
- func JoinStatePathStr(p StatePath, elem ...string) string
- func ReadEncryptedFile(path string, passphrase string, v interface{}) error
- func ReadStructuredFile(path string, v interface{}) error
- func WriteEncryptedFile(path string, passphrase string, v interface{}) error
- func WriteStructuredFile(path string, v interface{}) error
- type CachePath
- type ConfigPath
- type CustomPaths
- func (p *CustomPaths) CachePathFor(relPath CachePath) string
- func (p *CustomPaths) ConfigPathFor(relPath ConfigPath) string
- func (p *CustomPaths) CreateCacheDirFor(relDirPath CachePath) (string, error)
- func (p *CustomPaths) CreateCachePathFor(relFilePath CachePath) (string, error)
- func (p *CustomPaths) CreateConfigDirFor(relDirPath ConfigPath) (string, error)
- func (p *CustomPaths) CreateConfigPathFor(relFilePath ConfigPath) (string, error)
- func (p *CustomPaths) CreateDataDirFor(relDirPath DataPath) (string, error)
- func (p *CustomPaths) CreateDataPathFor(relFilePath DataPath) (string, error)
- func (p *CustomPaths) CreateStateDirFor(relDirPath StatePath) (string, error)
- func (p *CustomPaths) CreateStatePathFor(relFilePath StatePath) (string, error)
- func (p *CustomPaths) DataPathFor(relPath DataPath) string
- func (p *CustomPaths) StatePathFor(relPath StatePath) string
- type DataPath
- type DefaultPaths
- func (p *DefaultPaths) CachePathFor(relPath CachePath) string
- func (p *DefaultPaths) ConfigPathFor(relPath ConfigPath) string
- func (p *DefaultPaths) CreateCacheDirFor(relDirPath CachePath) (string, error)
- func (p *DefaultPaths) CreateCachePathFor(relFilePath CachePath) (string, error)
- func (p *DefaultPaths) CreateConfigDirFor(relDirPath ConfigPath) (string, error)
- func (p *DefaultPaths) CreateConfigPathFor(relFilePath ConfigPath) (string, error)
- func (p *DefaultPaths) CreateDataDirFor(relDirPath DataPath) (string, error)
- func (p *DefaultPaths) CreateDataPathFor(relFilePath DataPath) (string, error)
- func (p *DefaultPaths) CreateStateDirFor(relDirPath StatePath) (string, error)
- func (p *DefaultPaths) CreateStatePathFor(relFilePath StatePath) (string, error)
- func (p *DefaultPaths) DataPathFor(relPath DataPath) string
- func (p *DefaultPaths) StatePathFor(relPath StatePath) string
- type ListPathsResponse
- type Paths
- type StatePath
Constants ¶
const ( // LongestPathNameLen is the length of the longest path name. It is used // for text formatting. LongestPathNameLen = 35 )
Variables ¶
var ( ErrEmptyResponse = errors.New("empty response") ErrEmptyFile = errors.New("empty file") )
var ( // BlockExplorerConfigHome is the folder containing the configuration files // used by the block explorer. BlockExplorerConfigHome = ConfigPath("blockexplorer") // BlockExplorerDefaultConfigFile is the default configuration file for the // block explorer. BlockExplorerDefaultConfigFile = JoinConfigPath(BlockExplorerConfigHome, "config.toml") // DataNodeConfigHome is the folder containing the configuration files // used by the node. DataNodeConfigHome = ConfigPath("data-node") // DataNodeDefaultConfigFile is the default configuration file for the // data-node. DataNodeDefaultConfigFile = JoinConfigPath(DataNodeConfigHome, "config.toml") // FaucetConfigHome is the folder containing the configuration files // used by the node. FaucetConfigHome = ConfigPath("faucet") // FaucetDefaultConfigFile is the default configuration file for the // data-node. FaucetDefaultConfigFile = JoinConfigPath(FaucetConfigHome, "config.toml") // NodeConfigHome is the folder containing the configuration files used by // the node. NodeConfigHome = ConfigPath("node") // NodeDefaultConfigFile is the default configuration file for the node. NodeDefaultConfigFile = JoinConfigPath(NodeConfigHome, "config.toml") // NodeWalletsConfigFile is the configuration file for the node wallets. NodeWalletsConfigFile = JoinConfigPath(NodeConfigHome, "wallets.encrypted") // WalletCLIConfigHome is the folder containing the configuration files // used by the wallet CLI. WalletCLIConfigHome = ConfigPath("wallet-cli") // WalletCLIDefaultConfigFile is the default configuration file for the // wallet CLI. WalletCLIDefaultConfigFile = JoinConfigPath(WalletCLIConfigHome, "config.toml") // WalletAppConfigHome is the folder containing the configuration files // used by the wallet app application. WalletAppConfigHome = ConfigPath("wallet-app") // WalletAppDefaultConfigFile is the default configuration file for the // wallet app application. WalletAppDefaultConfigFile = JoinConfigPath(WalletAppConfigHome, "config.toml") // WalletServiceConfigHome is the folder containing the configuration files // used by the wallet service application. WalletServiceConfigHome = ConfigPath("wallet-service") // WalletServiceNetworksConfigHome is the folder containing the // configuration files used by the networks. WalletServiceNetworksConfigHome = JoinConfigPath(WalletServiceConfigHome, "networks") // WalletServicePermissionsConfigFile is the file containing the permissions that // control the access to the wallets. WalletServicePermissionsConfigFile = ConfigPath(filepath.Join(WalletServiceConfigHome.String(), "permissions.toml")) )
var ( // NodeDataHome is the folder containing the data used by the node. NodeDataHome = DataPath("node") // NodeWalletsDataHome is the folder containing the data used by the // node wallets. NodeWalletsDataHome = DataPath(filepath.Join(NodeDataHome.String(), "wallets")) // VegaNodeWalletsDataHome is the folder containing the vega wallet // used by the node. VegaNodeWalletsDataHome = DataPath(filepath.Join(NodeWalletsDataHome.String(), "vega")) // EthereumNodeWalletsDataHome is the folder containing the ethereum wallet // used by the node. EthereumNodeWalletsDataHome = DataPath(filepath.Join(NodeWalletsDataHome.String(), "ethereum")) // FaucetDataHome is the folder containing the data used by the faucet. FaucetDataHome = DataPath("faucet") // FaucetWalletsDataHome is the folder containing the data used by the // faucet wallets. FaucetWalletsDataHome = DataPath(filepath.Join(FaucetDataHome.String(), "wallets")) // WalletsDataHome is the folder containing the user wallets. WalletsDataHome = DataPath("wallets") // WalletServiceDataHome is the folder containing the data used by the // wallet service. WalletServiceDataHome = DataPath("wallet-service") // WalletServiceRSAKeysDataHome is the folder containing the RSA keys used by // the wallet service. WalletServiceRSAKeysDataHome = DataPath(filepath.Join(WalletServiceDataHome.String(), "rsa-keys")) // WalletServicePublicRSAKeyDataFile is the file containing the public RSA key // used by the wallet service. WalletServicePublicRSAKeyDataFile = DataPath(filepath.Join(WalletServiceRSAKeysDataHome.String(), "public.pem")) // WalletServicePrivateRSAKeyDataFile is the file containing the private RSA key // used by the wallet service. WalletServicePrivateRSAKeyDataFile = DataPath(filepath.Join(WalletServiceRSAKeysDataHome.String(), "private.pem")) )
var ( // DataNodeStateHome is the folder containing the state used by the // data-node. DataNodeStateHome = StatePath("data-node") // DataNodeLogsHome is the folder containing the logs of the data-node. DataNodeLogsHome = StatePath(filepath.Join(DataNodeStateHome.String(), "logs")) // DataNodeStorageHome is the folder containing the data storage of the // data-node. DataNodeStorageHome = StatePath(filepath.Join(DataNodeStateHome.String(), "storage")) // DataNodeSnapshotHome is the folder containing the snapshots of the data-node. DataNodeSnapshotHome = StatePath(filepath.Join(DataNodeStateHome.String(), "snapshots")) // NodeStateHome is the folder containing the state of the node. NodeStateHome = StatePath("node") // NodeLogsHome is the folder containing the logs of the node. NodeLogsHome = StatePath(filepath.Join(NodeStateHome.String(), "logs")) // CheckpointStateHome is the folder containing the checkpoint files // of to the node. CheckpointStateHome = StatePath(filepath.Join(NodeStateHome.String(), "checkpoints")) // SnapshotStateHome is the folder containing the snapshot files // of to the node. SnapshotStateHome = StatePath(filepath.Join(NodeStateHome.String(), "snapshots")) // SnapshotDBStateFile is the DB file for GoLevelDB used in snapshots. SnapshotDBStateFile = StatePath(filepath.Join(SnapshotStateHome.String(), "ldb")) // WalletCLIStateHome is the folder containing the state of the wallet CLI. WalletCLIStateHome = StatePath("wallet-cli") // WalletCLILogsHome is the folder containing the logs of the wallet CLI. WalletCLILogsHome = StatePath(filepath.Join(WalletCLIStateHome.String(), "logs")) // WalletAppStateHome is the folder containing the state of the wallet // app. WalletAppStateHome = StatePath("wallet-app") // WalletAppLogsHome is the folder containing the logs of the wallet // app. WalletAppLogsHome = StatePath(filepath.Join(WalletAppStateHome.String(), "logs")) // WalletServiceStateHome is the folder containing the state of the node. WalletServiceStateHome = StatePath("wallet-service") // WalletServiceLogsHome is the folder containing the logs of the node. WalletServiceLogsHome = StatePath(filepath.Join(WalletServiceStateHome.String(), "logs")) )
var DataNodeCacheHome = CachePath("data-node")
DataNodeCacheHome is the folder containing the cache used by the data-node.
var VegaHome = "vega"
VegaHome is the name of the Vega folder for every type of file structure.
Functions ¶
func CreateCustomCacheDirFor ¶
CreateCustomCacheDirFor builds the path for cache directories at a given root path and creates intermediate directories. It scoped the files under a "data" folder, and follow the default structure.
func CreateCustomCachePathFor ¶
CreateCustomCachePathFor builds the path for cache files at a given root path and creates intermediate directories. It scoped the files under a "cache" folder, and follow the default structure.
func CreateCustomConfigDirFor ¶
func CreateCustomConfigDirFor(customHome string, relDirPath ConfigPath) (string, error)
CreateCustomConfigDirFor builds the path for config directories at a given root path and creates intermediate directories. It scoped the files under a "data" folder, and follow the default structure.
func CreateCustomConfigPathFor ¶
func CreateCustomConfigPathFor(customHome string, relFilePath ConfigPath) (string, error)
CreateCustomConfigPathFor builds the path for configuration files at a given root path and creates intermediate directories. It scoped the files under a "config" folder, and follow the default structure.
func CreateCustomDataDirFor ¶
CreateCustomDataDirFor builds the path for data directories at a given root path and creates intermediate directories. It scoped the files under a "data" folder, and follow the default structure.
func CreateCustomDataPathFor ¶
CreateCustomDataPathFor builds the path for data files at a given root path and creates intermediate directories. It scoped the files under a "data" folder, and follow the default structure.
func CreateCustomStateDirFor ¶
CreateCustomStateDirFor builds the path for data directories at a given root path and creates intermediate directories. It scoped the files under a "data" folder, and follow the default structure.
func CreateCustomStatePathFor ¶
CreateCustomStatePathFor builds the path for cache files at a given root path and creates intermediate directories. It scoped the files under a "cache" folder, and follow the default structure.
func CreateDefaultCacheDirFor ¶
CreateDefaultCacheDirFor builds the default path for a cache directory and creates it, along with intermediate directories, if needed.
func CreateDefaultCachePathFor ¶
CreateDefaultCachePathFor builds the default path for a cache file and creates intermediate directories, if needed.
func CreateDefaultConfigDirFor ¶
func CreateDefaultConfigDirFor(relDirPath ConfigPath) (string, error)
CreateDefaultConfigDirFor builds the default path for a config directory and creates it, along with intermediate directories, if needed.
func CreateDefaultConfigPathFor ¶
func CreateDefaultConfigPathFor(relFilePath ConfigPath) (string, error)
CreateDefaultConfigPathFor builds the default path for a configuration file and creates intermediate directories, if needed.
func CreateDefaultDataDirFor ¶
CreateDefaultDataDirFor builds the default path for a data directory and creates it, along with intermediate directories, if needed.
func CreateDefaultDataPathFor ¶
CreateDefaultDataPathFor builds the default path for a data file and creates intermediate directories, if needed.
func CreateDefaultStateDirFor ¶
CreateDefaultStateDirFor builds the default path for a state directory and creates it, along with intermediate directories, if needed.
func CreateDefaultStatePathFor ¶
CreateDefaultStatePathFor builds the default path for a state file and creates intermediate directories, if needed.
func CustomCachePathFor ¶
CustomCachePathFor builds the path for a cache file or directories at a given root path. It doesn't create any resources.
func CustomConfigPathFor ¶
func CustomConfigPathFor(customHome string, relPath ConfigPath) string
CustomConfigPathFor builds the path for a config file or directories at a given root path. It doesn't create any resources.
func CustomDataPathFor ¶
CustomDataPathFor builds the path for a data file or directories at a given root path. It doesn't create any resources.
func CustomStatePathFor ¶
CustomStatePathFor builds the path for a state file or directories at a given root path. It doesn't create any resources.
func DefaultCachePathFor ¶
DefaultCachePathFor build the default path for a cache file or directory. It doesn't create any resources.
func DefaultConfigPathFor ¶
func DefaultConfigPathFor(relPath ConfigPath) string
DefaultConfigPathFor build the default path for a config file or directory. It doesn't create any resources.
func DefaultDataPathFor ¶
DefaultDataPathFor build the default path for a data file or directory. It doesn't create any resources.
func DefaultStatePathFor ¶
DefaultStatePathFor build the default path for a state file or directory. It doesn't create any resources.
func FetchStructuredFile ¶
func JoinCachePathStr ¶
JoinCachePathStr joins any number of path elements with a root CachePath into a single path, separating them with an OS specific Separator, and returns it as a string.
func JoinConfigPathStr ¶
func JoinConfigPathStr(p ConfigPath, elem ...string) string
JoinConfigPathStr joins any number of path elements with a root ConfigPath into a single path, separating them with an OS specific Separator, and returns it as a string.
func JoinDataPathStr ¶
JoinDataPathStr joins any number of path elements with a root DataPath into a single path, separating them with an OS specific Separator, and returns it as a string.
func JoinStatePathStr ¶
JoinStatePathStr joins any number of path elements with a root StatePath into a single path, separating them with an OS specific Separator, and returns it as a string.
func ReadEncryptedFile ¶
func ReadStructuredFile ¶
func WriteEncryptedFile ¶
func WriteStructuredFile ¶
Types ¶
type CachePath ¶
type CachePath string
func JoinCachePath ¶
JoinCachePath joins any number of path elements with a root CachePath into a single path, separating them with an OS specific Separator, and returns it as a CachePath.
type ConfigPath ¶
type ConfigPath string
func JoinConfigPath ¶
func JoinConfigPath(p ConfigPath, elem ...string) ConfigPath
JoinConfigPath joins any number of path elements with a root ConfigPath into a single path, separating them with an OS specific Separator, and returns it as a ConfigPath.
func (ConfigPath) String ¶
func (p ConfigPath) String() string
type CustomPaths ¶
type CustomPaths struct {
CustomHome string
}
func (*CustomPaths) CachePathFor ¶
func (p *CustomPaths) CachePathFor(relPath CachePath) string
CachePathFor builds the path for a cache file or directories at the configured home. It doesn't create any resources.
func (*CustomPaths) ConfigPathFor ¶
func (p *CustomPaths) ConfigPathFor(relPath ConfigPath) string
ConfigPathFor builds the path for a config file or directories at the configured home. It doesn't create any resources.
func (*CustomPaths) CreateCacheDirFor ¶
func (p *CustomPaths) CreateCacheDirFor(relDirPath CachePath) (string, error)
CreateCacheDirFor builds the path for cache files at the configured home and creates intermediate directories.
func (*CustomPaths) CreateCachePathFor ¶
func (p *CustomPaths) CreateCachePathFor(relFilePath CachePath) (string, error)
CreateCachePathFor builds the path for cache directories at the configured home and creates intermediate directories.
func (*CustomPaths) CreateConfigDirFor ¶
func (p *CustomPaths) CreateConfigDirFor(relDirPath ConfigPath) (string, error)
CreateConfigDirFor builds the path for configuration files at a given configured home and creates intermediate directories.
func (*CustomPaths) CreateConfigPathFor ¶
func (p *CustomPaths) CreateConfigPathFor(relFilePath ConfigPath) (string, error)
CreateConfigPathFor builds the path for config directories at the configured home and creates intermediate directories.
func (*CustomPaths) CreateDataDirFor ¶
func (p *CustomPaths) CreateDataDirFor(relDirPath DataPath) (string, error)
CreateDataDirFor builds the path for data files at the configured home and creates intermediate directories.
func (*CustomPaths) CreateDataPathFor ¶
func (p *CustomPaths) CreateDataPathFor(relFilePath DataPath) (string, error)
CreateDataPathFor builds the path for data directories at the configured home and creates intermediate directories.
func (*CustomPaths) CreateStateDirFor ¶
func (p *CustomPaths) CreateStateDirFor(relDirPath StatePath) (string, error)
CreateStateDirFor builds the path for cache files at the configured home and creates intermediate directories.
func (*CustomPaths) CreateStatePathFor ¶
func (p *CustomPaths) CreateStatePathFor(relFilePath StatePath) (string, error)
CreateStatePathFor builds the path for data directories at the configured home and creates intermediate directories.
func (*CustomPaths) DataPathFor ¶
func (p *CustomPaths) DataPathFor(relPath DataPath) string
DataPathFor builds the path for a data file or directories at the configured home. It doesn't create any resources.
func (*CustomPaths) StatePathFor ¶
func (p *CustomPaths) StatePathFor(relPath StatePath) string
StatePathFor builds the path for a state file or directories at the configured home. It doesn't create any resources.
type DataPath ¶
type DataPath string
func JoinDataPath ¶
JoinDataPath joins any number of path elements with a root DataPath into a single path, separating them with an OS specific Separator, and returns it as a DataPath.
type DefaultPaths ¶
type DefaultPaths struct{}
func (*DefaultPaths) CachePathFor ¶
func (p *DefaultPaths) CachePathFor(relPath CachePath) string
CachePathFor build the default path for a cache file or directory. It doesn't create any resources.
func (*DefaultPaths) ConfigPathFor ¶
func (p *DefaultPaths) ConfigPathFor(relPath ConfigPath) string
ConfigPathFor build the default path for a config file or directory. It doesn't create any resources.
func (*DefaultPaths) CreateCacheDirFor ¶
func (p *DefaultPaths) CreateCacheDirFor(relDirPath CachePath) (string, error)
CreateCacheDirFor builds the default path for a cache directory and creates it, along with intermediate directories, if needed.
func (*DefaultPaths) CreateCachePathFor ¶
func (p *DefaultPaths) CreateCachePathFor(relFilePath CachePath) (string, error)
CreateCachePathFor builds the default path for a cache file and creates intermediate directories, if needed.
func (*DefaultPaths) CreateConfigDirFor ¶
func (p *DefaultPaths) CreateConfigDirFor(relDirPath ConfigPath) (string, error)
CreateConfigDirFor builds the default path for a config directory and creates it, along with intermediate directories, if needed.
func (*DefaultPaths) CreateConfigPathFor ¶
func (p *DefaultPaths) CreateConfigPathFor(relFilePath ConfigPath) (string, error)
CreateConfigPathFor builds the default path for a configuration file and creates intermediate directories, if needed.
func (*DefaultPaths) CreateDataDirFor ¶
func (p *DefaultPaths) CreateDataDirFor(relDirPath DataPath) (string, error)
CreateDataDirFor builds the default path for a data directory and creates it, along with intermediate directories, if needed.
func (*DefaultPaths) CreateDataPathFor ¶
func (p *DefaultPaths) CreateDataPathFor(relFilePath DataPath) (string, error)
CreateDataPathFor builds the default path for a data file and creates intermediate directories, if needed.
func (*DefaultPaths) CreateStateDirFor ¶
func (p *DefaultPaths) CreateStateDirFor(relDirPath StatePath) (string, error)
CreateStateDirFor builds the default path for a state directory and creates it, along with intermediate directories, if needed.
func (*DefaultPaths) CreateStatePathFor ¶
func (p *DefaultPaths) CreateStatePathFor(relFilePath StatePath) (string, error)
CreateStatePathFor builds the default path for a state file and creates intermediate directories, if needed.
func (*DefaultPaths) DataPathFor ¶
func (p *DefaultPaths) DataPathFor(relPath DataPath) string
DataPathFor build the default path for a data file or directory. It doesn't create any resources.
func (*DefaultPaths) StatePathFor ¶
func (p *DefaultPaths) StatePathFor(relPath StatePath) string
StatePathFor build the default path for a state file or directory. It doesn't create any resources.
type ListPathsResponse ¶
type ListPathsResponse struct { CachePaths map[string]string `json:"cachePaths"` ConfigPaths map[string]string `json:"configPaths"` DataPaths map[string]string `json:"dataPaths"` StatePaths map[string]string `json:"statePaths"` }
func List ¶
func List(vegaPaths Paths) *ListPathsResponse
type Paths ¶
type Paths interface { CreateCachePathFor(CachePath) (string, error) CreateCacheDirFor(CachePath) (string, error) CreateConfigPathFor(ConfigPath) (string, error) CreateConfigDirFor(ConfigPath) (string, error) CreateDataPathFor(DataPath) (string, error) CreateDataDirFor(DataPath) (string, error) CreateStatePathFor(StatePath) (string, error) CreateStateDirFor(StatePath) (string, error) CachePathFor(CachePath) string ConfigPathFor(ConfigPath) string DataPathFor(DataPath) string StatePathFor(StatePath) string }
nolint: interfacebloat
type StatePath ¶
type StatePath string
func JoinStatePath ¶
JoinStatePath joins any number of path elements with a root StatePath into a single path, separating them with an OS specific Separator, and returns it as a StatePath.