Documentation ¶
Index ¶
- Variables
- func CheckVersion(configFile io.Reader) error
- func CreateConfigDir() error
- func FaucetHost(cfg *Config) string
- func LocateDefault(root string) (path string, err error)
- func MigrateLatest(current io.Reader, latest io.Writer) error
- func ReadConfigVersion(configFile io.Reader) (config.Version, error)
- func TSClientPath(conf *Config) string
- type Config
- type UnsupportedVersionError
- type ValidationError
- type VersionError
Constants ¶
This section is empty.
Variables ¶
var ( // ConfigDirPath returns the path of configuration directory of Ignite. ConfigDirPath = xfilepath.JoinFromHome(xfilepath.Path(".ignite")) // ConfigFileNames is a list of recognized names as for Ignite's config file. ConfigFileNames = []string{"config.yml", "config.yaml"} // DefaultTSClientPath defines the default relative path to use when generating the TS client. // The path is relative to the app's directory. DefaultTSClientPath = "ts-client" // LatestVersion defines the latest version of the config. LatestVersion config.Version = 1 // Versions holds config types for the supported versions. Versions = map[config.Version]config.Converter{ 0: &v0.Config{}, 1: &v1.Config{}, } )
var ErrConfigNotFound = errors.New("could not locate a config.yml in your chain")
ErrConfigNotFound indicates that the config.yml can't be found.
Functions ¶
func CheckVersion ¶ added in v0.25.0
CheckVersion checks that the config version is the latest and if not a VersionError is returned.
func CreateConfigDir ¶
func CreateConfigDir() error
CreateConfigDir creates config directory if it is not created yet.
func LocateDefault ¶
LocateDefault locates the default path for the config file. Returns ErrConfigNotFound when no config file found.
func MigrateLatest ¶ added in v0.25.0
MigrateLatest migrates a config file to the latest version.
func ReadConfigVersion ¶ added in v0.25.0
ReadConfigVersion reads the config version.
func TSClientPath ¶ added in v0.25.0
TSClientPath returns the relative path to the Typescript client directory. Path is relative to the app's directory.
Types ¶
type Config ¶
Config defines the latest config.
func ConvertLatest ¶ added in v0.25.0
ConvertLatest converts a config to the latest version.
func DefaultConfig ¶ added in v0.25.0
func DefaultConfig() *Config
DefaultConfig returns a config for the latest version initialized with default values.
type UnsupportedVersionError ¶ added in v0.25.0
UnsupportedVersionError is returned when the version of the config is not supported.
func (UnsupportedVersionError) Error ¶ added in v0.25.0
func (e UnsupportedVersionError) Error() string
type ValidationError ¶
type ValidationError struct {
Message string
}
ValidationError is returned when a configuration is invalid.
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type VersionError ¶ added in v0.25.0
VersionError is returned when config version is not the latest.
func (VersionError) Error ¶ added in v0.25.0
func (e VersionError) Error() string