config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config defines configuration scheme

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Base      string    `json:"base"`
	GitLab    GitLab    `json:"gitlab"`
	MR        MR        `json:"mr"`
	Notifier  Notifier  `json:"notifier"`
	Mentioner Mentioner `json:"mentioner"`
	Hooks     Hooks     `json:"hooks"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) (err error)

type GitLab

type GitLab struct {
	URL   string `json:"url"`
	Token string `json:"token"`
}

type Hooks

type Hooks struct {
	AfterCommands  map[string][]string `json:"after"`
	BeforeCommands map[string][]string `json:"before"`
	Timeout        Duration            `json:"timeout"`
}

type MR

type MR struct {
	BranchRegexp       string   `json:"branch_regexp"`
	Title              string   `json:"title"`
	Description        string   `json:"description"`
	TargetBranch       string   `json:"target_branch"`
	Squash             bool     `json:"squash"`
	RemoveSourceBranch bool     `json:"remove_source_branch"`
	LabelVars          []string `json:"label_vars"`
}

type MattermostWebHook added in v0.5.0

type MattermostWebHook struct {
	Enabled     bool   `json:"enabled"`
	URL         string `json:"url"`
	MessageTmpl string `json:"message"`
	User        string `json:"user"`
}

type Mentioner

type Mentioner struct {
	TeamFileSource string `json:"team_file_source"`
	MentionsCount  int    `json:"count"`
}

type Notifier

type Notifier struct {
	SlackWebHook      SlackWebHook      `json:"slack_web_hook"`
	Telegram          Telegram          `json:"telegram"`
	MattermostWebHook MattermostWebHook `json:"mattermost_web_hook"`
}

type SlackWebHook

type SlackWebHook struct {
	Enabled     bool   `json:"enabled"`
	URL         string `json:"url"`
	MessageTmpl string `json:"message"`
	User        string `json:"user"`
}

type Telegram

type Telegram struct {
	Enabled     bool   `json:"enabled"`
	URL         string `json:"url"`
	APIKey      string `json:"api_key"`
	MessageTmpl string `json:"message"`
	ChatID      string `json:"chat_id"`
}

Jump to

Keyboard shortcuts

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