cache

package
v0.0.0-...-cd00529 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *Config, d *db.Database, applicationName string, logger *zap.Logger) (*db.Database, error)

New initializes read through cache for database access

Types

type APIProductCache

type APIProductCache struct {
	// contains filtered or unexported fields
}

APIProductCache holds our database config

func NewAPIProductCache

func NewAPIProductCache(cache *Cache, apiproduct db.APIProduct) *APIProductCache

NewAPIProductCache creates apiproduct instance

func (*APIProductCache) Delete

func (s *APIProductCache) Delete(organizationName, apiProduct string) types.Error

Delete deletes an apiproduct

func (*APIProductCache) Get

func (s *APIProductCache) Get(organizationName, apiproductName string) (*types.APIProduct, types.Error)

Get returns an apiproduct

func (*APIProductCache) GetAll

func (s *APIProductCache) GetAll(organizationName string) (types.APIProducts, types.Error)

GetAll retrieves all api products

func (*APIProductCache) Update

func (s *APIProductCache) Update(organizationName string, p *types.APIProduct) types.Error

Update UPSERTs an apiproduct in database

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache holds our runtime parameters

type Config

type Config struct {
	Size        int
	TTL         int
	NegativeTTL int
}

Config contains our start configuration

type DeveloperAppCache

type DeveloperAppCache struct {
	// contains filtered or unexported fields
}

DeveloperAppCache holds our database config

func NewDeveloperAppCache

func NewDeveloperAppCache(cache *Cache, developerapp db.DeveloperApp) *DeveloperAppCache

NewDeveloperAppCache creates developer instance

func (*DeveloperAppCache) DeleteByID

func (s *DeveloperAppCache) DeleteByID(organizationName, developerAppID string) types.Error

DeleteByID deletes a developer app

func (*DeveloperAppCache) GetAll

func (s *DeveloperAppCache) GetAll(organizationName string) (types.DeveloperApps, types.Error)

GetAll retrieves all developer apps

func (*DeveloperAppCache) GetAllByDeveloperID

func (s *DeveloperAppCache) GetAllByDeveloperID(organizationName, developerID string) (types.DeveloperApps, types.Error)

GetAllByDeveloperID retrieves all developer apps from one developer

func (*DeveloperAppCache) GetByID

func (s *DeveloperAppCache) GetByID(organizationName, developerAppID string) (*types.DeveloperApp, types.Error)

GetByID returns a developer app

func (*DeveloperAppCache) GetByName

func (s *DeveloperAppCache) GetByName(organizationName string, developerEmail, developerAppName string) (*types.DeveloperApp, types.Error)

GetByName returns a developer app

func (*DeveloperAppCache) GetCountByDeveloperID

func (s *DeveloperAppCache) GetCountByDeveloperID(organizationName, developerID string) (int, types.Error)

GetCountByDeveloperID retrieves number of apps belonging to a developer

func (*DeveloperAppCache) Update

func (s *DeveloperAppCache) Update(organizationName string, app *types.DeveloperApp) types.Error

Update UPSERTs a developer app

type DeveloperCache

type DeveloperCache struct {
	// contains filtered or unexported fields
}

DeveloperCache holds our database config

func NewDeveloperCache

func NewDeveloperCache(cache *Cache, developer db.Developer) *DeveloperCache

NewDeveloperCache creates developer instance

func (*DeveloperCache) DeleteByID

func (s *DeveloperCache) DeleteByID(organizationName, developerID string) types.Error

DeleteByID deletes a developer

func (*DeveloperCache) GetAll

func (s *DeveloperCache) GetAll(organizationName string) (types.Developers, types.Error)

GetAll retrieves all developer

func (*DeveloperCache) GetByEmail

func (s *DeveloperCache) GetByEmail(organizationName, developerEmail string) (*types.Developer, types.Error)

GetByEmail retrieves a developer from database

func (*DeveloperCache) GetByID

func (s *DeveloperCache) GetByID(organizationName, developerID string) (*types.Developer, types.Error)

GetByID retrieves a developer from database

func (*DeveloperCache) Update

func (s *DeveloperCache) Update(organizationName string, d *types.Developer) types.Error

Update UPSERTs a developer in database

type KeyCache

type KeyCache struct {
	// contains filtered or unexported fields
}

KeyCache holds our database config

func NewKeyCache

func NewKeyCache(cache *Cache, key db.Key) *KeyCache

NewKeyCache creates key instance

func (*KeyCache) DeleteByKey

func (s *KeyCache) DeleteByKey(organizationName, consumerKey string) types.Error

DeleteByKey deletes keys

func (*KeyCache) GetByDeveloperAppID

func (s *KeyCache) GetByDeveloperAppID(organizationName, developerAppID string) (types.Keys, types.Error)

GetByDeveloperAppID returns an array with apikey details of a developer app

func (*KeyCache) GetByKey

func (s *KeyCache) GetByKey(organizationName, key *string) (*types.Key, types.Error)

GetByKey returns details of a single apikey

func (*KeyCache) GetCountByAPIProductName

func (s *KeyCache) GetCountByAPIProductName(organizationName, apiProductName string) (int, types.Error)

GetCountByAPIProductName counts the number of times an apiproduct has been assigned to keys

func (*KeyCache) UpdateByKey

func (s *KeyCache) UpdateByKey(organizationName string, c *types.Key) types.Error

UpdateByKey UPSERTs keys in database

type OAuthCache

type OAuthCache struct {
	// contains filtered or unexported fields
}

OAuthCache holds our database config

func NewOAuthCache

func NewOAuthCache(cache *Cache, oauth db.OAuth) *OAuthCache

NewOAuthCache creates user instance

func (*OAuthCache) OAuthAccessTokenCreate

func (s *OAuthCache) OAuthAccessTokenCreate(t *types.OAuthAccessToken) error

OAuthAccessTokenCreate UPSERTs a token in database

func (*OAuthCache) OAuthAccessTokenGetByAccess

func (s *OAuthCache) OAuthAccessTokenGetByAccess(accessToken string) (*types.OAuthAccessToken, error)

OAuthAccessTokenGetByAccess retrieves an access token

func (*OAuthCache) OAuthAccessTokenGetByCode

func (s *OAuthCache) OAuthAccessTokenGetByCode(code string) (*types.OAuthAccessToken, error)

OAuthAccessTokenGetByCode retrieves token by code

func (*OAuthCache) OAuthAccessTokenGetByRefresh

func (s *OAuthCache) OAuthAccessTokenGetByRefresh(refresh string) (*types.OAuthAccessToken, error)

OAuthAccessTokenGetByRefresh retrieves token by refreshcode

func (*OAuthCache) OAuthAccessTokenRemoveByAccess

func (s *OAuthCache) OAuthAccessTokenRemoveByAccess(accessTokenToDelete string) error

OAuthAccessTokenRemoveByAccess deletes an access token

func (*OAuthCache) OAuthAccessTokenRemoveByCode

func (s *OAuthCache) OAuthAccessTokenRemoveByCode(codeToDelete string) error

OAuthAccessTokenRemoveByCode deletes an access token

func (*OAuthCache) OAuthAccessTokenRemoveByRefresh

func (s *OAuthCache) OAuthAccessTokenRemoveByRefresh(refreshToDelete string) error

OAuthAccessTokenRemoveByRefresh deletes an access token

type RoleCache

type RoleCache struct {
	// contains filtered or unexported fields
}

RoleCache holds our database config

func NewRoleCache

func NewRoleCache(cache *Cache, role db.Role) *RoleCache

NewRoleCache creates role instance

func (*RoleCache) Delete

func (s *RoleCache) Delete(roleToDelete string) types.Error

Delete deletes a role

func (*RoleCache) Get

func (s *RoleCache) Get(roleName string) (*types.Role, types.Error)

Get retrieves a role from database

func (*RoleCache) GetAll

func (s *RoleCache) GetAll() (types.Roles, types.Error)

GetAll retrieves all roles

func (*RoleCache) Update

func (s *RoleCache) Update(c *types.Role) types.Error

Update UPSERTs an role in database

type UserCache

type UserCache struct {
	// contains filtered or unexported fields
}

UserCache holds our database config

func NewUserCache

func NewUserCache(cache *Cache, user db.User) *UserCache

NewUserCache creates user instance

func (*UserCache) Delete

func (s *UserCache) Delete(userToDelete string) types.Error

Delete deletes a user

func (*UserCache) Get

func (s *UserCache) Get(userName string) (*types.User, types.Error)

Get retrieves a user from database

func (*UserCache) GetAll

func (s *UserCache) GetAll() (types.Users, types.Error)

GetAll retrieves all users

func (*UserCache) Update

func (s *UserCache) Update(c *types.User) types.Error

Update UPSERTs an user in database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL