user

package
v0.0.0-...-42c4776 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Routes = map[myrouter.RouteKey]func(w http.ResponseWriter, r *http.Request, ps common.QueryMap){
	{Path: "/api/v2/users/:user_id", Method: http.MethodGet, NeedAuth: false}: hf.Find,
	{Path: "/api/v2/users", Method: http.MethodPost, NeedAuth: false}:         hc.Create,
}

Functions

This section is empty.

Types

type Create

type Create interface {
	Create(w http.ResponseWriter, r *http.Request, ps common.QueryMap)
}

func NewCreate

func NewCreate(uc u.Create) Create

type Find

type Find interface {
	Find(w http.ResponseWriter, r *http.Request, ps common.QueryMap)
}

func NewFind

func NewFind(uc u.Find) Find

type PostRequest

type PostRequest struct {
	GivenName  string `json:"given_name"`
	FamilyName string `json:"family_name"`
	Email      string `json:"email"`
	Password   string `json:"password"`
}

type PostResponse

type PostResponse struct {
	*myhttp.ResponseBase
	User User `json:"user"`
}

func NewResponse

func NewResponse(res *myhttp.ResponseBase, user d.User) *PostResponse

type SimpleResponse

type SimpleResponse struct {
	*myhttp.ResponseBase
}

func NewSimpleResponse

func NewSimpleResponse(res *myhttp.ResponseBase) *SimpleResponse

type User

type User struct {
	Id         int    `json:"id"`
	GivenName  string `json:"given_name"`
	FamilyName string `json:"family_name"`
	Email      string `json:"email"`
}

func ToResponse

func ToResponse(v d.User) User

Jump to

Keyboard shortcuts

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