Documentation ¶
Index ¶
Constants ¶
const (
// YamlFilename is where dirprefs are stored
YamlFilename = ".manifold.yml"
)
Variables ¶
var ErrExpectedFile = errors.New("Expected ~/.manifoldrc to be a file; found a directory")
ErrExpectedFile represents an error where the manifoldrc file was a directory instead of a file.
var ErrMissingHomeDir = errors.New("Could not find Home Directory")
ErrMissingHomeDir represents an error when a home directory could not be found
var ErrPluginNotFound = errors.New("Plugin not found")
ErrPluginNotFound is returned if a particular plugin doesn't exist in the yaml when requested
var ErrWrongConfigPermissions = errors.New(
"~/.manifoldrc must be only readable and writable to the current user (0600)")
ErrWrongConfigPermissions represents an error when the config permissions are incorrect.
var GitHubCallback = "https://dashboard.manifold.co/login/oauth/github"
var GitHubClientID = "40ff4213256c4b253c7f"
GitHubClientID facilitates logins with GitHub
var StripePublishableKey = "pk_live_A6qSWh1v4SrNnrWSftgDcKFQ"
StripePublishableKey facilitates secure transmission of payment values
var Version = "dev"
Version represents the version of the cli. This variable is updated at build time.
Functions ¶
Types ¶
type Config ¶
type Config struct { Hostname string `ini:"hostname"` AuthToken string `ini:"auth_token"` TransportScheme string `ini:"scheme"` Analytics bool `ini:"analytics"` LegacyTeam string `ini:"team,omitempty"` TeamTitle string `ini:"team_title,omitempty"` TeamName string `ini:"team_name,omitempty"` TeamID string `ini:"team_id,omitempty"` GitHubCallback string `ini:"github_callback,omitempty"` }
Config represents the configuration which is stored inside a ~/.manifoldrc file in ini format.
func Load ¶
Load checks if ~/.manifoldrc exists, if it does, it reads it from disk.
If it doesn't an empty config with the default values is returned.
If the file cannot be read, or it has the incorrect permissions an error is returned.
func LoadIgnoreLegacy ¶ added in v0.8.1
LoadIgnoreLegacy checks if ~/.manifoldrc exists, if it does, it reads it from disk. This func ignores the legacy check.
If it doesn't an empty config with the default values is returned.
If the file cannot be read, or it has the incorrect permissions an error is returned.
func (*Config) IdentifyLegacyValues ¶ added in v0.8.1
IdentifyLegacyValues identifies if a user's config file is out of date aiding migration, or suggesting a fix
type ManifoldYaml ¶
type ManifoldYaml struct { Project string `yaml:"project,omitempty" flag:"project,omitempty"` Team string `yaml:"team,omitempty" flag:"team,omitempty"` Plugins map[string]interface{} `yaml:"plugins,omitempty"` Path string `yaml:"-" json:"-"` }
ManifoldYaml represents the standard project config object
func LoadYaml ¶
func LoadYaml(recurse bool) (*ManifoldYaml, error)
LoadYaml loads ManifoldYaml. It starts in the current working directory, looking for a readable '.manifold.yml' file, and walks up the directory hierarchy until it finds one, or reaches the root of the fs.
It returns an empty ManifoldYaml is no '.manifold.yml' files are found. It returns an error if a malformed file is found, or if any errors occur during file system access.
func (ManifoldYaml) GetPlugin ¶
func (m ManifoldYaml) GetPlugin(name string, conf interface{}) error
GetPlugin retrieves plugins config for the given plugin name
func (*ManifoldYaml) Remove ¶
func (m *ManifoldYaml) Remove() error
Remove removes the backing file for this ManifoldYaml
func (*ManifoldYaml) Save ¶
func (m *ManifoldYaml) Save() error
Save writes the ManifoldYaml values to the file in the struct's Path field
func (*ManifoldYaml) SavePlugin ¶
func (m *ManifoldYaml) SavePlugin(name string, conf interface{}) error
SavePlugin writes the ManifoldYaml values for a specific plugin name