-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstore.go
33 lines (25 loc) · 943 Bytes
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package oauth2
type (
// ClientStore the client information storage interface
ClientStore interface {
// according to the ID for the client information
GetByID(id string) (ClientInfo, error)
}
// TokenStore the token information storage interface
TokenStore interface {
// create and store the new token information
Create(info TokenInfo) error
// delete the authorization code
RemoveByCode(code string) error
// use the access token to delete the token information
RemoveByAccess(access string) error
// use the refresh token to delete the token information
RemoveByRefresh(refresh string) error
// use the authorization code for token information data
GetByCode(code string) (TokenInfo, error)
// use the access token for token information data
GetByAccess(access string) (TokenInfo, error)
// use the refresh token for token information data
GetByRefresh(refresh string) (TokenInfo, error)
}
)