Documentation
¶
Overview ¶
Package sms is an API service for authentication via SMS
Index ¶
- func Config(c *Flags) func(srv *Service) error
- func Hook(f HookFunc) func(srv *Service) error
- func Token(t *jwtutil.App) func(srv *Service) error
- type ArgsKey
- type Cookie
- type Flags
- type HookFunc
- type PhoneData
- type Resp
- type Service
- func (srv *Service) Code(r *http.Request, args *ArgsKey, reply *Resp) error
- func (srv *Service) Init(r *http.Request, args *ArgsKey, reply *Resp) error
- func (srv *Service) InitForced(r *http.Request, args *ArgsKey, reply *Resp) error
- func (srv *Service) Phone(r *http.Request, args *ArgsKey, reply *Resp) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flags ¶
type Flags struct { smpp.Flags AppKey string `long:"sms_session_key" description:"Key to encode user session (default: random key reset on restart)"` BlockKey string `long:"sms_block_key" default:"T<8rYvXmgLBdND(YW}3QRcLwh4$4P5eq" description:"Key to encode session blocks (16,32 or 62 byte)"` FailDelay int `long:"sms_delay" default:"5" description:"Delay response when password wrong (seconds)"` SmsRetry int `long:"sms_retry" default:"300" description:"Repeat SMS only after this period (seconds)"` StoreName string `long:"sms_code_file" default:"store.json" description:"File to store active sent codes at program exit"` }
Flags is a package flags sample in form ready for use with github.com/jessevdk/go-flags
type PhoneData ¶
type Service ¶
type Service struct { Store *kvstore.Store Hook *HookFunc Log *log.Logger Config *Flags Token *jwtutil.App IPField string // Context field for Real ip }
Service holds service attributes
func (*Service) Init ¶
Init - если клиент уже авторизован вернуть Code=4, иначе - проверить остальные варианты
func (*Service) InitForced ¶
InitForced - если клиент уже авторизован, выполнить активацию, иначе - проверить остальные варианты
Click to show internal directories.
Click to hide internal directories.