Documentation ¶
Index ¶
- Variables
- func NewHTTP(svc Service, eg *echo.Group)
- type ChangePasswordReq
- type CreateMemoReq
- type HTTP
- type ListMemoReq
- type ListMemosResp
- type Memo
- func (s *Memo) Create(c contextutil.Context, data CreateMemoReq) (*types.Memo, error)
- func (s *Memo) Delete(c contextutil.Context, id string) error
- func (s *Memo) List(c contextutil.Context, req ListMemoReq) (*ListMemosResp, error)
- func (s *Memo) Read(c contextutil.Context, id string) (*types.Memo, error)
- func (s *Memo) Update(c contextutil.Context, id string, data UpdateMemoReq) (*types.Memo, error)
- type Service
- type UpdateMemoReq
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMemoNotFound = server.NewHTTPError(http.StatusBadRequest, "MEMO_NOTFOUND", "Memo not found")
)
Custom errors
Functions ¶
Types ¶
type ChangePasswordReq ¶
type ChangePasswordReq struct { OldPassword string `json:"old_password" validate:"required"` NewPassword string `json:"new_password" validate:"required,min=8"` NewPasswordConfirm string `json:"new_password_confirm" validate:"required,eqfield=NewPassword"` }
ChangePasswordReq contains request data to change memo password swagger:model
type CreateMemoReq ¶
type CreateMemoReq struct {
Content string `json:"content" validate:"required"`
}
CreateMemoReq contains request data to create new memo swagger:model
type HTTP ¶
type HTTP struct { contextutil.Context // contains filtered or unexported fields }
HTTP represents memo http service
type ListMemoReq ¶
type ListMemoReq struct {
requestutil.ListQueryRequest
}
ListMemoReq contains request data to get list of memos swagger:parameters memosList
type ListMemosResp ¶
type ListMemosResp struct { Data []*types.Memo `json:"data"` TotalCount int64 `json:"total_count"` }
ListMemosResp contains list of paginated memos and total numbers after filtered swagger:model
type Memo ¶
type Memo struct {
// contains filtered or unexported fields
}
Memo represents memo application service
func (*Memo) Create ¶
func (s *Memo) Create(c contextutil.Context, data CreateMemoReq) (*types.Memo, error)
Create creates new memo
func (*Memo) Delete ¶
func (s *Memo) Delete(c contextutil.Context, id string) error
Delete deletes memo by id
func (*Memo) List ¶
func (s *Memo) List(c contextutil.Context, req ListMemoReq) (*ListMemosResp, error)
List returns the list of memos
func (*Memo) Update ¶
func (s *Memo) Update(c contextutil.Context, id string, data UpdateMemoReq) (*types.Memo, error)
Update updates memo information
type Service ¶
type Service interface { Create(contextutil.Context, CreateMemoReq) (*types.Memo, error) Read(contextutil.Context, string) (*types.Memo, error) List(contextutil.Context, ListMemoReq) (*ListMemosResp, error) Update(contextutil.Context, string, UpdateMemoReq) (*types.Memo, error) Delete(contextutil.Context, string) error }
Service represents memo application interface
type UpdateMemoReq ¶
type UpdateMemoReq struct {
Content *string `json:"content,omitempty"`
}
UpdateMemoReq contains request data to update existing memo swagger:model
Click to show internal directories.
Click to hide internal directories.