utils

package
v0.0.0-...-c45cdb4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(ctx context.Context, name string) *mongo.Collection

Collection : get pointer to collection with context

func Database

func Database(ctx context.Context) *mongo.Database

Database : Get pointer to database with context

func Message

func Message(status bool, message string) map[string]interface{}

Message : a status message possibly representing an error

func RandSeq

func RandSeq(n int) string

RandSeq : generate pseudorandom sequence of alphabets

func RandomID

func RandomID() string

RandomID : generate a 24-character pseudorandom sequence

func Respond

func Respond(w http.ResponseWriter, data interface{}, status int)

Respond : respond with JSON data and status code

Types

This section is empty.

Jump to

Keyboard shortcuts

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