Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config exposes helpers for robot configuration

Package config exposes helpers for robot options when startup service

Index

Constants

View Source
const (
	YamlTagNameJson                 = "json"
	YamlTagNameRequired             = "required"
	YamlFiledNameRepos              = "repos"
	YamlFiledNameExcludedRepos      = "excluded_repos"
	YamlFiledNameExcludedReposEmpty = "excluded_repos,omitempty"
)

Variables

View Source
var (
	RepoMap map[string]any
)

Functions

func GetRepoConfig added in v1.0.0

func GetRepoConfig(org, repo string) any

func ValidateConfigItems added in v1.0.0

func ValidateConfigItems[R any](items []R) error

func ValidateRepoConfig added in v1.0.0

func ValidateRepoConfig[C any](c C) error

ValidateRepoConfig to check the repoConfig data's validation, returns an error if invalid

func ValidateRequiredConfig added in v1.0.0

func ValidateRequiredConfig[C any](c C) error

Types

type Configmap

type Configmap interface {
	Validate() error
}

type ConfigmapAgent

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

func NewConfigmapAgent

func NewConfigmapAgent(cnf Configmap, path string) (a *ConfigmapAgent, err error)

func (*ConfigmapAgent) GetConfigmap

func (a *ConfigmapAgent) GetConfigmap() Configmap

type FrameworkOptions added in v0.2.0

type FrameworkOptions struct {
	Address             string
	Port                int
	ConfigFile          string
	GracePeriod         time.Duration
	EnableTLS           bool
	HandlePath          string
	CertFile            string
	KeyFile             string
	DelHmacSecretFile   bool
	HmacSecretFilePath  string
	DelTokenFile        bool
	TokenFilePath       string
	Interrupt           bool
	TokenValue          []byte
	HmacValue           []byte
	ConfigmapAgentValue *ConfigmapAgent
}

func (*FrameworkOptions) AddFlags added in v1.0.0

func (o *FrameworkOptions) AddFlags(fs *flag.FlagSet)

func (*FrameworkOptions) ValidateComposite added in v0.2.0

func (o *FrameworkOptions) ValidateComposite(c Configmap, logger *logrus.Entry)

func (*FrameworkOptions) ValidateConfigFile added in v1.0.0

func (o *FrameworkOptions) ValidateConfigFile(c Configmap, logger *logrus.Entry)

func (*FrameworkOptions) ValidateHmac added in v1.0.0

func (o *FrameworkOptions) ValidateHmac(logger *logrus.Entry)

func (*FrameworkOptions) ValidateTLS added in v1.0.0

func (o *FrameworkOptions) ValidateTLS(logger *logrus.Entry)

func (*FrameworkOptions) ValidateToken added in v1.0.0

func (o *FrameworkOptions) ValidateToken(logger *logrus.Entry)

Jump to

Keyboard shortcuts

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