Documentation ¶
Index ¶
- func DestroyApiKey(db *sqlx.DB, user, clientID string) error
- func DestroyApiKeys(db *sqlx.DB, uid string) error
- func DestroyToken(db *sqlx.DB, token string) error
- func DestroyTokenByUser(db *sqlx.DB, uid string) error
- func IncrementToken(db *sqlx.DB, token string) error
- func NewDB(driver, dsn string) (*sqlx.DB, error)
- func RandKey() (string, error)
- func RefreshApiKey(db *sqlx.DB, ak *ApiKey) error
- func RemoveAnswer(db *sqlx.DB, uid string) error
- func SignToken(salt, token string) string
- func StoreAnswer(db *sqlx.DB, user, ans string, qid int) error
- func VerifyToken(salt, signedToken string) (string, bool)
- type ApiKey
- type SecurityAnswer
- type SecurityQuestion
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyToken ¶ added in v0.0.4
Types ¶
type ApiKey ¶ added in v0.0.6
type ApiKey struct { UserName string `db:"user_name"` Key string `db:"api_key"` ClientID string `db:"client_id"` Scopes string `db:"scopes"` CreatedAt *time.Time `db:"created_at"` LastAccessed *time.Time `db:"last_accessed"` }
func CreateApiKey ¶ added in v0.0.6
type SecurityAnswer ¶
type SecurityAnswer struct { UserName string `db:"user_name"` QuestionID int `db:"question_id"` Question string `db:"question"` Answer string `db:"answer"` CreatedAt *time.Time `db:"created_at"` }
func FetchAnswer ¶
func FetchAnswer(db *sqlx.DB, uid string) (*SecurityAnswer, error)
func (*SecurityAnswer) Verify ¶ added in v0.0.5
func (a *SecurityAnswer) Verify(ans string) bool
Verify security answer
type SecurityQuestion ¶
func FetchQuestions ¶
func FetchQuestions(db *sqlx.DB) ([]*SecurityQuestion, error)
Click to show internal directories.
Click to hide internal directories.