user

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package user contains user service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	GetUserByTgID(ctx context.Context, tgID int64) (*repo.User, error)
	CreateUser(ctx context.Context, params repo.CreateUserParams) (*repo.User, error)
	IncrementCredits(ctx context.Context, id int64, credit int32, updateDate bool) (*repo.User, error)
	GetUsersCount(ctx context.Context) (int64, error)
	DecrementCredits(ctx context.Context, id int64, credit int32) (*repo.User, error)
	IncrementTotalLinkCount(ctx context.Context, id int64) (*repo.User, error)
	GetAllUsers(ctx context.Context) ([]*repo.User, error)
	UpdateUser(ctx context.Context, user *repo.User) (*repo.User, error)
	GetUserInfo(ctx context.Context, m *tg.Message, e tg.Entities) *TgUser
}

func NewService

func NewService(repo repo.Querier, redis rs.RedisService, ttl time.Duration) Service

type TgUser

type TgUser struct {
	ID         int64  `json:"id"`
	Username   string `json:"username"`
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	AccessHash int64  `json:"access_hash"`
}

func NewTgUser

func NewTgUser(id int64, username, firstName, lastName string, accessHash int64) *TgUser

Jump to

Keyboard shortcuts

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