simple

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsersCollection = "users"
)

Variables

This section is empty.

Functions

func CollectionExists added in v1.11.2

func CollectionExists(ctx context.Context, db mongoifc.Database, name string) (bool, error)

func Create added in v1.11.2

func Create(ctx context.Context, db mongoifc.Database, users ...User) ([]string, error)

func CreateCollection added in v1.11.2

func CreateCollection(ctx context.Context, db mongoifc.Database, name string) error

func Delete added in v1.11.2

func Delete(ctx context.Context, db mongoifc.Database, ids ...string) error

func DropCollection added in v1.11.2

func DropCollection(ctx context.Context, db mongoifc.Database, name string) error

Types

type User

type User struct {
	ID      string `json:"id,omitempty" bson:"_id,omitempty"`
	Name    string `json:"name,omitempty" bson:"name,omitempty"`
	Email   string `json:"email,omitempty" bson:"email,omitempty"`
	Active  bool   `json:"active,omitempty" bson:"active,omitempty"`
	IsAdmin bool   `json:"is_admin,omitempty" bson:"is_admin,omitempty"`
}

func GetAdmins

func GetAdmins(ctx context.Context, db mongoifc.Database) ([]User, error)

Jump to

Keyboard shortcuts

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