Documentation
¶
Index ¶
- Variables
- type MemoryStorage
- func (ms *MemoryStorage) GetAccess(access string) (clientId string, err error)
- func (ms *MemoryStorage) GetCode(code string) (clientId string, err error)
- func (ms *MemoryStorage) GetRefresh(refresh string) (clientId string, err error)
- func (ms *MemoryStorage) RemoveAccess(access string) error
- func (ms *MemoryStorage) RemoveCode(code string) error
- func (ms *MemoryStorage) RemoveRefresh(refresh string) error
- func (ms *MemoryStorage) SaveAccess(access string, clientId string) (err error)
- func (ms *MemoryStorage) SaveCode(code string, clientId string) (err error)
- func (ms *MemoryStorage) SaveRefresh(refresh string, clientId string) (err error)
- type Storage
- type TokenInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AccessTokenExpires int64 = 60 * 60 * 24 * 30 RefreshToken int64 = 24 * 30 )
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func (*MemoryStorage) GetAccess ¶
func (ms *MemoryStorage) GetAccess(access string) (clientId string, err error)
func (*MemoryStorage) GetCode ¶
func (ms *MemoryStorage) GetCode(code string) (clientId string, err error)
func (*MemoryStorage) GetRefresh ¶
func (ms *MemoryStorage) GetRefresh(refresh string) (clientId string, err error)
func (*MemoryStorage) RemoveAccess ¶
func (ms *MemoryStorage) RemoveAccess(access string) error
func (*MemoryStorage) RemoveCode ¶
func (ms *MemoryStorage) RemoveCode(code string) error
func (*MemoryStorage) RemoveRefresh ¶
func (ms *MemoryStorage) RemoveRefresh(refresh string) error
func (*MemoryStorage) SaveAccess ¶
func (ms *MemoryStorage) SaveAccess(access string, clientId string) (err error)
func (*MemoryStorage) SaveCode ¶
func (ms *MemoryStorage) SaveCode(code string, clientId string) (err error)
func (*MemoryStorage) SaveRefresh ¶
func (ms *MemoryStorage) SaveRefresh(refresh string, clientId string) (err error)
type Storage ¶
type Storage interface {
RemoveCode(code string) error
RemoveAccess(access string) error
RemoveRefresh(refresh string) error
GetCode(code string) (clientId string, err error)
GetAccess(access string) (clientId string, err error)
GetRefresh(refresh string) (clientId string, err error)
SaveCode(code string, clientId string) (err error)
SaveAccess(access string, clientId string) (err error)
SaveRefresh(refresh string, clientId string) (err error)
}
func NewMemStorage ¶
func NewMemStorage() (s Storage)
type TokenInfo ¶
type TokenInfo struct {
AccessToken string
RefreshToken string
AccessTokenExpires int64
RefreshTokenExpires int64
}
func GenCredentialToken ¶
func GenCredentialToken(data model.CredentialsApp, provider *token.JwtProvider) (ti TokenInfo, err error)
Click to show internal directories.
Click to hide internal directories.