opa

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: BSD-3-Clause-Clear Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterSlogger

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

AdapterSlogger is the adapter to slog using OPA logger interface.

func (*AdapterSlogger) Debug

func (l *AdapterSlogger) Debug(msg string, a ...interface{})

Debug logs at debug level.

func (*AdapterSlogger) Error

func (l *AdapterSlogger) Error(msg string, a ...interface{})

Error logs at error level.

func (*AdapterSlogger) GetLevel

func (l *AdapterSlogger) GetLevel() opalog.Level

GetLevel noop, uses slog so no current log level.

func (*AdapterSlogger) Info

func (l *AdapterSlogger) Info(msg string, a ...interface{})

Info logs at info level.

func (*AdapterSlogger) SetLevel

func (l *AdapterSlogger) SetLevel(opalog.Level)

SetLevel noop, uses slog.

func (*AdapterSlogger) Warn

func (l *AdapterSlogger) Warn(msg string, a ...interface{})

Warn logs at warn level.

func (*AdapterSlogger) WithFields

func (l *AdapterSlogger) WithFields(fields map[string]interface{}) opalog.Logger

WithFields provides additional fields to include in log output.

type Config

type Config struct {
	Path     string `yaml:"path" default:"./opentdf-opa.yaml"`
	Embedded bool   `yaml:"embedded" default:"false"`
	// Logger to use otherwise slog.Default(), mainly for testability.
	Logger *slog.Logger
}

type Engine

type Engine struct {
	*sdk.OPA
}

func NewEngine

func NewEngine(config Config) (*Engine, error)

Jump to

Keyboard shortcuts

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