2022-08-02 09:55:19 -05:00
|
|
|
package apikey
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Service interface {
|
2022-08-04 07:19:09 -05:00
|
|
|
GetAPIKeys(ctx context.Context, query *GetApiKeysQuery) error
|
|
|
|
GetAllAPIKeys(ctx context.Context, orgID int64) []*APIKey
|
|
|
|
DeleteApiKey(ctx context.Context, cmd *DeleteCommand) error
|
|
|
|
AddAPIKey(ctx context.Context, cmd *AddCommand) error
|
|
|
|
GetApiKeyById(ctx context.Context, query *GetByIDQuery) error
|
|
|
|
GetApiKeyByName(ctx context.Context, query *GetByNameQuery) error
|
|
|
|
GetAPIKeyByHash(ctx context.Context, hash string) (*APIKey, error)
|
2022-08-02 09:55:19 -05:00
|
|
|
UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error
|
|
|
|
}
|