config

package
v0.0.0-...-c75d569 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	config.RepoFilter
	// EnableSyncIssue control whether synchronization issues, default false.
	EnableSyncIssue bool `json:"enable_sync_issue,omitempty"`
	// EnableSyncComment control whether synchronization comments, default false.
	EnableSyncComment bool `json:"enable_sync_comment,omitempty"`
	// DoNotSyncAuthors the person configured by this Configuration item as the author of
	// the issue or comment will not need to synchronize.
	// in addition, if it is empty the current robot account is default.
	DoNotSyncAuthors []NotSyncConfig `json:"do_not_sync_authors,omitempty"`
	// SyncOrgMapping mappings of organizations that need to perform synchronization.
	SyncOrgMapping map[string]string `json:"sync_org_mapping,omitempty"`
}

func (*BotConfig) OrgMapping

func (c *BotConfig) OrgMapping(org string) string

type Configuration

type Configuration struct {
	ConfigItems []BotConfig `json:"config_items,omitempty"`
}

func (*Configuration) ConfigFor

func (c *Configuration) ConfigFor(org, repo string) *BotConfig

func (*Configuration) SetDefault

func (c *Configuration) SetDefault()

func (*Configuration) Validate

func (c *Configuration) Validate() error

type NotSyncConfig

type NotSyncConfig struct {
	// Account the login account name of the platform where the user is located.
	Account string `json:"account" required:"true"`
	// IssueCommentContentWhitelist the account Configuration item specifies a regular whitelist of user comment content,
	// and comments that match the regular pattern will be synchronized.
	IssueCommentContentWhitelist []string `json:"issue_comment_content_whitelist,omitempty"`
	// NeedSyncIssue whether the issue created by the person specified by the account Configuration item needs to be synchronized.
	NeedSyncIssue bool `json:"need_sync_issue,omitempty"`
}

func (NotSyncConfig) CommentContentInWhitelist

func (nc NotSyncConfig) CommentContentInWhitelist(content string) bool

Jump to

Keyboard shortcuts

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