Documentation ¶
Overview ¶
Package apikeys is a generated GoMock package.
Index ¶
- func InitRepositoryProvider(databaseProvider string)
- type MockRepository
- func (m *MockRepository) AddAPIKey(userID, comment string) (*interfaces.APIKey, error)
- func (m *MockRepository) DeleteAPIKey(userGUID, keyGUID string) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetAPIKeyBySecret(keySecret string) (*interfaces.APIKey, error)
- func (m *MockRepository) ListAPIKeys(userID string) ([]interfaces.APIKey, error)
- func (m *MockRepository) UpdateAPIKeyLastUsed(keyGUID string) error
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) AddAPIKey(userID, comment interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteAPIKey(userGUID, keyGUID interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetAPIKeyBySecret(keySecret interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListAPIKeys(userID interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) UpdateAPIKeyLastUsed(keyGUID interface{}) *gomock.Call
- type PgsqlAPIKeysRepository
- func (p *PgsqlAPIKeysRepository) AddAPIKey(userID string, comment string) (*interfaces.APIKey, error)
- func (p *PgsqlAPIKeysRepository) DeleteAPIKey(userGUID string, keyGUID string) error
- func (p *PgsqlAPIKeysRepository) GetAPIKeyBySecret(keySecret string) (*interfaces.APIKey, error)
- func (p *PgsqlAPIKeysRepository) ListAPIKeys(userID string) ([]interfaces.APIKey, error)
- func (p *PgsqlAPIKeysRepository) UpdateAPIKeyLastUsed(keyGUID string) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRepositoryProvider ¶
func InitRepositoryProvider(databaseProvider string)
InitRepositoryProvider - One time init for the given DB Provider
Types ¶
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance
func (*MockRepository) AddAPIKey ¶
func (m *MockRepository) AddAPIKey(userID, comment string) (*interfaces.APIKey, error)
AddAPIKey mocks base method
func (*MockRepository) DeleteAPIKey ¶
func (m *MockRepository) DeleteAPIKey(userGUID, keyGUID string) error
DeleteAPIKey mocks base method
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRepository) GetAPIKeyBySecret ¶
func (m *MockRepository) GetAPIKeyBySecret(keySecret string) (*interfaces.APIKey, error)
GetAPIKeyBySecret mocks base method
func (*MockRepository) ListAPIKeys ¶
func (m *MockRepository) ListAPIKeys(userID string) ([]interfaces.APIKey, error)
ListAPIKeys mocks base method
func (*MockRepository) UpdateAPIKeyLastUsed ¶
func (m *MockRepository) UpdateAPIKeyLastUsed(keyGUID string) error
UpdateAPIKeyLastUsed mocks base method
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository
func (*MockRepositoryMockRecorder) AddAPIKey ¶
func (mr *MockRepositoryMockRecorder) AddAPIKey(userID, comment interface{}) *gomock.Call
AddAPIKey indicates an expected call of AddAPIKey
func (*MockRepositoryMockRecorder) DeleteAPIKey ¶
func (mr *MockRepositoryMockRecorder) DeleteAPIKey(userGUID, keyGUID interface{}) *gomock.Call
DeleteAPIKey indicates an expected call of DeleteAPIKey
func (*MockRepositoryMockRecorder) GetAPIKeyBySecret ¶
func (mr *MockRepositoryMockRecorder) GetAPIKeyBySecret(keySecret interface{}) *gomock.Call
GetAPIKeyBySecret indicates an expected call of GetAPIKeyBySecret
func (*MockRepositoryMockRecorder) ListAPIKeys ¶
func (mr *MockRepositoryMockRecorder) ListAPIKeys(userID interface{}) *gomock.Call
ListAPIKeys indicates an expected call of ListAPIKeys
func (*MockRepositoryMockRecorder) UpdateAPIKeyLastUsed ¶
func (mr *MockRepositoryMockRecorder) UpdateAPIKeyLastUsed(keyGUID interface{}) *gomock.Call
UpdateAPIKeyLastUsed indicates an expected call of UpdateAPIKeyLastUsed
type PgsqlAPIKeysRepository ¶
type PgsqlAPIKeysRepository struct {
// contains filtered or unexported fields
}
PgsqlAPIKeysRepository - Postgresql-backed API keys repository
func (*PgsqlAPIKeysRepository) AddAPIKey ¶
func (p *PgsqlAPIKeysRepository) AddAPIKey(userID string, comment string) (*interfaces.APIKey, error)
AddAPIKey - Add a new API key to the datastore.
func (*PgsqlAPIKeysRepository) DeleteAPIKey ¶
func (p *PgsqlAPIKeysRepository) DeleteAPIKey(userGUID string, keyGUID string) error
DeleteAPIKey - delete an API key identified by its GUID
func (*PgsqlAPIKeysRepository) GetAPIKeyBySecret ¶
func (p *PgsqlAPIKeysRepository) GetAPIKeyBySecret(keySecret string) (*interfaces.APIKey, error)
GetAPIKeyBySecret - gets user ID for an API key
func (*PgsqlAPIKeysRepository) ListAPIKeys ¶
func (p *PgsqlAPIKeysRepository) ListAPIKeys(userID string) ([]interfaces.APIKey, error)
ListAPIKeys - list API keys for a given user GUID
func (*PgsqlAPIKeysRepository) UpdateAPIKeyLastUsed ¶
func (p *PgsqlAPIKeysRepository) UpdateAPIKeyLastUsed(keyGUID string) error
UpdateAPIKeyLastUsed - sets API key last_used field to current time
type Repository ¶
type Repository interface { AddAPIKey(userID string, comment string) (*interfaces.APIKey, error) GetAPIKeyBySecret(keySecret string) (*interfaces.APIKey, error) ListAPIKeys(userID string) ([]interfaces.APIKey, error) DeleteAPIKey(userGUID string, keyGUID string) error UpdateAPIKeyLastUsed(keyGUID string) error }
Repository - API keys repository
func NewPgsqlAPIKeysRepository ¶
func NewPgsqlAPIKeysRepository(dcp *sql.DB) (Repository, error)
NewPgsqlAPIKeysRepository - get a reference to the API keys data source