http

package
v0.0.0-...-2e07358 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, msg interface{}) (int, error)

func Conflict

func Conflict(w http.ResponseWriter, msg interface{}) (int, error)

func Forbidden

func Forbidden(w http.ResponseWriter, msg interface{}) (int, error)

func InternalServerError

func InternalServerError(w http.ResponseWriter, msg interface{}) (int, error)

func MountRoutes

func MountRoutes(c *ent.Client, l *zap.Logger, r chi.Router)

MountRoutes mounts all generated routes on the given router.

func NewHandler

func NewHandler(c *ent.Client, l *zap.Logger) chi.Router

NewHandler returns a ready to use handler with all generated endpoints mounted.

func NotFound

func NotFound(w http.ResponseWriter, msg interface{}) (int, error)

func Unauthorized

func Unauthorized(w http.ResponseWriter, msg interface{}) (int, error)

Types

type Badge2492344257View

type Badge2492344257View struct {
	ID       uint32         `json:"id,omitempty"`
	Color    badge.Color    `json:"color,omitempty"`
	Material badge.Material `json:"material,omitempty"`
}

Badge2492344257View represents the data serialized for the following serialization group combinations: [] [pet:list pet:read] [pet:read] [pet:list]

func NewBadge2492344257View

func NewBadge2492344257View(e *ent.Badge) *Badge2492344257View

func (Badge2492344257View) MarshalEasyJSON

func (v Badge2492344257View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Badge2492344257View) UnmarshalEasyJSON

func (v *Badge2492344257View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Badge2492344257Views

type Badge2492344257Views []*Badge2492344257View

func NewBadge2492344257Views

func NewBadge2492344257Views(es []*ent.Badge) Badge2492344257Views

func (Badge2492344257Views) MarshalEasyJSON

func (v Badge2492344257Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Badge2492344257Views) UnmarshalEasyJSON

func (v *Badge2492344257Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type BadgeCreateRequest

type BadgeCreateRequest struct {
	Color    *badge.Color    `json:"color"`
	Material *badge.Material `json:"material"`
	Wearer   *int            `json:"wearer"`
}

Payload of a ent.Badge create request.

func (BadgeCreateRequest) MarshalEasyJSON

func (v BadgeCreateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*BadgeCreateRequest) UnmarshalEasyJSON

func (v *BadgeCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type BadgeHandler

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

BadgeHandler handles http crud operations on ent.Badge.

func NewBadgeHandler

func NewBadgeHandler(c *ent.Client, l *zap.Logger) *BadgeHandler

func (BadgeHandler) Create

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

Create creates a new ent.Badge and stores it in the database.

func (BadgeHandler) Delete

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

Delete removes a ent.Badge from the database.

func (*BadgeHandler) List

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

Read fetches the ent.Badge identified by a given url-parameter from the database and returns it to the client.

func (*BadgeHandler) MountCreateRoute

func (h *BadgeHandler) MountCreateRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) MountDeleteRoute

func (h *BadgeHandler) MountDeleteRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) MountListRoute

func (h *BadgeHandler) MountListRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) MountReadRoute

func (h *BadgeHandler) MountReadRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) MountRoutes

func (h *BadgeHandler) MountRoutes(r chi.Router)

func (*BadgeHandler) MountUpdateRoute

func (h *BadgeHandler) MountUpdateRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) MountWearerRoute

func (h *BadgeHandler) MountWearerRoute(r chi.Router) *BadgeHandler

func (*BadgeHandler) Read

func (h *BadgeHandler) Read(w http.ResponseWriter, r *http.Request)

Read fetches the ent.Badge identified by a given url-parameter from the database and renders it to the client.

func (BadgeHandler) Update

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

Update updates a given ent.Badge and saves the changes to the database.

func (BadgeHandler) Wearer

func (h BadgeHandler) Wearer(w http.ResponseWriter, r *http.Request)

Wearer fetches the ent.wearer attached to the ent.Badge identified by a given url-parameter from the database and renders it to the client.

type BadgeUpdateRequest

type BadgeUpdateRequest struct {
	Color    *badge.Color    `json:"color"`
	Material *badge.Material `json:"material"`
	Wearer   *int            `json:"wearer"`
}

Payload of a ent.Badge update request.

func (BadgeUpdateRequest) MarshalEasyJSON

func (v BadgeUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*BadgeUpdateRequest) UnmarshalEasyJSON

func (v *BadgeUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type ErrResponse

type ErrResponse struct {
	Code   int         `json:"code"`             // http response status code
	Status string      `json:"status"`           // user-level status message
	Errors interface{} `json:"errors,omitempty"` // application-level error
}

Basic HTTP Error Response

func (ErrResponse) MarshalEasyJSON

func (v ErrResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrResponse) MarshalToHTTPResponseWriter

func (e ErrResponse) MarshalToHTTPResponseWriter(w http.ResponseWriter) (int, error)

func (*ErrResponse) UnmarshalEasyJSON

func (v *ErrResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet3217017920View

type Pet3217017920View struct {
	ID         int                      `json:"id,omitempty"`
	Height     int                      `json:"height,omitempty"`
	Weight     float64                  `json:"weight,omitempty"`
	Castrated  bool                     `json:"castrated,omitempty"`
	Name       string                   `json:"name,omitempty"`
	Birthday   time.Time                `json:"birthday,omitempty"`
	Nicknames  []string                 `json:"nicknames,omitempty"`
	Sex        pet.Sex                  `json:"sex,omitempty"`
	Chip       uuid.UUID                `json:"chip,omitempty"`
	Badge      *Badge2492344257View     `json:"badge,omitempty"`
	Protege    *Pet340207500View        `json:"protege,omitempty"`
	Spouse     *Pet340207500View        `json:"spouse,omitempty"`
	Toys       Toy36157710Views         `json:"toys,omitempty"`
	Parent     *Pet340207500View        `json:"parent,omitempty"`
	PlayGroups PlayGroup3432834655Views `json:"play_groups,omitempty"`
	Friends    Pet340207500Views        `json:"friends,omitempty"`
}

Pet3217017920View represents the data serialized for the following serialization group combinations: [pet:list pet:read] [pet:read]

func NewPet3217017920View

func NewPet3217017920View(e *ent.Pet) *Pet3217017920View

func (Pet3217017920View) MarshalEasyJSON

func (v Pet3217017920View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet3217017920View) UnmarshalEasyJSON

func (v *Pet3217017920View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet3217017920Views

type Pet3217017920Views []*Pet3217017920View

func NewPet3217017920Views

func NewPet3217017920Views(es []*ent.Pet) Pet3217017920Views

func (Pet3217017920Views) MarshalEasyJSON

func (v Pet3217017920Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet3217017920Views) UnmarshalEasyJSON

func (v *Pet3217017920Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet340207500View

type Pet340207500View struct {
	ID        int       `json:"id,omitempty"`
	Height    int       `json:"height,omitempty"`
	Weight    float64   `json:"weight,omitempty"`
	Castrated bool      `json:"castrated,omitempty"`
	Name      string    `json:"name,omitempty"`
	Birthday  time.Time `json:"birthday,omitempty"`
	Nicknames []string  `json:"nicknames,omitempty"`
	Sex       pet.Sex   `json:"sex,omitempty"`
	Chip      uuid.UUID `json:"chip,omitempty"`
}

Pet340207500View represents the data serialized for the following serialization group combinations: []

func NewPet340207500View

func NewPet340207500View(e *ent.Pet) *Pet340207500View

func (Pet340207500View) MarshalEasyJSON

func (v Pet340207500View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet340207500View) UnmarshalEasyJSON

func (v *Pet340207500View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet340207500Views

type Pet340207500Views []*Pet340207500View

func NewPet340207500Views

func NewPet340207500Views(es []*ent.Pet) Pet340207500Views

func (Pet340207500Views) MarshalEasyJSON

func (v Pet340207500Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet340207500Views) UnmarshalEasyJSON

func (v *Pet340207500Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet45794832View

type Pet45794832View struct {
	ID    int                  `json:"id,omitempty"`
	Name  string               `json:"name,omitempty"`
	Sex   pet.Sex              `json:"sex,omitempty"`
	Chip  uuid.UUID            `json:"chip,omitempty"`
	Badge *Badge2492344257View `json:"badge,omitempty"`
}

Pet45794832View represents the data serialized for the following serialization group combinations: [pet:list]

func NewPet45794832View

func NewPet45794832View(e *ent.Pet) *Pet45794832View

func (Pet45794832View) MarshalEasyJSON

func (v Pet45794832View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet45794832View) UnmarshalEasyJSON

func (v *Pet45794832View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Pet45794832Views

type Pet45794832Views []*Pet45794832View

func NewPet45794832Views

func NewPet45794832Views(es []*ent.Pet) Pet45794832Views

func (Pet45794832Views) MarshalEasyJSON

func (v Pet45794832Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Pet45794832Views) UnmarshalEasyJSON

func (v *Pet45794832Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PetCreateRequest

type PetCreateRequest struct {
	Height     *int        `json:"height"`
	Weight     *float64    `json:"weight"`
	Castrated  *bool       `json:"castrated"`
	Name       *string     `json:"name"`
	Birthday   *time.Time  `json:"birthday"`
	Nicknames  *[]string   `json:"nicknames"`
	Sex        *pet.Sex    `json:"sex"`
	Chip       *uuid.UUID  `json:"chip"`
	Badge      *uint32     `json:"badge"`
	Protege    *int        `json:"protege"`
	Mentor     *int        `json:"mentor"`
	Spouse     *int        `json:"spouse"`
	Toys       []uuid.UUID `json:"toys"`
	Parent     *int        `json:"parent"`
	Children   []int       `json:"children"`
	PlayGroups []int       `json:"play_groups"`
	Friends    []int       `json:"friends"`
}

Payload of a ent.Pet create request.

func (PetCreateRequest) MarshalEasyJSON

func (v PetCreateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PetCreateRequest) UnmarshalEasyJSON

func (v *PetCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PetHandler

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

PetHandler handles http crud operations on ent.Pet.

func NewPetHandler

func NewPetHandler(c *ent.Client, l *zap.Logger) *PetHandler

func (PetHandler) Badge

func (h PetHandler) Badge(w http.ResponseWriter, r *http.Request)

Badge fetches the ent.badge attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Children

func (h PetHandler) Children(w http.ResponseWriter, r *http.Request)

Children fetches the ent.children attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Create

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

Create creates a new ent.Pet and stores it in the database.

func (PetHandler) Delete

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

Delete removes a ent.Pet from the database.

func (PetHandler) Friends

func (h PetHandler) Friends(w http.ResponseWriter, r *http.Request)

Friends fetches the ent.friends attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (*PetHandler) List

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

Read fetches the ent.Pet identified by a given url-parameter from the database and returns it to the client.

func (PetHandler) Mentor

func (h PetHandler) Mentor(w http.ResponseWriter, r *http.Request)

Mentor fetches the ent.mentor attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (*PetHandler) MountBadgeRoute

func (h *PetHandler) MountBadgeRoute(r chi.Router) *PetHandler

func (*PetHandler) MountChildrenRoute

func (h *PetHandler) MountChildrenRoute(r chi.Router) *PetHandler

func (*PetHandler) MountCreateRoute

func (h *PetHandler) MountCreateRoute(r chi.Router) *PetHandler

func (*PetHandler) MountDeleteRoute

func (h *PetHandler) MountDeleteRoute(r chi.Router) *PetHandler

func (*PetHandler) MountFriendsRoute

func (h *PetHandler) MountFriendsRoute(r chi.Router) *PetHandler

func (*PetHandler) MountListRoute

func (h *PetHandler) MountListRoute(r chi.Router) *PetHandler

func (*PetHandler) MountMentorRoute

func (h *PetHandler) MountMentorRoute(r chi.Router) *PetHandler

func (*PetHandler) MountParentRoute

func (h *PetHandler) MountParentRoute(r chi.Router) *PetHandler

func (*PetHandler) MountPlayGroupsRoute

func (h *PetHandler) MountPlayGroupsRoute(r chi.Router) *PetHandler

func (*PetHandler) MountProtegeRoute

func (h *PetHandler) MountProtegeRoute(r chi.Router) *PetHandler

func (*PetHandler) MountReadRoute

func (h *PetHandler) MountReadRoute(r chi.Router) *PetHandler

func (*PetHandler) MountRoutes

func (h *PetHandler) MountRoutes(r chi.Router)

func (*PetHandler) MountSpouseRoute

func (h *PetHandler) MountSpouseRoute(r chi.Router) *PetHandler

func (*PetHandler) MountToysRoute

func (h *PetHandler) MountToysRoute(r chi.Router) *PetHandler

func (*PetHandler) MountUpdateRoute

func (h *PetHandler) MountUpdateRoute(r chi.Router) *PetHandler

func (PetHandler) Parent

func (h PetHandler) Parent(w http.ResponseWriter, r *http.Request)

Parent fetches the ent.parent attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) PlayGroups

func (h PetHandler) PlayGroups(w http.ResponseWriter, r *http.Request)

PlayGroups fetches the ent.play_groups attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Protege

func (h PetHandler) Protege(w http.ResponseWriter, r *http.Request)

Protege fetches the ent.protege attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (*PetHandler) Read

func (h *PetHandler) Read(w http.ResponseWriter, r *http.Request)

Read fetches the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Spouse

func (h PetHandler) Spouse(w http.ResponseWriter, r *http.Request)

Spouse fetches the ent.spouse attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Toys

func (h PetHandler) Toys(w http.ResponseWriter, r *http.Request)

Toys fetches the ent.toys attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.

func (PetHandler) Update

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

Update updates a given ent.Pet and saves the changes to the database.

type PetUpdateRequest

type PetUpdateRequest struct {
	Height     *int        `json:"height"`
	Weight     *float64    `json:"weight"`
	Castrated  *bool       `json:"castrated"`
	Name       *string     `json:"name"`
	Birthday   *time.Time  `json:"birthday"`
	Nicknames  *[]string   `json:"nicknames"`
	Chip       *uuid.UUID  `json:"chip"`
	Badge      *uint32     `json:"badge"`
	Protege    *int        `json:"protege"`
	Mentor     *int        `json:"mentor"`
	Spouse     *int        `json:"spouse"`
	Toys       []uuid.UUID `json:"toys"`
	Parent     *int        `json:"parent"`
	Children   []int       `json:"children"`
	PlayGroups []int       `json:"play_groups"`
	Friends    []int       `json:"friends"`
}

Payload of a ent.Pet update request.

func (PetUpdateRequest) MarshalEasyJSON

func (v PetUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PetUpdateRequest) UnmarshalEasyJSON

func (v *PetUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PlayGroup3432834655View

type PlayGroup3432834655View struct {
	ID          int               `json:"id,omitempty"`
	Title       string            `json:"title,omitempty"`
	Description string            `json:"description,omitempty"`
	Weekday     playgroup.Weekday `json:"weekday,omitempty"`
}

PlayGroup3432834655View represents the data serialized for the following serialization group combinations: [] [pet:list pet:read] [pet:read] [pet:list]

func NewPlayGroup3432834655View

func NewPlayGroup3432834655View(e *ent.PlayGroup) *PlayGroup3432834655View

func (PlayGroup3432834655View) MarshalEasyJSON

func (v PlayGroup3432834655View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PlayGroup3432834655View) UnmarshalEasyJSON

func (v *PlayGroup3432834655View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PlayGroup3432834655Views

type PlayGroup3432834655Views []*PlayGroup3432834655View

func NewPlayGroup3432834655Views

func NewPlayGroup3432834655Views(es []*ent.PlayGroup) PlayGroup3432834655Views

func (PlayGroup3432834655Views) MarshalEasyJSON

func (v PlayGroup3432834655Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PlayGroup3432834655Views) UnmarshalEasyJSON

func (v *PlayGroup3432834655Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PlayGroupCreateRequest

type PlayGroupCreateRequest struct {
	Title        *string            `json:"title"`
	Description  *string            `json:"description"`
	Weekday      *playgroup.Weekday `json:"weekday"`
	Participants []int              `json:"participants"`
}

Payload of a ent.PlayGroup create request.

func (PlayGroupCreateRequest) MarshalEasyJSON

func (v PlayGroupCreateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PlayGroupCreateRequest) UnmarshalEasyJSON

func (v *PlayGroupCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type PlayGroupHandler

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

PlayGroupHandler handles http crud operations on ent.PlayGroup.

func NewPlayGroupHandler

func NewPlayGroupHandler(c *ent.Client, l *zap.Logger) *PlayGroupHandler

func (PlayGroupHandler) Create

Create creates a new ent.PlayGroup and stores it in the database.

func (PlayGroupHandler) Delete

Delete removes a ent.PlayGroup from the database.

func (*PlayGroupHandler) List

Read fetches the ent.PlayGroup identified by a given url-parameter from the database and returns it to the client.

func (*PlayGroupHandler) MountCreateRoute

func (h *PlayGroupHandler) MountCreateRoute(r chi.Router) *PlayGroupHandler

func (*PlayGroupHandler) MountDeleteRoute

func (h *PlayGroupHandler) MountDeleteRoute(r chi.Router) *PlayGroupHandler

func (*PlayGroupHandler) MountListRoute

func (h *PlayGroupHandler) MountListRoute(r chi.Router) *PlayGroupHandler

func (*PlayGroupHandler) MountParticipantsRoute

func (h *PlayGroupHandler) MountParticipantsRoute(r chi.Router) *PlayGroupHandler

func (*PlayGroupHandler) MountReadRoute

func (h *PlayGroupHandler) MountReadRoute(r chi.Router) *PlayGroupHandler

func (*PlayGroupHandler) MountRoutes

func (h *PlayGroupHandler) MountRoutes(r chi.Router)

func (*PlayGroupHandler) MountUpdateRoute

func (h *PlayGroupHandler) MountUpdateRoute(r chi.Router) *PlayGroupHandler

func (PlayGroupHandler) Participants

func (h PlayGroupHandler) Participants(w http.ResponseWriter, r *http.Request)

Participants fetches the ent.participants attached to the ent.PlayGroup identified by a given url-parameter from the database and renders it to the client.

func (*PlayGroupHandler) Read

Read fetches the ent.PlayGroup identified by a given url-parameter from the database and renders it to the client.

func (PlayGroupHandler) Update

Update updates a given ent.PlayGroup and saves the changes to the database.

type PlayGroupUpdateRequest

type PlayGroupUpdateRequest struct {
	Title        *string            `json:"title"`
	Description  *string            `json:"description"`
	Weekday      *playgroup.Weekday `json:"weekday"`
	Participants []int              `json:"participants"`
}

Payload of a ent.PlayGroup update request.

func (PlayGroupUpdateRequest) MarshalEasyJSON

func (v PlayGroupUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*PlayGroupUpdateRequest) UnmarshalEasyJSON

func (v *PlayGroupUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Toy36157710View

type Toy36157710View struct {
	ID       uuid.UUID    `json:"id,omitempty"`
	Color    toy.Color    `json:"color,omitempty"`
	Material toy.Material `json:"material,omitempty"`
	Title    string       `json:"title,omitempty"`
}

Toy36157710View represents the data serialized for the following serialization group combinations: [] [pet:list pet:read] [pet:read] [pet:list]

func NewToy36157710View

func NewToy36157710View(e *ent.Toy) *Toy36157710View

func (Toy36157710View) MarshalEasyJSON

func (v Toy36157710View) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Toy36157710View) UnmarshalEasyJSON

func (v *Toy36157710View) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Toy36157710Views

type Toy36157710Views []*Toy36157710View

func NewToy36157710Views

func NewToy36157710Views(es []*ent.Toy) Toy36157710Views

func (Toy36157710Views) MarshalEasyJSON

func (v Toy36157710Views) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*Toy36157710Views) UnmarshalEasyJSON

func (v *Toy36157710Views) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type ToyCreateRequest

type ToyCreateRequest struct {
	Color    *toy.Color    `json:"color"`
	Material *toy.Material `json:"material"`
	Title    *string       `json:"title"`
	Owner    *int          `json:"owner"`
}

Payload of a ent.Toy create request.

func (ToyCreateRequest) MarshalEasyJSON

func (v ToyCreateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*ToyCreateRequest) UnmarshalEasyJSON

func (v *ToyCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type ToyHandler

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

ToyHandler handles http crud operations on ent.Toy.

func NewToyHandler

func NewToyHandler(c *ent.Client, l *zap.Logger) *ToyHandler

func (ToyHandler) Create

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

Create creates a new ent.Toy and stores it in the database.

func (ToyHandler) Delete

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

Delete removes a ent.Toy from the database.

func (*ToyHandler) List

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

Read fetches the ent.Toy identified by a given url-parameter from the database and returns it to the client.

func (*ToyHandler) MountCreateRoute

func (h *ToyHandler) MountCreateRoute(r chi.Router) *ToyHandler

func (*ToyHandler) MountDeleteRoute

func (h *ToyHandler) MountDeleteRoute(r chi.Router) *ToyHandler

func (*ToyHandler) MountListRoute

func (h *ToyHandler) MountListRoute(r chi.Router) *ToyHandler

func (*ToyHandler) MountOwnerRoute

func (h *ToyHandler) MountOwnerRoute(r chi.Router) *ToyHandler

func (*ToyHandler) MountReadRoute

func (h *ToyHandler) MountReadRoute(r chi.Router) *ToyHandler

func (*ToyHandler) MountRoutes

func (h *ToyHandler) MountRoutes(r chi.Router)

func (*ToyHandler) MountUpdateRoute

func (h *ToyHandler) MountUpdateRoute(r chi.Router) *ToyHandler

func (ToyHandler) Owner

func (h ToyHandler) Owner(w http.ResponseWriter, r *http.Request)

Owner fetches the ent.owner attached to the ent.Toy identified by a given url-parameter from the database and renders it to the client.

func (*ToyHandler) Read

func (h *ToyHandler) Read(w http.ResponseWriter, r *http.Request)

Read fetches the ent.Toy identified by a given url-parameter from the database and renders it to the client.

func (ToyHandler) Update

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

Update updates a given ent.Toy and saves the changes to the database.

type ToyUpdateRequest

type ToyUpdateRequest struct {
	Color    *toy.Color    `json:"color"`
	Material *toy.Material `json:"material"`
	Title    *string       `json:"title"`
	Owner    *int          `json:"owner"`
}

Payload of a ent.Toy update request.

func (ToyUpdateRequest) MarshalEasyJSON

func (v ToyUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*ToyUpdateRequest) UnmarshalEasyJSON

func (v *ToyUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

Jump to

Keyboard shortcuts

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