Documentation
¶
Overview ¶
Package config loads and persists jiratui configuration.
Index ¶
- Constants
- Variables
- func CacheDir() (string, error)
- func JiraToken() (string, error)
- func MailPassword() (string, error)
- func Path(explicit string) (string, error)
- func Save(path string, cfg Config) error
- func SetJiraToken(token string) error
- func SetMailPassword(password string) error
- func StateDir() (string, error)
- type Config
- type JiraConfig
- type MailConfig
- type ReportConfig
- type StatusGroups
- type UIConfig
Constants ¶
const (
// AppName is the application name used for XDG paths and keyring service names.
AppName = "jiratui"
)
Variables ¶
var ErrSecretNotFound = errors.New("secret not found")
ErrSecretNotFound is returned when a secret is missing from keyring and environment.
Functions ¶
func MailPassword ¶
MailPassword returns the IONOS IMAP password from environment or the OS keyring.
func SetJiraToken ¶
SetJiraToken stores the Jira API token in the OS keyring.
func SetMailPassword ¶
SetMailPassword stores the IONOS IMAP password in the OS keyring.
Types ¶
type Config ¶
type Config struct {
Jira JiraConfig `yaml:"jira"`
Mail MailConfig `yaml:"mail"`
Report ReportConfig `yaml:"report"`
UI UIConfig `yaml:"ui"`
}
Config contains all non-secret application settings.
func Load ¶
Load reads the config from path. If path is empty, the XDG default path is used. Missing config files are not considered an error; the default config is returned.
func (Config) IsConfigured ¶
IsConfigured reports whether the config has enough data to start the daily sprint view.
func (Config) IsJiraConfigured ¶
IsJiraConfigured reports whether Jira setup/discovery has completed.
type JiraConfig ¶
type JiraConfig struct {
BaseURL string `yaml:"base_url"`
Username string `yaml:"username"`
AccountID string `yaml:"account_id"`
DisplayName string `yaml:"display_name"`
ProjectKey string `yaml:"project_key"`
ProjectID string `yaml:"project_id"`
ProjectName string `yaml:"project_name"`
BoardID int `yaml:"board_id"`
IssueTypeTaskID string `yaml:"issue_type_task_id"`
StoryPointsFieldID string `yaml:"story_points_field_id"`
StatusGroups StatusGroups `yaml:"status_groups"`
CreateDefaults map[string]any `yaml:"create_defaults,omitempty"`
}
JiraConfig contains Jira connection and workflow settings.
type MailConfig ¶
type MailConfig struct {
Provider string `yaml:"provider"`
IMAPHost string `yaml:"imap_host"`
IMAPPort int `yaml:"imap_port"`
TLS bool `yaml:"tls"`
Username string `yaml:"username"`
From string `yaml:"from"`
To []string `yaml:"to"`
CC []string `yaml:"cc,omitempty"`
DraftsMailbox string `yaml:"drafts_mailbox"`
SubjectTemplate string `yaml:"subject_template"`
}
MailConfig contains IONOS IMAP draft settings.
type ReportConfig ¶
type ReportConfig struct {
ProjectLabel string `yaml:"project_label"`
Timezone string `yaml:"timezone"`
OnlyMyStatusChanges bool `yaml:"only_my_status_changes"`
BlockersDefault string `yaml:"blockers_default"`
DeliveryDefault string `yaml:"delivery_default"`
TodoNextLimit int `yaml:"todo_next_limit"`
}
ReportConfig contains daily report generation settings.
type StatusGroups ¶
type StatusGroups struct {
Done []string `yaml:"done"`
InProgress []string `yaml:"in_progress"`
Blocked []string `yaml:"blocked"`
}
StatusGroups maps Jira status names to jiratui buckets.