server

package
v0.0.0-...-69a499a Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanLoginTokenSessionPath

func CleanLoginTokenSessionPath() string

CleanLoginTokenSessionPath returns the URL path to the session service clean-login-token HTTP endpoint.

func CleanMergeTokenSessionPath

func CleanMergeTokenSessionPath() string

CleanMergeTokenSessionPath returns the URL path to the session service clean-merge-token HTTP endpoint.

func CleanSessionsSessionPath

func CleanSessionsSessionPath() string

CleanSessionsSessionPath returns the URL path to the session service clean-sessions HTTP endpoint.

func DecodeCleanLoginTokenRequest

func DecodeCleanLoginTokenRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeCleanLoginTokenRequest returns a decoder for requests sent to the session clean-login-token endpoint.

func DecodeCleanMergeTokenRequest

func DecodeCleanMergeTokenRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeCleanMergeTokenRequest returns a decoder for requests sent to the session clean-merge-token endpoint.

func DecodeCleanSessionsRequest

func DecodeCleanSessionsRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeCleanSessionsRequest returns a decoder for requests sent to the session clean-sessions endpoint.

func DecodeGetSessionsRequest

func DecodeGetSessionsRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeGetSessionsRequest returns a decoder for requests sent to the session get-sessions endpoint.

func DecodeLogoutOtherRequest

func DecodeLogoutOtherRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeLogoutOtherRequest returns a decoder for requests sent to the session logout-other endpoint.

func DecodeLogoutRequest

func DecodeLogoutRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeLogoutRequest returns a decoder for requests sent to the session logout endpoint.

func DecodeLogoutSpecificRequest

func DecodeLogoutSpecificRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeLogoutSpecificRequest returns a decoder for requests sent to the session logout-specific endpoint.

func DecodeRedeemTokenRequest

func DecodeRedeemTokenRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeRedeemTokenRequest returns a decoder for requests sent to the session redeemToken endpoint.

func DecodeRefreshRequest

func DecodeRefreshRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeRefreshRequest returns a decoder for requests sent to the session refresh endpoint.

func EncodeCleanLoginTokenResponse

func EncodeCleanLoginTokenResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeCleanLoginTokenResponse returns an encoder for responses returned by the session clean-login-token endpoint.

func EncodeCleanMergeTokenResponse

func EncodeCleanMergeTokenResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeCleanMergeTokenResponse returns an encoder for responses returned by the session clean-merge-token endpoint.

func EncodeCleanSessionsResponse

func EncodeCleanSessionsResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeCleanSessionsResponse returns an encoder for responses returned by the session clean-sessions endpoint.

func EncodeGetSessionsResponse

func EncodeGetSessionsResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeGetSessionsResponse returns an encoder for responses returned by the session get-sessions endpoint.

func EncodeLogoutOtherResponse

func EncodeLogoutOtherResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeLogoutOtherResponse returns an encoder for responses returned by the session logout-other endpoint.

func EncodeLogoutResponse

func EncodeLogoutResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeLogoutResponse returns an encoder for responses returned by the session logout endpoint.

func EncodeLogoutSpecificResponse

func EncodeLogoutSpecificResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeLogoutSpecificResponse returns an encoder for responses returned by the session logout-specific endpoint.

func EncodeRedeemTokenResponse

func EncodeRedeemTokenResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeRedeemTokenResponse returns an encoder for responses returned by the session redeemToken endpoint.

func EncodeRefreshResponse

func EncodeRefreshResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeRefreshResponse returns an encoder for responses returned by the session refresh endpoint.

func GetSessionsSessionPath

func GetSessionsSessionPath() string

GetSessionsSessionPath returns the URL path to the session service get-sessions HTTP endpoint.

func LogoutOtherSessionPath

func LogoutOtherSessionPath() string

LogoutOtherSessionPath returns the URL path to the session service logout-other HTTP endpoint.

func LogoutSessionPath

func LogoutSessionPath() string

LogoutSessionPath returns the URL path to the session service logout HTTP endpoint.

func LogoutSpecificSessionPath

func LogoutSpecificSessionPath() string

LogoutSpecificSessionPath returns the URL path to the session service logout-specific HTTP endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the session endpoints.

func MountCORSHandler

func MountCORSHandler(mux goahttp.Muxer, h http.Handler)

MountCORSHandler configures the mux to serve the CORS endpoints for the service session.

func MountCleanLoginTokenHandler

func MountCleanLoginTokenHandler(mux goahttp.Muxer, h http.Handler)

MountCleanLoginTokenHandler configures the mux to serve the "session" service "clean-login-token" endpoint.

func MountCleanMergeTokenHandler

func MountCleanMergeTokenHandler(mux goahttp.Muxer, h http.Handler)

MountCleanMergeTokenHandler configures the mux to serve the "session" service "clean-merge-token" endpoint.

func MountCleanSessionsHandler

func MountCleanSessionsHandler(mux goahttp.Muxer, h http.Handler)

MountCleanSessionsHandler configures the mux to serve the "session" service "clean-sessions" endpoint.

func MountGetSessionsHandler

func MountGetSessionsHandler(mux goahttp.Muxer, h http.Handler)

MountGetSessionsHandler configures the mux to serve the "session" service "get-sessions" endpoint.

func MountLogoutHandler

func MountLogoutHandler(mux goahttp.Muxer, h http.Handler)

MountLogoutHandler configures the mux to serve the "session" service "logout" endpoint.

func MountLogoutOtherHandler

func MountLogoutOtherHandler(mux goahttp.Muxer, h http.Handler)

MountLogoutOtherHandler configures the mux to serve the "session" service "logout-other" endpoint.

func MountLogoutSpecificHandler

func MountLogoutSpecificHandler(mux goahttp.Muxer, h http.Handler)

MountLogoutSpecificHandler configures the mux to serve the "session" service "logout-specific" endpoint.

func MountRedeemTokenHandler

func MountRedeemTokenHandler(mux goahttp.Muxer, h http.Handler)

MountRedeemTokenHandler configures the mux to serve the "session" service "redeemToken" endpoint.

func MountRefreshHandler

func MountRefreshHandler(mux goahttp.Muxer, h http.Handler)

MountRefreshHandler configures the mux to serve the "session" service "refresh" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

NewCORSHandler creates a HTTP handler which returns a simple 200 response.

func NewCleanLoginTokenHandler

func NewCleanLoginTokenHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewCleanLoginTokenHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "clean-login-token" endpoint.

func NewCleanLoginTokenPayload

func NewCleanLoginTokenPayload(authorization *string, xSession *string, aPIKey *string) *session.CleanLoginTokenPayload

NewCleanLoginTokenPayload builds a session service clean-login-token endpoint payload.

func NewCleanMergeTokenHandler

func NewCleanMergeTokenHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewCleanMergeTokenHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "clean-merge-token" endpoint.

func NewCleanMergeTokenPayload

func NewCleanMergeTokenPayload(authorization *string, xSession *string, aPIKey *string) *session.CleanMergeTokenPayload

NewCleanMergeTokenPayload builds a session service clean-merge-token endpoint payload.

func NewCleanSessionsHandler

func NewCleanSessionsHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewCleanSessionsHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "clean-sessions" endpoint.

func NewCleanSessionsPayload

func NewCleanSessionsPayload(authorization *string, xSession *string, aPIKey *string) *session.CleanSessionsPayload

NewCleanSessionsPayload builds a session service clean-sessions endpoint payload.

func NewGetSessionsHandler

func NewGetSessionsHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewGetSessionsHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "get-sessions" endpoint.

func NewGetSessionsPayload

func NewGetSessionsPayload(authorization *string, xSession *string, aPIKey *string) *session.GetSessionsPayload

NewGetSessionsPayload builds a session service get-sessions endpoint payload.

func NewLogoutHandler

func NewLogoutHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewLogoutHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "logout" endpoint.

func NewLogoutOtherHandler

func NewLogoutOtherHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewLogoutOtherHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "logout-other" endpoint.

func NewLogoutOtherPayload

func NewLogoutOtherPayload(authorization *string, xSession *string, aPIKey *string) *session.LogoutOtherPayload

NewLogoutOtherPayload builds a session service logout-other endpoint payload.

func NewLogoutPayload

func NewLogoutPayload(authorization *string, xSession *string, aPIKey *string) *session.LogoutPayload

NewLogoutPayload builds a session service logout endpoint payload.

func NewLogoutSpecificHandler

func NewLogoutSpecificHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewLogoutSpecificHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "logout-specific" endpoint.

func NewLogoutSpecificPayload

func NewLogoutSpecificPayload(sessionID string, authorization *string, xSession *string, aPIKey *string) *session.LogoutSpecificPayload

NewLogoutSpecificPayload builds a session service logout-specific endpoint payload.

func NewRedeemTokenHandler

func NewRedeemTokenHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRedeemTokenHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "redeemToken" endpoint.

func NewRedeemTokenPayload

func NewRedeemTokenPayload(body *RedeemTokenRequestBody, aPIKey *string) *session.RedeemTokenPayload

NewRedeemTokenPayload builds a session service redeemToken endpoint payload.

func NewRefreshHandler

func NewRefreshHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRefreshHandler creates a HTTP handler which loads the HTTP request and calls the "session" service "refresh" endpoint.

func NewRefreshPayload

func NewRefreshPayload(xSession string, aPIKey *string) *session.RefreshPayload

NewRefreshPayload builds a session service refresh endpoint payload.

func RedeemTokenSessionPath

func RedeemTokenSessionPath() string

RedeemTokenSessionPath returns the URL path to the session service redeemToken HTTP endpoint.

func RefreshSessionPath

func RefreshSessionPath() string

RefreshSessionPath returns the URL path to the session service refresh HTTP endpoint.

func ValidateRedeemTokenRequestBody

func ValidateRedeemTokenRequestBody(body *RedeemTokenRequestBody) (err error)

ValidateRedeemTokenRequestBody runs the validations defined on RedeemTokenRequestBody

func ValidateSessionResponseBody

func ValidateSessionResponseBody(body *SessionResponseBody) (err error)

ValidateSessionResponseBody runs the validations defined on SessionResponseBody

func ValidateSessionResponseBodyCollection

func ValidateSessionResponseBodyCollection(body SessionResponseBodyCollection) (err error)

ValidateSessionResponseBodyCollection runs the validations defined on SessionResponseBodyCollection

Types

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.

type GetSessionsResponseBody

type GetSessionsResponseBody struct {
	CurrentSession *SessionResponseBody          `form:"currentSession,omitempty" json:"currentSession,omitempty" xml:"currentSession,omitempty"`
	OtherSessions  SessionResponseBodyCollection `form:"otherSessions,omitempty" json:"otherSessions,omitempty" xml:"otherSessions,omitempty"`
}

GetSessionsResponseBody is the type of the "session" service "get-sessions" endpoint HTTP response body.

func NewGetSessionsResponseBody

func NewGetSessionsResponseBody(res *sessionviews.AllSessionsView) *GetSessionsResponseBody

NewGetSessionsResponseBody builds the HTTP response body from the result of the "get-sessions" endpoint of the "session" service.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type RedeemTokenRequestBody

type RedeemTokenRequestBody struct {
	// A merge token for merging into an account
	Token     *string `form:"token,omitempty" json:"token,omitempty" xml:"token,omitempty"`
	UserAgent *string `form:"User-Agent,omitempty" json:"User-Agent,omitempty" xml:"User-Agent,omitempty"`
}

RedeemTokenRequestBody is the type of the "session" service "redeemToken" endpoint HTTP request body.

type Server

type Server struct {
	Mounts          []*MountPoint
	Refresh         http.Handler
	Logout          http.Handler
	LogoutOther     http.Handler
	LogoutSpecific  http.Handler
	GetSessions     http.Handler
	RedeemToken     http.Handler
	CleanSessions   http.Handler
	CleanLoginToken http.Handler
	CleanMergeToken http.Handler
	CORS            http.Handler
}

Server lists the session service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the session service endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type SessionResponseBody

type SessionResponseBody struct {
	// Unique unchanging session ID
	ID string `form:"id" json:"id" xml:"id"`
	// ID of the user this session is for
	UserID string `form:"userId" json:"userId" xml:"userId"`
	// Time that this session was last used
	LastUsed string `form:"lastUsed" json:"lastUsed" xml:"lastUsed"`
	// The browser and browser version connected with this session
	Browser string `form:"browser" json:"browser" xml:"browser"`
	// The OS of the system where this session was used
	Os string `form:"os" json:"os" xml:"os"`
	// The last IP address where this session was used
	IP string `form:"ip" json:"ip" xml:"ip"`
	// A humanReadable string describing the last known location of the session
	Location string `form:"location" json:"location" xml:"location"`
	// The latitude of the last known location of the session
	Latitude string `form:"latitude" json:"latitude" xml:"latitude"`
	// The longitude of the last known location of the session
	Longitude string `form:"longitude" json:"longitude" xml:"longitude"`
	// Whether the session was from a mobile device
	IsMobile bool `form:"isMobile" json:"isMobile" xml:"isMobile"`
	// The URL of the Google map to show the location, suitable for using in an img
	// tag
	MapURL string `form:"mapUrl" json:"mapUrl" xml:"mapUrl"`
}

SessionResponseBody is used to define fields on response body types.

type SessionResponseBodyCollection

type SessionResponseBodyCollection []*SessionResponseBody

SessionResponseBodyCollection is used to define fields on response body types.

Jump to

Keyboard shortcuts

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