Documentation
¶
Index ¶
- Constants
- Variables
- func GetDeprecatedEnv(name string, defaultValue string, deprecationNote string) string
- func GetDeprecatedEnvBool(name string, defaultValue bool, deprecationNote string) (bool, error)
- func GetEnvBoolWithDeprecated(newName string, oldName string, defaultValue bool) (bool, error)
- func GetEnvWithDeprecated(newName string, oldName string, defaultValue string) string
- func IllConfigBool(entry dirapi.Entry, fallback bool, field func(dirapi.IllConfig) *bool) bool
- func IllConfigString(entry dirapi.Entry, fallback string, field func(dirapi.IllConfig) *string) string
- func MapToStruct(obj map[string]any, v any) error
- func Must[T any](ctx ExtendedContext, handler func() (ret T, err error), errMsg string) T
- func MustHttp[T any](ctx ExtendedContext, w http.ResponseWriter, handler func() (ret T, err error), ...) T
- func PackItemNote(fields []string) string
- func PackItemsNote(items [][]string) string
- func SplitSymbol(symbol string) (authority, value string, err error)
- func SplitSymbolLenient(symbol string) (string, string)
- func StructToMap(obj any) (map[string]any, error)
- func ToInt32(i int) int32
- func UnpackItemNote(input string) []string
- func UnpackItemsNote(note string) ([][]string, int, int)
- type BrokerMode
- type ExtendedContext
- type LoggerArgs
Constants ¶
View Source
const DO_NOT_SEND = "doNotSend"
View Source
const MULTIPLE_ITEMS = "#MultipleItems#"
View Source
const MULTIPLE_ITEMS_END = "#MultipleItemsEnd#"
Variables ¶
View Source
var DefaultLogHandler slog.Handler = slog.NewTextHandler(os.Stdout, nil)
Functions ¶
func GetDeprecatedEnv ¶
func GetDeprecatedEnvBool ¶
func GetEnvWithDeprecated ¶
func IllConfigBool ¶
func IllConfigString ¶
func Must ¶
func Must[T any](ctx ExtendedContext, handler func() (ret T, err error), errMsg string) T
func MustHttp ¶
func MustHttp[T any](ctx ExtendedContext, w http.ResponseWriter, handler func() (ret T, err error), errMsg string) T
func PackItemNote ¶
func PackItemsNote ¶
PackItemsNote creates a note string for a SupplyingAgencyMessage containing multiple items, using the defined markers and escaping. Does the reverse of UnpackItemsNote.
func SplitSymbol ¶
func SplitSymbolLenient ¶
func UnpackItemNote ¶
Types ¶
type BrokerMode ¶
type BrokerMode string
const ( BrokerModeOpaque BrokerMode = "opaque" BrokerModeTransparent BrokerMode = "transparent" )
type ExtendedContext ¶
type ExtendedContext interface {
context.Context
// return logger associated with this context
Logger() *slog.Logger
// create new instance backed by the same context and log handler but with new log args
WithArgs(args *LoggerArgs) ExtendedContext
// return logger args associated with this context
LoggerArgs() LoggerArgs
}
func CreateExtCtxWithArgs ¶
func CreateExtCtxWithArgs(ctx context.Context, args *LoggerArgs) ExtendedContext
func CreateExtCtxWithLogArgsAndHandler ¶
func CreateExtCtxWithLogArgsAndHandler(ctx context.Context, args *LoggerArgs, logHandler slog.Handler) ExtendedContext
type LoggerArgs ¶
type LoggerArgs struct {
RequestId string
TransactionId string
EventId string
Component string
Other map[string]string
}
func (LoggerArgs) WithComponent ¶
func (args LoggerArgs) WithComponent(component string) *LoggerArgs
Click to show internal directories.
Click to hide internal directories.