entities

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigKeyMissing = errors.New("config keys missing")
)

Functions

func ResolveToken

func ResolveToken(raw string) string

ResolveToken resolves a raw token string by expanding ${ENV_VAR} references with their corresponding environment variable values. If the fully expanded result is a path to an existing file, the token is read from that file (with leading/trailing whitespace trimmed). This standalone function is useful when callers need to resolve a token string that is not tied to a specific ProviderConfig instance.

Types

type Config

type Config struct {
	Providers []ProviderConfig
}

Config holds the full application configuration loaded from a YAML file. Exported for use by autobump and autoupdate as the canonical configuration entity.

func NewConfig

func NewConfig(providers []ProviderConfig) *Config

NewConfig creates a Config from a slice of provider configurations.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that all provider entries are complete and returns an error if any are invalid.

type ProviderConfig

type ProviderConfig struct {
	Type          string   `yaml:"type"`          // "github", "gitlab", "azuredevops"
	Token         string   `yaml:"token"`         // inline, ${ENV_VAR}, or file path
	Organizations []string `yaml:"organizations"` // org names or URLs to scan
}

ProviderConfig describes a single Git hosting provider instance.

func (*ProviderConfig) ResolveToken

func (p *ProviderConfig) ResolveToken() string

ResolveToken expands ${ENV_VAR} references in the provider's token string and, if the result is a path to an existing file, reads the token from it. It delegates to the standalone ResolveToken function using p.Token as input.

Jump to

Keyboard shortcuts

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