Documentation ¶
Index ¶
- Constants
- Variables
- type Auth
- func (a Auth) IdentityByCookie(cookie *http.Cookie) (string, error)
- func (a Auth) Init() error
- func (a Auth) Login(ctx context.Context, r *models.RequestLogin)
- func (a *Auth) NotifyRegistered(ctx context.Context, customer *customer.Customer, ...) error
- func (a Auth) Register(ctx context.Context, rm *models.RequestRegister) (*customer.Customer, error)
- type Claims
Constants ¶
View Source
const ( TokenExpired = time.Hour * 24 SecretKey = "bu7HBJD&873HVHJdh*Jbhsfdfs8622Dsf" )
Variables ¶
View Source
var ErrAlreadyRegistered error = errors.New("customer already registered")
View Source
var ErrInvalidAuthorization = errors.New("отсутствует UID сессии пользователя")
View Source
var ErrInvalidScenarioRegistered error = errors.New("customer already registered")
View Source
var ErrNeedAuthorization = errors.New("требуется авторизация")
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { TokenExpired time.Duration SecretKey string Logger *alog.Alog Storage models.Storable Cache models.Cachable // contains filtered or unexported fields }
func (*Auth) NotifyRegistered ¶
func (a *Auth) NotifyRegistered( ctx context.Context, customer *customer.Customer, scenario *models.RequestRegister, ) error
NotifyRegistered отправка уведомления о регистрации, в зависимости от сценария регистрации будут использованы разные методы отправки
Click to show internal directories.
Click to hide internal directories.