Documentation
¶
Index ¶
- type Animal
- type AnimalHandler
- type Article
- type ArticleHandler
- type AuthHandler
- type CheckResponse
- type CreateAnimalRequest
- type CreateArticleRequest
- type CreateImageRequest
- type CreatePageRequest
- type DeleteImageRequest
- type GetAnimalRequest
- type GetArticleRequest
- type GetImageRequest
- type GetPageRequest
- type GetUserRequest
- type GetUserResponse
- type ImageData
- type ImageHandler
- type ListAnimalReply
- type ListAnimalRequest
- type ListArticleReply
- type ListArticleRequest
- type ListImageReply
- type ListImageRequest
- type ListPageReply
- type ListPageRequest
- type LoginResponse
- type LogoutRequest
- type LostPasswordRequest
- type Page
- type PageHandler
- type PageLight
- type RenewSessionResponse
- type SetKeyRequest
- type StdPaging
- type UpdateAnimalRequest
- type UpdateArticleRequest
- type UpdatePageRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animal ¶
type Animal struct { ID primitive.ObjectID `json:"id"` Name string `json:"name"` Description string `json:"description"` Birthdate time.Time `json:"birthdate"` Sex model.Sex `json:"sex"` Color string `json:"color"` AdoptionStatus model.AdoptionStatus `json:"adoptionStatus"` Pictures []primitive.ObjectID `json:"pictures"` CreationDate time.Time `json:"creationDate"` UpdateDate time.Time `json:"updateDate"` }
Animal create animal reply
type AnimalHandler ¶
type AnimalHandler interface { CreateAnimal(c echo.Context, req CreateAnimalRequest) (*Animal, error) ListAnimal(c echo.Context, req ListAnimalRequest) (*ListAnimalReply, error) GetAnimal(c echo.Context, req GetAnimalRequest) (*Animal, error) UpdateAnimal(c echo.Context, req UpdateAnimalRequest) (*Animal, error) }
AnimalHandler animal handler
func NewAnimalHandler ¶
func NewAnimalHandler(db *dao.DAO) AnimalHandler
NewAnimalHandler return a new animal handler
type Article ¶
type Article struct { ID primitive.ObjectID `json:"id"` Name string `json:"name"` Content string `json:"content"` Date time.Time `json:"date"` }
Article create article reply
type ArticleHandler ¶
type ArticleHandler interface { CreateArticle(c echo.Context, req CreateArticleRequest) (*Article, error) ListArticle(c echo.Context, req ListArticleRequest) (*ListArticleReply, error) GetArticle(c echo.Context, req GetArticleRequest) (*Article, error) UpdateArticle(c echo.Context, req UpdateArticleRequest) (*Article, error) }
ArticleHandler article handler
func NewArticleHandler ¶
func NewArticleHandler(db *dao.DAO) ArticleHandler
NewArticleHandler return a new article handler
type AuthHandler ¶
type AuthHandler interface { GetUser(c echo.Context, req GetUserRequest) (*GetUserResponse, error) Login(c echo.Context) (*LoginResponse, error) RenewSession(c echo.Context) (*RenewSessionResponse, error) Logout(c echo.Context, req LogoutRequest) error SetKey(c echo.Context, req SetKeyRequest) error LostPassword(c echo.Context, req LostPasswordRequest) error Check(c echo.Context) (*CheckResponse, error) }
AuthHandler authentication handler
func NewAuthHandler ¶
func NewAuthHandler(dao *dao.DAO) AuthHandler
NewAuthHandler return a new animal handler
type CheckResponse ¶
type CheckResponse struct {
Authenticated bool `json:"authenticated"`
}
CheckResponse check response
type CreateAnimalRequest ¶
type CreateAnimalRequest struct { Name string `json:"name"` Description string `json:"description"` Birthdate time.Time `json:"birthdate"` Sex model.Sex `json:"sex"` Color string `json:"color"` AdoptionStatus model.AdoptionStatus `json:"adoptionStatus"` Pictures []primitive.ObjectID `json:"pictures"` }
CreateAnimalRequest create animal request
type CreateArticleRequest ¶
type CreateArticleRequest struct { Name string `json:"name"` Content string `json:"content"` Date time.Time `json:"date"` }
CreateArticleRequest create article request
type CreateImageRequest ¶
type CreateImageRequest struct {
Name string `form:"name"`
}
CreateImageRequest create image request
type CreatePageRequest ¶
type CreatePageRequest struct { Name string `json:"name"` Content string `json:"content"` Priority int `json:"priority"` Category string `json:"category"` }
CreatePageRequest create page request
type DeleteImageRequest ¶
type DeleteImageRequest struct {
ID string `param:"id"`
}
DeleteImageRequest update image request
type GetAnimalRequest ¶
type GetAnimalRequest struct {
ID string `param:"id"`
}
GetAnimalRequest get animal request
type GetArticleRequest ¶
type GetArticleRequest struct {
ID string `param:"id"`
}
GetArticleRequest get article request
type GetImageRequest ¶
type GetImageRequest struct {
ID string `param:"id"`
}
GetImageRequest get image request
type GetPageRequest ¶
type GetPageRequest struct {
ID string `param:"id"`
}
GetPageRequest get page request
type GetUserRequest ¶
type GetUserRequest struct {
Email string `param:"email"`
}
GetUserRequest get seed request
type GetUserResponse ¶
type GetUserResponse struct { ID string `json:"id"` Email string `json:"email"` Seed string `json:"seed"` }
GetUserResponse get seed response
type ImageHandler ¶
type ImageHandler interface { CreateImage(c echo.Context, req CreateImageRequest) (*ImageData, error) ListImage(c echo.Context, req ListImageRequest) (*ListImageReply, error) GetImage(c echo.Context, req GetImageRequest) error GetImageThumbnail(c echo.Context, req GetImageRequest) error DeleteImage(c echo.Context, req DeleteImageRequest) error }
ImageHandler image handler
func NewImageHandler ¶
func NewImageHandler(db *dao.DAO) ImageHandler
NewImageHandler return a new image handler
type ListAnimalReply ¶
ListAnimalReply list animal reply
type ListAnimalRequest ¶
type ListAnimalRequest struct { Name *string `query:"name"` Description *string `query:"description"` Birthdate *time.Time `query:"birthdate"` Sex *model.Sex `query:"sex"` Color *string `query:"color"` AdoptionStatus *model.AdoptionStatus `query:"adoptionStatus"` StdPaging }
ListAnimalRequest list animal request
type ListArticleReply ¶
ListArticleReply list article reply
type ListArticleRequest ¶
ListArticleRequest list article request
type ListImageReply ¶
ListImageReply list image reply
type ListImageRequest ¶
ListImageRequest list image request
type ListPageReply ¶
ListPageReply list page reply
type ListPageRequest ¶
ListPageRequest list page request
type LoginResponse ¶
type LoginResponse struct { SessionID string `json:"sessionId"` Key string `json:"key"` UseBefore string `json:"useBefore"` }
LoginResponse login response
type LogoutRequest ¶
type LogoutRequest struct {
Everywhere bool `query:"everywhere"`
}
LogoutRequest logout request
type LostPasswordRequest ¶
type LostPasswordRequest struct {
Email string `param:"email"`
}
LostPasswordRequest request a renewal password link
type Page ¶
type Page struct { ID primitive.ObjectID `json:"id"` Name string `json:"name"` Content string `json:"content"` Priority int `json:"priority"` Category string `json:"category"` }
Page create page reply
type PageHandler ¶
type PageHandler interface { CreatePage(c echo.Context, req CreatePageRequest) (*Page, error) ListPage(c echo.Context, req ListPageRequest) (*ListPageReply, error) GetPage(c echo.Context, req GetPageRequest) (*Page, error) UpdatePage(c echo.Context, req UpdatePageRequest) (*Page, error) }
PageHandler page handler
func NewPageHandler ¶
func NewPageHandler(db *dao.DAO) PageHandler
NewPageHandler return a new page handler
type PageLight ¶
type PageLight struct { ID primitive.ObjectID `json:"id"` Name string `json:"name"` Priority int `json:"priority"` Category string `json:"category"` }
PageLight list page reply
type RenewSessionResponse ¶
type RenewSessionResponse struct { SessionID string `json:"sessionId"` UseBefore string `json:"useBefore"` }
RenewSessionResponse session renewal response
type SetKeyRequest ¶
type SetKeyRequest struct { Email string `param:"email"` Key string `json:"key"` Token string `json:"token" description:"token used when resetting lost password"` }
SetKeyRequest set key request
type StdPaging ¶
type StdPaging struct { Limit *int64 `json:"limit" query:"limit"` Offset *int64 `json:"offset" query:"offset"` Sort *string `json:"sort" query:"sort"` }
StdPaging containt standard paging information
type UpdateAnimalRequest ¶
type UpdateAnimalRequest struct { ID string `param:"id"` Name string `json:"name"` Description string `json:"description"` Birthdate time.Time `json:"birthdate"` Sex model.Sex `json:"sex"` Color string `json:"color"` AdoptionStatus model.AdoptionStatus `json:"adoptionStatus"` Pictures []primitive.ObjectID `json:"pictures"` }
UpdateAnimalRequest update animal request