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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePasswordPasswordAuthPath

func ChangePasswordPasswordAuthPath() string

ChangePasswordPasswordAuthPath returns the URL path to the password-auth service change-password HTTP endpoint.

func CheckEmailAvailablePasswordAuthPath

func CheckEmailAvailablePasswordAuthPath() string

CheckEmailAvailablePasswordAuthPath returns the URL path to the password-auth service check-email-available HTTP endpoint.

func CheckPhoneAvailablePasswordAuthPath

func CheckPhoneAvailablePasswordAuthPath() string

CheckPhoneAvailablePasswordAuthPath returns the URL path to the password-auth service check-phone-available HTTP endpoint.

func ConfirmResetPasswordAuthPath

func ConfirmResetPasswordAuthPath() string

ConfirmResetPasswordAuthPath returns the URL path to the password-auth service confirm-reset HTTP endpoint.

func DecodeChangePasswordRequest

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

DecodeChangePasswordRequest returns a decoder for requests sent to the password-auth change-password endpoint.

func DecodeCheckEmailAvailableRequest

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

DecodeCheckEmailAvailableRequest returns a decoder for requests sent to the password-auth check-email-available endpoint.

func DecodeCheckPhoneAvailableRequest

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

DecodeCheckPhoneAvailableRequest returns a decoder for requests sent to the password-auth check-phone-available endpoint.

func DecodeConfirmResetRequest

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

DecodeConfirmResetRequest returns a decoder for requests sent to the password-auth confirm-reset endpoint.

func DecodeLoginRequest

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

DecodeLoginRequest returns a decoder for requests sent to the password-auth login endpoint.

func DecodeRegisterRequest

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

DecodeRegisterRequest returns a decoder for requests sent to the password-auth register endpoint.

func DecodeRemoveRequest

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

DecodeRemoveRequest returns a decoder for requests sent to the password-auth remove endpoint.

func DecodeResetRequest

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

DecodeResetRequest returns a decoder for requests sent to the password-auth reset endpoint.

func EncodeChangePasswordResponse

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

EncodeChangePasswordResponse returns an encoder for responses returned by the password-auth change-password endpoint.

func EncodeCheckEmailAvailableResponse

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

EncodeCheckEmailAvailableResponse returns an encoder for responses returned by the password-auth check-email-available endpoint.

func EncodeCheckPhoneAvailableResponse

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

EncodeCheckPhoneAvailableResponse returns an encoder for responses returned by the password-auth check-phone-available endpoint.

func EncodeConfirmResetResponse

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

EncodeConfirmResetResponse returns an encoder for responses returned by the password-auth confirm-reset endpoint.

func EncodeLoginResponse

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

EncodeLoginResponse returns an encoder for responses returned by the password-auth login endpoint.

func EncodeRegisterResponse

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

EncodeRegisterResponse returns an encoder for responses returned by the password-auth register endpoint.

func EncodeRemoveResponse

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

EncodeRemoveResponse returns an encoder for responses returned by the password-auth remove endpoint.

func EncodeResetResponse

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

EncodeResetResponse returns an encoder for responses returned by the password-auth reset endpoint.

func LoginPasswordAuthPath

func LoginPasswordAuthPath() string

LoginPasswordAuthPath returns the URL path to the password-auth service login HTTP endpoint.

func Mount

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

Mount configures the mux to serve the password-auth endpoints.

func MountCORSHandler

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

MountCORSHandler configures the mux to serve the CORS endpoints for the service password-auth.

func MountChangePasswordHandler

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

MountChangePasswordHandler configures the mux to serve the "password-auth" service "change-password" endpoint.

func MountCheckEmailAvailableHandler

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

MountCheckEmailAvailableHandler configures the mux to serve the "password-auth" service "check-email-available" endpoint.

func MountCheckPhoneAvailableHandler

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

MountCheckPhoneAvailableHandler configures the mux to serve the "password-auth" service "check-phone-available" endpoint.

func MountConfirmResetHandler

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

MountConfirmResetHandler configures the mux to serve the "password-auth" service "confirm-reset" endpoint.

func MountLoginHandler

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

MountLoginHandler configures the mux to serve the "password-auth" service "login" endpoint.

func MountRegisterHandler

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

MountRegisterHandler configures the mux to serve the "password-auth" service "register" endpoint.

func MountRemoveHandler

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

MountRemoveHandler configures the mux to serve the "password-auth" service "remove" endpoint.

func MountResetHandler

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

MountResetHandler configures the mux to serve the "password-auth" service "reset" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

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

func NewChangePasswordHandler

func NewChangePasswordHandler(
	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

NewChangePasswordHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "change-password" endpoint.

func NewChangePasswordParams

func NewChangePasswordParams(body *ChangePasswordRequestBody, authorization string, xSession string, aPIKey *string) *passwordauth.ChangePasswordParams

NewChangePasswordParams builds a password-auth service change-password endpoint payload.

func NewCheckEmailAvailableHandler

func NewCheckEmailAvailableHandler(
	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

NewCheckEmailAvailableHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "check-email-available" endpoint.

func NewCheckEmailAvailablePayload

func NewCheckEmailAvailablePayload(email *string, aPIKey *string) *passwordauth.CheckEmailAvailablePayload

NewCheckEmailAvailablePayload builds a password-auth service check-email-available endpoint payload.

func NewCheckPhoneAvailableHandler

func NewCheckPhoneAvailableHandler(
	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

NewCheckPhoneAvailableHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "check-phone-available" endpoint.

func NewCheckPhoneAvailablePayload

func NewCheckPhoneAvailablePayload(phone *string, aPIKey *string) *passwordauth.CheckPhoneAvailablePayload

NewCheckPhoneAvailablePayload builds a password-auth service check-phone-available endpoint payload.

func NewConfirmResetHandler

func NewConfirmResetHandler(
	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

NewConfirmResetHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "confirm-reset" endpoint.

func NewConfirmResetResetPasswordParams

func NewConfirmResetResetPasswordParams(body *ConfirmResetRequestBody, aPIKey *string) *passwordauth.ResetPasswordParams

NewConfirmResetResetPasswordParams builds a password-auth service confirm-reset endpoint payload.

func NewLoginHandler

func NewLoginHandler(
	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

NewLoginHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "login" endpoint.

func NewLoginParams

func NewLoginParams(body *LoginRequestBody, token *string, aPIKey *string) *passwordauth.LoginParams

NewLoginParams builds a password-auth service login endpoint payload.

func NewRegisterHandler

func NewRegisterHandler(
	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

NewRegisterHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "register" endpoint.

func NewRegisterParams

func NewRegisterParams(body *RegisterRequestBody, authorization *string, xSession *string, aPIKey *string) *passwordauth.RegisterParams

NewRegisterParams builds a password-auth service register endpoint payload.

func NewRemoveHandler

func NewRemoveHandler(
	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

NewRemoveHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "remove" endpoint.

func NewRemovePayload

func NewRemovePayload(authorization *string, xSession *string, aPIKey *string) *passwordauth.RemovePayload

NewRemovePayload builds a password-auth service remove endpoint payload.

func NewResetHandler

func NewResetHandler(
	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

NewResetHandler creates a HTTP handler which loads the HTTP request and calls the "password-auth" service "reset" endpoint.

func NewResetPayload

func NewResetPayload(email string, aPIKey *string) *passwordauth.ResetPayload

NewResetPayload builds a password-auth service reset endpoint payload.

func RegisterPasswordAuthPath

func RegisterPasswordAuthPath() string

RegisterPasswordAuthPath returns the URL path to the password-auth service register HTTP endpoint.

func RemovePasswordAuthPath

func RemovePasswordAuthPath() string

RemovePasswordAuthPath returns the URL path to the password-auth service remove HTTP endpoint.

func ResetPasswordAuthPath

func ResetPasswordAuthPath() string

ResetPasswordAuthPath returns the URL path to the password-auth service reset HTTP endpoint.

func ValidateChangePasswordRequestBody

func ValidateChangePasswordRequestBody(body *ChangePasswordRequestBody) (err error)

ValidateChangePasswordRequestBody runs the validations defined on Change-PasswordRequestBody

func ValidateConfirmResetRequestBody

func ValidateConfirmResetRequestBody(body *ConfirmResetRequestBody) (err error)

ValidateConfirmResetRequestBody runs the validations defined on Confirm-ResetRequestBody

func ValidateLoginRequestBody

func ValidateLoginRequestBody(body *LoginRequestBody) (err error)

ValidateLoginRequestBody runs the validations defined on LoginRequestBody

func ValidateRegisterRequestBody

func ValidateRegisterRequestBody(body *RegisterRequestBody) (err error)

ValidateRegisterRequestBody runs the validations defined on RegisterRequestBody

Types

type ChangePasswordRequestBody

type ChangePasswordRequestBody struct {
	// The old password for the current user account
	OldPassword *string `form:"oldPassword,omitempty" json:"oldPassword,omitempty" xml:"oldPassword,omitempty"`
	// The new password for the current user account
	NewPassword *string `form:"newPassword,omitempty" json:"newPassword,omitempty" xml:"newPassword,omitempty"`
}

ChangePasswordRequestBody is the type of the "password-auth" service "change-password" endpoint HTTP request body.

type ConfirmResetRequestBody

type ConfirmResetRequestBody struct {
	// The UUID of the password reset, send from the user's email
	ResetCode *string `form:"resetCode,omitempty" json:"resetCode,omitempty" xml:"resetCode,omitempty"`
	// The ID of the user to reset the password of
	UserID *string `form:"userID,omitempty" json:"userID,omitempty" xml:"userID,omitempty"`
	// The new password that will be used to login to the account
	NewPassword *string `form:"newPassword,omitempty" json:"newPassword,omitempty" xml:"newPassword,omitempty"`
}

ConfirmResetRequestBody is the type of the "password-auth" service "confirm-reset" endpoint HTTP request body.

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 LoginRequestBody

type LoginRequestBody struct {
	// The email address of the account to login to
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// The password of the account to login to
	Password *string `form:"password,omitempty" json:"password,omitempty" xml:"password,omitempty"`
	// 2 Factor Auth if user has enabled the feature
	TwoFactor *string `form:"TwoFactor,omitempty" json:"TwoFactor,omitempty" xml:"TwoFactor,omitempty"`
}

LoginRequestBody is the type of the "password-auth" service "login" endpoint HTTP request body.

type LoginResponseBody

type LoginResponseBody struct {
	// Unique unchanging user ID
	ID string `form:"id" json:"id" xml:"id"`
	// Phone Number Of the user
	Phone string `form:"phone" json:"phone" xml:"phone"`
	// Family name for the user
	LastName  string  `form:"lastName" json:"lastName" xml:"lastName"`
	UpdatedAt *string `form:"updatedAt,omitempty" json:"updatedAt,omitempty" xml:"updatedAt,omitempty"`
	// Email attached to the account of the user
	Email     string  `form:"email" json:"email" xml:"email"`
	CreatedAt *string `form:"createdAt,omitempty" json:"createdAt,omitempty" xml:"createdAt,omitempty"`
	// Given name for the user
	FirstName        string  `form:"firstName" json:"firstName" xml:"firstName"`
	CountryPhoneCode *string `form:"countryPhoneCode,omitempty" json:"countryPhoneCode,omitempty" xml:"countryPhoneCode,omitempty"`
	// When the user attempts to change their email, this is what they will change
	// it to after they verify that it belongs to them
	ChangingEmail *string `form:"changingEmail,omitempty" json:"changingEmail,omitempty" xml:"changingEmail,omitempty"`
	// Whether the user is an administrator on the site
	IsAdmin *bool `form:"isAdmin,omitempty" json:"isAdmin,omitempty" xml:"isAdmin,omitempty"`
	// Whether the user has verified their email
	VerifiedEmail bool `form:"verifiedEmail" json:"verifiedEmail" xml:"verifiedEmail"`
}

LoginResponseBody is the type of the "password-auth" service "login" endpoint HTTP response body.

func NewLoginResponseBody

func NewLoginResponseBody(res *passwordauthviews.UserMediaView) *LoginResponseBody

NewLoginResponseBody builds the HTTP response body from the result of the "login" endpoint of the "password-auth" 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 RegisterRequestBody

type RegisterRequestBody struct {
	// The email that will be attached to the account
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// The user's given name
	FirstName *string `form:"firstName,omitempty" json:"firstName,omitempty" xml:"firstName,omitempty"`
	// The user's family name
	LastName *string `form:"lastName,omitempty" json:"lastName,omitempty" xml:"lastName,omitempty"`
	// The password associated with the new account
	Password *string `form:"password,omitempty" json:"password,omitempty" xml:"password,omitempty"`
	// The user's phone number
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,omitempty"`
	// The recaptcha response code
	GRecaptchaResponse *string `form:"gRecaptchaResponse,omitempty" json:"gRecaptchaResponse,omitempty" xml:"gRecaptchaResponse,omitempty"`
}

RegisterRequestBody is the type of the "password-auth" service "register" endpoint HTTP request body.

type RegisterResponseBody

type RegisterResponseBody struct {
	// Unique unchanging user ID
	ID string `form:"id" json:"id" xml:"id"`
	// Phone Number Of the user
	Phone string `form:"phone" json:"phone" xml:"phone"`
	// Family name for the user
	LastName  string  `form:"lastName" json:"lastName" xml:"lastName"`
	UpdatedAt *string `form:"updatedAt,omitempty" json:"updatedAt,omitempty" xml:"updatedAt,omitempty"`
	// Email attached to the account of the user
	Email     string  `form:"email" json:"email" xml:"email"`
	CreatedAt *string `form:"createdAt,omitempty" json:"createdAt,omitempty" xml:"createdAt,omitempty"`
	// Given name for the user
	FirstName        string  `form:"firstName" json:"firstName" xml:"firstName"`
	CountryPhoneCode *string `form:"countryPhoneCode,omitempty" json:"countryPhoneCode,omitempty" xml:"countryPhoneCode,omitempty"`
	// When the user attempts to change their email, this is what they will change
	// it to after they verify that it belongs to them
	ChangingEmail *string `form:"changingEmail,omitempty" json:"changingEmail,omitempty" xml:"changingEmail,omitempty"`
	// Whether the user is an administrator on the site
	IsAdmin *bool `form:"isAdmin,omitempty" json:"isAdmin,omitempty" xml:"isAdmin,omitempty"`
	// Whether the user has verified their email
	VerifiedEmail bool `form:"verifiedEmail" json:"verifiedEmail" xml:"verifiedEmail"`
}

RegisterResponseBody is the type of the "password-auth" service "register" endpoint HTTP response body.

func NewRegisterResponseBody

func NewRegisterResponseBody(res *passwordauthviews.UserMediaView) *RegisterResponseBody

NewRegisterResponseBody builds the HTTP response body from the result of the "register" endpoint of the "password-auth" service.

type Server

type Server struct {
	Mounts              []*MountPoint
	Register            http.Handler
	Login               http.Handler
	Remove              http.Handler
	ChangePassword      http.Handler
	Reset               http.Handler
	ConfirmReset        http.Handler
	CheckEmailAvailable http.Handler
	CheckPhoneAvailable http.Handler
	CORS                http.Handler
}

Server lists the password-auth service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the password-auth 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.

Jump to

Keyboard shortcuts

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