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 DeactivateUserPath

func DeactivateUserPath() string

DeactivateUserPath returns the URL path to the user service deactivate HTTP endpoint.

func DecodeDeactivateRequest

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

DecodeDeactivateRequest returns a decoder for requests sent to the user deactivate endpoint.

func DecodeGetAuthsRequest

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

DecodeGetAuthsRequest returns a decoder for requests sent to the user getAuths endpoint.

func DecodeGetUserRequest

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

DecodeGetUserRequest returns a decoder for requests sent to the user getUser endpoint.

func DecodeResendOtpRequest

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

DecodeResendOtpRequest returns a decoder for requests sent to the user resend-otp endpoint.

func DecodeResendVerifyEmailRequest

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

DecodeResendVerifyEmailRequest returns a decoder for requests sent to the user resend-verify-email endpoint.

func DecodeUpdatePhoneRequest

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

DecodeUpdatePhoneRequest returns a decoder for requests sent to the user update-phone endpoint.

func DecodeUpdateUserRequest

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

DecodeUpdateUserRequest returns a decoder for requests sent to the user update-user endpoint.

func DecodeValidateEmailRequest

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

DecodeValidateEmailRequest returns a decoder for requests sent to the user validate-email endpoint.

func DecodeVerifyPhoneRequest

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

DecodeVerifyPhoneRequest returns a decoder for requests sent to the user verify-phone endpoint.

func EncodeDeactivateResponse

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

EncodeDeactivateResponse returns an encoder for responses returned by the user deactivate endpoint.

func EncodeGetAuthsResponse

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

EncodeGetAuthsResponse returns an encoder for responses returned by the user getAuths endpoint.

func EncodeGetUserResponse

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

EncodeGetUserResponse returns an encoder for responses returned by the user getUser endpoint.

func EncodeResendOtpResponse

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

EncodeResendOtpResponse returns an encoder for responses returned by the user resend-otp endpoint.

func EncodeResendVerifyEmailResponse

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

EncodeResendVerifyEmailResponse returns an encoder for responses returned by the user resend-verify-email endpoint.

func EncodeUpdatePhoneResponse

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

EncodeUpdatePhoneResponse returns an encoder for responses returned by the user update-phone endpoint.

func EncodeUpdateUserResponse

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

EncodeUpdateUserResponse returns an encoder for responses returned by the user update-user endpoint.

func EncodeValidateEmailResponse

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

EncodeValidateEmailResponse returns an encoder for responses returned by the user validate-email endpoint.

func EncodeVerifyPhoneResponse

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

EncodeVerifyPhoneResponse returns an encoder for responses returned by the user verify-phone endpoint.

func GetAuthsUserPath

func GetAuthsUserPath() string

GetAuthsUserPath returns the URL path to the user service getAuths HTTP endpoint.

func GetUserUserPath

func GetUserUserPath() string

GetUserUserPath returns the URL path to the user service getUser HTTP endpoint.

func Mount

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

Mount configures the mux to serve the user endpoints.

func MountCORSHandler

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

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

func MountDeactivateHandler

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

MountDeactivateHandler configures the mux to serve the "user" service "deactivate" endpoint.

func MountGetAuthsHandler

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

MountGetAuthsHandler configures the mux to serve the "user" service "getAuths" endpoint.

func MountGetUserHandler

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

MountGetUserHandler configures the mux to serve the "user" service "getUser" endpoint.

func MountResendOtpHandler

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

MountResendOtpHandler configures the mux to serve the "user" service "resend-otp" endpoint.

func MountResendVerifyEmailHandler

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

MountResendVerifyEmailHandler configures the mux to serve the "user" service "resend-verify-email" endpoint.

func MountUpdatePhoneHandler

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

MountUpdatePhoneHandler configures the mux to serve the "user" service "update-phone" endpoint.

func MountUpdateUserHandler

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

MountUpdateUserHandler configures the mux to serve the "user" service "update-user" endpoint.

func MountValidateEmailHandler

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

MountValidateEmailHandler configures the mux to serve the "user" service "validate-email" endpoint.

func MountVerifyPhoneHandler

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

MountVerifyPhoneHandler configures the mux to serve the "user" service "verify-phone" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

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

func NewDeactivateHandler

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

NewDeactivateHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "deactivate" endpoint.

func NewDeactivatePayload

func NewDeactivatePayload(id *string, admin *string, authorization *string, xSession *string, aPIKey *string) *user.DeactivatePayload

NewDeactivatePayload builds a user service deactivate endpoint payload.

func NewGetAuthsHandler

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

NewGetAuthsHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "getAuths" endpoint.

func NewGetAuthsPayload

func NewGetAuthsPayload(userID *string, authorization *string, xSession *string, aPIKey *string) *user.GetAuthsPayload

NewGetAuthsPayload builds a user service getAuths endpoint payload.

func NewGetUserHandler

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

NewGetUserHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "getUser" endpoint.

func NewGetUserPayload

func NewGetUserPayload(authorization *string, xSession *string, aPIKey *string) *user.GetUserPayload

NewGetUserPayload builds a user service getUser endpoint payload.

func NewResendOtpHandler

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

NewResendOtpHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "resend-otp" endpoint.

func NewResendOtpPayload

func NewResendOtpPayload(authorization *string, xSession *string, aPIKey *string) *user.ResendOtpPayload

NewResendOtpPayload builds a user service resend-otp endpoint payload.

func NewResendVerifyEmailHandler

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

NewResendVerifyEmailHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "resend-verify-email" endpoint.

func NewResendVerifyEmailPayload

func NewResendVerifyEmailPayload(authorization *string, xSession *string, aPIKey *string) *user.ResendVerifyEmailPayload

NewResendVerifyEmailPayload builds a user service resend-verify-email endpoint payload.

func NewUpdatePhoneHandler

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

NewUpdatePhoneHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "update-phone" endpoint.

func NewUpdatePhonePayload

func NewUpdatePhonePayload(phone *string, country *string, authorization *string, xSession *string, aPIKey *string) *user.UpdatePhonePayload

NewUpdatePhonePayload builds a user service update-phone endpoint payload.

func NewUpdateUserHandler

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

NewUpdateUserHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "update-user" endpoint.

func NewUpdateUserUserUpdateParams

func NewUpdateUserUserUpdateParams(body *UpdateUserRequestBody, authorization *string, xSession *string, aPIKey *string) *user.UserUpdateParams

NewUpdateUserUserUpdateParams builds a user service update-user endpoint payload.

func NewValidateEmailHandler

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

NewValidateEmailHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "validate-email" endpoint.

func NewValidateEmailPayload

func NewValidateEmailPayload(validateID string, aPIKey *string) *user.ValidateEmailPayload

NewValidateEmailPayload builds a user service validate-email endpoint payload.

func NewVerifyPhoneHandler

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

NewVerifyPhoneHandler creates a HTTP handler which loads the HTTP request and calls the "user" service "verify-phone" endpoint.

func NewVerifyPhonePayload

func NewVerifyPhonePayload(otp *string, authorization *string, xSession *string, aPIKey *string) *user.VerifyPhonePayload

NewVerifyPhonePayload builds a user service verify-phone endpoint payload.

func ResendOtpUserPath

func ResendOtpUserPath() string

ResendOtpUserPath returns the URL path to the user service resend-otp HTTP endpoint.

func ResendVerifyEmailUserPath

func ResendVerifyEmailUserPath() string

ResendVerifyEmailUserPath returns the URL path to the user service resend-verify-email HTTP endpoint.

func UpdatePhoneUserPath

func UpdatePhoneUserPath() string

UpdatePhoneUserPath returns the URL path to the user service update-phone HTTP endpoint.

func UpdateUserUserPath

func UpdateUserUserPath() string

UpdateUserUserPath returns the URL path to the user service update-user HTTP endpoint.

func ValidateEmailUserPath

func ValidateEmailUserPath(validateID string) string

ValidateEmailUserPath returns the URL path to the user service validate-email HTTP endpoint.

func VerifyPhoneUserPath

func VerifyPhoneUserPath() string

VerifyPhoneUserPath returns the URL path to the user service verify-phone HTTP endpoint.

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 GetAuthsResponseBody

type GetAuthsResponseBody struct {
	// True if user has google Oauth signin
	Google bool `form:"google" json:"google" xml:"google"`
	// True if user has facebook Oauth signin
	Facebook bool `form:"facebook" json:"facebook" xml:"facebook"`
	// True if user has twitter Oauth signin
	Twitter bool `form:"twitter" json:"twitter" xml:"twitter"`
	// True if user has linkedin Oauth signin
	Linkedin bool `form:"linkedin" json:"linkedin" xml:"linkedin"`
	// True if user has microsoft Oauth signin
	Instagram bool `form:"instagram" json:"instagram" xml:"instagram"`
	// True if user has password signin
	Standard bool `form:"standard" json:"standard" xml:"standard"`
}

GetAuthsResponseBody is the type of the "user" service "getAuths" endpoint HTTP response body.

func NewGetAuthsResponseBody

func NewGetAuthsResponseBody(res *userviews.AuthStatusMediaView) *GetAuthsResponseBody

NewGetAuthsResponseBody builds the HTTP response body from the result of the "getAuths" endpoint of the "user" service.

type GetUserResponseBody

type GetUserResponseBody 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"`
	Authorization string `form:"Authorization" json:"Authorization" xml:"Authorization"`
	XSession      string `form:"X-Session" json:"X-Session" xml:"X-Session"`
}

GetUserResponseBody is the type of the "user" service "getUser" endpoint HTTP response body.

func NewGetUserResponseBody

func NewGetUserResponseBody(res *userviews.UserMediaView) *GetUserResponseBody

NewGetUserResponseBody builds the HTTP response body from the result of the "getUser" endpoint of the "user" 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 Server

type Server struct {
	Mounts            []*MountPoint
	GetAuths          http.Handler
	Deactivate        http.Handler
	GetUser           http.Handler
	ValidateEmail     http.Handler
	UpdateUser        http.Handler
	ResendVerifyEmail http.Handler
	UpdatePhone       http.Handler
	ResendOtp         http.Handler
	VerifyPhone       http.Handler
	CORS              http.Handler
}

Server lists the user service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the user 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 UpdateUserRequestBody

type UpdateUserRequestBody struct {
	// Given name for the user
	FirstName *string `form:"firstName,omitempty" json:"firstName,omitempty" xml:"firstName,omitempty"`
	// Family name for the user
	LastName *string `form:"lastName,omitempty" json:"lastName,omitempty" xml:"lastName,omitempty"`
	// Email attached to the account of the user
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// Phone Number Of the user
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,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 has verified their email
	VerifiedEmail *bool `form:"verifiedEmail,omitempty" json:"verifiedEmail,omitempty" xml:"verifiedEmail,omitempty"`
	// Whether the user is an administrator on the site
	IsAdmin          *bool   `form:"isAdmin,omitempty" json:"isAdmin,omitempty" xml:"isAdmin,omitempty"`
	CountryPhoneCode *string `form:"countryPhoneCode,omitempty" json:"countryPhoneCode,omitempty" xml:"countryPhoneCode,omitempty"`
}

UpdateUserRequestBody is the type of the "user" service "update-user" endpoint HTTP request body.

type UpdateUserResponseBody

type UpdateUserResponseBody 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"`
	Authorization string `form:"Authorization" json:"Authorization" xml:"Authorization"`
	XSession      string `form:"X-Session" json:"X-Session" xml:"X-Session"`
}

UpdateUserResponseBody is the type of the "user" service "update-user" endpoint HTTP response body.

func NewUpdateUserResponseBody

func NewUpdateUserResponseBody(res *userviews.UserMediaView) *UpdateUserResponseBody

NewUpdateUserResponseBody builds the HTTP response body from the result of the "update-user" endpoint of the "user" service.

Jump to

Keyboard shortcuts

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