services

package
v0.0.0-...-057e48f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlacklistService

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

BlacklistService is an interface used to manage the relevant group doc controllers

type FileService

type FileService 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)
}

FileService is an interface used to manage the relevant file doc controllers

type GroupService

type GroupService 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)
}

GroupService is an interface used to manage the relevant group doc controllers

type TaskService

type TaskService 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)
}

TaskService is an interface used to manage the relevant task doc controllers

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 UserService, gService GroupService, bService BlacklistService) *TokenService

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

func (*TokenService) AdminTokenVerifyMiddleWare

func (a *TokenService) AdminTokenVerifyMiddleWare(next http.HandlerFunc) http.HandlerFunc

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(next http.HandlerFunc) http.HandlerFunc

MemberTokenVerifyMiddleWare is used to verify that a requester is authenticated

func (*TokenService) RootAdminTokenVerifyMiddleWare

func (a *TokenService) RootAdminTokenVerifyMiddleWare(next http.HandlerFunc) http.HandlerFunc

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

type UserService

type UserService 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)
}

UserService is an interface used to manage the relevant user doc controllers

Jump to

Keyboard shortcuts

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