controller

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func New

func New(service Service) *Controller

func (*Controller) DeleteUser

func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)

func (*Controller) GetUser

func (c *Controller) GetUser(w http.ResponseWriter, r *http.Request)

func (*Controller) Mux added in v0.4.3

func (c *Controller) Mux() *mux.Router

func (*Controller) NewUser

func (c *Controller) NewUser(w http.ResponseWriter, r *http.Request)

func (*Controller) UpdateUser

func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)

type Service

type Service interface {
	FindUser(ctx context.Context, id string) (model.User, error)
	CreateUser(ctx context.Context, user model.User) (model.User, error)
	UpdateUser(ctx context.Context, user model.User) (model.User, error)
	DeleteUser(ctx context.Context, id string) error
}

Service abstracts the service layer.

Jump to

Keyboard shortcuts

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