flg

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package flg defines flags, common for all commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineGroup

type EngineGroup struct {
	Type   string      `long:"type" env:"TYPE" choice:"github" choice:"gitlab" description:"type of the repository engine" required:"true"`
	Github GithubGroup `group:"github" namespace:"github" env-namespace:"GITHUB"`
	Gitlab GitlabGroup `group:"gitlab" namespace:"gitlab" env-namespace:"GITLAB"`
}

EngineGroup defines parameters for the engine.

func (EngineGroup) Build

func (r EngineGroup) Build() (engine.Interface, error)

Build builds the engine.

type GithubGroup

type GithubGroup struct {
	Repo struct {
		Owner string `long:"owner" env:"OWNER" description:"owner of the repository"`
		Name  string `long:"name" env:"NAME" description:"name of the repository"`
	} `group:"repo" namespace:"repo" env-namespace:"REPO"`
	BasicAuth struct {
		Username string `long:"username" env:"USERNAME" description:"username for basic auth"`
		Password string `long:"password" env:"PASSWORD" description:"password for basic auth"`
	} `group:"basic_auth" namespace:"basic_auth" env-namespace:"BASIC_AUTH"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

GithubGroup defines parameters to connect to the github repository.

type GithubNotifierGroup

type GithubNotifierGroup struct {
	GithubGroup
	ReleaseNameTemplate string `long:"release_name_tmpl" env:"RELEASE_NAME_TMPL" description:"template for release name"`
}

GithubNotifierGroup defines parameters to make release in the github.

type GitlabGroup

type GitlabGroup struct {
	Token     string        `long:"token" env:"TOKEN" description:"token to connect to the gitlab repository"`
	BaseURL   string        `long:"base_url" env:"BASE_URL" description:"base url of the gitlab instance"`
	ProjectID string        `long:"project_id" env:"PROJECT_ID" description:"project id of the repository"`
	Timeout   time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

GitlabGroup defines parameters to connect to the gitlab repository.

type MattermostGroup

type MattermostGroup struct {
	BaseURL   string        `long:"base_url" env:"BASE_URL" description:"base url of the mattermost server"`
	ChannelID string        `long:"channel_id" env:"CHANNEL_ID" description:"id of the channel, where the release notes will be sent"`
	LoginID   string        `long:"login_id" env:"LOGIN_ID" description:"login id of the user, who will send the release notes"`
	Password  string        `long:"password" env:"PASSWORD" description:"password of the user, who will send the release notes"`
	LDAP      bool          `long:"ldap" env:"LDAP" description:"use ldap auth"`
	Timeout   time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

MattermostGroup defines parameters for mattermost notifier.

type MattermostHookGroup added in v0.5.0

type MattermostHookGroup struct {
	BaseURL string        `long:"base_url" env:"BASE_URL" description:"base url of the mattermost server"`
	ID      string        `long:"id" env:"ID" description:"id of the hook, where the release notes will be sent"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

MattermostHookGroup defines parameters for mattermost hook notifier.

type NotifyGroup

type NotifyGroup struct {
	Telegram       TelegramGroup       `group:"telegram" namespace:"telegram" env-namespace:"TELEGRAM"`
	Github         GithubNotifierGroup `group:"github" namespace:"github" env-namespace:"GITHUB"`
	Mattermost     MattermostGroup     `group:"mattermost" namespace:"mattermost" env-namespace:"MATTERMOST"`
	MattermostHook MattermostHookGroup `group:"mattermost-hook" namespace:"mattermost-hook" env-namespace:"MATTERMOST_HOOK"`
	Post           PostGroup           `group:"post" namespace:"post" env-namespace:"POST"`
	Stdout         bool                `long:"stdout" env:"STDOUT" description:"print release notes to stdout"`
	ConfLocation   string              `long:"conf_location" env:"CONF_LOCATION" description:"location to the config file" required:"true"`
	Extras         map[string]string   `long:"extras" env:"EXTRAS" env-delim:"," description:"extra variables to use in the template"`
}

NotifyGroup defines parameters for the notifier.

func (*NotifyGroup) Build

func (r *NotifyGroup) Build() (destinations notify.Destinations, err error)

Build builds the notifier.

func (*NotifyGroup) ReleaseNotesBuilder

func (r *NotifyGroup) ReleaseNotesBuilder() (*notes.Builder, error)

ReleaseNotesBuilder builds the release notes builder.

type PostGroup added in v0.6.0

type PostGroup struct {
	URL     string        `long:"url" env:"URL" description:"url to send the release notes"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

PostGroup defines parameters for post notifier.

type ServiceGroup added in v0.6.0

type ServiceGroup struct {
	SquashCommitRx string      `long:"squash-commit-rx" env:"SQUASH_COMMIT_RX" description:"regexp to match squash commits" default:"^squash:(.?)+$"`
	Engine         EngineGroup `group:"engine" namespace:"engine" env-namespace:"ENGINE"`
	Notify         NotifyGroup `group:"notify" namespace:"notify" env-namespace:"NOTIFY"`
}

ServiceGroup defines parameters to initialize application service.

func (ServiceGroup) Build added in v0.6.0

func (s ServiceGroup) Build() (*service.Service, error)

Build creates a new service.Service instance.

type TelegramGroup

type TelegramGroup struct {
	ChatID         string        `long:"chat_id" env:"CHAT_ID" description:"id of the chat, where the release notes will be sent"`
	Token          string        `long:"token" env:"TOKEN" description:"bot token"`
	WebPagePreview bool          `long:"web_page_preview" env:"WEB_PAGE_PREVIEW" description:"request telegram to preview for web links"`
	Timeout        time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

TelegramGroup defines parameters for telegram notifier.

Jump to

Keyboard shortcuts

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