config

package
v1.15.14 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvGitHubAppID               = "GITHUB_APP_ID"
	EnvGitHubAppSecret           = "GITHUB_APP_SECRET"
	EnvGitHubAppPrivateKeyBase64 = "GITHUB_PRIVATE_KEY_BASE64"
	EnvMySQLURL                  = "MYSQL_URL"
	EnvPort                      = "PORT"
	EnvShoesPluginPath           = "PLUGIN"
	EnvShoesPluginOutputPath     = "PLUGIN_OUTPUT"
	EnvRunnerUser                = "RUNNER_USER"
	EnvDebug                     = "DEBUG"
	EnvStrict                    = "STRICT"
	EnvModeWebhookType           = "MODE_WEBHOOK_TYPE"
	EnvMaxConnectionsToBackend   = "MAX_CONNECTIONS_TO_BACKEND"
	EnvMaxConcurrencyDeleting    = "MAX_CONCURRENCY_DELETING"
	EnvGitHubURL                 = "GITHUB_URL"
	EnvRunnerVersion             = "RUNNER_VERSION"
)

Config Environment keys

Variables

This section is empty.

Functions

func Load

func Load()

Load load config from environment

func LoadMySQLURL

func LoadMySQLURL() string

LoadMySQLURL load MySQL URL from environment

func LoadPluginPath

func LoadPluginPath() string

LoadPluginPath load plugin path from environment

Types

type Conf

type Conf struct {
	GitHub GitHubApp

	MySQLDSN              string
	Port                  int
	ShoesPluginPath       string
	ShoesPluginOutputPath string
	RunnerUser            string

	Debug           bool
	Strict          bool // check to registered runner before delete job
	ModeWebhookType ModeWebhookType

	MaxConnectionsToBackend int64
	MaxConcurrencyDeleting  int64

	GitHubURL     string
	RunnerVersion string
}

Conf is type of Config

var Config Conf

Config is config value

func LoadWithDefault

func LoadWithDefault() Conf

LoadWithDefault load only value that has default value

func (Conf) IsGHES

func (c Conf) IsGHES() bool

IsGHES return myshoes for GitHub Enterprise Server

type GitHubApp

type GitHubApp struct {
	AppID     int64
	AppSecret []byte
	PEMByte   []byte
	PEM       *rsa.PrivateKey
}

GitHubApp is type of config value

func LoadGitHubApps

func LoadGitHubApps() *GitHubApp

LoadGitHubApps load config for GitHub Apps

type ModeWebhookType

type ModeWebhookType int

ModeWebhookType is type value for GitHub webhook

const (
	// ModeWebhookTypeUnknown is unknown
	ModeWebhookTypeUnknown ModeWebhookType = iota
	// ModeWebhookTypeCheckRun is check_run
	ModeWebhookTypeCheckRun
	// ModeWebhookTypeWorkflowJob is workflow_job
	ModeWebhookTypeWorkflowJob
)

func (ModeWebhookType) Equal

func (mwt ModeWebhookType) Equal(in string) bool

Equal check in and value

func (ModeWebhookType) String

func (mwt ModeWebhookType) String() string

String is implementation of fmt.Stringer

Jump to

Keyboard shortcuts

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