cacheevent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompactSensitiveValues

func CompactSensitiveValues(values ...string) []string

func RedactEventError

func RedactEventError(value string, redactedTarget string, rawTargets []string, sensitiveValues ...string) string

func RedactTarget

func RedactTarget(raw string) string

Types

type AcquisitionErrorResult

type AcquisitionErrorResult struct {
	Event         Event
	RedactedError string
}

type AcquisitionEventInput

type AcquisitionEventInput struct {
	Source            Source
	Target            string
	Revision          string
	RequestedRevision string
	Offline           bool
	Refresh           bool
	FromCache         bool
	Network           bool
	Err               error
	ErrorText         string
	RawTargets        []string
	SensitiveValues   []string
}

type Action

type Action string
const (
	ActionLocal    Action = "local"
	ActionMapped   Action = "mapped"
	ActionHit      Action = "hit"
	ActionFetch    Action = "fetch"
	ActionRefresh  Action = "refresh"
	ActionMiss     Action = "miss"
	ActionError    Action = "error"
	ActionDisabled Action = "disabled"
)

func ActionForAcquisition

func ActionForAcquisition(fromCache bool, network bool, refresh bool) Action

func ActionForError

func ActionForError(err error) Action

type Event

type Event struct {
	Source          Source   `json:"source" yaml:"source"`
	Action          Action   `json:"action" yaml:"action"`
	Target          string   `json:"target,omitempty" yaml:"target,omitempty"`
	Revision        string   `json:"revision,omitempty" yaml:"revision,omitempty"`
	CacheHit        bool     `json:"cacheHit,omitempty" yaml:"cacheHit,omitempty"`
	Offline         bool     `json:"offline,omitempty" yaml:"offline,omitempty"`
	Refresh         bool     `json:"refresh,omitempty" yaml:"refresh,omitempty"`
	Error           string   `json:"error,omitempty" yaml:"error,omitempty"`
	RawTargets      []string `json:"-" yaml:"-"`
	SensitiveValues []string `json:"-" yaml:"-"`
}

func NewAcquisitionEvent

func NewAcquisitionEvent(input AcquisitionEventInput) Event

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

func NewRecorder

func NewRecorder(enabled bool) *Recorder

func (*Recorder) Enabled

func (r *Recorder) Enabled() bool

func (*Recorder) Events

func (r *Recorder) Events() []Event

func (*Recorder) Record

func (r *Recorder) Record(event Event)

type Source

type Source string
const (
	SourceGit    Source = "git"
	SourceChart  Source = "chart"
	SourceRemote Source = "remote"
)

Jump to

Keyboard shortcuts

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