utils

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStorable

func CheckStorable(inDoc interface{}) error

CheckStorable returns an error if the given document - or any of it's subdocuments - contains field names which are not valid for storage into MongoDB.

func EscapeKey

func EscapeKey(s string) string

EscapeKey escapes a string to be safe to store in Mongo as a document key.

func EscapeKeys

func EscapeKeys(input map[string]interface{}) map[string]interface{}

EscapeKeys is used to escape bad keys in a map. A statusDoc without escaped keys is broken.

func IsValidFieldName

func IsValidFieldName(name string) bool

IsValidFieldName returns true if the given name is acceptable for use as a MongoDB field name.

func UnescapeKey

func UnescapeKey(s string) string

UnescapeKey restores escaped characters from a key to their original values.

func UnescapeKeys

func UnescapeKeys(input map[string]interface{}) map[string]interface{}

UnescapeKeys is used to restore escaped keys from a map to their original values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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