services

package
v0.0.0-...-f92ab88 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateTokenPlaintext

func ValidateTokenPlaintext(v *validator.Validator, plaintexttoken string)

Types

type EconomicDashboardService

type EconomicDashboardService interface {
	GetDashboardSummary() (*[]data.Summary, error)
}

type EconomicService

type EconomicService interface {
	GetAll(reportType data.ReportType) (*[]data.Economic, error)
	GetIntervalWithPercentChange(ctx context.Context, wg *sync.WaitGroup, dataChan chan data.EconomicWithChangeResult, errChan chan error, reportType data.ReportType, years int, paging data.Paging)
	GetStats(ctx context.Context, wg *sync.WaitGroup, dataChan chan data.EconomicStatsResult, errChan chan error, reportType data.ReportType, years int, timeBucket int, paging data.Paging)
	StartDataSyncTask()
}

type PermissionsService

type PermissionsService interface {
	GetAllForUser(ctx context.Context, userId int64) (data.Permissions, error)
}

func NewPermissionsService

func NewPermissionsService(permissionRepo data.PermissionsRepository) PermissionsService

type ServicesModel

type ServicesModel struct {
	AlphaVantageEconomicService EconomicService
	Economicdashservice         EconomicDashboardService
	UserService                 UserService
	PermissionsService          PermissionsService
	TokenService                TokenService
}

func NewServicesModel

func NewServicesModel(models repo.Models, client alpha.ClientInterface, mailer *mailer.Mailer) ServicesModel

type TokenService

type TokenService interface {
	New(ctx context.Context, userID int64, ttl time.Duration, scope string) (*data.Token, error)
	DeleteAllForUser(ctx context.Context, userId int64, scope string) error
}

func NewTokenService

func NewTokenService(tokenRepo data.TokenRepository) TokenService

type UserService

type UserService interface {
	RegisterUser(ctx context.Context, user *data.User) error
	ActivateUser(ctx context.Context, token string) (*data.User, error)
	GetByEmail(ctx context.Context, email string) (*data.User, error)
	GetFromToken(ctx context.Context, tokenScope, tokenplaintext string) (*data.User, error)
}

func NewUserService

func NewUserService(userRepository data.UserRepository, permissionsRepository data.PermissionsRepository, tokenService TokenService, mailer *mailer.Mailer) UserService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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