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: 12 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 Date

func Date(dateStr *string, targetDate *primitive.DateTime)

func Filter

func Filter(input interface{}) interface{}

func GenerateMembershipCardNumber

func GenerateMembershipCardNumber() string

GenerateMembershipCardNumber generates a unique membership card number.

func IndexOf

func IndexOf(slice []string, value string) int

indexOf finds the index of a string in a slice. It returns -1 if the string is not present in the slice.

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 String

func String(n int) string

String ...

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