svc

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditLoggerFromConfig

func AuditLoggerFromConfig(ctx context.Context, cfg config.Auditlog, ch <-chan interface{}, log log.Logger)

AuditLoggerFromConfig will start a new AuditLogger generated from the config

func StartAuditLogger

func StartAuditLogger(ctx context.Context, ch <-chan interface{}, log log.Logger, marshaller Marshaller, logto ...Log)

StartAuditLogger will block. run in seperate go routine

Types

type Log

type Log func([]byte)

Log is used to log to different outputs

func WriteToFile

func WriteToFile(path string, log log.Logger) Log

WriteToFile returns a Log function writing to a file

func WriteToStdout

func WriteToStdout() Log

WriteToStdout return a Log function writing to Stdout

type Marshaller

type Marshaller func(interface{}) ([]byte, error)

Marshaller is used to marshal events

func Marshal

func Marshal(format string, log log.Logger) Marshaller

Marshal returns a Marshaller from the `format` string

Jump to

Keyboard shortcuts

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