user

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEmail            = errors.New("email inválido")
	ErrInvalidPassword         = errors.New("senha deve ter pelo menos 8 caracteres")
	ErrInvalidRole             = errors.New("papel inválido")
	ErrDeleteLastAdmin         = errors.New("não é possível remover o último administrador")
	ErrTokenServiceUnavailable = errors.New("serviço de tokens indisponível")
)

Functions

This section is empty.

Types

type CreateInput

type CreateInput struct {
	Email    string
	Password string
	Role     string
}

type InstanceManager

type InstanceManager interface {
	ListByUser(ctx context.Context, userID string, userRole string, searchQuery string, limit, offset int) ([]model.Instance, int, error)
	Delete(ctx context.Context, id string) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(repo storage.UserRepository, tokenService TokenManager, instanceSvc InstanceManager) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, input CreateInput) (model.User, string, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, id string) (bool, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (model.User, error)

func (*Service) List

func (s *Service) List(ctx context.Context, searchQuery string, limit, offset int) ([]model.User, int, error)

func (*Service) RotateAPIToken

func (s *Service) RotateAPIToken(ctx context.Context, id string) (string, error)

func (*Service) UpdatePassword

func (s *Service) UpdatePassword(ctx context.Context, id, password string) error

type TokenManager

type TokenManager interface {
	Create(ctx context.Context, userID, name string, expiresAt *time.Time) (model.APIToken, string, error)
}

Jump to

Keyboard shortcuts

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