config

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = "v1"

Variables

This section is empty.

Functions

func ResolvePath

func ResolvePath(explicit string) (string, error)

ResolvePath computes the config path from explicit path, env, or home default.

func Save

func Save(path string, cfg Config) error

Save writes config deterministically.

func Validate

func Validate(cfg Config) error

func ValidateTarget

func ValidateTarget(mode TargetMode, value string) error

Types

type AuthProfile

type AuthProfile struct {
	Token string `json:"token,omitempty"`
}

AuthProfile holds token data for one privilege profile.

type AuthProfiles

type AuthProfiles struct {
	Scan AuthProfile `json:"scan"`
	Fix  AuthProfile `json:"fix"`
}

AuthProfiles stores split privileges for scan and fix paths.

type Config

type Config struct {
	Version       string       `json:"version"`
	Auth          AuthProfiles `json:"auth"`
	DefaultTarget Target       `json:"default_target"`
}

Config is the persisted wrkr init configuration.

func Default

func Default() Config

func Load

func Load(path string) (Config, error)

Load reads config from disk.

type Target

type Target struct {
	Mode  TargetMode `json:"mode"`
	Value string     `json:"value"`
}

Target identifies a scan source target.

type TargetMode

type TargetMode string

TargetMode identifies the default scan target source.

const (
	TargetRepo TargetMode = "repo"
	TargetOrg  TargetMode = "org"
	TargetPath TargetMode = "path"
)

Jump to

Keyboard shortcuts

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