Documentation ¶
Index ¶
- type SessionPostStruct
- type SessionResource
- func (r *SessionResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, ...)
- func (r *SessionResource) PostAuthRequired() bool
- func (r *SessionResource) PostDoc() string
- func (r *SessionResource) PostParams() []*restful.Parameter
- func (r *SessionResource) Reads() interface{}
- func (r *SessionResource) Register(container *restful.Container, config smolder.APIConfig, ...)
- func (r *SessionResource) Returns() interface{}
- func (r *SessionResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
- type SessionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionPostStruct ¶
type SessionPostStruct struct { Username string `json:"username"` Password string `json:"password"` Token string `json:"token"` }
SessionPostStruct holds all values of an incoming POST request
type SessionResource ¶
SessionResource is the resource responsible for /sessions
func (*SessionResource) Post ¶
func (r *SessionResource) Post(context smolder.APIContext, data interface{}, request *restful.Request, response *restful.Response)
Post processes an incoming POST (create) request
func (*SessionResource) PostAuthRequired ¶
func (r *SessionResource) PostAuthRequired() bool
PostAuthRequired returns false because we don't want requests to be filtered by authentication - we are the ones creating the auth
func (*SessionResource) PostDoc ¶
func (r *SessionResource) PostDoc() string
PostDoc returns the description of this API endpoint
func (*SessionResource) PostParams ¶
func (r *SessionResource) PostParams() []*restful.Parameter
PostParams returns the parameters supported by this API endpoint
func (*SessionResource) Reads ¶
func (r *SessionResource) Reads() interface{}
Reads returns the model that will be read by POST, PUT & PATCH operations
func (*SessionResource) Register ¶
func (r *SessionResource) Register(container *restful.Container, config smolder.APIConfig, context smolder.APIContextFactory)
Register this resource with the container to setup all the routes
func (*SessionResource) Returns ¶
func (r *SessionResource) Returns() interface{}
Returns returns the model that will be returned
func (*SessionResource) Validate ¶
func (r *SessionResource) Validate(context smolder.APIContext, data interface{}, request *restful.Request) error
type SessionResponse ¶
type SessionResponse struct { smolder.Response IDToken string `json:"id_token"` UserID int64 `json:"user_id"` }
SessionResponse is the common response to 'session' requests
func (*SessionResponse) Init ¶
func (r *SessionResponse) Init(context smolder.APIContext)
Init a new response