Documentation ¶
Index ¶
- Variables
- type Auth
- func (a *Auth) ChangeEmail(w http.ResponseWriter, r *http.Request)
- func (a *Auth) ChangePassword(w http.ResponseWriter, r *http.Request)
- func (a *Auth) DeleteAccount(w http.ResponseWriter, r *http.Request)
- func (a *Auth) ForgotPassword(w http.ResponseWriter, r *http.Request)
- func (a *Auth) GetAccount(w http.ResponseWriter, r *http.Request)
- func (a *Auth) Logout(w http.ResponseWriter, r *http.Request)
- func (a *Auth) Register(w http.ResponseWriter, r *http.Request)
- func (a *Auth) ResendEmail(w http.ResponseWriter, r *http.Request)
- func (a *Auth) Token(w http.ResponseWriter, r *http.Request)
- func (a *Auth) UpdateAccount(w http.ResponseWriter, r *http.Request)
- type Payments
- func (p *Payments) AccountBalance(w http.ResponseWriter, r *http.Request)
- func (p *Payments) AddCreditCard(w http.ResponseWriter, r *http.Request)
- func (p *Payments) BillingHistory(w http.ResponseWriter, r *http.Request)
- func (p *Payments) ListCreditCards(w http.ResponseWriter, r *http.Request)
- func (p *Payments) MakeCreditCardDefault(w http.ResponseWriter, r *http.Request)
- func (p *Payments) PaywallEnabled(w http.ResponseWriter, r *http.Request)
- func (p *Payments) ProjectsCharges(w http.ResponseWriter, r *http.Request)
- func (p *Payments) RemoveCreditCard(w http.ResponseWriter, r *http.Request)
- func (p *Payments) SetupAccount(w http.ResponseWriter, r *http.Request)
- func (p *Payments) TokenDeposit(w http.ResponseWriter, r *http.Request)
- type Referrals
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAuthAPI - console auth api error type. ErrAuthAPI = errs.Class("console auth api error") )
var ( // ErrPaymentsAPI - console payments api error type. ErrPaymentsAPI = errs.Class("console payments api error") )
var ErrReferralsAPI = errs.Class("console referrals api error")
ErrReferralsAPI - console referrals api error type.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { ExternalAddress string LetUsKnowURL string TermsAndConditionsURL string ContactInfoURL string // contains filtered or unexported fields }
Auth is an api controller that exposes all auth functionality.
func NewAuth ¶
func NewAuth(log *zap.Logger, service *console.Service, mailService *mailservice.Service, cookieAuth *consolewebauth.CookieAuth, partners *rewards.PartnersService, externalAddress string, letUsKnowURL string, termsAndConditionsURL string, contactInfoURL string) *Auth
NewAuth is a constructor for api auth controller.
func (*Auth) ChangeEmail ¶ added in v1.17.1
func (a *Auth) ChangeEmail(w http.ResponseWriter, r *http.Request)
ChangeEmail auth user, changes users email for a new one.
func (*Auth) ChangePassword ¶
func (a *Auth) ChangePassword(w http.ResponseWriter, r *http.Request)
ChangePassword auth user, changes users password for a new one.
func (*Auth) DeleteAccount ¶ added in v0.25.0
func (a *Auth) DeleteAccount(w http.ResponseWriter, r *http.Request)
DeleteAccount authorizes user and deletes account by password.
func (*Auth) ForgotPassword ¶
func (a *Auth) ForgotPassword(w http.ResponseWriter, r *http.Request)
ForgotPassword creates password-reset token and sends email to user.
func (*Auth) GetAccount ¶ added in v0.25.0
func (a *Auth) GetAccount(w http.ResponseWriter, r *http.Request)
GetAccount gets authorized user and take it's params.
func (*Auth) Logout ¶ added in v0.31.6
func (a *Auth) Logout(w http.ResponseWriter, r *http.Request)
Logout removes auth cookie.
func (*Auth) Register ¶
func (a *Auth) Register(w http.ResponseWriter, r *http.Request)
Register creates new user, sends activation e-mail.
func (*Auth) ResendEmail ¶
func (a *Auth) ResendEmail(w http.ResponseWriter, r *http.Request)
ResendEmail generates activation token by userID and sends email account activation email to user.
func (*Auth) Token ¶
func (a *Auth) Token(w http.ResponseWriter, r *http.Request)
Token authenticates user by credentials and returns auth token.
func (*Auth) UpdateAccount ¶ added in v0.25.0
func (a *Auth) UpdateAccount(w http.ResponseWriter, r *http.Request)
UpdateAccount updates user's full name and short name.
type Payments ¶
type Payments struct {
// contains filtered or unexported fields
}
Payments is an api controller that exposes all payment related functionality.
func NewPayments ¶
NewPayments is a constructor for api payments controller.
func (*Payments) AccountBalance ¶
func (p *Payments) AccountBalance(w http.ResponseWriter, r *http.Request)
AccountBalance returns an integer amount in cents that represents the current balance of payment account.
func (*Payments) AddCreditCard ¶
func (p *Payments) AddCreditCard(w http.ResponseWriter, r *http.Request)
AddCreditCard is used to save new credit card and attach it to payment account.
func (*Payments) BillingHistory ¶ added in v0.25.0
func (p *Payments) BillingHistory(w http.ResponseWriter, r *http.Request)
BillingHistory returns a list of invoices, transactions and all others billing history items for payment account.
func (*Payments) ListCreditCards ¶
func (p *Payments) ListCreditCards(w http.ResponseWriter, r *http.Request)
ListCreditCards returns a list of credit cards for a given payment account.
func (*Payments) MakeCreditCardDefault ¶
func (p *Payments) MakeCreditCardDefault(w http.ResponseWriter, r *http.Request)
MakeCreditCardDefault makes a credit card default payment method.
func (*Payments) PaywallEnabled ¶ added in v1.10.1
func (p *Payments) PaywallEnabled(w http.ResponseWriter, r *http.Request)
PaywallEnabled returns is paywall enabled status.
func (*Payments) ProjectsCharges ¶ added in v0.26.0
func (p *Payments) ProjectsCharges(w http.ResponseWriter, r *http.Request)
ProjectsCharges returns how much money current user will be charged for each project which he owns.
func (*Payments) RemoveCreditCard ¶
func (p *Payments) RemoveCreditCard(w http.ResponseWriter, r *http.Request)
RemoveCreditCard is used to detach a credit card from payment account.
func (*Payments) SetupAccount ¶
func (p *Payments) SetupAccount(w http.ResponseWriter, r *http.Request)
SetupAccount creates a payment account for the user.
func (*Payments) TokenDeposit ¶ added in v0.26.0
func (p *Payments) TokenDeposit(w http.ResponseWriter, r *http.Request)
TokenDeposit creates new deposit transaction and info about address and amount of newly created tx.
type Referrals ¶ added in v0.27.0
type Referrals struct { ExternalAddress string // contains filtered or unexported fields }
Referrals is an api controller that exposes all referrals functionality.
func NewReferrals ¶ added in v0.27.0
func NewReferrals(log *zap.Logger, service *referrals.Service, consoleService *console.Service, mailService *mailservice.Service, externalAddress string) *Referrals
NewReferrals is a constructor for api referrals controller.