config

package
v0.0.0-...-ea74aed Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DryRun bool

	ServerPort int64

	Github GithubConfig

	KubeConfig  string
	KubeContext string
	Namespace   string

	SyncInterval time.Duration
	Runners      RunnerConfigList

	PrintVersion bool
)

Functions

func LoadConfig

func LoadConfig()

Types

type GithubConfig

type GithubConfig struct {
	Token             string `yaml:"token"`
	AppID             int64  `yaml:"app_id"`
	AppInstallationID int64  `yaml:"app_installation_id"`
	AppPrivateKey     string `yaml:"app_private_key"`
	AppPrivateKeyFile string `yaml:"app_private_key_file"`
}

func (GithubConfig) IsApp

func (c GithubConfig) IsApp() bool

func (GithubConfig) IsToken

func (c GithubConfig) IsToken() bool

func (GithubConfig) Transport

func (c GithubConfig) Transport(ctx context.Context) (http.RoundTripper, error)

func (GithubConfig) Validate

func (c GithubConfig) Validate() error

type Labels

type Labels []string

func (Labels) Has

func (rl Labels) Has(search string) bool

func (Labels) String

func (rl Labels) String() string

func (Labels) Validate

func (rl Labels) Validate() error

type RunnerConfig

type RunnerConfig struct {
	Labels Labels `yaml:"labels" json:"labels,omitempty"`
	Scope  Scope  `yaml:"scope"  json:"scope,omitempty"`

	MaxReplicas int `yaml:"max_replicas" json:"max_replicas,omitempty"`

	ServiceAccountName string          `yaml:"service_account_name" json:"service_account_name,omitempty"`
	Image              string          `yaml:"image"                json:"image,omitempty"`
	Resources          RunnerResources `yaml:"resources"            json:"resources,omitempty"`
}

func (RunnerConfig) Slug

func (c RunnerConfig) Slug() string

func (RunnerConfig) String

func (c RunnerConfig) String() string

func (RunnerConfig) Validate

func (c RunnerConfig) Validate() error

type RunnerConfigList

type RunnerConfigList []RunnerConfig

func (RunnerConfigList) Strs

func (rcl RunnerConfigList) Strs() []string

func (RunnerConfigList) Validate

func (rcl RunnerConfigList) Validate() error

type RunnerResources

type RunnerResources struct {
	CPULimit      string `yaml:"cpu_limit"      json:"cpu_limit"`
	MemoryLimit   string `yaml:"memory_limit"   json:"memory_limit"`
	CPURequest    string `yaml:"cpu_request"    json:"cpu_request"`
	MemoryRequest string `yaml:"memory_request" json:"memory_request"`
}

func (RunnerResources) Validate

func (rr RunnerResources) Validate() error

type Scope

type Scope struct {
	IsOrg      bool   `yaml:"is_org"     json:"is_org"`
	Owner      string `yaml:"owner"      json:"owner"`
	Repository string `yaml:"repository" json:"repository"`
}

func ScopeFromWorkflowJobEvent

func ScopeFromWorkflowJobEvent(e *github.WorkflowJobEvent) (*Scope, error)

func (Scope) String

func (rs Scope) String() string

func (Scope) Validate

func (rs Scope) Validate() error

Jump to

Keyboard shortcuts

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