Documentation ¶
Index ¶
- Constants
- type Config
- func (c *Config) Context() context.Context
- func (c *Config) GetConfigFile() string
- func (c *Config) GetConfigString(key string) string
- func (c *Config) GetDaemonPeriod() time.Duration
- func (c *Config) GetFieldID(key fieldKey) string
- func (c *Config) GetFieldKey(key fieldKey) string
- func (c *Config) GetJiraComponents() []*jira.Component
- func (c *Config) GetProject() *jira.Project
- func (c *Config) GetProjectKey() string
- func (c *Config) GetRepo() (string, string)
- func (c *Config) GetSinceParam() time.Time
- func (c *Config) GetTimeout() time.Duration
- func (c *Config) IsBasicAuth() bool
- func (c *Config) IsDaemon() bool
- func (c *Config) IsDryRun() bool
- func (c *Config) LoadJiraConfig(client *jira.Client) error
- func (c *Config) SaveConfig() error
- func (c *Config) SetJiraToken(token *oauth1.Token)
- type ReadingJiraComponentError
Constants ¶
const ( GitHubID fieldKey = iota GitHubNumber fieldKey = iota GitHubLabels fieldKey = iota GitHubStatus fieldKey = iota GitHubReporter fieldKey = iota GitHubLastSync fieldKey = iota // Custom field names. CustomFieldNameGitHubID = "github-id" CustomFieldNameGitHubNumber = "github-number" CustomFieldNameGitHubLabels = "github-labels" CustomFieldNameGitHubStatus = "github-status" CustomFieldNameGitHubReporter = "github-reporter" CustomFieldNameGitHubLastSync = "github-last-sync" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the root configuration object the application creates.
func New ¶
New creates a new, immutable configuration object. This object holds the Viper configuration and the logger, and is validated. The Jira configuration is not yet initialized.
func (*Config) GetConfigFile ¶
GetConfigFile returns the file that Viper loaded the configuration from.
func (*Config) GetConfigString ¶
GetConfigString returns a string value from the Viper configuration.
func (*Config) GetDaemonPeriod ¶
GetDaemonPeriod returns the period on which the tool runs if in daemon mode.
func (*Config) GetFieldID ¶
GetFieldID returns the customfield ID of a Jira custom field.
func (*Config) GetFieldKey ¶
GetFieldKey returns customfield_XXXXX, where XXXXX is the custom field ID (see GetFieldID).
func (*Config) GetJiraComponents ¶ added in v0.0.8
GetJiraComponents returns the Jira component the user has configured.
func (*Config) GetProject ¶
GetProject returns the Jira project the user has configured.
func (*Config) GetProjectKey ¶
GetProjectKey returns the Jira key of the configured project.
func (*Config) GetRepo ¶
GetRepo returns the user/org name and the repo name of the configured GitHub repository.
func (*Config) GetSinceParam ¶
GetSinceParam returns the `since` configuration parameter, parsed as a time.Time.
func (*Config) GetTimeout ¶
GetTimeout returns the configured timeout on all API calls, parsed as a time.Duration.
func (*Config) IsBasicAuth ¶
IsBasicAuth is true if we're using HTTP Basic Authentication, and false if we're using OAuth.
func (*Config) IsDryRun ¶
IsDryRun returns whether the application is running in confirmed mode or not.
func (*Config) LoadJiraConfig ¶ added in v0.0.7
LoadJiraConfig loads the Jira configuration (project key, custom field IDs) from a remote Jira server.
func (*Config) SaveConfig ¶
SaveConfig updates the `since` parameter to now, then saves the configuration file.
func (*Config) SetJiraToken ¶ added in v0.0.7
SetJiraToken adds the Jira OAuth tokens in the Viper configuration, ensuring that they are saved for future runs.
type ReadingJiraComponentError ¶ added in v0.0.8
type ReadingJiraComponentError string
func (ReadingJiraComponentError) Error ¶ added in v0.0.8
func (r ReadingJiraComponentError) Error() string