Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct { Id int64 `db:"id"` OrgId int64 `db:"org_id"` Name string `db:"name"` Key string `db:"key"` Role org.RoleType `db:"role"` Created time.Time `db:"created"` Updated time.Time `db:"updated"` LastUsedAt *time.Time `xorm:"last_used_at" db:"last_used_at"` Expires *int64 `db:"expires"` ServiceAccountId *int64 `db:"service_account_id"` IsRevoked *bool `xorm:"is_revoked" db:"is_revoked"` }
type AddCommand ¶
type AddCommand struct { Name string `json:"name" binding:"Required"` Role org.RoleType `json:"role" binding:"Required"` OrgId int64 `json:"-"` Key string `json:"-"` SecondsToLive int64 `json:"secondsToLive"` ServiceAccountID *int64 `json:"-"` Result *APIKey `json:"-"` }
swagger:model
type DeleteCommand ¶
type GetApiKeysQuery ¶
type GetApiKeysQuery struct { OrgId int64 IncludeExpired bool User *user.SignedInUser Result []*APIKey }
type GetByIDQuery ¶
type GetByNameQuery ¶
type Service ¶
type Service interface { GetAPIKeys(ctx context.Context, query *GetApiKeysQuery) error GetAllAPIKeys(ctx context.Context, orgID int64) ([]*APIKey, error) 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) UpdateAPIKeyLastUsedDate(ctx context.Context, tokenID int64) error }
Click to show internal directories.
Click to hide internal directories.