autobrr/internal/domain/api.go
ze0s fa20978d58
feat(api): add apikey support (#408)
* feat(api): add apikey support

* feat(web): api settings crud
2022-08-15 11:58:13 +02:00

19 lines
387 B
Go

package domain
import (
"context"
"time"
)
type APIRepo interface {
Store(ctx context.Context, key *APIKey) error
Delete(ctx context.Context, key string) error
GetKeys(ctx context.Context) ([]APIKey, error)
}
type APIKey struct {
Name string `json:"name"`
Key string `json:"key"`
Scopes []string `json:"scopes"`
CreatedAt time.Time `json:"created_at"`
}