config

package
v0.0.0-...-efd69ef Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const API_PATH_PREFIX = "/api/v1" // nolint:staticcheck

Variables

View Source
var ConfigRefreshRWMutex sync.RWMutex

Functions

func GetGitClients

func GetGitClients() map[string]observe.GitClient

func GetMatchingGitClient

func GetMatchingGitClient(repositoryURL string) (observe.GitClient, error)

func GetMatchingGitClientFromMap

func GetMatchingGitClientFromMap(repositoryURL string, gitClients map[string]observe.GitClient) (observe.GitClient, error)

func GetNeededObservers

func GetNeededObservers() []observe.Observer

returns a map with a latent space key.

func GetObserversByConfigs

func GetObserversByConfigs(configs []BadgeConfig) []observe.Observer

func GetSVG

func GetSVG(key string) ([]byte, bool)

func ParseConfig

func ParseConfig()

func ResetCache

func ResetCache()

func SetGitClients

func SetGitClients(clients map[string]observe.GitClient)

Types

type BadgeConfig

type BadgeConfig struct {
	ID          string        `yaml:"id" json:"id"`
	Name        string        `yaml:"name" json:"name"`
	Description string        `yaml:"description" json:"description"`
	Levels      []LevelConfig `yaml:"levels" json:"levels"`
}

type CheckConfig

type CheckConfig struct {
	Type        string          `yaml:"type" json:"type"`
	Description string          `yaml:"description" json:"description"`
	Threshold   ThresholdConfig `yaml:"threshold" json:"threshold"`

	Key             string `yaml:"key" json:"key"`                         // only defined for the manual check
	DecisionJSONURL string `yaml:"DecisionJSONURL" json:"decisionURL"`     // only defined for the manual check
	DecisionJsonURL string `yaml:"decisionjsonurl" json:"decisionJsonUrl"` // nolint just because i messed up the yaml config - see the yaml tag for the DecisionJSONURL

	GrundschutzConfig oscal.GrundschutzConfig `yaml:"grundschutz_config" json:"grundschutzConfig"` // only defined for GRUNDSCHUTZ_COMPLIANCE
}

func (CheckConfig) ObserverKey

func (c CheckConfig) ObserverKey() string

func (CheckConfig) RuleID

func (c CheckConfig) RuleID() string

type GitClientConfig

type GitClientConfig struct {
	MaxRequestsPerSecond int    `yaml:"maxrequestspersecond" json:"maxRequestsPerSecond"`
	BaseURL              string `yaml:"baseurl" json:"baseUrl"`
	TokenFile            string `yaml:"tokenfile" json:"tokenFile"`
	Type                 string `yaml:"type" json:"type"`
}

type LevelConfig

type LevelConfig struct {
	Name                           string        `yaml:"name" json:"name"`
	SvgURL                         string        `yaml:"svgurl" json:"svgUrl"`
	NotNecessaryForNextHigherLevel *bool         `yaml:"notnecessaryfornexthigherlevel" json:"notNecessaryForNextHigherLevel"`
	Checks                         []CheckConfig `yaml:"checks" json:"checks"`
	Description                    string        `yaml:"description" json:"description"`
}

type RuntimeConfigType

type RuntimeConfigType struct {
	GitClients             []GitClientConfig `yaml:"gitclients" json:"gitClients"`
	Badges                 []BadgeConfig     `yaml:"badges" json:"badges"`
	PersonalEmailDomains   []string          `yaml:"personalemaildomains" json:"personalEmailDomains"`
	RemoteConfigURL        string            `yaml:"remoteconfigurl" json:"remoteConfigUrl"`
	SubsequentUseAPIDomain string            `yaml:"subsequentuseapidomain" json:"subsequentUseApiDomain"`
}
var RuntimeConfig RuntimeConfigType

type ThresholdConfig

type ThresholdConfig struct {
	Min               *int `yaml:"min" json:"min,omitempty"` // nil means no lower bound
	Max               *int `yaml:"max" json:"max,omitempty"` // nil means no upper bound
	TimeRangeInMonths *int `yaml:"timerangeinmonths" json:"timeRangeInMonths,omitempty"`
}

func (ThresholdConfig) ID

func (threshold ThresholdConfig) ID() string

type URLSaveSvgCache

type URLSaveSvgCache map[string][]byte

just a map which uses base64 encoded keys.

var URLSafeSvgCache URLSaveSvgCache = make(URLSaveSvgCache)

func (URLSaveSvgCache) Get

func (s URLSaveSvgCache) Get(key string) ([]byte, bool)

func (URLSaveSvgCache) Set

func (s URLSaveSvgCache) Set(value []byte) string

Source Files

  • config.go
  • svg_cache.go

Jump to

Keyboard shortcuts

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