audit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidResult = errors.New("not a valid Result")

Functions

This section is empty.

Types

type Auditor

type Auditor interface {
	Write(ctx context.Context, fields Fields)
}

Auditor is a audit message writer.

func NewLogAuditor

func NewLogAuditor(logger *slog.Logger) Auditor

NewLogAuditor ...

type Fields

type Fields struct {
	Service string
	Method  string
	Subject *domain.SubjectInformation
	Result  Result
}

Fields that will be written to audit.

type Result

type Result uint8

Result ... ENUM(unspecified, ok, error)

const (
	// ResultUnspecified is a Result of type Unspecified.
	ResultUnspecified Result = iota
	// ResultOk is a Result of type Ok.
	ResultOk
	// ResultError is a Result of type Error.
	ResultError
)

func ParseResult

func ParseResult(name string) (Result, error)

ParseResult attempts to convert a string to a Result.

func (Result) IsValid

func (x Result) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Result) String

func (x Result) String() string

String implements the Stringer interface.

Jump to

Keyboard shortcuts

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