db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Username string `bson:"username" json:"username"`
	Password string `bson:"password"  json:"password"`
	Role     string `bson:"role" json:"role"`
}

User represents a user with a username and password

type UserStore

type UserStore struct {
	// contains filtered or unexported fields
}

UserStore represents a store for users

func NewUserStore

func NewUserStore(uri, databaseName string) (*UserStore, error)

NewUserStore creates a new user store

func (*UserStore) AddUser

func (store *UserStore) AddUser(ctx context.Context, user User) error

AddUser adds a new user to the store

func (*UserStore) FindByUserName

func (store *UserStore) FindByUserName(ctx context.Context, username string) (*User, error)

Jump to

Keyboard shortcuts

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