config

package
v0.0.0-...-386ad9e Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreatedBy         string = "created_by"
	CreatedDate       string = "created_date"
	UpdatedBy         string = "updated_by"
	UpdatedDate       string = "updated_date"
	Latest            string = "latest"
	ConfluenceStatus  string = "status"
	LastVersionNumber string = "last_version"
	SpaceName         string = "space_name"
)
View Source
const (
	StyledView          string = "styled_view"
	AnonymousExportView string = "anonymous_export_view"
	Storage             string = "storage"
	ExportView          string = "export_view"
	View                string = "view"
	Editor              string = "editor"
)
View Source
const (
	Assignee   string = "assignee"
	Status     string = "status"
	Reporter   string = "reporter"
	Creator    string = "creator"
	Priority   string = "priority"
	Resolution string = "resolution"
	Type       string = "type"
	Created    string = "created"
	Updated    string = "updated"
	Watches    string = "watches"
	Components string = "components"
	Labels     string = "labels"
)

Variables

View Source
var ConfluenceBodyExpand = [...]string{
	StyledView, AnonymousExportView, Storage, ExportView, View, Editor,
}
View Source
var JiraDefaultFields = [...]string{
	Priority, Type, Status, Resolution, Assignee, Reporter, Created, Updated,
}

Functions

This section is empty.

Types

type App

type App struct {
	Host        string
	Port        int
	LogLevel    string `mapstructure:"log_level"`
	ErrToRocket bool   `mapstructure:"err_to_rocket"`
}

type Config

type Config struct {
	App               App
	Jira              *Jira
	Confluence        *Confluence
	MessageJira       MessageJira       `mapstructure:"message_jira"`
	MessageConfluence MessageConfluence `mapstructure:"message_confluence"`
	Rocketchat        Rocketchat
}

func Load

func Load(configFile string) (*Config, error)

func (*Config) ListenAddr

func (c *Config) ListenAddr() string

type Confluence

type Confluence struct {
	URL                   string `validate:"required"`
	Username              string `validate:"required"`
	Password              string `validate:"required"`
	Timeout               time.Duration
	FindPagesByViewID     string `mapstructure:"find_pages_viewid"`
	FindPagesBySpaceTitle string `mapstructure:"find_pages_spacetitle"`
	BodyExpand            string `mapstructure:"body_expand"`
}

type Jira

type Jira struct {
	URL      string `validate:"required"`
	Username string `validate:"required"`
	Password string `validate:"required"`
	Timeout  time.Duration

	FindKeyRegexp string `mapstructure:"find_keys_regexp"`
	// contains filtered or unexported fields
}

func (*Jira) RequestFields

func (j *Jira) RequestFields() []string

type Message

type Message struct {
	Username         string   `mapstructure:"username"`
	IconURL          string   `mapstructure:"icon_url"`
	MaxTextLen       int      `mapstructure:"max_text_length"`
	DefaultColor     string   `mapstructure:"default_color"`
	UseRealNames     bool     `mapstructure:"use_real_names"`
	DatetimeLayout   string   `mapstructure:"datetime_layout"`
	MsgLang          string   `mapstructure:"msg_lang"`
	QuoteProbability float32  `mapstructure:"quote_prob"`
	UnescapeHTML     bool     `mapstructure:"unescape_html"`
	StripTags        bool     `mapstructure:"strip_tags"`
	TitleTemplate    string   `mapstructure:"title_template"`
	ShowAuthor       bool     `mapstructure:"show_author"`
	AuthorTemplate   string   `mapstructure:"author_template"`
	AuthorIcons      []string `mapstructure:"author_icons"`
	Fields           []string `mapstructure:"fields"`
}

func (*Message) LangTag

func (m *Message) LangTag() language.Tag

type MessageConfluence

type MessageConfluence struct {
	Message `mapstructure:",squash"`
}

type MessageJira

type MessageJira struct {
	Message              `mapstructure:",squash"`
	PriorityColors       bool     `mapstructure:"priority_colors"`
	PriorityIDPrecedence []int    `mapstructure:"priority_id_precedence"`
	SortByPrecedence     bool     `mapstructure:"sort_by_precedence"`
	ColorsByPriority     []string `mapstructure:"colors_by_priority"`
	InactiveAuthor       string   `mapstructure:"inactive_author"`
	InactiveAuthorIcons  []string `mapstructure:"inactive_author_icons"`
}

type Rocketchat

type Rocketchat struct {
	Tokens                     []string
	WhitelistedUsers           []string `mapstructure:"whitelisted_users"`
	BlacklistedUsers           []string `mapstructure:"blacklisted_users"`
	WhitelistedChannels        []string `mapstructure:"whitelisted_channels"`
	BlacklistedChannels        []string `mapstructure:"blacklisted_channels"`
	WhitelistedJiraProjectKeys []string `mapstructure:"whitelisted_jira_keys"`
	BlacklistedJiraProjectKeys []string `mapstructure:"blacklisted_jira_keys"`
	AllowEdits                 bool     `mapstructure:"allow_edits"`
	AllowBots                  bool     `mapstructure:"allow_bots"`
}

Jump to

Keyboard shortcuts

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