governance

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListNoAI                 = "no_ai"
	ListNotificationRequired = "notification_required"
)

Variables

This section is empty.

Functions

func NormalizeName

func NormalizeName(value string) string

Types

type Audit

type Audit struct {
	ConfigEntries       int      `json:"config_entries"`
	ConfigAliases       int      `json:"config_aliases"`
	CandidateValues     int      `json:"candidate_values"`
	MatchedEntries      []Match  `json:"matched_entries"`
	UnmatchedEntries    []Target `json:"unmatched_entries"`
	SuppressedCallIDs   []string `json:"suppressed_call_ids,omitempty"`
	SuppressedCallCount int      `json:"suppressed_call_count"`
}

func AuditCandidates

func AuditCandidates(candidates []Candidate, cfg *Config) *Audit

func BuildAudit

func BuildAudit(ctx context.Context, store CandidateStore, cfg *Config) (*Audit, error)

type Candidate

type Candidate struct {
	CallID string
	Source string
	Value  string
}

type CandidateStore

type CandidateStore interface {
	GovernanceNameCandidates(ctx context.Context) ([]Candidate, error)
	GovernanceDataFingerprint(ctx context.Context) (string, error)
}

type Config

type Config struct {
	Version int             `json:"version" yaml:"version"`
	Lists   map[string]List `json:"lists" yaml:"lists"`
}

func LoadFile

func LoadFile(path string) (*Config, error)

func ParseYAML

func ParseYAML(body []byte) (*Config, error)

func (*Config) Targets

func (c *Config) Targets() []Target

type Entry

type Entry struct {
	Name    string   `json:"name" yaml:"name"`
	Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"`
	Reason  string   `json:"reason,omitempty" yaml:"reason,omitempty"`
	Notes   string   `json:"notes,omitempty" yaml:"notes,omitempty"`
}

type List

type List struct {
	Description string  `json:"description,omitempty" yaml:"description,omitempty"`
	Action      string  `json:"action,omitempty" yaml:"action,omitempty"`
	Customers   []Entry `json:"customers" yaml:"customers"`
}

type Match

type Match struct {
	List       string `json:"list"`
	Name       string `json:"name"`
	Alias      string `json:"alias,omitempty"`
	Normalized string `json:"normalized"`
	CallCount  int    `json:"call_count"`
}

type RuntimeSnapshot

type RuntimeSnapshot struct {
	ConfigSize    int64
	ConfigModTime int64
	Data          string
}

func Snapshot

func Snapshot(ctx context.Context, path string, store CandidateStore) (RuntimeSnapshot, error)

type Target

type Target struct {
	List       string `json:"list"`
	Name       string `json:"name"`
	Alias      string `json:"alias,omitempty"`
	Normalized string `json:"normalized"`
}

Jump to

Keyboard shortcuts

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