user

package
v0.0.0-...-00d640b Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: MIT Imports: 8 Imported by: 0

README

Commands

mockgen --source=user.go --destination=user_mock_test.go --package=user_test

mockgen --source=user_handler.go --destination=user_handler_mock_test.go --package=user_test

go test -tags=integration

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("error not found")
)

Functions

func NewRouter

func NewRouter(userHandler *Handler) http.Handler

Types

type Handler

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

func NewHandler

func NewHandler(srv service) *Handler

func (*Handler) Register

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

type Service

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

func NewService

func NewService(repo repository) *Service

func (*Service) Register

func (s *Service) Register(ctx context.Context, user *User) error

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Users

type Users []User

func (*Users) ReadFrom

func (users *Users) ReadFrom(r io.Reader) (int64, error)

Jump to

Keyboard shortcuts

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