services

package
v0.0.0-...-9b6346a Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

AuthService gRPC Service

func NewAuthService

NewAuthService constructs a UserService for controller gRPC service User requests

func (*AuthService) GenerateKey

GenerateKey is the handler function that generates 6 month API Key for a given user

func (*AuthService) Login

Login is the handler function that manages the user SignIn process

func (*AuthService) Logout

Logout is the handler function that ends a users session

func (*AuthService) Refresh

Refresh is the handler function that refreshes a users JWT token

func (*AuthService) Register

Register handler function that registers a new user

func (*AuthService) UpdatePassword

UpdatePassword is the handler function that manages the user password update process

type BlacklistDataService

type BlacklistDataService interface {
	BlacklistAuthToken(authToken string) error
	CheckTokenBlacklist(authToken string) bool
}

BlacklistDataService is an interface to database.BlacklistService

type FileDataService

type FileDataService interface {
	FileCreate(g *models.File, content []byte) (*models.File, error)
	FileFind(g *models.File) (*models.File, error)
	FilesFind(g *models.File) ([]*models.File, error)
	FileDelete(g *models.File) (*models.File, error)
	FileDeleteMany(g []*models.File) error
	FileUpdate(g *models.File, content []byte) (*models.File, error)
	RetrieveFile(g *models.File) (*bytes.Buffer, error)
	FilesQuery(ctx context.Context, g *models.File, pagination *utilities.Pagination) (*models.FilesRes, error)
}

FileDataService is an interface to database.FileService

type GroupDataService

type GroupDataService interface {
	GroupCreate(g *models.Group) (*models.Group, error)
	GroupFind(g *models.Group) (*models.Group, error)
	GroupsFind(g *models.Group) ([]*models.Group, error)
	GroupDelete(g *models.Group) (*models.Group, error)
	GroupDeleteMany(g *models.Group) (*models.Group, error)
	GroupUpdate(g *models.Group) (*models.Group, error)
	GroupDocInsert(g *models.Group) (*models.Group, error)
	GroupsQuery(ctx context.Context, g *models.Group, pagination *utilities.Pagination) (*models.GroupsRes, error)
}

GroupDataService is an interface to database.GroupService

type GroupService

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

GroupService gRPC Service

func NewGroupService

NewGroupService constructs a GroupService for controller gRPC service Group requests

func (*GroupService) Create

Create is a New Group

func (*GroupService) Delete

Delete is the handler function that deletes a group

func (*GroupService) Find

Find Groups from an input query

func (*GroupService) Get

Get a specific Group

func (*GroupService) Update

Update a Group

type TaskDataService

type TaskDataService interface {
	TaskCreate(g *models.Task) (*models.Task, error)
	TaskFind(g *models.Task) (*models.Task, error)
	TasksFind(g *models.Task) ([]*models.Task, error)
	TaskDelete(g *models.Task) (*models.Task, error)
	TaskDeleteMany(g *models.Task) (*models.Task, error)
	TaskUpdate(g *models.Task) (*models.Task, error)
	TaskDocInsert(g *models.Task) (*models.Task, error)
	TasksQuery(ctx context.Context, g *models.Task, pagination *utilities.Pagination) (*models.TasksRes, error)
}

TaskDataService is an interface to database.TaskService

type TaskService

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

TaskService gRPC Service

func NewTaskService

NewTaskService constructs a TaskService for controller gRPC service Task requests

func (*TaskService) Create

Create a New Task

func (*TaskService) Delete

Delete is the handler function that deletes a task

func (*TaskService) Find

Find Tasks from an input query

func (*TaskService) Get

Get a specific Task

func (*TaskService) GetGroupTasks

GetGroupTasks returns the tasks for a given groupId

func (*TaskService) GetUserTasks

GetUserTasks returns the tasks for a given userId

func (*TaskService) Update

Update a Task

type TokenService

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

TokenService is used by the app to manage db auth functionality

func NewTokenService

func NewTokenService(uService UserDataService, gService GroupDataService, bService BlacklistDataService) *TokenService

NewTokenService is an exported function used to initialize a new authService struct

func (*TokenService) AdminTokenVerifyMiddleWare

func (a *TokenService) AdminTokenVerifyMiddleWare(authToken string) (bool, error)

AdminTokenVerifyMiddleWare is used to verify that the requester is a valid admin

func (*TokenService) BlacklistAuthToken

func (a *TokenService) BlacklistAuthToken(authToken string) error

BlacklistAuthToken is used to blacklist an unexpired token

func (*TokenService) GenerateToken

func (a *TokenService) GenerateToken(u *models.User, tType string) (string, error)

GenerateToken outputs an auth token string for an inputted User

func (*TokenService) MemberTokenVerifyMiddleWare

func (a *TokenService) MemberTokenVerifyMiddleWare(authToken string) (bool, error)

MemberTokenVerifyMiddleWare is used to verify that a requester is authenticated

func (*TokenService) RootAdminTokenVerifyMiddleWare

func (a *TokenService) RootAdminTokenVerifyMiddleWare(authToken string) (bool, error)

RootAdminTokenVerifyMiddleWare is used to verify that the requester is a valid admin

type UserDataService

type UserDataService interface {
	AuthenticateUser(u *models.User) (*models.User, error)
	UpdatePassword(u *models.User, CurrentPassword string, newPassword string) (*models.User, error)
	UserCreate(u *models.User) (*models.User, error)
	UserDelete(u *models.User) (*models.User, error)
	UserDeleteMany(u *models.User) (*models.User, error)
	UsersFind(u *models.User) ([]*models.User, error)
	UserFind(u *models.User) (*models.User, error)
	UserUpdate(u *models.User) (*models.User, error)
	UserDocInsert(u *models.User) (*models.User, error)
	UsersQuery(ctx context.Context, u *models.User, pagination *utilities.Pagination) (*models.UsersRes, error)
}

UserDataService is an interface to database.UserService

type UserService

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

UserService gRPC Service

func NewUserService

NewUserService constructs a UserService for controller gRPC service User requests

func (*UserService) Create

Create is a New User

func (*UserService) Delete

Delete is the handler function that deletes a user

func (*UserService) Find

Find Users from an input query

func (*UserService) Get

Get a specific User

func (*UserService) GetGroupUsers

GetGroupUsers returns the users for a given groupId

func (*UserService) Update

Update a User

Jump to

Keyboard shortcuts

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