2021-12-30 00:27:52 +00:00
|
|
|
package ticket
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-03-13 10:58:34 +00:00
|
|
|
"source.toby3d.me/toby3d/auth/internal/domain"
|
2021-12-30 00:27:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
2022-01-20 19:45:26 +00:00
|
|
|
Create(ctx context.Context, ticket *domain.Ticket) error
|
|
|
|
GetAndDelete(ctx context.Context, ticket string) (*domain.Ticket, error)
|
|
|
|
GC()
|
2021-12-30 00:27:52 +00:00
|
|
|
}
|
|
|
|
|
2022-01-29 20:30:37 +00:00
|
|
|
var ErrNotExist error = domain.NewError(domain.ErrorCodeInvalidRequest, "ticket not exist or expired", "")
|