utils

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPayloadSize max size of content
	MaxPayloadSize = 1024 * 1024
)

Variables

This section is empty.

Functions

func AllOrNoneReqd

func AllOrNoneReqd(opts ...string) (ok bool)

AllOrNoneReqd util for checking parameters that must be provided together

func CreateTLSConfiguration

func CreateTLSConfiguration(tlsConfig *conf.TLSConfig) (t *tls.Config, err error)

CreateTLSConfiguration creates a tls.Config structure based on parsing the configuration passed in via a TLSConfig structure

func DecodePayload added in v0.9.7

func DecodePayload(payload []byte) interface{}

func GetMapString

func GetMapString(genericMap map[string]interface{}, key string) string

GetMapString is a helper to safely extract strings from generic interface maps

func GetenvOrDefault

func GetenvOrDefault(varName, defaultVal string) string

func GetenvOrDefaultLowerCase

func GetenvOrDefaultLowerCase(varName, defaultVal string) string

func GetenvOrDefaultUpperCase

func GetenvOrDefaultUpperCase(varName, defaultVal string) string

func MarshalToYAML

func MarshalToYAML(conf interface{}) (yamlBytes []byte, err error)

MarshalToYAML marshals a JSON annotated structure into YAML, by first going to JSON

func ParseJSONPayload

func ParseJSONPayload(req *http.Request) (map[string]interface{}, error)

parseJSONPayload processes either a YAML or JSON payload from an input HTTP request

func SwaggerUIHTML added in v0.9.4

func SwaggerUIHTML(_ context.Context) []byte

func UUIDv4

func UUIDv4() string

UUIDv4 returns a new UUID V4 as a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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