Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUsedEmail is an error class for reporting already used emails. ErrUsedEmail = errs.Class("email used error") )
View Source
var ErrValidation = errs.Class("validation error")
ErrValidation validation related error class.
Functions ¶
This section is empty.
Types ¶
type CreateUser ¶
type CreateUser struct { FullName string `json:"fullName"` ShortName string `json:"shortName"` Email string `json:"email"` Password string `json:"password"` ReferralToken string `json:"referralToken"` }
CreateUser contains information that's necessary for creating a new user through referral program.
func (*CreateUser) IsValid ¶
func (user *CreateUser) IsValid() error
IsValid checks CreateUser validity and returns error describing whats wrong.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allows communicating with the Referral Manager
architecture: Service
func NewService ¶
func NewService(log *zap.Logger, signer signing.Signer, config Config, dialer rpc.Dialer, db console.Users, passwordCost int) *Service
NewService returns a service for handling referrals information.
func (*Service) CreateUser ¶
func (service *Service) CreateUser(ctx context.Context, user CreateUser) (_ *console.User, err error)
CreateUser validates user's registration information and creates a new user.
Click to show internal directories.
Click to hide internal directories.