utils

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64(n int, padded bool) (string, error)

func Bytes

func Bytes(n int) ([]byte, error)

func Decrypt

func Decrypt(ciphertext []byte, key []byte) ([]byte, error)

func Encrypt

func Encrypt(plainText []byte, key []byte) ([]byte, error)

func Filter

func Filter(input interface{}) interface{}

func Number

func Number(n int) string

Number ...

func Params

func Params(args map[string]interface{}) *api.SearchCollectionParams

func Project

func Project(projection map[string]interface{}) *options.FindOptions

Project converts a map into MongoDB-compatible projection options.

func Sort

func Sort(sortCriteria map[string]interface{}) *options.FindOptions

Sort converts a map of sort criteria into MongoDB-compatible sort options.

func StructToMap

func StructToMap(obj interface{}) (map[string]interface{}, error)

func UID

func UID(ctx context.Context) (*primitive.ObjectID, error)

Types

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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