setting

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HomeDirName = "frau"
View Source
const RootConfigFile = "/config.toml"
View Source
const XdgConfigHomeEnvKey = "XDG_CONFIG_HOME"

Variables

This section is empty.

Functions

func HomeDir

func HomeDir(base string) (bool, string)

Types

type GithubSetting

type GithubSetting struct {
	BotName      string   `toml:"botname"`
	Token        string   `toml:"api_token"`
	HookSecret   string   `toml:"webhook_secret"`
	Repositories []string `toml:"accepted_repositories"`
	// contains filtered or unexported fields
}

type OwnersFile

type OwnersFile struct {
	Version      float64       `json:"version"`
	RawReviewers []interface{} `json:"reviewers"`

	// Users in this list can merge only a pull request opened by themselves.
	// They only can command `@<botname> r=<reviewer_name>` and `<reviewer_name>`
	// must be different from their names.
	RawMergeableUsers []interface{} `json:"mergeable_users,omitempty"`

	// Provide a reviewer privilege for all users whoc can write some comment to
	// pull request.
	//
	// This feature is for the internal repository in your company
	// and there is no restrictions for non-reviewer/
	// NOT FOR PUBLIC OPEN SOURCE PROJECT.
	// You must not enable this option for an open source project.
	RegardAllAsReviewer bool `json:"regard_all_as_reviewer,omitempty"`

	// Enable to merge branch automatically by this bot after you command `r+`.
	// If you merge by hand and this bot should change the status label,
	// disable this option.
	EnableAutoMerge bool `json:"auto_merge.enabled,omitempty"`

	// Delete the branch by this bot after this bot had merged it
	// if you enable this option.
	// The operation may not delete contributor's branch by API
	// restriction. This only clean up only the upstream repository
	// managed by this bot.
	DeleteAfterAutoMerge bool `json:"auto_merge.delete_branch,omitempty"`

	// The name of the branch which is used for "Auto-Merging" to test changesets
	// before merging it into upstream. The default value is defined as `autoBranchName`.
	AutoBranchName string `json:"auto_branch.branch_name.auto,omitempty"`
}

func (*OwnersFile) ReviewersList added in v1.1.0

func (o *OwnersFile) ReviewersList() []string

func (*OwnersFile) ToRepoInfo

func (o *OwnersFile) ToRepoInfo() (bool, *RepositoryInfo)

type RepositoryInfo

type RepositoryInfo struct {
	EnableAutoMerge      bool
	DeleteAfterAutoMerge bool
	AutoBranchName       string
	// contains filtered or unexported fields
}

func (*RepositoryInfo) IsInMergeableUserList

func (r *RepositoryInfo) IsInMergeableUserList(name string) bool

func (*RepositoryInfo) IsReviewer

func (r *RepositoryInfo) IsReviewer(name string) bool

type ReviewerSet

type ReviewerSet struct {
	// contains filtered or unexported fields
}

func (*ReviewerSet) Entries

func (s *ReviewerSet) Entries() []string

func (*ReviewerSet) Has

func (s *ReviewerSet) Has(person string) bool

type Settings

type Settings struct {
	Version int           `toml:"config_version"`
	Port    int           `toml:"port"`
	Github  GithubSetting `toml:"github"`
}

func LoadSettings

func LoadSettings(dir string) *Settings

func (*Settings) AcceptRepo

func (s *Settings) AcceptRepo(owner, name string) bool

func (*Settings) BotNameForGithub

func (s *Settings) BotNameForGithub() string

func (*Settings) GithubToken

func (s *Settings) GithubToken() string

func (*Settings) PortStr

func (s *Settings) PortStr() string

func (*Settings) WebHookSecret

func (s *Settings) WebHookSecret() []byte

Jump to

Keyboard shortcuts

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