jutils

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 2

README

jutils

Go library for common Jackal needs

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BasicKeyring = MakeContextKeyring()
)

Functions

func CloneByteSlice

func CloneByteSlice(source []byte) ([]byte, []byte, error)

func CloneBytes

func CloneBytes(reader *bytes.Reader) []byte

func FriendlyTimestamp

func FriendlyTimestamp() string

func LoadEnvVarOrFallback

func LoadEnvVarOrFallback(varId string, fallback string) string

func LoadEnvVarOrPanic

func LoadEnvVarOrPanic(varId string) string

func ProcessCustomError

func ProcessCustomError(block string, customError string) error

func ProcessCustomHttpError

func ProcessCustomHttpError(block string, customError string, eCode int, w http.ResponseWriter) error

func ProcessError

func ProcessError(block string, caughtError error)

func ProcessHttpError

func ProcessHttpError(block string, caughtError error, eCode int, w http.ResponseWriter)

func SimpleWriteJSON

func SimpleWriteJSON(w http.ResponseWriter, respVal interface{})

func UnixMsTimestamp

func UnixMsTimestamp() int64

Types

type ContextKey

type ContextKey string

type ContextKeyring

type ContextKeyring map[string]ContextKey

func MakeContextKeyring

func MakeContextKeyring() ContextKeyring

func (ContextKeyring) AddKeyToRing

func (r ContextKeyring) AddKeyToRing(key string)

func (ContextKeyring) UseKey

func (r ContextKeyring) UseKey(key string) ContextKey

Jump to

Keyboard shortcuts

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