user

package
v0.0.0-...-a551046 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	UserName  string `json:"userName" validate:"required,alphanum"`
	Email     string `json:"email" validate:"required,email"`
	FirstName string `json:"firstName" validate:"required,alpha"`
	LastName  string `json:"lastName" validate:"required,alpha"`
	Password  string `json:"password" validate:"required"`
}

func (*Entity) Bind

func (u *Entity) Bind(r *http.Request) error

type Items

type Items struct {
	*Entity
}

type Repository

type Repository struct {
}

func NewRepository

func NewRepository() *Repository

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, e *Entity) (*Entity, error)

func (*Repository) Get

func (r *Repository) Get(ctx context.Context) (*Entity, error)

func (*Repository) List

func (r *Repository) List(ctx context.Context) ([]Items, error)

type Response

type Response struct {
	Data []Items `json:"data"`
}

func (*Response) Render

func (res *Response) Render(w http.ResponseWriter, r *http.Request) error

type Service

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

func NewService

func NewService(repository *Repository) *Service

func (*Service) Create

func (s *Service) Create(w http.ResponseWriter, r *http.Request)

func (*Service) Get

func (s *Service) Get(w http.ResponseWriter, r *http.Request)

func (*Service) List

func (s *Service) List(w http.ResponseWriter, r *http.Request)

type UserId

type UserId int

type UserInterface

type UserInterface interface {
	Create(ctx context.Context, entity Entity) error
}

Jump to

Keyboard shortcuts

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