Documentation ¶
Index ¶
- Constants
- type MongoDBUserStorage
- func (s *MongoDBUserStorage) Add(ctx context.Context, user service.User) error
- func (s *MongoDBUserStorage) Get(ctx context.Context, id string) (service.User, error)
- func (s *MongoDBUserStorage) GetByName(ctx context.Context, name string) (service.User, error)
- func (s *MongoDBUserStorage) Update(ctx context.Context, user service.User) error
- type PasswordHasher
- type TokenMaker
Constants ¶
View Source
const TokenExp = time.Hour
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBUserStorage ¶
type MongoDBUserStorage struct {
// contains filtered or unexported fields
}
func MakeUserStorage ¶
func MakeUserStorage(dbConnectionStr string) (*MongoDBUserStorage, error)
type PasswordHasher ¶
type PasswordHasher struct { }
func MakePasswordHasher ¶
func MakePasswordHasher() *PasswordHasher
func (*PasswordHasher) Verify ¶
func (ph *PasswordHasher) Verify(password, hash string) bool
type TokenMaker ¶
type TokenMaker struct {
// contains filtered or unexported fields
}
func MakeTokenGenerator ¶
func MakeTokenGenerator(seacretKey string) *TokenMaker
Click to show internal directories.
Click to hide internal directories.