sessions

package
v0.0.0-...-1ad76dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

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

type SessionResource struct {
	smolder.Resource
}

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  string `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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL