Documentation ¶
Index ¶
- type AccountAdvertBuilder
- type AccountAdvertWrapper
- type AccountBuilder
- type AccountWrapper
- func (c *AccountWrapper) CreateUser(w http.ResponseWriter, r *http.Request)
- func (c *AccountWrapper) GetUser(w http.ResponseWriter, r *http.Request)
- func (c *AccountWrapper) IsUserPremium(w http.ResponseWriter, r *http.Request)
- func (c *AccountWrapper) ResendVerification(w http.ResponseWriter, r *http.Request)
- func (c *AccountWrapper) UpdateUser(w http.ResponseWriter, r *http.Request)
- func (c *AccountWrapper) UpdateValue(email string, cr *models.ChangeRequest) error
- func (c *AccountWrapper) VerifyEmail(w http.ResponseWriter, r *http.Request)
- type SignInBuilder
- type SignInWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAdvertBuilder ¶
type AccountAdvertBuilder interface { GetRefereeAdsPosted(w http.ResponseWriter, r *http.Request) GetJobApplications(w http.ResponseWriter, r *http.Request) GetAdApplicants(w http.ResponseWriter, r *http.Request) }
implement only the necessary methods for each repository available to be consumed by the API
var AccountAdvert AccountAdvertBuilder
interface with the implemented methods will be injected in this variable
type AccountAdvertWrapper ¶
func (*AccountAdvertWrapper) GetAdApplicants ¶
func (c *AccountAdvertWrapper) GetAdApplicants(w http.ResponseWriter, r *http.Request)
func (*AccountAdvertWrapper) GetJobApplications ¶
func (c *AccountAdvertWrapper) GetJobApplications(w http.ResponseWriter, r *http.Request)
Get all applications
func (*AccountAdvertWrapper) GetRefereeAdsPosted ¶
func (c *AccountAdvertWrapper) GetRefereeAdsPosted(w http.ResponseWriter, r *http.Request)
get all the adverts for a specific account token validated
type AccountBuilder ¶
type AccountBuilder interface { GetUser(http.ResponseWriter, *http.Request) UpdateUser(http.ResponseWriter, *http.Request) CreateUser(http.ResponseWriter, *http.Request) IsUserPremium(http.ResponseWriter, *http.Request) VerifyEmail(http.ResponseWriter, *http.Request) ResendVerification(http.ResponseWriter, *http.Request) }
implement only the necessary methods for each repository available to be consumed by the API
var Account AccountBuilder
interface with the implemented methods will be injected in this variable
type AccountWrapper ¶
func (*AccountWrapper) CreateUser ¶
func (c *AccountWrapper) CreateUser(w http.ResponseWriter, r *http.Request)
We check for the recaptcha response and proceed Covert the response body into appropriate models Create a new user using our dynamodb adapter A event message it sent to the queues which are consumed by the relevant services
func (*AccountWrapper) GetUser ¶
func (c *AccountWrapper) GetUser(w http.ResponseWriter, r *http.Request)
get the email from the jwt stored in the subject claim
func (*AccountWrapper) IsUserPremium ¶
func (c *AccountWrapper) IsUserPremium(w http.ResponseWriter, r *http.Request)
check if the user has an active subscription parses email from the jwt
func (*AccountWrapper) ResendVerification ¶
func (c *AccountWrapper) ResendVerification(w http.ResponseWriter, r *http.Request)
TODO:resend verification email
func (*AccountWrapper) UpdateUser ¶
func (c *AccountWrapper) UpdateUser(w http.ResponseWriter, r *http.Request)
two ways of updating a user's information type 1: updates a single string value for a defined field type 2: appends a map for a defined field(this field name must already exists) all parameters are set under ChangeRequest struct
func (*AccountWrapper) UpdateValue ¶
func (c *AccountWrapper) UpdateValue(email string, cr *models.ChangeRequest) error
func (*AccountWrapper) VerifyEmail ¶
func (c *AccountWrapper) VerifyEmail(w http.ResponseWriter, r *http.Request)
we parse the access_code and token from the query string token is validated we compare the access_code in the db matches the one passed in from the query string
type SignInBuilder ¶
type SignInBuilder interface {
Login(w http.ResponseWriter, r *http.Request)
}
implement only the necessary methods for each repository available to be consumed by the API
var SignIn SignInBuilder
interface with the implemented methods will be injected in this variable
type SignInWrapper ¶
func (*SignInWrapper) Login ¶
func (c *SignInWrapper) Login(w http.ResponseWriter, r *http.Request)
credentials extract from the body query the db with the email if this exists, get the pw hash and compare