userdb

package
v0.0.0-...-45ec72a Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(client *mongo.Client, ctx context.Context) (*[]User, error)

func GetEnv

func GetEnv(key string) string

func NewClient

func NewClient(ctx context.Context) (*mongo.Client, error)

func UpsertOne

func UpsertOne(client *mongo.Client, ctx context.Context, user *User) error

Types

type User

type User struct {
	Id       primitive.ObjectID `bson:"_id,omitempty"`
	Name     string             `bson:"name,omitempty"`
	Age      int32              `bson:"age,omitempty"`
	Greeting string             `bson:"greeting,omitempty"`
	Salary   int32              `bson:"salary,omitempty"`
	Power    string             `bson:"power,omitempty"`
}

func FindOne

func FindOne(client *mongo.Client, ctx context.Context, id primitive.ObjectID) (*User, error)

Jump to

Keyboard shortcuts

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