Documentation
¶
Overview ¶
Package config defines the structure of the configuration for the `dev` tool. I expect it to be YAML, but am providing support for JSON via the struct tags to keep the options open.
There's a global configuration instance which should be populated by the controller and consumed from all other parts of the view or controller layers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Global = &Config{ Dev: Dev{}, Includes: Includes{}, Links: Links{}, Networks: Networks{}, Platforms: Platforms{}, Softwares: Softwares{}, Repositories: Repositories{}, }
Global contains the global configuration usable by all CLI commands, all root properties are guaranteed to exist
var Loaded = map[string]Config{}
Loaded contains a dictionary of configurations where the key equals the file's absolute path and the value containing the loaded configuration
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.0.7
type Config struct {
Dev Dev `json:"dev" yaml:"dev"`
Includes Includes `json:"includes" yaml:"includes"`
Links Links `json:"links" yaml:"links"`
Networks Networks `json:"networks" yaml:"networks"`
Platforms Platforms `json:"platforms" yaml:"platforms"`
Softwares Softwares `json:"softwares" yaml:"softwares"`
Repositories Repositories `json:"repositories" yaml:"repositories"`
}
func NewFromFile ¶
NewFromFile is a convenience function that reads the configuration in from a file at the provided :filePath
type Dev ¶
type Dev struct {
Client DevClient `json:"client" yaml:"client"`
Defaults DevDefaults `json:"defaults" yaml:"defaults"`
}
Dev specifies the configurations available for the CLI tool itself
type DevClient ¶
type DevClient struct {
Database DevClientDatabase `json:"database" yaml:"database"`
Notifications DevClientNotifications `json:"notifications" yaml:"notifications"`
}
DevClient holds configurations related to the CLI tool
type DevClientDatabase ¶
type DevClientDatabase struct {
Path string `json:"path" yaml:"path"`
}
DevClientDatabase holds configurations related to the data persistence mechanism of the CLI tool
type DevClientNotifications ¶
type DevClientNotifications struct {
Telegram DevClientNotificationsTelegram `json:"telegram" yaml:"telegram"`
}
DevClientNotifications holds configurations related to the notifications mechanisms of the CLI tool
type DevClientNotificationsTelegram ¶
type DevClientNotificationsTelegram struct {
Token string `json:"token" yaml:"token"`
ID string `json:"id" yaml:"id"`
}
DevClientNotificationsTelegram holds configurations related to the telegram integration for sending notifications
type DevDefaults ¶
type DevDefaults struct {
// Account defines the default platform to use for account
Account string `json:"account" yaml:"account"`
// Notifications defines the default platform to use for notifications
Notifications string `json:"notifications" yaml:"notifications"`
// Work defines the default platform to use for work
Work string `json:"work" yaml:"work"`
}
DevDefaults specifies default selections when running `dev <verb> <noum> <this>` commands
type IncludePath ¶ added in v0.0.7
type IncludePath string
IncludePath represents a file path to a configuration file
func (IncludePath) GetConfig ¶ added in v0.0.7
func (i IncludePath) GetConfig() (*Config, error)
GetConfig returns the configuration read from the path specified by this instance of IncludePath
type Networks ¶
Networks represents a list of networks that the user's machine should be able to connect to
type Platforms ¶
type Platforms struct {
PivotalTracker pivotaltracker.Config `json:"pivotaltracker" yaml:"pivotaltracker"`
Github github.Config `json:"github" yaml:"github"`
Gitlab gitlab.Config `json:"gitlab" yaml:"gitlab"`
Trello trello.Config `json:"trello" yaml:"trello"`
}
Platforms specifies the configurations available
func (Platforms) GetSanitized ¶
GetSanitized returns a sanitised deep copy of the current Platforms instance
type Repositories ¶
type Repositories []repository.Repository
Repositories represents a list of repositories a user should have access to on their machines
func (*Repositories) MergeWith ¶ added in v0.0.8
func (r *Repositories) MergeWith(o Repositories)
MergeWith merges the current Repositories instance with a provided Repositories instance. The merge strategy is add-only