Documentation ¶
Index ¶
- type Repo
- type Store
- func (s *Store) AddToken(ctx context.Context, t Token) (Token, error)
- func (s *Store) DeleteOldToken(ctx context.Context) error
- func (s *Store) DeleteToken(ctx context.Context, t Token) error
- func (s *Store) GetToken(ctx context.Context, t Token) (Token, error)
- func (s *Store) GetTokens(ctx context.Context, userID int) ([]Token, error)
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { GetTokens(ctx context.Context, userID int) ([]Token, error) GetToken(ctx context.Context, t Token) (Token, error) AddToken(ctx context.Context, t Token) (Token, error) DeleteToken(ctx context.Context, t Token) error DeleteOldToken(ctx context.Context) error // contains filtered or unexported methods }
Repo is used for navigating a package
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores the dependencies
func (*Store) AddToken ¶
AddToken adds a token id, name, description, user id and expiration, the actual jwt token is not stored
func (*Store) DeleteOldToken ¶
DeleteOldToken deletes all old tokens by the subroutine
func (*Store) DeleteToken ¶
DeleteToken deletes a specific token
type Token ¶
type Token struct { TokenID string `db:"token_id" json:"tokenID"` Name string `db:"name" json:"name,omitempty"` Description string `db:"description" json:"description,omitempty"` Expiry null.Time `db:"expiry" json:"expiry"` UserID int `db:"user_id" json:"userID"` }
Token is the struct for a token to be stored
Click to show internal directories.
Click to hide internal directories.