util

package
v0.0.0-...-75b1e24 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util contains helper functions and data structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRequestUID

func AssignRequestUID(req *http.Request) *http.Request

AttachRequestID will attach a brand new request ID to a http request

func GetRequestUID

func GetRequestUID(req *http.Request) string

GetRequestID will get reqID from a http request and return it as a string

func PrepocessPoliciesInDir

func PrepocessPoliciesInDir(config *configs.AppConfig, dir string) string

func PreprocessPolicy

func PreprocessPolicy(config *configs.AppConfig, rego string) string

Types

type OpStack

type OpStack [][]string

Stack of string slices. Panics if operations (like Pop()) are performed on an empty stack.

This stack also contains debug logs.

func (OpStack) AppendToTop

func (s OpStack) AppendToTop(v string)

Appends a new string to the top slice of the stack.

func (OpStack) Pop

func (s OpStack) Pop() (stack OpStack, slice []string)

Pop the top slice of the stack.

func (OpStack) Push

func (s OpStack) Push(v []string) OpStack

Push a string slice to the top of the stack.

type SStack

type SStack []string

Simple stack of strings. Panics if operations (like Pop()) are performed on an empty stack.

func (SStack) Empty

func (s SStack) Empty() bool

Check if the stack is empty.

func (SStack) Pop

func (s SStack) Pop() (stack SStack, slice string)

Pop the top element of the stack.

func (SStack) Push

func (s SStack) Push(v string) SStack

Push a string to the top of the stack.

type UTCFormatter

type UTCFormatter struct {
	log.Formatter
}

func (UTCFormatter) Format

func (u UTCFormatter) Format(e *log.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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