config

package
v0.0.1-prerelease5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialTypeBasic       = CredentialType("basic")
	CredentialTypeSSH         = CredentialType("ssh")
	CredentialTypeAccessToken = CredentialType("access_token")
	CredentialTypeGitHubApp   = CredentialType("github_app")
	CredentialTypeDockerLocal = CredentialType("docker_local")
)
View Source
const (
	ProtocolHTTP  = Protocol("http")
	ProtocolHTTPS = Protocol("https")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthConfig

type BasicAuthConfig struct {
	Username string `glu:"username"`
	Password string `glu:"password"`
}

BasicAuthConfig has configuration for authenticating with private git repositories with basic auth.

type Config

type Config struct {
	Log         Log         `glu:"log"`
	Credentials Credentials `glu:"credentials"`
	Sources     Sources     `glu:"sources"`
	Server      Server      `glu:"server"`
}

func ReadFromFS

func ReadFromFS(filesystem fs.FS) (_ *Config, err error)

func (*Config) SetDefaults

func (c *Config) SetDefaults() error

func (*Config) Validate

func (c *Config) Validate() error

type Credential

type Credential struct {
	Type        CredentialType   `glu:"type"`
	Basic       *BasicAuthConfig `glu:"basic"`
	SSH         *SSHAuthConfig   `glu:"ssh"`
	AccessToken *string          `glu:"access_token"`
	GitHubApp   *GitHubAppConfig `glu:"github_app"`
}

type CredentialType

type CredentialType string

type Credentials

type Credentials map[string]Credential

type GitHubAppConfig

type GitHubAppConfig struct {
	AppID           int64  `glu:"app_id"`
	InstallationID  int64  `glu:"installation_id"`
	PrivateKeyBytes string `glu:"private_key_bytes"`
	PrivateKeyPath  string `glu:"private_key_path"`
}

type GitRepositories

type GitRepositories map[string]*GitRepository

type GitRepository

type GitRepository struct {
	Path          string     `glu:"path"`
	DefaultBranch string     `glu:"default_branch"`
	Remote        *Remote    `glu:"remote"`
	Proposals     *Proposals `glu:"proposals"`
}

type Log

type Log struct {
	Level string `glu:"level"`
}

type OCIRepositories

type OCIRepositories map[string]*OCIRepository

type OCIRepository

type OCIRepository struct {
	Reference  string `glu:"reference"`
	Credential string `glu:"credential"`
}

type Proposals

type Proposals struct {
	Credential string `glu:"credential"`
}

type Protocol

type Protocol string

type Remote

type Remote struct {
	Name       string        `glu:"name"`
	URL        string        `glu:"url"`
	Credential string        `glu:"credential"`
	Interval   time.Duration `glu:"interval"`
}

type SSHAuthConfig

type SSHAuthConfig struct {
	User                  string `glu:"user"`
	Password              string `glu:"password"`
	PrivateKeyBytes       string `glu:"private_key_bytes"`
	PrivateKeyPath        string `glu:"private_key_path"`
	InsecureIgnoreHostKey bool   `glu:"insecure_ignore_host_key"`
}

SSHAuthConfig provides configuration support for SSH private key credentials when authenticating with private git repositories

type Server

type Server struct {
	Port     int      `glu:"port"`
	Host     string   `glu:"host"`
	Protocol Protocol `glu:"protocol"`
	CertFile string   `glu:"cert_file"`
	KeyFile  string   `glu:"key_file"`
}

type Sources

type Sources struct {
	Git GitRepositories `glu:"git"`
	OCI OCIRepositories `glu:"oci"`
}

Jump to

Keyboard shortcuts

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