Help us shape the future of Go! Take the 2026 Go Developer Survey

cfg

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Metrics         metrics.AppMetrics
	PrNotifications []PrNotification
	SlackConfig     SlackConfig

	SlackToGithubUserMap map[string]string // Map of Slack user IDs to GitHub logins
}

AppConfig is the main app runtime config

func (*AppConfig) GetGithubLogin added in v0.0.2

func (config *AppConfig) GetGithubLogin(slackUID string) (string, bool)

GetGithubLogin returns GitHub login for a given Slack user ID

func (*AppConfig) GetSlackMessageReply added in v0.0.2

func (config *AppConfig) GetSlackMessageReply(channelID, messageText string) (string, bool)

GetSlackMessageReply returns a reply message for a given Slack channel ID and message text

func (*AppConfig) GetSlackUID added in v0.0.2

func (config *AppConfig) GetSlackUID(githubLogin string) (string, bool)

GetSlackUID returns Slack user ID for a given GitHub login

func (*AppConfig) LoadConfig

func (config *AppConfig) LoadConfig(cf string) error

LoadConfig loads config file

type GHUsersChannel added in v0.0.2

type GHUsersChannel struct {
	ID                        string                    `yaml:"id"`
	PeriodicNotifications     PeriodicNotifications     `yaml:"periodic_notifications"`
	MessageReplyNotifications MessageReplyNotifications `yaml:"message_reply_notifications"`
}

GHUsersChannel struct describes a GitHub users channel mapping

type MessageReplyNotifications added in v0.0.2

type MessageReplyNotifications struct {
	NotifyUsers   bool   `yaml:"notify_users"`
	MessageRegex  string `yaml:"message_regex"`
	Reply         string `yaml:"reply"`
	ReplyInThread bool   `yaml:"reply_in_thread"`
}

MessageReplyNotifications struct describes the message reply notification settings

type Notification

type Notification struct {
	Slack SlackNotification `yaml:"slack"`
}

Notification struct describes desired notification routes

type PeriodicNotifications added in v0.0.2

type PeriodicNotifications struct {
	NotifyUsers bool   `yaml:"notify_users"`
	Schedule    string `yaml:"schedule"`
	Message     string `yaml:"message"`
}

PeriodicNotifications struct describes the periodic notification settings for users without GH info

type PrConditions added in v0.0.2

type PrConditions struct {
	OlderThanSeconds int `yaml:"older_than_seconds"`
}

PrConditions struct describes additional conditions for PRs

type PrNotification

type PrNotification struct {
	Owner                  string       `yaml:"gh_owner"`
	Labels                 []string     `yaml:"gh_pr_labels"`
	Repo                   string       `yaml:"gh_repo"`
	Schedule               string       `yaml:"schedule"`
	IncludeDrafts          bool         `yaml:"gh_pr_include_drafts"`
	IgnoreApproved         bool         `yaml:"gh_pr_ignore_approved"`
	IgnoreChangesRequested bool         `yaml:"gh_pr_ignore_changes_requested"`
	Conditions             PrConditions `yaml:"gh_pr_conditions"`
	Notifications          Notification `yaml:"notify"`
}

PrNotification is a struct for a single GH repo PRs notifications

type SlackConfig added in v0.0.2

type SlackConfig struct {
	GithubUsersChannels           []GHUsersChannel `yaml:"github_users_channels"`
	GithubCustomFieldPattern      string           `yaml:"github_custom_field_pattern"`
	SlackUsersPullIntervalSeconds int              `yaml:"slack_users_pull_interval_seconds"`
}

SlackConfig is the configuration for Slack integration

type SlackNotification

type SlackNotification struct {
	ChannelID      string `yaml:"channel_id"`
	Header         string `yaml:"message_header"`
	NotifyAssignee bool   `yaml:"notify_assignee"`
}

SlackNotification struct describes slack notification config

type UserMapping added in v0.0.2

type UserMapping struct {
	GithubLogin string `yaml:"github_login"`
	SlackUID    string `yaml:"slack_uid"`
}

UserMapping is a struct for mapping GitHub users to other notification channels

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL