Documentation ¶
Index ¶
- func HandlerFor(name EndPtName) func(http.ResponseWriter, *http.Request)
- func ValidateEmail(ctx context.Context, email string) (*string, error)
- func ValidateUsername(ctx context.Context, username string) (*string, error)
- type CreateUser
- type EmailData
- type EndPtName
- type Endpoint
- type RetrieveUser
- type RollUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerFor ¶
func HandlerFor( name EndPtName, ) func( http.ResponseWriter, *http.Request, )
HandlerFor returns an handler for the given endpoint name.
func ValidateEmail ¶
ValidateEmail vlaidates an email address.
Types ¶
type CreateUser ¶
CreateUser a new user by username and email and send its secret over eail.
type EmailData ¶
type EmailData struct { Env string From string Username string Email string Mint string CredsURL string Secret string }
EmailData is the data required to execute the email template.
type EndPtName ¶
type EndPtName string
EndPtName reprensents an endpoint name.
const ( // EndPtCreateUser creates a new offer. EndPtCreateUser EndPtName = "CreateUser" )
const ( // EndPtRetrieveUser creates a new offer. EndPtRetrieveUser EndPtName = "RetrieveUser" )
const ( // EndPtRollUser rolls a user password. EndPtRollUser EndPtName = "RollUser" )
type Endpoint ¶
type Endpoint interface { Validate( r *http.Request, ) error Execute( ctx context.Context, ) (*int, *svc.Resp, error) }
Endpoint is the interface that endpoints need to implement.
func NewCreateUser ¶
NewCreateUser constructs and initialiezes the endpoint.
func NewRetrieveUser ¶
NewRetrieveUser constructs and initialiezes the endpoint.
type RetrieveUser ¶
RetrieveUser a new user by username and email and send its secret over eail.
Click to show internal directories.
Click to hide internal directories.