Documentation ¶
Index ¶
- type Deps
- type Operations
- type OperationsService
- func (o *OperationsService) CreateRelationsBySegmentIDs(ctx context.Context, userId int, segmentIDs []int) ([]int, error)
- func (o *OperationsService) CreateRelationsBySegmentNames(ctx context.Context, userId int, segmentsNames []string) ([]int, error)
- func (o *OperationsService) DeleteRelationsAfterTTLBySegmentIDs(ctx context.Context, userId int, segmentsIDs []int, ttl time.Duration)
- func (o *OperationsService) DeleteRelationsAfterTTLBySegmentNames(ctx context.Context, userId int, segmentsNames []string, ttl time.Duration)
- func (o *OperationsService) DeleteRelationsBySegmentIDs(ctx context.Context, userId int, segmentIDs []int) ([]int, error)
- func (o *OperationsService) DeleteRelationsBySegmentNames(ctx context.Context, userId int, segmentsNames []string) ([]int, error)
- func (o *OperationsService) GetOperationsHistory(ctx context.Context, year, month int, userIDs ...int) ([]entity.Operation, error)
- type Reports
- type ReportsService
- type Segments
- type SegmentsService
- func (s *SegmentsService) Create(ctx context.Context, segment entity.Segment) (int, error)
- func (s *SegmentsService) DeleteByID(ctx context.Context, id int) error
- func (s *SegmentsService) DeleteByName(ctx context.Context, name string) error
- func (s *SegmentsService) GetActiveUsersBySegmentID(ctx context.Context, id int) ([]entity.User, error)
- func (s *SegmentsService) GetAll(ctx context.Context) ([]entity.Segment, error)
- func (s *SegmentsService) GetByID(ctx context.Context, id int) (entity.Segment, error)
- type Services
- type Tokens
- type UserService
- func (u *UserService) GetActiveSegmentsByUserID(ctx context.Context, id int) ([]entity.Segment, error)
- func (u *UserService) RefreshTokens(ctx context.Context, refreshToken string) (Tokens, error)
- func (u *UserService) SignIn(ctx context.Context, login, password string) (Tokens, error)
- func (u *UserService) SignUp(ctx context.Context, login, email, password string) (int, error)
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct { Repos *repository.Repositories Hasher hash.PasswordHasher TokenManager auth.TokenManager AccessTokenTTL time.Duration RefreshTokenTTL time.Duration Storage *storage.GDriveStorage }
type Operations ¶
type Operations interface { CreateRelationsBySegmentIDs(ctx context.Context, userId int, segmentIDs []int) ([]int, error) CreateRelationsBySegmentNames(ctx context.Context, userId int, segmentsNames []string) ([]int, error) DeleteRelationsBySegmentIDs(ctx context.Context, userId int, segmentIDs []int) ([]int, error) DeleteRelationsBySegmentNames(ctx context.Context, userId int, segmentsNames []string) ([]int, error) DeleteRelationsAfterTTLBySegmentIDs(ctx context.Context, userId int, segmentIDs []int, ttl time.Duration) DeleteRelationsAfterTTLBySegmentNames(ctx context.Context, userId int, segmentsNames []string, ttl time.Duration) GetOperationsHistory(ctx context.Context, year, month int, userIDs ...int) ([]entity.Operation, error) }
type OperationsService ¶
type OperationsService struct {
// contains filtered or unexported fields
}
func NewOperations ¶
func NewOperations(usersRepo repository.Users, segmentsRepo repository.Segments, operationsRepo repository.Operations) *OperationsService
func (*OperationsService) CreateRelationsBySegmentIDs ¶
func (*OperationsService) CreateRelationsBySegmentNames ¶
func (*OperationsService) DeleteRelationsAfterTTLBySegmentIDs ¶
func (*OperationsService) DeleteRelationsAfterTTLBySegmentNames ¶
func (*OperationsService) DeleteRelationsBySegmentIDs ¶
func (*OperationsService) DeleteRelationsBySegmentNames ¶
func (*OperationsService) GetOperationsHistory ¶
type ReportsService ¶
type ReportsService struct {
// contains filtered or unexported fields
}
func NewReports ¶
func NewReports(repo repository.Operations, storage storage.Provider) *ReportsService
func (*ReportsService) CreateReportFile ¶
func (*ReportsService) CreateReportLink ¶
type Segments ¶
type Segments interface { Create(ctx context.Context, segment entity.Segment) (int, error) GetByID(ctx context.Context, id int) (entity.Segment, error) GetActiveUsersBySegmentID(ctx context.Context, id int) ([]entity.User, error) GetAll(ctx context.Context) ([]entity.Segment, error) DeleteByName(ctx context.Context, name string) error DeleteByID(ctx context.Context, id int) error }
type SegmentsService ¶
type SegmentsService struct {
// contains filtered or unexported fields
}
func NewSegments ¶
func NewSegments(segmentsRepo repository.Segments, usersRepo repository.Users) *SegmentsService
func (*SegmentsService) DeleteByID ¶
func (s *SegmentsService) DeleteByID(ctx context.Context, id int) error
func (*SegmentsService) DeleteByName ¶
func (s *SegmentsService) DeleteByName(ctx context.Context, name string) error
func (*SegmentsService) GetActiveUsersBySegmentID ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUsers ¶
func NewUsers(repo repository.Users, hasher hash.PasswordHasher, tokenManager auth.TokenManager, accessTokenTTL, refreshTokenTTL time.Duration) *UserService
func (*UserService) GetActiveSegmentsByUserID ¶
func (*UserService) RefreshTokens ¶
type Users ¶
type Users interface { SignUp(ctx context.Context, login, email, password string) (int, error) SignIn(ctx context.Context, login, password string) (Tokens, error) RefreshTokens(ctx context.Context, refreshToken string) (Tokens, error) GetActiveSegmentsByUserID(ctx context.Context, id int) ([]entity.Segment, error) }
Click to show internal directories.
Click to hide internal directories.