Documentation
¶
Index ¶
- type APIKey
- type APIKeyKey
- type APIKeySpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateAPIKey(spec APIKeySpec) (*APIKey, error)
- func (s *S) DeleteAPIKey(k APIKeyKey) error
- func (s *S) GetAPIKeyByNameAndTenantID(name, tenantID string) (*APIKey, error)
- func (s *S) ListAPIKeysByTenantID(tenantID string) ([]*APIKey, error)
- func (s *S) ListAllAPIKeys() ([]*APIKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct {
gorm.Model
APIKeyID string `gorm:"uniqueIndex:idx_api_key_api_key_id_tenant_id"`
Name string `gorm:"uniqueIndex:idx_api_key_name_tenant_id"`
TenantID string `gorm:"uniqueIndex:idx_api_key_api_key_id_tenant_id;uniqueIndex:idx_api_key_name_tenant_id"`
OrganizationID string
UserID string
Secret string
}
APIKey represents an API key.
type APIKeySpec ¶
APIKeySpec is a spec of the API key.
type S ¶
type S struct {
// contains filtered or unexported fields
}
S represents the data store.
func (*S) AutoMigrate ¶
AutoMigrate sets up the auto-migration task of the database.
func (*S) CreateAPIKey ¶
func (s *S) CreateAPIKey(spec APIKeySpec) (*APIKey, error)
CreateAPIKey creates a new API key.
func (*S) DeleteAPIKey ¶
DeleteAPIKey deletes an APIKey by APIKey ID and tenant ID.
func (*S) GetAPIKeyByNameAndTenantID ¶ added in v0.7.0
GetAPIKeyByNameAndTenantID gets an API key by its name and tenant ID.
func (*S) ListAPIKeysByTenantID ¶
ListAPIKeysByTenantID lists API keys by a tenant ID.
func (*S) ListAllAPIKeys ¶
ListAllAPIKeys lists all API keys.
Click to show internal directories.
Click to hide internal directories.