Documentation
¶
Index ¶
- func KeyAPIProductStatusesMarshal(ps types.KeyAPIProductStatuses) string
- func KeyAPIProductStatusesUnmarshal(jsonProductStatuses string) types.KeyAPIProductStatuses
- func New(config DatabaseConfig, serviceName string, logger *zap.Logger, ...) (*db.Database, error)
- func PermissionsMarshal(a types.Permissions) string
- func PermissionsUnmarshal(rolePermissionsAsJSON string) types.Permissions
- func ShowCreateSchemaStatements()
- type APIProductStore
- func (s *APIProductStore) Delete(organizationName, apiProduct string) types.Error
- func (s *APIProductStore) Get(organizationName, apiproductName string) (*types.APIProduct, types.Error)
- func (s *APIProductStore) GetAll(organizationName string) (types.APIProducts, types.Error)
- func (s *APIProductStore) Update(organizationName string, p *types.APIProduct) types.Error
- type AuditStore
- func (s *AuditStore) GetAPIProduct(organizationName, apiproductName string, params db.AuditFilterParams) (types.Audits, types.Error)
- func (s *AuditStore) GetApplication(organizationName, developerID, appID string, params db.AuditFilterParams) (types.Audits, types.Error)
- func (s *AuditStore) GetDeveloper(organizationName, developerID string, params db.AuditFilterParams) (types.Audits, types.Error)
- func (s *AuditStore) GetOrganization(organizationName string, params db.AuditFilterParams) (types.Audits, types.Error)
- func (s *AuditStore) GetUser(userName string, params db.AuditFilterParams) (types.Audits, types.Error)
- func (s *AuditStore) Write(a *types.Audit) types.Error
- type ClusterStore
- type CompanyStore
- func (s *CompanyStore) Delete(organizationName, companyToDelete string) types.Error
- func (s *CompanyStore) Get(organizationName, companyName string) (*types.Company, types.Error)
- func (s *CompanyStore) GetAll(organizationName string) (types.Companies, types.Error)
- func (s *CompanyStore) Update(organizationName string, c *types.Company) types.Error
- type Database
- type DatabaseConfig
- type DeveloperAppStore
- func (s *DeveloperAppStore) DeleteByID(organizationName, developerAppID string) types.Error
- func (s *DeveloperAppStore) GetAll(organizationName string) (types.DeveloperApps, types.Error)
- func (s *DeveloperAppStore) GetAllByDeveloperID(organizationName, developerID string) (types.DeveloperApps, types.Error)
- func (s *DeveloperAppStore) GetByID(organizationName, developerAppID string) (*types.DeveloperApp, types.Error)
- func (s *DeveloperAppStore) GetByName(organizationName, developerEmail, developerAppName string) (*types.DeveloperApp, types.Error)
- func (s *DeveloperAppStore) GetCountByDeveloperID(organizationName, developerID string) (int, types.Error)
- func (s *DeveloperAppStore) Update(organizationName string, app *types.DeveloperApp) types.Error
- type DeveloperStore
- func (s *DeveloperStore) DeleteByID(organizationName, developerID string) types.Error
- func (s *DeveloperStore) GetAll(organizationName string) (types.Developers, types.Error)
- func (s *DeveloperStore) GetByEmail(organizationName, developerEmail string) (*types.Developer, types.Error)
- func (s *DeveloperStore) GetByID(organizationName, developerID string) (*types.Developer, types.Error)
- func (s *DeveloperStore) Update(organizationName string, d *types.Developer) types.Error
- type KeyStore
- func (s *KeyStore) DeleteByKey(organization, consumerKey string) types.Error
- func (s *KeyStore) GetByDeveloperAppID(organization, developerAppID string) (types.Keys, types.Error)
- func (s *KeyStore) GetByKey(organization, key *string) (*types.Key, types.Error)
- func (s *KeyStore) GetCountByAPIProductName(organization, apiProductName string) (int, types.Error)
- func (s *KeyStore) Metric(what string)
- func (s *KeyStore) UpdateByKey(organization string, k *types.Key) types.Error
- type ListenerStore
- type OAuthStore
- func (s *OAuthStore) OAuthAccessTokenCreate(t *types.OAuthAccessToken) error
- func (s *OAuthStore) OAuthAccessTokenGetByAccess(accessToken string) (*types.OAuthAccessToken, error)
- func (s *OAuthStore) OAuthAccessTokenGetByCode(code string) (*types.OAuthAccessToken, error)
- func (s *OAuthStore) OAuthAccessTokenGetByRefresh(refresh string) (*types.OAuthAccessToken, error)
- func (s *OAuthStore) OAuthAccessTokenRemoveByAccess(accessTokenToDelete string) error
- func (s *OAuthStore) OAuthAccessTokenRemoveByCode(codeToDelete string) error
- func (s *OAuthStore) OAuthAccessTokenRemoveByRefresh(refreshToDelete string) error
- type OrganizationStore
- func (s *OrganizationStore) Delete(organizationToDelete string) types.Error
- func (s *OrganizationStore) Get(organizationName string) (*types.Organization, types.Error)
- func (s *OrganizationStore) GetAll() (types.Organizations, types.Error)
- func (s *OrganizationStore) Update(o *types.Organization) types.Error
- type RoleStore
- type RouteStore
- type UserStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyAPIProductStatusesMarshal ¶
func KeyAPIProductStatusesMarshal(ps types.KeyAPIProductStatuses) string
Marshal packs a key's product statuses into JSON Example input: [{"name":"DisplayName","value":"erikbos teleporter"},{"name":"ErikbosTeleporterExtraAttribute","value":"42"}]
func KeyAPIProductStatusesUnmarshal ¶
func KeyAPIProductStatusesUnmarshal(jsonProductStatuses string) types.KeyAPIProductStatuses
Unmarshal unpacks a key's product statuses Example input: [{"name":"S","value":"erikbos teleporter"},{"name":"ErikbosTeleporterExtraAttribute","value":"42"}]
func New ¶
func New(config DatabaseConfig, serviceName string, logger *zap.Logger, createSchema bool, replicationCount int) (*db.Database, error)
New builds new connected database instance
func PermissionsMarshal ¶
func PermissionsMarshal(a types.Permissions) string
PermissionsMarshal packs role Permissions into JSON
func PermissionsUnmarshal ¶
func PermissionsUnmarshal(rolePermissionsAsJSON string) types.Permissions
PermissionsUnmarshal unpacks JSON-encoded role permissions into Permissions
func ShowCreateSchemaStatements ¶
func ShowCreateSchemaStatements()
ShowCreateSchemaStatements show CQL statements to create all tables
Types ¶
type APIProductStore ¶
type APIProductStore struct {
// contains filtered or unexported fields
}
APIProductStore holds our database config
func NewAPIProductStore ¶
func NewAPIProductStore(database *Database) *APIProductStore
NewAPIProductStore creates api product instance
func (*APIProductStore) Delete ¶
func (s *APIProductStore) Delete(organizationName, apiProduct string) types.Error
Delete deletes an apiproduct
func (*APIProductStore) Get ¶
func (s *APIProductStore) Get(organizationName, apiproductName string) (*types.APIProduct, types.Error)
Get returns an apiproduct
func (*APIProductStore) GetAll ¶
func (s *APIProductStore) GetAll(organizationName string) (types.APIProducts, types.Error)
GetAll retrieves all api products
func (*APIProductStore) Update ¶
func (s *APIProductStore) Update(organizationName string, p *types.APIProduct) types.Error
Update UPSERTs an apiproduct in database
type AuditStore ¶
type AuditStore struct {
// contains filtered or unexported fields
}
AuditStore holds our AuditStore config
func NewAuditStore ¶
func NewAuditStore(database *Database) *AuditStore
NewAuditStore creates audit instance
func (*AuditStore) GetAPIProduct ¶
func (s *AuditStore) GetAPIProduct(organizationName, apiproductName string, params db.AuditFilterParams) (types.Audits, types.Error)
GetAPIProduct retrieves audit records of an apiproduct
func (*AuditStore) GetApplication ¶
func (s *AuditStore) GetApplication(organizationName, developerID, appID string, params db.AuditFilterParams) (types.Audits, types.Error)
GetApplication retrieves audit records of an application
func (*AuditStore) GetDeveloper ¶
func (s *AuditStore) GetDeveloper(organizationName, developerID string, params db.AuditFilterParams) (types.Audits, types.Error)
GetDeveloper retrieves audit records of a developer
func (*AuditStore) GetOrganization ¶
func (s *AuditStore) GetOrganization(organizationName string, params db.AuditFilterParams) (types.Audits, types.Error)
GetOrganization retrieves audit records of an organization
func (*AuditStore) GetUser ¶
func (s *AuditStore) GetUser(userName string, params db.AuditFilterParams) (types.Audits, types.Error)
GetUser retrieves audit records of a user
type ClusterStore ¶
type ClusterStore struct {
// contains filtered or unexported fields
}
ClusterStore holds our database config
func NewClusterStore ¶
func NewClusterStore(database *Database) *ClusterStore
NewClusterStore creates cluster instance
func (*ClusterStore) Delete ¶
func (s *ClusterStore) Delete(clusterToDelete string) types.Error
Delete deletes a cluster
type CompanyStore ¶
type CompanyStore struct {
// contains filtered or unexported fields
}
CompanyStore holds our database config
func NewCompanyStore ¶
func NewCompanyStore(database *Database) *CompanyStore
NewCompanyStore creates company instance
func (*CompanyStore) Delete ¶
func (s *CompanyStore) Delete(organizationName, companyToDelete string) types.Error
Delete deletes a company
type DatabaseConfig ¶
type DatabaseConfig struct { Hostname string Port int TLS struct { Enable bool Capath string } Username string Password string Keyspace string InitKeyspaces bool Timeout time.Duration ConnectAttempts int QueryRetries int }
DatabaseConfig holds database connection configuration
type DeveloperAppStore ¶
type DeveloperAppStore struct {
// contains filtered or unexported fields
}
DeveloperAppStore holds our database config
func NewDeveloperAppStore ¶
func NewDeveloperAppStore(database *Database) *DeveloperAppStore
NewDeveloperAppStore creates developer app instance
func (*DeveloperAppStore) DeleteByID ¶
func (s *DeveloperAppStore) DeleteByID(organizationName, developerAppID string) types.Error
DeleteByID deletes a developer app
func (*DeveloperAppStore) GetAll ¶
func (s *DeveloperAppStore) GetAll(organizationName string) (types.DeveloperApps, types.Error)
GetAll retrieves all developer apps
func (*DeveloperAppStore) GetAllByDeveloperID ¶
func (s *DeveloperAppStore) GetAllByDeveloperID(organizationName, developerID string) (types.DeveloperApps, types.Error)
GetAllByDeveloperID retrieves all developer apps from a developer
func (*DeveloperAppStore) GetByID ¶
func (s *DeveloperAppStore) GetByID(organizationName, developerAppID string) (*types.DeveloperApp, types.Error)
GetByID returns a developer app
func (*DeveloperAppStore) GetByName ¶
func (s *DeveloperAppStore) GetByName(organizationName, developerEmail, developerAppName string) (*types.DeveloperApp, types.Error)
GetByName returns a developer app
func (*DeveloperAppStore) GetCountByDeveloperID ¶
func (s *DeveloperAppStore) GetCountByDeveloperID(organizationName, developerID string) (int, types.Error)
GetCountByDeveloperID retrieves number of apps belonging to a developer
func (*DeveloperAppStore) Update ¶
func (s *DeveloperAppStore) Update(organizationName string, app *types.DeveloperApp) types.Error
Update UPSERTs a developer app
type DeveloperStore ¶
type DeveloperStore struct {
// contains filtered or unexported fields
}
DeveloperStore holds our database config
func NewDeveloperStore ¶
func NewDeveloperStore(database *Database) *DeveloperStore
NewDeveloperStore creates developer instance
func (*DeveloperStore) DeleteByID ¶
func (s *DeveloperStore) DeleteByID(organizationName, developerID string) types.Error
DeleteByID deletes a developer
func (*DeveloperStore) GetAll ¶
func (s *DeveloperStore) GetAll(organizationName string) (types.Developers, types.Error)
GetAll retrieves all developer
func (*DeveloperStore) GetByEmail ¶
func (s *DeveloperStore) GetByEmail(organizationName, developerEmail string) (*types.Developer, types.Error)
GetByEmail retrieves a developer from database
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore holds our database config
func (*KeyStore) DeleteByKey ¶
DeleteByKey deletes keys
func (*KeyStore) GetByDeveloperAppID ¶
func (s *KeyStore) GetByDeveloperAppID(organization, developerAppID string) (types.Keys, types.Error)
GetByDeveloperAppID returns an array with apikey details of a developer app
func (*KeyStore) GetCountByAPIProductName ¶
GetCountByAPIProductName counts the number of times an apiproduct has been assigned to keys
type ListenerStore ¶
type ListenerStore struct {
// contains filtered or unexported fields
}
ListenerStore holds our ListenerStore config
func NewListenerStore ¶
func NewListenerStore(database *Database) *ListenerStore
NewListenerStore creates listener instance
func (*ListenerStore) Delete ¶
func (s *ListenerStore) Delete(listenerToDelete string) types.Error
Delete deletes a listener
type OAuthStore ¶
type OAuthStore struct {
// contains filtered or unexported fields
}
OAuthStore holds our database config
func NewOAuthStore ¶
func NewOAuthStore(database *Database) *OAuthStore
NewOAuthStore creates oauth instance
func (*OAuthStore) OAuthAccessTokenCreate ¶
func (s *OAuthStore) OAuthAccessTokenCreate(t *types.OAuthAccessToken) error
OAuthAccessTokenCreate UPSERTs a token in database
func (*OAuthStore) OAuthAccessTokenGetByAccess ¶
func (s *OAuthStore) OAuthAccessTokenGetByAccess(accessToken string) (*types.OAuthAccessToken, error)
OAuthAccessTokenGetByAccess retrieves an access token
func (*OAuthStore) OAuthAccessTokenGetByCode ¶
func (s *OAuthStore) OAuthAccessTokenGetByCode(code string) (*types.OAuthAccessToken, error)
OAuthAccessTokenGetByCode retrieves token by code
func (*OAuthStore) OAuthAccessTokenGetByRefresh ¶
func (s *OAuthStore) OAuthAccessTokenGetByRefresh(refresh string) (*types.OAuthAccessToken, error)
OAuthAccessTokenGetByRefresh retrieves token by refreshcode
func (*OAuthStore) OAuthAccessTokenRemoveByAccess ¶
func (s *OAuthStore) OAuthAccessTokenRemoveByAccess(accessTokenToDelete string) error
OAuthAccessTokenRemoveByAccess deletes an access token
func (*OAuthStore) OAuthAccessTokenRemoveByCode ¶
func (s *OAuthStore) OAuthAccessTokenRemoveByCode(codeToDelete string) error
OAuthAccessTokenRemoveByCode deletes an access token
func (*OAuthStore) OAuthAccessTokenRemoveByRefresh ¶
func (s *OAuthStore) OAuthAccessTokenRemoveByRefresh(refreshToDelete string) error
OAuthAccessTokenRemoveByRefresh deletes an access token
type OrganizationStore ¶
type OrganizationStore struct {
// contains filtered or unexported fields
}
OrganizationStore holds our database config
func NewOrganizationStore ¶
func NewOrganizationStore(database *Database) *OrganizationStore
NewOrganizationStore creates organization instance
func (*OrganizationStore) Delete ¶
func (s *OrganizationStore) Delete(organizationToDelete string) types.Error
Delete deletes a organization
func (*OrganizationStore) Get ¶
func (s *OrganizationStore) Get(organizationName string) (*types.Organization, types.Error)
Get retrieves a organization from database
func (*OrganizationStore) GetAll ¶
func (s *OrganizationStore) GetAll() (types.Organizations, types.Error)
GetAll retrieves all organizations
func (*OrganizationStore) Update ¶
func (s *OrganizationStore) Update(o *types.Organization) types.Error
Update UPSERTs an organization in database
type RoleStore ¶
type RoleStore struct {
// contains filtered or unexported fields
}
RoleStore holds our database config
func NewRoleStore ¶
NewRoleStore creates role instance
type RouteStore ¶
type RouteStore struct {
// contains filtered or unexported fields
}
RouteStore holds our route config
func NewRouteStore ¶
func NewRouteStore(database *Database) *RouteStore
NewRouteStore creates route instance
func (*RouteStore) Delete ¶
func (s *RouteStore) Delete(routeToDelete string) types.Error
Delete deletes a route
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore holds our database config
func NewUserStore ¶
NewUserStore creates user instance