util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrContains

func ArrContains[T comparable](arr []T, obj T) bool

func CheckHttpError

func CheckHttpError(funcName string, resp *http.Response) error

func GetObjectID

func GetObjectID(id *string) *primitive.ObjectID

func GetObjectIDs

func GetObjectIDs(ids []*string) *[]*primitive.ObjectID

func IsNil

func IsNil(i any) bool

func Ptr

func Ptr[T any](obj T) *T

func ToJsonString

func ToJsonString[T interface{}](obj T) string

func UnPtrString

func UnPtrString(s *string) string

func UnPtrs

func UnPtrs[T any](objs []*T) []T

Types

type BsonMap

type BsonMap struct {
	bson.M
}

func (*BsonMap) Set

func (m *BsonMap) Set(key string, value any) *BsonMap

func (*BsonMap) SetNotNull

func (m *BsonMap) SetNotNull(key string, value any) *BsonMap

func (*BsonMap) ToBsonM

func (m *BsonMap) ToBsonM() *bson.M

Jump to

Keyboard shortcuts

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