mongodb

package
v0.0.0-...-47b55c5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseModifyUser

func BaseModifyUser(user root.User, curUser *userModel) root.User

BaseModifyUser is a function that setups the base user struct during a user modification request

func DatabaseConn

func DatabaseConn(mongoUri string) (*mongo.Client, error)

DatabaseConn is a function that takes a mongoUri string and outputs a connected mongo client for the app to use

Types

type GroupService

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

GroupService is used by the app to manage all group related controllers and functionality

func NewGroupService

func NewGroupService(client *mongo.Client, dbName string, collectionName string) *GroupService

NewGroupService is an exported function used to initialize a new GroupService struct

func (*GroupService) GroupCreate

func (p *GroupService) GroupCreate(group root.Group) root.Group

GroupCreate is used to create a new user group

func (*GroupService) GroupDelete

func (p *GroupService) GroupDelete(id string) root.Group

GroupDelete is used to delete a group doc

func (*GroupService) GroupDocInsert

func (p *GroupService) GroupDocInsert(group root.Group) root.Group

GroupDocInsert is used to insert a group doc directly into mongodb for testing purposes

func (*GroupService) GroupFind

func (p *GroupService) GroupFind(id string) root.Group

GroupFind is used to find a specific group doc

func (*GroupService) GroupUpdate

func (p *GroupService) GroupUpdate(group root.Group) root.Group

GroupUpdate is used to update an existing group

func (*GroupService) GroupsFind

func (p *GroupService) GroupsFind() []root.Group

GroupsFind is used to find all group docs

type TodoService

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

TodoService is used by the app to manage all todos related controllers and functionality

func NewTodoService

func NewTodoService(client *mongo.Client, dbName string, collectionName string, config configuration.Configuration) *TodoService

NewTodoService is an exported function used to initialize a new TodoService struct

func (*TodoService) TodoCreate

func (p *TodoService) TodoCreate(todo root.Todo) root.Todo

TodoCreate is used to create a new todos doc

func (*TodoService) TodoDelete

func (p *TodoService) TodoDelete(decodedToken []string, id string) root.Todo

TodoDelete is used to delete a specified todos doc

func (*TodoService) TodoDocInsert

func (p *TodoService) TodoDocInsert(todo root.Todo) root.Todo

TodoDocInsert is used to insert a todos doc directly into mongodb for testing purposes

func (*TodoService) TodoFind

func (p *TodoService) TodoFind(decodedToken []string, id string) root.Todo

TodoFind is used to Find a specific todos doc

func (*TodoService) TodoUpdate

func (p *TodoService) TodoUpdate(todo root.Todo) root.Todo

TodoUpdate is used to update an existing todos doc

func (*TodoService) TodosFind

func (p *TodoService) TodosFind(decodedToken []string) []root.Todo

TodosFind is used to Find all todos docs

type UserService

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

UserService is used by the app to manage all user related controllers and functionality

func NewUserService

func NewUserService(client *mongo.Client, dbName string, collectionName string, config configuration.Configuration) *UserService

NewUserService is an exported function used to initialize a new UserService struct

func (*UserService) AuthenticateUser

func (p *UserService) AuthenticateUser(user root.User) root.User

AuthenticateUser is used to authenticate users that are signing in

func (*UserService) BlacklistAuthToken

func (p *UserService) BlacklistAuthToken(authToken string)

BlacklistAuthToken is used during signout to add the now invalid auth-token/api key to the blacklist collection

func (*UserService) RefreshToken

func (p *UserService) RefreshToken(tokenData []string, groupUuid string) root.User

RefreshToken is used to refresh an existing & valid JWT token

func (*UserService) UpdatePassword

func (p *UserService) UpdatePassword(tokenData []string, CurrentPassword string, newPassword string) root.User

UpdatePassword is used to update the currently logged in user's password

func (*UserService) UserCreate

func (p *UserService) UserCreate(user root.User) root.User

UserCreate is used to create a new user

func (*UserService) UserDelete

func (p *UserService) UserDelete(id string, groupUuid string) root.User

UserDelete is used to delete an user

func (*UserService) UserDocInsert

func (p *UserService) UserDocInsert(user root.User) root.User

UserDocInsert is used to insert an user doc directly into mongodb for testing purposes

func (*UserService) UserFind

func (p *UserService) UserFind(id string, groupUuid string) root.User

UserFind is used to find a specific user doc

func (*UserService) UserUpdate

func (p *UserService) UserUpdate(user root.User, groupUuid string) root.User

UserUpdate is used to update an existing user doc

func (*UserService) UsersFind

func (p *UserService) UsersFind(groupUuid string) []root.User

UsersFind is used to find all user docs

Jump to

Keyboard shortcuts

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