Documentation ¶
Index ¶
- Variables
- type ConfigProvider
- type ConfigProviderAPI
- type GcpFactoryConfig
- type GoogleAuthProvider
- type GoogleAuthProviderAPI
- type MockConfigProviderAPI
- type MockConfigProviderAPI_Expecter
- type MockConfigProviderAPI_GetGcpClientConfig_Call
- func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) Return(_a0 *GcpFactoryConfig, _a1 error) *MockConfigProviderAPI_GetGcpClientConfig_Call
- func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) Run(run func(ctx context.Context, cfg config.GcpConfig, log *logp.Logger)) *MockConfigProviderAPI_GetGcpClientConfig_Call
- func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) RunAndReturn(...) *MockConfigProviderAPI_GetGcpClientConfig_Call
- type MockGoogleAuthProviderAPI
- type MockGoogleAuthProviderAPI_Expecter
- type MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
- func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Return(_a0 *google.Credentials, _a1 error) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
- func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Run(run func(ctx context.Context)) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
- func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) RunAndReturn(run func(context.Context) (*google.Credentials, error)) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCredentialsJSON = errors.New("invalid credentials JSON")
var ErrMissingOrgId = errors.New("organization ID is required for organization account type")
var ErrProjectNotFound = errors.New("no project ID was found")
Functions ¶
This section is empty.
Types ¶
type ConfigProvider ¶
type ConfigProvider struct {
AuthProvider GoogleAuthProviderAPI
}
func (*ConfigProvider) GetGcpClientConfig ¶
func (p *ConfigProvider) GetGcpClientConfig(ctx context.Context, cfg config.GcpConfig, log *logp.Logger) (*GcpFactoryConfig, error)
type ConfigProviderAPI ¶
type GcpFactoryConfig ¶
type GcpFactoryConfig struct { // organizations/%s or projects/%s Parent string ClientOpts []option.ClientOption }
type GoogleAuthProvider ¶
type GoogleAuthProvider struct{}
func (*GoogleAuthProvider) FindDefaultCredentials ¶
func (p *GoogleAuthProvider) FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)
FindDefaultCredentials is a wrapper around google.FindDefaultCredentials to make it easier to mock
type GoogleAuthProviderAPI ¶
type GoogleAuthProviderAPI interface {
FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)
}
type MockConfigProviderAPI ¶
MockConfigProviderAPI is an autogenerated mock type for the ConfigProviderAPI type
func NewMockConfigProviderAPI ¶
func NewMockConfigProviderAPI(t interface { mock.TestingT Cleanup(func()) }) *MockConfigProviderAPI
NewMockConfigProviderAPI creates a new instance of MockConfigProviderAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockConfigProviderAPI) EXPECT ¶
func (_m *MockConfigProviderAPI) EXPECT() *MockConfigProviderAPI_Expecter
func (*MockConfigProviderAPI) GetGcpClientConfig ¶
func (_m *MockConfigProviderAPI) GetGcpClientConfig(ctx context.Context, cfg config.GcpConfig, log *logp.Logger) (*GcpFactoryConfig, error)
GetGcpClientConfig provides a mock function with given fields: ctx, cfg, log
type MockConfigProviderAPI_Expecter ¶
type MockConfigProviderAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockConfigProviderAPI_Expecter) GetGcpClientConfig ¶
func (_e *MockConfigProviderAPI_Expecter) GetGcpClientConfig(ctx interface{}, cfg interface{}, log interface{}) *MockConfigProviderAPI_GetGcpClientConfig_Call
GetGcpClientConfig is a helper method to define mock.On call
- ctx context.Context
- cfg config.GcpConfig
- log *logp.Logger
type MockConfigProviderAPI_GetGcpClientConfig_Call ¶
MockConfigProviderAPI_GetGcpClientConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGcpClientConfig'
func (*MockConfigProviderAPI_GetGcpClientConfig_Call) Return ¶
func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) Return(_a0 *GcpFactoryConfig, _a1 error) *MockConfigProviderAPI_GetGcpClientConfig_Call
func (*MockConfigProviderAPI_GetGcpClientConfig_Call) Run ¶
func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) Run(run func(ctx context.Context, cfg config.GcpConfig, log *logp.Logger)) *MockConfigProviderAPI_GetGcpClientConfig_Call
func (*MockConfigProviderAPI_GetGcpClientConfig_Call) RunAndReturn ¶
func (_c *MockConfigProviderAPI_GetGcpClientConfig_Call) RunAndReturn(run func(context.Context, config.GcpConfig, *logp.Logger) (*GcpFactoryConfig, error)) *MockConfigProviderAPI_GetGcpClientConfig_Call
type MockGoogleAuthProviderAPI ¶
MockGoogleAuthProviderAPI is an autogenerated mock type for the GoogleAuthProviderAPI type
func NewMockGoogleAuthProviderAPI ¶
func NewMockGoogleAuthProviderAPI(t interface { mock.TestingT Cleanup(func()) }) *MockGoogleAuthProviderAPI
NewMockGoogleAuthProviderAPI creates a new instance of MockGoogleAuthProviderAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockGoogleAuthProviderAPI) EXPECT ¶
func (_m *MockGoogleAuthProviderAPI) EXPECT() *MockGoogleAuthProviderAPI_Expecter
func (*MockGoogleAuthProviderAPI) FindDefaultCredentials ¶
func (_m *MockGoogleAuthProviderAPI) FindDefaultCredentials(ctx context.Context) (*google.Credentials, error)
FindDefaultCredentials provides a mock function with given fields: ctx
type MockGoogleAuthProviderAPI_Expecter ¶
type MockGoogleAuthProviderAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockGoogleAuthProviderAPI_Expecter) FindDefaultCredentials ¶
func (_e *MockGoogleAuthProviderAPI_Expecter) FindDefaultCredentials(ctx interface{}) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
FindDefaultCredentials is a helper method to define mock.On call
- ctx context.Context
type MockGoogleAuthProviderAPI_FindDefaultCredentials_Call ¶
MockGoogleAuthProviderAPI_FindDefaultCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDefaultCredentials'
func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Return ¶
func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Return(_a0 *google.Credentials, _a1 error) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Run ¶
func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) Run(run func(ctx context.Context)) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call
func (*MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) RunAndReturn ¶
func (_c *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call) RunAndReturn(run func(context.Context) (*google.Credentials, error)) *MockGoogleAuthProviderAPI_FindDefaultCredentials_Call