Documentation
¶
Index ¶
- Variables
- type Service
- func (service *Service) CreateLog(ctx context.Context, l *entity.Log) error
- func (service *Service) EndLog(ctx context.Context, userId string, id string, endTime int64) error
- func (service *Service) GetLogsInRange(ctx context.Context, userId string, startTime int64, endTime int64) (*[]entity.Log, error)
- func (service *Service) GetPendingLogs(ctx context.Context, userId string) (*[]entity.Log, error)
- func (service *Service) Login(ctx context.Context, u *entity.User) (string, error)
- func (service *Service) Logout(ctx context.Context, token string) error
- func (service *Service) Signup(ctx context.Context, u *entity.User) error
- func (service *Service) StartLog(ctx context.Context, l *entity.Log) error
- func (service *Service) VerifyAndDecodeToken(ctx context.Context, token string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidEmailFormat = errors.New("Invalid email format. Check RFC 5322.") ErrInvalidPasswordFormat = errors.New("Password format: Min. 8 chars, atleast 1 number" + "1 lowercase char, 1 uppercase char, 1 special char") ErrEmailExists = errors.New("This email already exists.") ErrInvalidEmailPassword = errors.New("Invalid email/password combination.") ErrNilUser = errors.New("Nil user.") ErrInvalidToken = errors.New("Invalid token.") ErrInvalidLog = errors.New("Invalid log.") ErrNoLogInsert = errors.New("Insertion failed, check logs.") ErrNoLogUpdate = errors.New("Update failed, check logs.") ErrNoLogFetch = errors.New("Fetching failed, check logs.") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Repo repository.Repository Conn redis.Conn JwtSecret []byte Logger *zap.Logger }
func (*Service) GetLogsInRange ¶
func (service *Service) GetLogsInRange(ctx context.Context, userId string, startTime int64, endTime int64) (*[]entity.Log, error)
GetLogsInRange will fetch all logs for the user within the given range of startTime and endTime.
func (*Service) GetPendingLogs ¶
GetPendingLogs will fetch pending logs from DB for the given user.
Click to show internal directories.
Click to hide internal directories.