juju: github.com/juju/juju/mongo/utils Index | Files

package utils

import "github.com/juju/juju/mongo/utils"

Index

Package Files

data_cleansing.go validfield.go

func CheckStorable Uses

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 Uses

func EscapeKey(s string) string

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

func EscapeKeys Uses

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 Uses

func IsValidFieldName(name string) bool

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

func UnescapeKey Uses

func UnescapeKey(s string) string

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

func UnescapeKeys Uses

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

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

Package utils imports 3 packages (graph) and is imported by 16 packages. Updated 2018-07-23. Refresh now. Tools for package owners.