Documentation ¶
Index ¶
- func BadRequest(w http.ResponseWriter, msg interface{}) (int, error)
- func Conflict(w http.ResponseWriter, msg interface{}) (int, error)
- func Forbidden(w http.ResponseWriter, msg interface{}) (int, error)
- func InternalServerError(w http.ResponseWriter, msg interface{}) (int, error)
- func MountRoutes(c *ent.Client, l *zap.Logger, r chi.Router)
- func NewHandler(c *ent.Client, l *zap.Logger) chi.Router
- func NotFound(w http.ResponseWriter, msg interface{}) (int, error)
- func Unauthorized(w http.ResponseWriter, msg interface{}) (int, error)
- type Category4094953247View
- type Category4094953247Views
- type CategoryCreateRequest
- type CategoryHandler
- func (h CategoryHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h CategoryHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *CategoryHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *CategoryHandler) MountCreateRoute(r chi.Router) *CategoryHandler
- func (h *CategoryHandler) MountDeleteRoute(r chi.Router) *CategoryHandler
- func (h *CategoryHandler) MountListRoute(r chi.Router) *CategoryHandler
- func (h *CategoryHandler) MountPetsRoute(r chi.Router) *CategoryHandler
- func (h *CategoryHandler) MountReadRoute(r chi.Router) *CategoryHandler
- func (h *CategoryHandler) MountRoutes(r chi.Router)
- func (h *CategoryHandler) MountUpdateRoute(r chi.Router) *CategoryHandler
- func (h CategoryHandler) Pets(w http.ResponseWriter, r *http.Request)
- func (h *CategoryHandler) Read(w http.ResponseWriter, r *http.Request)
- func (h CategoryHandler) Update(w http.ResponseWriter, r *http.Request)
- type CategoryUpdateRequest
- type Collar1522160880View
- type Collar1522160880Views
- type CollarCreateRequest
- type CollarHandler
- func (h CollarHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h CollarHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *CollarHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *CollarHandler) MountCreateRoute(r chi.Router) *CollarHandler
- func (h *CollarHandler) MountDeleteRoute(r chi.Router) *CollarHandler
- func (h *CollarHandler) MountListRoute(r chi.Router) *CollarHandler
- func (h *CollarHandler) MountPetRoute(r chi.Router) *CollarHandler
- func (h *CollarHandler) MountReadRoute(r chi.Router) *CollarHandler
- func (h *CollarHandler) MountRoutes(r chi.Router)
- func (h *CollarHandler) MountUpdateRoute(r chi.Router) *CollarHandler
- func (h CollarHandler) Pet(w http.ResponseWriter, r *http.Request)
- func (h *CollarHandler) Read(w http.ResponseWriter, r *http.Request)
- func (h CollarHandler) Update(w http.ResponseWriter, r *http.Request)
- type CollarUpdateRequest
- type ErrResponse
- type Media1941033838View
- type Media1941033838Views
- type MediaCreateRequest
- type MediaHandler
- func (h MediaHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h MediaHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *MediaHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *MediaHandler) MountCreateRoute(r chi.Router) *MediaHandler
- func (h *MediaHandler) MountDeleteRoute(r chi.Router) *MediaHandler
- func (h *MediaHandler) MountListRoute(r chi.Router) *MediaHandler
- func (h *MediaHandler) MountReadRoute(r chi.Router) *MediaHandler
- func (h *MediaHandler) MountRoutes(r chi.Router)
- func (h *MediaHandler) MountUpdateRoute(r chi.Router) *MediaHandler
- func (h *MediaHandler) Read(w http.ResponseWriter, r *http.Request)
- func (h MediaHandler) Update(w http.ResponseWriter, r *http.Request)
- type MediaUpdateRequest
- type Owner139708381View
- type Owner139708381Views
- type OwnerCreateRequest
- type OwnerHandler
- func (h OwnerHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h OwnerHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *OwnerHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *OwnerHandler) MountCreateRoute(r chi.Router) *OwnerHandler
- func (h *OwnerHandler) MountDeleteRoute(r chi.Router) *OwnerHandler
- func (h *OwnerHandler) MountListRoute(r chi.Router) *OwnerHandler
- func (h *OwnerHandler) MountPetsRoute(r chi.Router) *OwnerHandler
- func (h *OwnerHandler) MountReadRoute(r chi.Router) *OwnerHandler
- func (h *OwnerHandler) MountRoutes(r chi.Router)
- func (h *OwnerHandler) MountUpdateRoute(r chi.Router) *OwnerHandler
- func (h OwnerHandler) Pets(w http.ResponseWriter, r *http.Request)
- func (h *OwnerHandler) Read(w http.ResponseWriter, r *http.Request)
- func (h OwnerHandler) Update(w http.ResponseWriter, r *http.Request)
- type OwnerUpdateRequest
- type Pet1876743790View
- type Pet1876743790Views
- type Pet359800019View
- type Pet359800019Views
- type PetCreateRequest
- type PetHandler
- func (h PetHandler) Categories(w http.ResponseWriter, r *http.Request)
- func (h PetHandler) Collar(w http.ResponseWriter, r *http.Request)
- func (h PetHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h PetHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h PetHandler) Friends(w http.ResponseWriter, r *http.Request)
- func (h *PetHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *PetHandler) MountCategoriesRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountCollarRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountCreateRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountDeleteRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountFriendsRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountListRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountOwnerRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountReadRoute(r chi.Router) *PetHandler
- func (h *PetHandler) MountRoutes(r chi.Router)
- func (h *PetHandler) MountUpdateRoute(r chi.Router) *PetHandler
- func (h PetHandler) Owner(w http.ResponseWriter, r *http.Request)
- func (h *PetHandler) Read(w http.ResponseWriter, r *http.Request)
- func (h PetHandler) Update(w http.ResponseWriter, r *http.Request)
- type PetUpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, msg interface{}) (int, error)
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, msg interface{}) (int, error)
func MountRoutes ¶
MountRoutes mounts all generated routes on the given router.
func NewHandler ¶
NewHandler returns a ready to use handler with all generated endpoints mounted.
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, msg interface{}) (int, error)
Types ¶
type Category4094953247View ¶
type Category4094953247View struct { ID uint64 `json:"id,omitempty"` Name string `json:"name,omitempty"` }
Category4094953247View represents the data serialized for the following serialization group combinations: [] [owner pet pet:owner]
func NewCategory4094953247View ¶
func NewCategory4094953247View(e *ent.Category) *Category4094953247View
func (Category4094953247View) MarshalEasyJSON ¶
func (v Category4094953247View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Category4094953247View) UnmarshalEasyJSON ¶
func (v *Category4094953247View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Category4094953247Views ¶
type Category4094953247Views []*Category4094953247View
func NewCategory4094953247Views ¶
func NewCategory4094953247Views(es []*ent.Category) Category4094953247Views
func (Category4094953247Views) MarshalEasyJSON ¶
func (v Category4094953247Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Category4094953247Views) UnmarshalEasyJSON ¶
func (v *Category4094953247Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type CategoryCreateRequest ¶
Payload of a ent.Category create request.
func (CategoryCreateRequest) MarshalEasyJSON ¶
func (v CategoryCreateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CategoryCreateRequest) UnmarshalEasyJSON ¶
func (v *CategoryCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type CategoryHandler ¶
type CategoryHandler struct {
// contains filtered or unexported fields
}
CategoryHandler handles http crud operations on ent.Category.
func NewCategoryHandler ¶
func NewCategoryHandler(c *ent.Client, l *zap.Logger) *CategoryHandler
func (CategoryHandler) Create ¶
func (h CategoryHandler) Create(w http.ResponseWriter, r *http.Request)
Create creates a new ent.Category and stores it in the database.
func (CategoryHandler) Delete ¶
func (h CategoryHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes a ent.Category from the database.
func (*CategoryHandler) List ¶
func (h *CategoryHandler) List(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Category identified by a given url-parameter from the database and returns it to the client.
func (*CategoryHandler) MountCreateRoute ¶
func (h *CategoryHandler) MountCreateRoute(r chi.Router) *CategoryHandler
func (*CategoryHandler) MountDeleteRoute ¶
func (h *CategoryHandler) MountDeleteRoute(r chi.Router) *CategoryHandler
func (*CategoryHandler) MountListRoute ¶
func (h *CategoryHandler) MountListRoute(r chi.Router) *CategoryHandler
func (*CategoryHandler) MountPetsRoute ¶
func (h *CategoryHandler) MountPetsRoute(r chi.Router) *CategoryHandler
func (*CategoryHandler) MountReadRoute ¶
func (h *CategoryHandler) MountReadRoute(r chi.Router) *CategoryHandler
func (*CategoryHandler) MountRoutes ¶
func (h *CategoryHandler) MountRoutes(r chi.Router)
func (*CategoryHandler) MountUpdateRoute ¶
func (h *CategoryHandler) MountUpdateRoute(r chi.Router) *CategoryHandler
func (CategoryHandler) Pets ¶
func (h CategoryHandler) Pets(w http.ResponseWriter, r *http.Request)
Pets fetches the ent.pets attached to the ent.Category identified by a given url-parameter from the database and renders it to the client.
func (*CategoryHandler) Read ¶
func (h *CategoryHandler) Read(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Category identified by a given url-parameter from the database and renders it to the client.
func (CategoryHandler) Update ¶
func (h CategoryHandler) Update(w http.ResponseWriter, r *http.Request)
Update updates a given ent.Category and saves the changes to the database.
type CategoryUpdateRequest ¶
Payload of a ent.Category update request.
func (CategoryUpdateRequest) MarshalEasyJSON ¶
func (v CategoryUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CategoryUpdateRequest) UnmarshalEasyJSON ¶
func (v *CategoryUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Collar1522160880View ¶
type Collar1522160880View struct { ID int `json:"id,omitempty"` Color collar.Color `json:"color,omitempty"` }
Collar1522160880View represents the data serialized for the following serialization group combinations: [] [owner pet pet:owner]
func NewCollar1522160880View ¶
func NewCollar1522160880View(e *ent.Collar) *Collar1522160880View
func (Collar1522160880View) MarshalEasyJSON ¶
func (v Collar1522160880View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Collar1522160880View) UnmarshalEasyJSON ¶
func (v *Collar1522160880View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Collar1522160880Views ¶
type Collar1522160880Views []*Collar1522160880View
func NewCollar1522160880Views ¶
func NewCollar1522160880Views(es []*ent.Collar) Collar1522160880Views
func (Collar1522160880Views) MarshalEasyJSON ¶
func (v Collar1522160880Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Collar1522160880Views) UnmarshalEasyJSON ¶
func (v *Collar1522160880Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type CollarCreateRequest ¶
Payload of a ent.Collar create request.
func (CollarCreateRequest) MarshalEasyJSON ¶
func (v CollarCreateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CollarCreateRequest) UnmarshalEasyJSON ¶
func (v *CollarCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type CollarHandler ¶
type CollarHandler struct {
// contains filtered or unexported fields
}
CollarHandler handles http crud operations on ent.Collar.
func NewCollarHandler ¶
func NewCollarHandler(c *ent.Client, l *zap.Logger) *CollarHandler
func (CollarHandler) Create ¶
func (h CollarHandler) Create(w http.ResponseWriter, r *http.Request)
Create creates a new ent.Collar and stores it in the database.
func (CollarHandler) Delete ¶
func (h CollarHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes a ent.Collar from the database.
func (*CollarHandler) List ¶
func (h *CollarHandler) List(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Collar identified by a given url-parameter from the database and returns it to the client.
func (*CollarHandler) MountCreateRoute ¶
func (h *CollarHandler) MountCreateRoute(r chi.Router) *CollarHandler
func (*CollarHandler) MountDeleteRoute ¶
func (h *CollarHandler) MountDeleteRoute(r chi.Router) *CollarHandler
func (*CollarHandler) MountListRoute ¶
func (h *CollarHandler) MountListRoute(r chi.Router) *CollarHandler
func (*CollarHandler) MountPetRoute ¶
func (h *CollarHandler) MountPetRoute(r chi.Router) *CollarHandler
func (*CollarHandler) MountReadRoute ¶
func (h *CollarHandler) MountReadRoute(r chi.Router) *CollarHandler
func (*CollarHandler) MountRoutes ¶
func (h *CollarHandler) MountRoutes(r chi.Router)
func (*CollarHandler) MountUpdateRoute ¶
func (h *CollarHandler) MountUpdateRoute(r chi.Router) *CollarHandler
func (CollarHandler) Pet ¶
func (h CollarHandler) Pet(w http.ResponseWriter, r *http.Request)
Pet fetches the ent.pet attached to the ent.Collar identified by a given url-parameter from the database and renders it to the client.
func (*CollarHandler) Read ¶
func (h *CollarHandler) Read(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Collar identified by a given url-parameter from the database and renders it to the client.
func (CollarHandler) Update ¶
func (h CollarHandler) Update(w http.ResponseWriter, r *http.Request)
Update updates a given ent.Collar and saves the changes to the database.
type CollarUpdateRequest ¶
Payload of a ent.Collar update request.
func (CollarUpdateRequest) MarshalEasyJSON ¶
func (v CollarUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*CollarUpdateRequest) UnmarshalEasyJSON ¶
func (v *CollarUpdateRequest) 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 Media1941033838View ¶
type Media1941033838View struct {
ID int `json:"id,omitempty"`
}
Media1941033838View represents the data serialized for the following serialization group combinations: [] [owner pet pet:owner]
func NewMedia1941033838View ¶
func NewMedia1941033838View(e *ent.Media) *Media1941033838View
func (Media1941033838View) MarshalEasyJSON ¶
func (v Media1941033838View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Media1941033838View) UnmarshalEasyJSON ¶
func (v *Media1941033838View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Media1941033838Views ¶
type Media1941033838Views []*Media1941033838View
func NewMedia1941033838Views ¶
func NewMedia1941033838Views(es []*ent.Media) Media1941033838Views
func (Media1941033838Views) MarshalEasyJSON ¶
func (v Media1941033838Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Media1941033838Views) UnmarshalEasyJSON ¶
func (v *Media1941033838Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type MediaCreateRequest ¶
type MediaCreateRequest struct { }
Payload of a ent.Media create request.
func (MediaCreateRequest) MarshalEasyJSON ¶
func (v MediaCreateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*MediaCreateRequest) UnmarshalEasyJSON ¶
func (v *MediaCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type MediaHandler ¶
type MediaHandler struct {
// contains filtered or unexported fields
}
MediaHandler handles http crud operations on ent.Media.
func NewMediaHandler ¶
func NewMediaHandler(c *ent.Client, l *zap.Logger) *MediaHandler
func (MediaHandler) Create ¶
func (h MediaHandler) Create(w http.ResponseWriter, r *http.Request)
Create creates a new ent.Media and stores it in the database.
func (MediaHandler) Delete ¶
func (h MediaHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes a ent.Media from the database.
func (*MediaHandler) List ¶
func (h *MediaHandler) List(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Media identified by a given url-parameter from the database and returns it to the client.
func (*MediaHandler) MountCreateRoute ¶
func (h *MediaHandler) MountCreateRoute(r chi.Router) *MediaHandler
func (*MediaHandler) MountDeleteRoute ¶
func (h *MediaHandler) MountDeleteRoute(r chi.Router) *MediaHandler
func (*MediaHandler) MountListRoute ¶
func (h *MediaHandler) MountListRoute(r chi.Router) *MediaHandler
func (*MediaHandler) MountReadRoute ¶
func (h *MediaHandler) MountReadRoute(r chi.Router) *MediaHandler
func (*MediaHandler) MountRoutes ¶
func (h *MediaHandler) MountRoutes(r chi.Router)
func (*MediaHandler) MountUpdateRoute ¶
func (h *MediaHandler) MountUpdateRoute(r chi.Router) *MediaHandler
func (*MediaHandler) Read ¶
func (h *MediaHandler) Read(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Media identified by a given url-parameter from the database and renders it to the client.
func (MediaHandler) Update ¶
func (h MediaHandler) Update(w http.ResponseWriter, r *http.Request)
Update updates a given ent.Media and saves the changes to the database.
type MediaUpdateRequest ¶
type MediaUpdateRequest struct { }
Payload of a ent.Media update request.
func (MediaUpdateRequest) MarshalEasyJSON ¶
func (v MediaUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*MediaUpdateRequest) UnmarshalEasyJSON ¶
func (v *MediaUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Owner139708381View ¶
type Owner139708381View struct { ID uuid.UUID `json:"id,omitempty"` Name string `json:"name,omitempty"` Age int `json:"age,omitempty"` }
Owner139708381View represents the data serialized for the following serialization group combinations: [] [owner pet pet:owner]
func NewOwner139708381View ¶
func NewOwner139708381View(e *ent.Owner) *Owner139708381View
func (Owner139708381View) MarshalEasyJSON ¶
func (v Owner139708381View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Owner139708381View) UnmarshalEasyJSON ¶
func (v *Owner139708381View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Owner139708381Views ¶
type Owner139708381Views []*Owner139708381View
func NewOwner139708381Views ¶
func NewOwner139708381Views(es []*ent.Owner) Owner139708381Views
func (Owner139708381Views) MarshalEasyJSON ¶
func (v Owner139708381Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Owner139708381Views) UnmarshalEasyJSON ¶
func (v *Owner139708381Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type OwnerCreateRequest ¶
type OwnerCreateRequest struct { Name *string `json:"name"` Age *int `json:"age"` Pets []string `json:"pets"` }
Payload of a ent.Owner create request.
func (OwnerCreateRequest) MarshalEasyJSON ¶
func (v OwnerCreateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*OwnerCreateRequest) UnmarshalEasyJSON ¶
func (v *OwnerCreateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type OwnerHandler ¶
type OwnerHandler struct {
// contains filtered or unexported fields
}
OwnerHandler handles http crud operations on ent.Owner.
func NewOwnerHandler ¶
func NewOwnerHandler(c *ent.Client, l *zap.Logger) *OwnerHandler
func (OwnerHandler) Create ¶
func (h OwnerHandler) Create(w http.ResponseWriter, r *http.Request)
Create creates a new ent.Owner and stores it in the database.
func (OwnerHandler) Delete ¶
func (h OwnerHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete removes a ent.Owner from the database.
func (*OwnerHandler) List ¶
func (h *OwnerHandler) List(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Owner identified by a given url-parameter from the database and returns it to the client.
func (*OwnerHandler) MountCreateRoute ¶
func (h *OwnerHandler) MountCreateRoute(r chi.Router) *OwnerHandler
func (*OwnerHandler) MountDeleteRoute ¶
func (h *OwnerHandler) MountDeleteRoute(r chi.Router) *OwnerHandler
func (*OwnerHandler) MountListRoute ¶
func (h *OwnerHandler) MountListRoute(r chi.Router) *OwnerHandler
func (*OwnerHandler) MountPetsRoute ¶
func (h *OwnerHandler) MountPetsRoute(r chi.Router) *OwnerHandler
func (*OwnerHandler) MountReadRoute ¶
func (h *OwnerHandler) MountReadRoute(r chi.Router) *OwnerHandler
func (*OwnerHandler) MountRoutes ¶
func (h *OwnerHandler) MountRoutes(r chi.Router)
func (*OwnerHandler) MountUpdateRoute ¶
func (h *OwnerHandler) MountUpdateRoute(r chi.Router) *OwnerHandler
func (OwnerHandler) Pets ¶
func (h OwnerHandler) Pets(w http.ResponseWriter, r *http.Request)
Pets fetches the ent.pets attached to the ent.Owner identified by a given url-parameter from the database and renders it to the client.
func (*OwnerHandler) Read ¶
func (h *OwnerHandler) Read(w http.ResponseWriter, r *http.Request)
Read fetches the ent.Owner identified by a given url-parameter from the database and renders it to the client.
func (OwnerHandler) Update ¶
func (h OwnerHandler) Update(w http.ResponseWriter, r *http.Request)
Update updates a given ent.Owner and saves the changes to the database.
type OwnerUpdateRequest ¶
type OwnerUpdateRequest struct { Name *string `json:"name"` Age *int `json:"age"` Pets []string `json:"pets"` }
Payload of a ent.Owner update request.
func (OwnerUpdateRequest) MarshalEasyJSON ¶
func (v OwnerUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*OwnerUpdateRequest) UnmarshalEasyJSON ¶
func (v *OwnerUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Pet1876743790View ¶
type Pet1876743790View struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Age int `json:"age,omitempty"` Owner *Owner139708381View `json:"owner,omitempty"` Friends Pet359800019Views `json:"friends,omitempty"` }
Pet1876743790View represents the data serialized for the following serialization group combinations: [owner pet pet:owner]
func NewPet1876743790View ¶
func NewPet1876743790View(e *ent.Pet) *Pet1876743790View
func (Pet1876743790View) MarshalEasyJSON ¶
func (v Pet1876743790View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Pet1876743790View) UnmarshalEasyJSON ¶
func (v *Pet1876743790View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Pet1876743790Views ¶
type Pet1876743790Views []*Pet1876743790View
func NewPet1876743790Views ¶
func NewPet1876743790Views(es []*ent.Pet) Pet1876743790Views
func (Pet1876743790Views) MarshalEasyJSON ¶
func (v Pet1876743790Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Pet1876743790Views) UnmarshalEasyJSON ¶
func (v *Pet1876743790Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Pet359800019View ¶
type Pet359800019View struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Age int `json:"age,omitempty"` }
Pet359800019View represents the data serialized for the following serialization group combinations: []
func NewPet359800019View ¶
func NewPet359800019View(e *ent.Pet) *Pet359800019View
func (Pet359800019View) MarshalEasyJSON ¶
func (v Pet359800019View) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Pet359800019View) UnmarshalEasyJSON ¶
func (v *Pet359800019View) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type Pet359800019Views ¶
type Pet359800019Views []*Pet359800019View
func NewPet359800019Views ¶
func NewPet359800019Views(es []*ent.Pet) Pet359800019Views
func (Pet359800019Views) MarshalEasyJSON ¶
func (v Pet359800019Views) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (*Pet359800019Views) UnmarshalEasyJSON ¶
func (v *Pet359800019Views) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
type PetCreateRequest ¶
type PetCreateRequest struct { Name *string `json:"name"` Age *int `json:"age"` Collar *int `json:"collar"` Categories []uint64 `json:"categories"` Owner *uuid.UUID `json:"owner"` Friends []string `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) Categories ¶
func (h PetHandler) Categories(w http.ResponseWriter, r *http.Request)
Categories fetches the ent.categories attached to the ent.Pet identified by a given url-parameter from the database and renders it to the client.
func (PetHandler) Collar ¶
func (h PetHandler) Collar(w http.ResponseWriter, r *http.Request)
Collar fetches the ent.collar 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) MountCategoriesRoute ¶
func (h *PetHandler) MountCategoriesRoute(r chi.Router) *PetHandler
func (*PetHandler) MountCollarRoute ¶
func (h *PetHandler) MountCollarRoute(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) MountOwnerRoute ¶
func (h *PetHandler) MountOwnerRoute(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) MountUpdateRoute ¶
func (h *PetHandler) MountUpdateRoute(r chi.Router) *PetHandler
func (PetHandler) Owner ¶
func (h PetHandler) Owner(w http.ResponseWriter, r *http.Request)
Owner fetches the ent.owner 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) 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 { Name *string `json:"name"` Age *int `json:"age"` Collar *int `json:"collar"` Categories []uint64 `json:"categories"` Owner *uuid.UUID `json:"owner"` Friends []string `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