services

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMessageTooLong = errors.New("message is too long")
	ErrModelRequired  = errors.New("model is required")
)

Functions

func NewSearchKnowledgeBase

func NewSearchKnowledgeBase(service *EmbeddingService) functions.ChatFunctionDefinition

Types

type AuthLogService

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

func NewAuthLogService

func NewAuthLogService(repo authlog.Repository, publisher event.Publisher) *AuthLogService

func (*AuthLogService) Count

func (s *AuthLogService) Count(ctx context.Context) (int64, error)

func (*AuthLogService) Create

func (*AuthLogService) Delete

func (s *AuthLogService) Delete(ctx context.Context, id int64) error

func (*AuthLogService) GetAll

func (*AuthLogService) GetByID

func (*AuthLogService) GetPaginated

func (s *AuthLogService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*authlog.AuthenticationLog, error)

func (*AuthLogService) Update

type AuthService

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

func NewAuthService

func NewAuthService(app application.Application) *AuthService

func (*AuthService) Authenticate

func (s *AuthService) Authenticate(ctx context.Context, email, password string) (*user.User, *session.Session, error)

func (*AuthService) AuthenticateGoogle

func (s *AuthService) AuthenticateGoogle(ctx context.Context, code string) (*user.User, *session.Session, error)

func (*AuthService) AuthenticateWithUserId

func (s *AuthService) AuthenticateWithUserId(ctx context.Context, id uint, password string) (*user.User, *session.Session, error)

func (*AuthService) Authorize

func (s *AuthService) Authorize(ctx context.Context, token string) (*user.User, *session.Session, error)

func (*AuthService) CoockieAuthenticateWithUserId

func (s *AuthService) CoockieAuthenticateWithUserId(ctx context.Context, id uint, password string) (*http.Cookie, error)

func (*AuthService) CookieAuthenticate

func (s *AuthService) CookieAuthenticate(ctx context.Context, email, password string) (*http.Cookie, error)

func (*AuthService) GoogleAuthenticate

func (s *AuthService) GoogleAuthenticate() (string, error)

func (*AuthService) Logout

func (s *AuthService) Logout(ctx context.Context, token string) error

func (*AuthService) OauthGoogleCallback

func (s *AuthService) OauthGoogleCallback(w http.ResponseWriter, r *http.Request)

type CurrencyService

type CurrencyService struct {
	Repo      currency.Repository
	Publisher event.Publisher
}

func NewCurrencyService

func NewCurrencyService(repo currency.Repository, publisher event.Publisher) *CurrencyService

func (*CurrencyService) Create

func (s *CurrencyService) Create(ctx context.Context, data *currency.CreateDTO) error

func (*CurrencyService) Delete

func (s *CurrencyService) Delete(ctx context.Context, id uint) (*currency.Currency, error)

func (*CurrencyService) GetAll

func (s *CurrencyService) GetAll(ctx context.Context) ([]*currency.Currency, error)

func (*CurrencyService) GetByID

func (s *CurrencyService) GetByID(ctx context.Context, id uint) (*currency.Currency, error)

func (*CurrencyService) GetPaginated

func (s *CurrencyService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*currency.Currency, error)

func (*CurrencyService) Update

func (s *CurrencyService) Update(ctx context.Context, data *currency.UpdateDTO) error

type DialogueService

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

func (*DialogueService) ChatComplete

func (s *DialogueService) ChatComplete(ctx context.Context, data *dialogue.Dialogue, model string) error

func (*DialogueService) Count

func (s *DialogueService) Count(ctx context.Context) (int64, error)

func (*DialogueService) Delete

func (s *DialogueService) Delete(ctx context.Context, id int64) (*dialogue.Dialogue, error)

func (*DialogueService) GetAll

func (s *DialogueService) GetAll(ctx context.Context) ([]*dialogue.Dialogue, error)

func (*DialogueService) GetByID

func (s *DialogueService) GetByID(ctx context.Context, id int64) (*dialogue.Dialogue, error)

func (*DialogueService) GetPaginated

func (s *DialogueService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*dialogue.Dialogue, error)

func (*DialogueService) GetUserDialogues

func (s *DialogueService) GetUserDialogues(ctx context.Context, userID int64) ([]*dialogue.Dialogue, error)

func (*DialogueService) ReplyToDialogue

func (s *DialogueService) ReplyToDialogue(
	ctx context.Context,
	dialogueID int64,
	message, model string,
) (*dialogue.Dialogue, error)

func (*DialogueService) StartDialogue

func (s *DialogueService) StartDialogue(ctx context.Context, message string, model string) (*dialogue.Dialogue, error)

func (*DialogueService) Update

func (s *DialogueService) Update(ctx context.Context, data *dialogue.Dialogue) error

type EmbeddingService

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

func NewEmbeddingService

func NewEmbeddingService(app application.Application) *EmbeddingService

func (*EmbeddingService) Search

func (s *EmbeddingService) Search(ctx context.Context, query string) ([]*embedding.SearchResult, error)

type EmployeeService

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

func NewEmployeeService

func NewEmployeeService(repo employee.Repository, publisher event.Publisher) *EmployeeService

func (*EmployeeService) Count

func (s *EmployeeService) Count(ctx context.Context) (int64, error)

func (*EmployeeService) Create

func (s *EmployeeService) Create(ctx context.Context, data *employee.CreateDTO) error

func (*EmployeeService) Delete

func (s *EmployeeService) Delete(ctx context.Context, id uint) (*employee.Employee, error)

func (*EmployeeService) GetAll

func (s *EmployeeService) GetAll(ctx context.Context) ([]*employee.Employee, error)

func (*EmployeeService) GetByID

func (s *EmployeeService) GetByID(ctx context.Context, id uint) (*employee.Employee, error)

func (*EmployeeService) GetPaginated

func (s *EmployeeService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*employee.Employee, error)

func (*EmployeeService) Update

func (s *EmployeeService) Update(ctx context.Context, id uint, data *employee.UpdateDTO) error

type PositionService

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

func NewPositionService

func NewPositionService(repo position.Repository, publisher event.Publisher) *PositionService

func (*PositionService) Count

func (s *PositionService) Count(ctx context.Context) (int64, error)

func (*PositionService) Create

func (s *PositionService) Create(ctx context.Context, data *position.Position) error

func (*PositionService) Delete

func (s *PositionService) Delete(ctx context.Context, id int64) error

func (*PositionService) GetAll

func (s *PositionService) GetAll(ctx context.Context) ([]*position.Position, error)

func (*PositionService) GetByID

func (s *PositionService) GetByID(ctx context.Context, id int64) (*position.Position, error)

func (*PositionService) GetPaginated

func (s *PositionService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*position.Position, error)

func (*PositionService) Update

func (s *PositionService) Update(ctx context.Context, data *position.Position) error

type ProjectService

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

func NewProjectService

func NewProjectService(repo project.Repository, publisher event.Publisher) *ProjectService

func (*ProjectService) Create

func (s *ProjectService) Create(ctx context.Context, data *project.CreateDTO) error

func (*ProjectService) Delete

func (s *ProjectService) Delete(ctx context.Context, id uint) (*project.Project, error)

func (*ProjectService) GetAll

func (s *ProjectService) GetAll(ctx context.Context) ([]*project.Project, error)

func (*ProjectService) GetByID

func (s *ProjectService) GetByID(ctx context.Context, id uint) (*project.Project, error)

func (*ProjectService) GetPaginated

func (s *ProjectService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*project.Project, error)

func (*ProjectService) Update

func (s *ProjectService) Update(ctx context.Context, id uint, data *project.UpdateDTO) error

type ProjectStageService

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

func NewProjectStageService

func NewProjectStageService(repo stage.Repository, publisher event.Publisher) *ProjectStageService

func (*ProjectStageService) Count

func (s *ProjectStageService) Count(ctx context.Context) (uint, error)

func (*ProjectStageService) Create

func (s *ProjectStageService) Create(ctx context.Context, data *stage.CreateDTO) error

func (*ProjectStageService) Delete

func (*ProjectStageService) GetAll

func (*ProjectStageService) GetByID

func (*ProjectStageService) GetPaginated

func (s *ProjectStageService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*stage.ProjectStage, error)

func (*ProjectStageService) Update

func (s *ProjectStageService) Update(ctx context.Context, id uint, data *stage.UpdateDTO) error

type PromptService

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

func NewPromptService

func NewPromptService(repo prompt.Repository, publisher event.Publisher) *PromptService

func (*PromptService) Count

func (s *PromptService) Count(ctx context.Context) (int64, error)

func (*PromptService) Create

func (s *PromptService) Create(ctx context.Context, data *prompt.Prompt) error

func (*PromptService) Delete

func (s *PromptService) Delete(ctx context.Context, id int64) error

func (*PromptService) GetAll

func (s *PromptService) GetAll(ctx context.Context) ([]*prompt.Prompt, error)

func (*PromptService) GetByID

func (s *PromptService) GetByID(ctx context.Context, id string) (*prompt.Prompt, error)

func (*PromptService) GetPaginated

func (s *PromptService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*prompt.Prompt, error)

func (*PromptService) Update

func (s *PromptService) Update(ctx context.Context, data *prompt.Prompt) error

type RoleService

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

func NewRoleService

func NewRoleService(repo role.Repository, publisher event.Publisher) *RoleService

func (*RoleService) Count

func (s *RoleService) Count(ctx context.Context) (int64, error)

func (*RoleService) Create

func (s *RoleService) Create(ctx context.Context, data *role.Role) error

func (*RoleService) Delete

func (s *RoleService) Delete(ctx context.Context, id int64) error

func (*RoleService) GetAll

func (s *RoleService) GetAll(ctx context.Context) ([]*role.Role, error)

func (*RoleService) GetByID

func (s *RoleService) GetByID(ctx context.Context, id int64) (*role.Role, error)

func (*RoleService) GetPaginated

func (s *RoleService) GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*role.Role, error)

func (*RoleService) Update

func (s *RoleService) Update(ctx context.Context, data *role.Role) error

type SessionService

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

func NewSessionService

func NewSessionService(repo session.Repository, publisher event.Publisher) *SessionService

func (*SessionService) Create

func (s *SessionService) Create(ctx context.Context, data *session.CreateDTO) error

func (*SessionService) Delete

func (s *SessionService) Delete(ctx context.Context, id int64) error

func (*SessionService) GetAll

func (s *SessionService) GetAll(ctx context.Context) ([]*session.Session, error)

func (*SessionService) GetByToken

func (s *SessionService) GetByToken(ctx context.Context, id string) (*session.Session, error)

func (*SessionService) GetCount

func (s *SessionService) GetCount(ctx context.Context) (int64, error)

func (*SessionService) GetPaginated

func (s *SessionService) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*session.Session, error)

func (*SessionService) Update

func (s *SessionService) Update(ctx context.Context, data *session.Session) error

type UhrProps

type UhrProps struct {
	Entities          []costcomponent.BillableHourEntity
	ExpenseComponents []costcomponent.ExpenseComponent
}

type UhrService

type UhrService struct {
}

func NewUhrService

func NewUhrService() *UhrService

func (*UhrService) Calculate

func (*UhrService) CalculateStaffExpenses

func (s *UhrService) CalculateStaffExpenses(employees []*employee.Employee, settings *settings.Settings)

type UploadService

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

func NewUploadService

func NewUploadService(
	repo upload.Repository,
	storage upload.Storage,
	publisher event.Publisher,
) *UploadService

func (*UploadService) Create

func (s *UploadService) Create(ctx context.Context, data *upload.CreateDTO) (*upload.Upload, error)

func (*UploadService) Delete

func (s *UploadService) Delete(ctx context.Context, id uint) (*upload.Upload, error)

func (*UploadService) GetAll

func (s *UploadService) GetAll(ctx context.Context) ([]*upload.Upload, error)

func (*UploadService) GetByHash

func (s *UploadService) GetByHash(ctx context.Context, hash string) (*upload.Upload, error)

func (*UploadService) GetByID

func (s *UploadService) GetByID(ctx context.Context, id uint) (*upload.Upload, error)

func (*UploadService) Update

func (s *UploadService) Update(ctx context.Context, id uint, data *upload.UpdateDTO) error

type UserService

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

func NewUserService

func NewUserService(repo user.Repository, publisher event.Publisher) *UserService

func (*UserService) Count

func (s *UserService) Count(ctx context.Context) (int64, error)

func (*UserService) Create

func (s *UserService) Create(ctx context.Context, data *user.User) error

func (*UserService) Delete

func (s *UserService) Delete(ctx context.Context, id uint) (*user.User, error)

func (*UserService) GetAll

func (s *UserService) GetAll(ctx context.Context) ([]*user.User, error)

func (*UserService) GetByEmail

func (s *UserService) GetByEmail(ctx context.Context, email string) (*user.User, error)

func (*UserService) GetByID

func (s *UserService) GetByID(ctx context.Context, id uint) (*user.User, error)

func (*UserService) GetPaginated

func (s *UserService) GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*user.User, error)

func (*UserService) Update

func (s *UserService) Update(ctx context.Context, data *user.User) error

func (*UserService) UpdateLastAction

func (s *UserService) UpdateLastAction(ctx context.Context, id uint) error

func (*UserService) UpdateLastLogin

func (s *UserService) UpdateLastLogin(ctx context.Context, id uint) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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