util

package
v4.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Util

This package utils in go-restful apps.

Usage

Importing
import "github.com/AccelByte/go-restful-plugins/v4/pkg/util"
ExtractDefault

ExtractDefault is default function for extracting attribute for filter event logger

Example event log all endpoints with ExtractDefault
ws := new(restful.WebService)
ws.Filter(event.Log("realm", "serviceName", util.ExtractDefault))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDefault

func ExtractDefault(req *restful.Request) (userID string, clientID []string,
	namespace string, traceID string, sessionID string, flightID string)

ExtractDefault is default function for extracting attribute for filter event logger

func MinifyJSON added in v4.4.0

func MinifyJSON(jsonBytes []byte) string

MinifyJSON is used to compact the json bytes (e.g. removing whitespaces and new lines character)

Types

This section is empty.

Jump to

Keyboard shortcuts

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