users

package
v0.0.0-...-d40265a Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UpdatableUser

type UpdatableUser struct {
	Uuid                          string
	FirstName, LastName, Position string
}

UpdatableUser defins the fields of a User that can be changed

type User

type User struct {
	Uuid         string `bson:"_id"`
	Username     string `bson:"username" required:"yes" min:"5"`
	FirstName    string `bson:"first_name" required:"yes"`
	LastName     string `bson:"last_name" required:"yes"`
	Organization string `bson:"organization" required:"yes"`
	Position     string `bson:"position" required:"yes"`
	Avatar       string `bson:"avatar"`
}

func NewDefault

func NewDefault(uuid, username, firstname, lastname, organization, position string) (*User, error)

type UserRepository

type UserRepository interface {
	Store(ctx context.Context, user User) error
	UpdateUser(ctx context.Context, updatable UpdatableUser) error
	GetById(ctx context.Context, uuid string, stored interface{}) error
	GetByOrganization(ctx context.Context, organization string, stored interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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