user

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Email       string                 `json:"email" validate:"required,email"`
	Password    string                 `json:"password" validate:"required,min=8"`
	DisplayName string                 `json:"display_name"`
	Metadata    map[string]interface{} `json:"metadata"`
}

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Activate

func (h *Handler) Activate(w http.ResponseWriter, r *http.Request)

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

func (*Handler) Routes

func (h *Handler) Routes() chi.Router

func (*Handler) Suspend

func (h *Handler) Suspend(w http.ResponseWriter, r *http.Request)

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

type ListParams

type ListParams struct {
	Limit  int
	Offset int
}

type Service

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

func NewService

func NewService(pool *pgxpool.Pool) *Service

func (*Service) Activate

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

func (*Service) Create

func (s *Service) Create(ctx context.Context, req CreateUserRequest) (*User, error)

func (*Service) Delete

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

func (*Service) GetByID

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

func (*Service) List

func (s *Service) List(ctx context.Context, params ListParams) ([]User, int64, error)

func (*Service) Suspend

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

func (*Service) Update

func (s *Service) Update(ctx context.Context, id string, req UpdateUserRequest) (*User, error)

type UpdateUserRequest

type UpdateUserRequest struct {
	Email         *string                `json:"email"`
	DisplayName   *string                `json:"display_name"`
	AvatarURL     *string                `json:"avatar_url"`
	EmailVerified *bool                  `json:"email_verified"`
	Metadata      map[string]interface{} `json:"metadata"`
}

type User

type User struct {
	ID            string                 `json:"id"`
	Email         string                 `json:"email"`
	EmailVerified bool                   `json:"email_verified"`
	DisplayName   string                 `json:"display_name"`
	AvatarURL     string                 `json:"avatar_url"`
	Status        string                 `json:"status"`
	Metadata      map[string]interface{} `json:"metadata"`
	CreatedAt     time.Time              `json:"created_at"`
	UpdatedAt     time.Time              `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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