2021-07-21 23:04:00 +00:00
|
|
|
package token
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-09-29 20:35:39 +00:00
|
|
|
|
2022-01-04 17:31:33 +00:00
|
|
|
"source.toby3d.me/website/indieauth/internal/domain"
|
2021-07-21 23:04:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
2021-09-29 20:35:39 +00:00
|
|
|
Get(ctx context.Context, accessToken string) (*domain.Token, error)
|
|
|
|
Create(ctx context.Context, accessToken *domain.Token) error
|
2021-09-22 21:32:40 +00:00
|
|
|
}
|
|
|
|
|
2021-10-17 22:51:10 +00:00
|
|
|
var (
|
2022-01-29 20:43:53 +00:00
|
|
|
ErrExist error = domain.NewError(domain.ErrorCodeServerError, "token already exist", "")
|
|
|
|
ErrNotExist error = domain.NewError(domain.ErrorCodeServerError, "token not exist", "")
|
2021-10-17 22:51:10 +00:00
|
|
|
)
|