Documentation ¶
Index ¶
- Variables
- func GetAllGatewayConsumers(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK) ([]kkComps.Consumer, error)
- func GetAllGatewayRoutes(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK) ([]kkComps.Route, error)
- func GetAllGatewayServices(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK) ([]kkComps.Service, error)
- func GetControlPlaneID(ctx context.Context, kkClient *kkSDK.SDK, cpName string) (string, error)
- type ControlPlaneAPI
- type Key
- type KonnectSDK
- type MockControlPlaneAPI
- func (_m *MockControlPlaneAPI) CreateControlPlane(ctx context.Context, request components.CreateControlPlaneRequest, ...) (*operations.CreateControlPlaneResponse, error)
- func (_m *MockControlPlaneAPI) DeleteControlPlane(ctx context.Context, id string, opts ...operations.Option) (*operations.DeleteControlPlaneResponse, error)
- func (_m *MockControlPlaneAPI) EXPECT() *MockControlPlaneAPI_Expecter
- func (_m *MockControlPlaneAPI) GetControlPlane(ctx context.Context, id string, opts ...operations.Option) (*operations.GetControlPlaneResponse, error)
- func (_m *MockControlPlaneAPI) ListControlPlanes(ctx context.Context, request operations.ListControlPlanesRequest, ...) (*operations.ListControlPlanesResponse, error)
- func (_m *MockControlPlaneAPI) UpdateControlPlane(ctx context.Context, id string, ...) (*operations.UpdateControlPlaneResponse, error)
- type MockControlPlaneAPI_CreateControlPlane_Call
- func (_c *MockControlPlaneAPI_CreateControlPlane_Call) Return(_a0 *operations.CreateControlPlaneResponse, _a1 error) *MockControlPlaneAPI_CreateControlPlane_Call
- func (_c *MockControlPlaneAPI_CreateControlPlane_Call) Run(...) *MockControlPlaneAPI_CreateControlPlane_Call
- func (_c *MockControlPlaneAPI_CreateControlPlane_Call) RunAndReturn(...) *MockControlPlaneAPI_CreateControlPlane_Call
- type MockControlPlaneAPI_DeleteControlPlane_Call
- func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) Return(_a0 *operations.DeleteControlPlaneResponse, _a1 error) *MockControlPlaneAPI_DeleteControlPlane_Call
- func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) Run(run func(ctx context.Context, id string, opts ...operations.Option)) *MockControlPlaneAPI_DeleteControlPlane_Call
- func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) RunAndReturn(...) *MockControlPlaneAPI_DeleteControlPlane_Call
- type MockControlPlaneAPI_Expecter
- func (_e *MockControlPlaneAPI_Expecter) CreateControlPlane(ctx interface{}, request interface{}, opts ...interface{}) *MockControlPlaneAPI_CreateControlPlane_Call
- func (_e *MockControlPlaneAPI_Expecter) DeleteControlPlane(ctx interface{}, id interface{}, opts ...interface{}) *MockControlPlaneAPI_DeleteControlPlane_Call
- func (_e *MockControlPlaneAPI_Expecter) GetControlPlane(ctx interface{}, id interface{}, opts ...interface{}) *MockControlPlaneAPI_GetControlPlane_Call
- func (_e *MockControlPlaneAPI_Expecter) ListControlPlanes(ctx interface{}, request interface{}, opts ...interface{}) *MockControlPlaneAPI_ListControlPlanes_Call
- func (_e *MockControlPlaneAPI_Expecter) UpdateControlPlane(ctx interface{}, id interface{}, updateControlPlaneRequest interface{}, ...) *MockControlPlaneAPI_UpdateControlPlane_Call
- type MockControlPlaneAPI_GetControlPlane_Call
- func (_c *MockControlPlaneAPI_GetControlPlane_Call) Return(_a0 *operations.GetControlPlaneResponse, _a1 error) *MockControlPlaneAPI_GetControlPlane_Call
- func (_c *MockControlPlaneAPI_GetControlPlane_Call) Run(run func(ctx context.Context, id string, opts ...operations.Option)) *MockControlPlaneAPI_GetControlPlane_Call
- func (_c *MockControlPlaneAPI_GetControlPlane_Call) RunAndReturn(...) *MockControlPlaneAPI_GetControlPlane_Call
- type MockControlPlaneAPI_ListControlPlanes_Call
- func (_c *MockControlPlaneAPI_ListControlPlanes_Call) Return(_a0 *operations.ListControlPlanesResponse, _a1 error) *MockControlPlaneAPI_ListControlPlanes_Call
- func (_c *MockControlPlaneAPI_ListControlPlanes_Call) Run(...) *MockControlPlaneAPI_ListControlPlanes_Call
- func (_c *MockControlPlaneAPI_ListControlPlanes_Call) RunAndReturn(...) *MockControlPlaneAPI_ListControlPlanes_Call
- type MockControlPlaneAPI_UpdateControlPlane_Call
- func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) Return(_a0 *operations.UpdateControlPlaneResponse, _a1 error) *MockControlPlaneAPI_UpdateControlPlane_Call
- func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) Run(run func(ctx context.Context, id string, ...)) *MockControlPlaneAPI_UpdateControlPlane_Call
- func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) RunAndReturn(...) *MockControlPlaneAPI_UpdateControlPlane_Call
- type MockKonnectSDK
- type MockKonnectSDKFactory
- type SDKAPI
- type SDKFactory
Constants ¶
This section is empty.
Variables ¶
var SDKFactoryKey = Key{}
A Key used to store the SDKFactory in a Context
Functions ¶
func GetAllGatewayConsumers ¶
func GetAllGatewayRoutes ¶
func GetAllGatewayServices ¶
Types ¶
type ControlPlaneAPI ¶
type ControlPlaneAPI interface { ListControlPlanes(ctx context.Context, request kkOPS.ListControlPlanesRequest, opts ...kkOPS.Option) (*kkOPS.ListControlPlanesResponse, error) CreateControlPlane(ctx context.Context, request kkCOM.CreateControlPlaneRequest, opts ...kkOPS.Option) (*kkOPS.CreateControlPlaneResponse, error) GetControlPlane(ctx context.Context, id string, opts ...kkOPS.Option) (*kkOPS.GetControlPlaneResponse, error) UpdateControlPlane(ctx context.Context, id string, updateControlPlaneRequest kkCOM.UpdateControlPlaneRequest, opts ...kkOPS.Option) (*kkOPS.UpdateControlPlaneResponse, error) DeleteControlPlane(ctx context.Context, id string, opts ...kkOPS.Option) (*kkOPS.DeleteControlPlaneResponse, error) }
type KonnectSDK ¶
This is the real implementation of the SDKAPI which wraps the actual SDK implmentation
func (*KonnectSDK) GetControlPlaneAPI ¶
func (k *KonnectSDK) GetControlPlaneAPI() ControlPlaneAPI
Returns the real implementation of the GetControlPlaneAPI from the Konnect SDK
type MockControlPlaneAPI ¶
MockControlPlaneAPI is an autogenerated mock type for the ControlPlaneAPI type
func NewMockControlPlaneAPI ¶
func NewMockControlPlaneAPI(t interface { mock.TestingT Cleanup(func()) }) *MockControlPlaneAPI
NewMockControlPlaneAPI creates a new instance of MockControlPlaneAPI. 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 (*MockControlPlaneAPI) CreateControlPlane ¶
func (_m *MockControlPlaneAPI) CreateControlPlane(ctx context.Context, request components.CreateControlPlaneRequest, opts ...operations.Option) (*operations.CreateControlPlaneResponse, error)
CreateControlPlane provides a mock function with given fields: ctx, request, opts
func (*MockControlPlaneAPI) DeleteControlPlane ¶
func (_m *MockControlPlaneAPI) DeleteControlPlane(ctx context.Context, id string, opts ...operations.Option) (*operations.DeleteControlPlaneResponse, error)
DeleteControlPlane provides a mock function with given fields: ctx, id, opts
func (*MockControlPlaneAPI) EXPECT ¶
func (_m *MockControlPlaneAPI) EXPECT() *MockControlPlaneAPI_Expecter
func (*MockControlPlaneAPI) GetControlPlane ¶
func (_m *MockControlPlaneAPI) GetControlPlane(ctx context.Context, id string, opts ...operations.Option) (*operations.GetControlPlaneResponse, error)
GetControlPlane provides a mock function with given fields: ctx, id, opts
func (*MockControlPlaneAPI) ListControlPlanes ¶
func (_m *MockControlPlaneAPI) ListControlPlanes(ctx context.Context, request operations.ListControlPlanesRequest, opts ...operations.Option) (*operations.ListControlPlanesResponse, error)
ListControlPlanes provides a mock function with given fields: ctx, request, opts
func (*MockControlPlaneAPI) UpdateControlPlane ¶
func (_m *MockControlPlaneAPI) UpdateControlPlane(ctx context.Context, id string, updateControlPlaneRequest components.UpdateControlPlaneRequest, opts ...operations.Option) (*operations.UpdateControlPlaneResponse, error)
UpdateControlPlane provides a mock function with given fields: ctx, id, updateControlPlaneRequest, opts
type MockControlPlaneAPI_CreateControlPlane_Call ¶
MockControlPlaneAPI_CreateControlPlane_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateControlPlane'
func (*MockControlPlaneAPI_CreateControlPlane_Call) Return ¶
func (_c *MockControlPlaneAPI_CreateControlPlane_Call) Return(_a0 *operations.CreateControlPlaneResponse, _a1 error) *MockControlPlaneAPI_CreateControlPlane_Call
func (*MockControlPlaneAPI_CreateControlPlane_Call) Run ¶
func (_c *MockControlPlaneAPI_CreateControlPlane_Call) Run(run func(ctx context.Context, request components.CreateControlPlaneRequest, opts ...operations.Option)) *MockControlPlaneAPI_CreateControlPlane_Call
func (*MockControlPlaneAPI_CreateControlPlane_Call) RunAndReturn ¶
func (_c *MockControlPlaneAPI_CreateControlPlane_Call) RunAndReturn(run func(context.Context, components.CreateControlPlaneRequest, ...operations.Option) (*operations.CreateControlPlaneResponse, error)) *MockControlPlaneAPI_CreateControlPlane_Call
type MockControlPlaneAPI_DeleteControlPlane_Call ¶
MockControlPlaneAPI_DeleteControlPlane_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteControlPlane'
func (*MockControlPlaneAPI_DeleteControlPlane_Call) Return ¶
func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) Return(_a0 *operations.DeleteControlPlaneResponse, _a1 error) *MockControlPlaneAPI_DeleteControlPlane_Call
func (*MockControlPlaneAPI_DeleteControlPlane_Call) Run ¶
func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) Run(run func(ctx context.Context, id string, opts ...operations.Option)) *MockControlPlaneAPI_DeleteControlPlane_Call
func (*MockControlPlaneAPI_DeleteControlPlane_Call) RunAndReturn ¶
func (_c *MockControlPlaneAPI_DeleteControlPlane_Call) RunAndReturn(run func(context.Context, string, ...operations.Option) (*operations.DeleteControlPlaneResponse, error)) *MockControlPlaneAPI_DeleteControlPlane_Call
type MockControlPlaneAPI_Expecter ¶
type MockControlPlaneAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockControlPlaneAPI_Expecter) CreateControlPlane ¶
func (_e *MockControlPlaneAPI_Expecter) CreateControlPlane(ctx interface{}, request interface{}, opts ...interface{}) *MockControlPlaneAPI_CreateControlPlane_Call
CreateControlPlane is a helper method to define mock.On call
- ctx context.Context
- request components.CreateControlPlaneRequest
- opts ...operations.Option
func (*MockControlPlaneAPI_Expecter) DeleteControlPlane ¶
func (_e *MockControlPlaneAPI_Expecter) DeleteControlPlane(ctx interface{}, id interface{}, opts ...interface{}) *MockControlPlaneAPI_DeleteControlPlane_Call
DeleteControlPlane is a helper method to define mock.On call
- ctx context.Context
- id string
- opts ...operations.Option
func (*MockControlPlaneAPI_Expecter) GetControlPlane ¶
func (_e *MockControlPlaneAPI_Expecter) GetControlPlane(ctx interface{}, id interface{}, opts ...interface{}) *MockControlPlaneAPI_GetControlPlane_Call
GetControlPlane is a helper method to define mock.On call
- ctx context.Context
- id string
- opts ...operations.Option
func (*MockControlPlaneAPI_Expecter) ListControlPlanes ¶
func (_e *MockControlPlaneAPI_Expecter) ListControlPlanes(ctx interface{}, request interface{}, opts ...interface{}) *MockControlPlaneAPI_ListControlPlanes_Call
ListControlPlanes is a helper method to define mock.On call
- ctx context.Context
- request operations.ListControlPlanesRequest
- opts ...operations.Option
func (*MockControlPlaneAPI_Expecter) UpdateControlPlane ¶
func (_e *MockControlPlaneAPI_Expecter) UpdateControlPlane(ctx interface{}, id interface{}, updateControlPlaneRequest interface{}, opts ...interface{}) *MockControlPlaneAPI_UpdateControlPlane_Call
UpdateControlPlane is a helper method to define mock.On call
- ctx context.Context
- id string
- updateControlPlaneRequest components.UpdateControlPlaneRequest
- opts ...operations.Option
type MockControlPlaneAPI_GetControlPlane_Call ¶
MockControlPlaneAPI_GetControlPlane_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetControlPlane'
func (*MockControlPlaneAPI_GetControlPlane_Call) Return ¶
func (_c *MockControlPlaneAPI_GetControlPlane_Call) Return(_a0 *operations.GetControlPlaneResponse, _a1 error) *MockControlPlaneAPI_GetControlPlane_Call
func (*MockControlPlaneAPI_GetControlPlane_Call) Run ¶
func (_c *MockControlPlaneAPI_GetControlPlane_Call) Run(run func(ctx context.Context, id string, opts ...operations.Option)) *MockControlPlaneAPI_GetControlPlane_Call
func (*MockControlPlaneAPI_GetControlPlane_Call) RunAndReturn ¶
func (_c *MockControlPlaneAPI_GetControlPlane_Call) RunAndReturn(run func(context.Context, string, ...operations.Option) (*operations.GetControlPlaneResponse, error)) *MockControlPlaneAPI_GetControlPlane_Call
type MockControlPlaneAPI_ListControlPlanes_Call ¶
MockControlPlaneAPI_ListControlPlanes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListControlPlanes'
func (*MockControlPlaneAPI_ListControlPlanes_Call) Return ¶
func (_c *MockControlPlaneAPI_ListControlPlanes_Call) Return(_a0 *operations.ListControlPlanesResponse, _a1 error) *MockControlPlaneAPI_ListControlPlanes_Call
func (*MockControlPlaneAPI_ListControlPlanes_Call) Run ¶
func (_c *MockControlPlaneAPI_ListControlPlanes_Call) Run(run func(ctx context.Context, request operations.ListControlPlanesRequest, opts ...operations.Option)) *MockControlPlaneAPI_ListControlPlanes_Call
func (*MockControlPlaneAPI_ListControlPlanes_Call) RunAndReturn ¶
func (_c *MockControlPlaneAPI_ListControlPlanes_Call) RunAndReturn(run func(context.Context, operations.ListControlPlanesRequest, ...operations.Option) (*operations.ListControlPlanesResponse, error)) *MockControlPlaneAPI_ListControlPlanes_Call
type MockControlPlaneAPI_UpdateControlPlane_Call ¶
MockControlPlaneAPI_UpdateControlPlane_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateControlPlane'
func (*MockControlPlaneAPI_UpdateControlPlane_Call) Return ¶
func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) Return(_a0 *operations.UpdateControlPlaneResponse, _a1 error) *MockControlPlaneAPI_UpdateControlPlane_Call
func (*MockControlPlaneAPI_UpdateControlPlane_Call) Run ¶
func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) Run(run func(ctx context.Context, id string, updateControlPlaneRequest components.UpdateControlPlaneRequest, opts ...operations.Option)) *MockControlPlaneAPI_UpdateControlPlane_Call
func (*MockControlPlaneAPI_UpdateControlPlane_Call) RunAndReturn ¶
func (_c *MockControlPlaneAPI_UpdateControlPlane_Call) RunAndReturn(run func(context.Context, string, components.UpdateControlPlaneRequest, ...operations.Option) (*operations.UpdateControlPlaneResponse, error)) *MockControlPlaneAPI_UpdateControlPlane_Call
type MockKonnectSDK ¶
type MockKonnectSDK struct { Token string T *testing.T CPAPIFactory func() ControlPlaneAPI }
This is a mock implementation of the SDKAPI interface
func (*MockKonnectSDK) GetControlPlaneAPI ¶
func (m *MockKonnectSDK) GetControlPlaneAPI() ControlPlaneAPI
Returns a mock instance of the ControlPlaneAPI
type MockKonnectSDKFactory ¶
This is a mock implementation of the SDKFactory interface which can associate a Testing.T instance with any MockKonnectSDK instances Built by it
type SDKAPI ¶
type SDKAPI interface {
GetControlPlaneAPI() ControlPlaneAPI
}
Provides an interface for the Konnect Go SDK "github.com/Kong/sdk-konnect-go" SDK struct allowing for easier testing and mocking
func KonnectSDKFactory ¶
THis is the real implementation of the SDKFactory, It creates an Authenticated SDK instance from the adjacent auth package
type SDKFactory ¶
A function that can build an SDKAPI with a given authorization token