service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuthService

type OAuthService interface {
	GenerateState(ctx context.Context, provider, redirectURL, userAgent, ipAddress string) (string, error)
	ValidateState(ctx context.Context, state, userAgent, ipAddress string) (*OAuthStateData, error)
	DeleteState(ctx context.Context, state string) error
}

func NewOAuthService

func NewOAuthService(rdb redis.UniversalClient, cfg configs.Config) OAuthService

type OAuthStateData

type OAuthStateData struct {
	Provider    string    `json:"provider"`
	RedirectURL string    `json:"redirect_url,omitempty"`
	UserAgent   string    `json:"user_agent,omitempty"`
	IPAddress   string    `json:"ip_address,omitempty"`
	CreatedAt   time.Time `json:"created_at"`
	ExpiresAt   time.Time `json:"expires_at"`
}

type SessionService

type SessionService interface {
	CreateSession(ctx context.Context, userID uint) (string, error)
	GetUserIDFromSession(ctx context.Context, sessionID string) (uint, error)
	RefreshSession(ctx context.Context, sessionID string) error
	GetSessionExpirationTime(ctx context.Context, sessionID string) (time.Time, error)
	DeleteSession(ctx context.Context, sessionID string) error
}

func NewSessionService

func NewSessionService(rdb redis.UniversalClient, cfg configs.Config) SessionService

type UserService

type UserService interface {
	CreateUser(ctx context.Context, req *userpb.CreateUserRequest) error
	GetUser(ctx context.Context, id uint64) (*userpb.User, error)
	GetCurrentUser(ctx context.Context) (*userpb.User, error)
	GetUserByEmail(ctx context.Context, email string) (*userpb.User, error)
	UpdateUser(ctx context.Context, req *userpb.UpdateUserRequest) error
	DeleteUser(ctx context.Context, id uint64) error
	ListUsers(ctx context.Context, req *userpb.ListUsersRequest) (*userpb.ListUsersResponse, error)
}

func NewUserService

func NewUserService(userRepo repository.UserRepository) UserService

Jump to

Keyboard shortcuts

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