Documentation ¶
Index ¶
- Variables
- func NewHTTP(svc Service, eg *echo.Group)
- type HTTP
- type ListSessionReq
- type ListSessionsResp
- type Service
- type Session
- func (s *Session) Delete(c contextutil.Context, id string) error
- func (s *Session) List(c contextutil.Context, req ListSessionReq) (*ListSessionsResp, error)
- func (s *Session) Read(c contextutil.Context, id string) (*types.Session, error)
- func (s *Session) Update(c contextutil.Context, id string, data UpdateSessionReq) (*types.Session, error)
- type UpdateSessionReq
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSessionNotFound = server.NewHTTPError(http.StatusBadRequest, "SESSION_NOTFOUND", "Session not found")
)
Custom errors
Functions ¶
Types ¶
type HTTP ¶
type HTTP struct { contextutil.Context // contains filtered or unexported fields }
HTTP represents session http service
type ListSessionReq ¶
type ListSessionReq struct {
requestutil.ListQueryRequest
}
ListSessionReq contains request data to get list of sessions swagger:parameters sessionsList
type ListSessionsResp ¶
type ListSessionsResp struct { Data []*types.Session `json:"data"` TotalCount int64 `json:"total_count"` }
ListSessionsResp contains list of paginated users and total numbers after filtered swagger:model
type Service ¶
type Service interface { Read(contextutil.Context, string) (*types.Session, error) List(contextutil.Context, ListSessionReq) (*ListSessionsResp, error) Update(contextutil.Context, string, UpdateSessionReq) (*types.Session, error) Delete(contextutil.Context, string) error }
Service represents session application interface
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents session application service
func (*Session) Delete ¶
func (s *Session) Delete(c contextutil.Context, id string) error
Delete deletes session by id
func (*Session) List ¶
func (s *Session) List(c contextutil.Context, req ListSessionReq) (*ListSessionsResp, error)
List returns the list of users
func (*Session) Update ¶
func (s *Session) Update(c contextutil.Context, id string, data UpdateSessionReq) (*types.Session, error)
Update updates session information
type UpdateSessionReq ¶
type UpdateSessionReq struct {
IsBlocked *bool `json:"is_blocked,omitempty"`
}
UpdateSessionReq contains request data to update existing session swagger:model
Click to show internal directories.
Click to hide internal directories.