helpers

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvTrue is the string value "true" used for environment variable checks
	EnvTrue = "true"
)

Variables

View Source
var SDKAPIFactoryKey = Key{}

A Key used to store the SDKFactory in a Context

Functions

func ApplicationSummary added in v0.1.6

func ApplicationSummary(app kkComponents.Application) (id string, name string)

ApplicationSummary represents the common fields needed from an application union

func GetAllAppAuthStrategies added in v0.0.14

func GetAllAppAuthStrategies(ctx context.Context, kkClient AppAuthStrategiesAPI) ([]any, error)

GetAllAppAuthStrategies fetches all app auth strategies with pagination

func GetAllGatewayConsumers

func GetAllGatewayConsumers(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK,
) ([]kkComps.Consumer, error)

func GetAllGatewayRoutes

func GetAllGatewayRoutes(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK,
) ([]kkComps.Route, error)

func GetAllGatewayServices

func GetAllGatewayServices(ctx context.Context, requestPageSize int64, cpID string, kkClient *kk.SDK,
) ([]kkComps.ServiceOutput, error)

func GetAllPortals added in v0.0.14

func GetAllPortals(ctx context.Context, requestPageSize int64, kkClient *kkSDK.SDK,
) ([]kkComps.Portal, error)

GetAllPortals fetches all portals with pagination

func GetControlPlaneID

func GetControlPlaneID(ctx context.Context, kkClient ControlPlaneAPI, cpName string) (string, error)

func GetDocumentsForAPI added in v0.0.14

func GetDocumentsForAPI(ctx context.Context, kkClient APIDocumentAPI, apiID string) ([]any, error)

GetDocumentsForAPI fetches all document objects for a specific API

func GetImplementationsForAPI added in v0.0.14

func GetImplementationsForAPI(ctx context.Context, kkClient APIImplementationAPI, apiID string) ([]any, error)

GetImplementationsForAPI fetches all implementation objects for a specific API

func GetPublicationsForAPI added in v0.0.14

func GetPublicationsForAPI(ctx context.Context, kkClient APIPublicationAPI, apiID string) ([]any, error)

GetPublicationsForAPI fetches all publication objects for a specific API

func GetVersionsForAPI added in v0.1.0

func GetVersionsForAPI(ctx context.Context, kkClient APIVersionAPI, apiID string) ([]any, error)

GetVersionsForAPI fetches all version objects for a specific API

func HasCustomDomainForPortal added in v0.0.14

func HasCustomDomainForPortal(ctx context.Context, portalAPI PortalAPI, portalID string) bool

HasCustomDomainForPortal checks if a portal has a custom domain configured

func HasPortalAuthSettings added in v0.0.14

func HasPortalAuthSettings(ctx context.Context, portalAPI PortalAPI, portalID string) bool

HasPortalAuthSettings checks if a portal has auth settings configured

func HasPortalCustomization added in v0.0.14

func HasPortalCustomization(ctx context.Context, portalAPI PortalAPI, portalID string) bool

HasPortalCustomization checks if a portal has customization settings configured

func HasPortalSettings added in v0.0.14

func HasPortalSettings(_ context.Context, _ PortalAPI, _ string) bool

HasPortalSettings checks if the portal has settings that can be exported Returns false if the operation isn't supported

func Int64 added in v0.0.14

func Int64(v int64) *int64

Int64 is a helper to convert int64 to *int64

Types

type APIAPI added in v0.0.14

type APIAPI interface {
	// API operations
	ListApis(ctx context.Context, request kkOps.ListApisRequest,
		opts ...kkOps.Option) (*kkOps.ListApisResponse, error)
	FetchAPI(ctx context.Context, apiID string,
		opts ...kkOps.Option) (*kkOps.FetchAPIResponse, error)
	CreateAPI(ctx context.Context, request kkComps.CreateAPIRequest,
		opts ...kkOps.Option) (*kkOps.CreateAPIResponse, error)
	UpdateAPI(ctx context.Context, apiID string, request kkComps.UpdateAPIRequest,
		opts ...kkOps.Option) (*kkOps.UpdateAPIResponse, error)
	DeleteAPI(ctx context.Context, apiID string,
		opts ...kkOps.Option) (*kkOps.DeleteAPIResponse, error)
}

APIAPI defines the interface for operations on APIs (parent resource only)

type APIAPIImpl added in v0.1.0

type APIAPIImpl struct {
	SDK *kkSDK.SDK
}

APIAPIImpl provides an implementation of the APIFullAPI interface It implements both APIAPI and all child resource operations for backward compatibility

func (*APIAPIImpl) CreateAPI added in v0.1.0

func (a *APIAPIImpl) CreateAPI(ctx context.Context, request kkComps.CreateAPIRequest,
	opts ...kkOps.Option,
) (*kkOps.CreateAPIResponse, error)

CreateAPI implements the APIAPI interface

func (*APIAPIImpl) CreateAPIDocument added in v0.1.0

func (a *APIAPIImpl) CreateAPIDocument(ctx context.Context, apiID string, request kkComps.CreateAPIDocumentRequest,
	opts ...kkOps.Option,
) (*kkOps.CreateAPIDocumentResponse, error)

CreateAPIDocument implements the APIAPI interface

func (*APIAPIImpl) CreateAPIVersion added in v0.1.0

func (a *APIAPIImpl) CreateAPIVersion(ctx context.Context, apiID string, request kkComps.CreateAPIVersionRequest,
	opts ...kkOps.Option,
) (*kkOps.CreateAPIVersionResponse, error)

CreateAPIVersion implements the APIAPI interface

func (*APIAPIImpl) DeleteAPI added in v0.1.0

func (a *APIAPIImpl) DeleteAPI(ctx context.Context, apiID string,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIResponse, error)

DeleteAPI implements the APIAPI interface

func (*APIAPIImpl) DeleteAPIDocument added in v0.1.0

func (a *APIAPIImpl) DeleteAPIDocument(ctx context.Context, apiID string, documentID string,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIDocumentResponse, error)

DeleteAPIDocument implements the APIAPI interface

func (*APIAPIImpl) DeleteAPIVersion added in v0.1.0

func (a *APIAPIImpl) DeleteAPIVersion(ctx context.Context, request kkOps.DeleteAPIVersionRequest,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIVersionResponse, error)

DeleteAPIVersion implements the APIAPI interface

func (*APIAPIImpl) DeletePublication added in v0.1.0

func (a *APIAPIImpl) DeletePublication(ctx context.Context, apiID string, portalID string,
	opts ...kkOps.Option,
) (*kkOps.DeletePublicationResponse, error)

DeletePublication implements the APIAPI interface

func (*APIAPIImpl) FetchAPI added in v0.1.0

func (a *APIAPIImpl) FetchAPI(ctx context.Context, apiID string,
	opts ...kkOps.Option,
) (*kkOps.FetchAPIResponse, error)

FetchAPI implements the APIAPI interface

func (*APIAPIImpl) FetchAPIDocument added in v0.1.0

func (a *APIAPIImpl) FetchAPIDocument(ctx context.Context, apiID string, documentID string,
	opts ...kkOps.Option,
) (*kkOps.FetchAPIDocumentResponse, error)

FetchAPIDocument implements the APIAPI interface

func (*APIAPIImpl) ListAPIDocuments added in v0.1.0

func (a *APIAPIImpl) ListAPIDocuments(ctx context.Context, request kkOps.ListAPIDocumentsRequest,
	opts ...kkOps.Option,
) (*kkOps.ListAPIDocumentsResponse, error)

ListAPIDocuments implements the APIAPI interface

func (*APIAPIImpl) ListAPIImplementations added in v0.1.0

func (a *APIAPIImpl) ListAPIImplementations(ctx context.Context, request kkOps.ListAPIImplementationsRequest,
	opts ...kkOps.Option,
) (*kkOps.ListAPIImplementationsResponse, error)

ListAPIImplementations implements the APIAPI interface Note: Implementation management is not yet available in the SDK

func (*APIAPIImpl) ListAPIPublications added in v0.1.0

func (a *APIAPIImpl) ListAPIPublications(ctx context.Context, request kkOps.ListAPIPublicationsRequest,
	opts ...kkOps.Option,
) (*kkOps.ListAPIPublicationsResponse, error)

ListAPIPublications implements the APIAPI interface

func (*APIAPIImpl) ListAPIVersions added in v0.1.0

func (a *APIAPIImpl) ListAPIVersions(ctx context.Context, request kkOps.ListAPIVersionsRequest,
	opts ...kkOps.Option,
) (*kkOps.ListAPIVersionsResponse, error)

ListAPIVersions implements the APIAPI interface

func (*APIAPIImpl) ListApis added in v0.1.0

func (a *APIAPIImpl) ListApis(ctx context.Context, request kkOps.ListApisRequest,
	opts ...kkOps.Option,
) (*kkOps.ListApisResponse, error)

ListApis implements the APIAPI interface

func (*APIAPIImpl) PublishAPIToPortal added in v0.1.0

func (a *APIAPIImpl) PublishAPIToPortal(ctx context.Context, request kkOps.PublishAPIToPortalRequest,
	opts ...kkOps.Option,
) (*kkOps.PublishAPIToPortalResponse, error)

PublishAPIToPortal implements the APIAPI interface

func (*APIAPIImpl) UpdateAPI added in v0.1.0

func (a *APIAPIImpl) UpdateAPI(ctx context.Context, apiID string, request kkComps.UpdateAPIRequest,
	opts ...kkOps.Option,
) (*kkOps.UpdateAPIResponse, error)

UpdateAPI implements the APIAPI interface

func (*APIAPIImpl) UpdateAPIDocument added in v0.1.0

func (a *APIAPIImpl) UpdateAPIDocument(
	ctx context.Context, apiID string, documentID string, request kkComps.APIDocument,
	opts ...kkOps.Option,
) (*kkOps.UpdateAPIDocumentResponse, error)

UpdateAPIDocument implements the APIAPI interface

func (*APIAPIImpl) UpdateAPIVersion added in v0.1.0

func (a *APIAPIImpl) UpdateAPIVersion(ctx context.Context, request kkOps.UpdateAPIVersionRequest,
	opts ...kkOps.Option,
) (*kkOps.UpdateAPIVersionResponse, error)

UpdateAPIVersion implements the APIAPI interface

type APIDocumentAPI added in v0.0.14

type APIDocumentAPI interface {
	// API Document operations
	CreateAPIDocument(ctx context.Context, apiID string, request kkComponents.CreateAPIDocumentRequest,
		opts ...kkOps.Option) (*kkOps.CreateAPIDocumentResponse, error)
	UpdateAPIDocument(ctx context.Context, apiID string, documentID string, request kkComponents.APIDocument,
		opts ...kkOps.Option) (*kkOps.UpdateAPIDocumentResponse, error)
	DeleteAPIDocument(ctx context.Context, apiID string, documentID string,
		opts ...kkOps.Option) (*kkOps.DeleteAPIDocumentResponse, error)
	ListAPIDocuments(ctx context.Context, apiID string, filter *kkComponents.APIDocumentFilterParameters,
		opts ...kkOps.Option) (*kkOps.ListAPIDocumentsResponse, error)
	FetchAPIDocument(ctx context.Context, apiID string, documentID string,
		opts ...kkOps.Option) (*kkOps.FetchAPIDocumentResponse, error)
}

APIDocumentAPI defines the interface for operations on API Documents

type APIDocumentAPIImpl added in v0.1.0

type APIDocumentAPIImpl struct {
	SDK *kkSDK.SDK
}

APIDocumentAPIImpl provides an implementation of the APIDocumentAPI interface

func (*APIDocumentAPIImpl) CreateAPIDocument added in v0.1.0

CreateAPIDocument implements the APIDocumentAPI interface

func (*APIDocumentAPIImpl) DeleteAPIDocument added in v0.1.0

func (a *APIDocumentAPIImpl) DeleteAPIDocument(ctx context.Context, apiID string, documentID string,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIDocumentResponse, error)

DeleteAPIDocument implements the APIDocumentAPI interface

func (*APIDocumentAPIImpl) FetchAPIDocument added in v0.1.0

func (a *APIDocumentAPIImpl) FetchAPIDocument(ctx context.Context, apiID string, documentID string,
	opts ...kkOps.Option,
) (*kkOps.FetchAPIDocumentResponse, error)

FetchAPIDocument implements the APIDocumentAPI interface

func (*APIDocumentAPIImpl) ListAPIDocuments added in v0.1.0

ListAPIDocuments implements the APIDocumentAPI interface

func (*APIDocumentAPIImpl) UpdateAPIDocument added in v0.1.0

func (a *APIDocumentAPIImpl) UpdateAPIDocument(
	ctx context.Context, apiID string, documentID string, request kkComponents.APIDocument,
	opts ...kkOps.Option,
) (*kkOps.UpdateAPIDocumentResponse, error)

UpdateAPIDocument implements the APIDocumentAPI interface

type APIFullAPI added in v0.1.0

type APIFullAPI interface {
	APIAPI

	// API Version operations
	CreateAPIVersion(ctx context.Context, apiID string, request kkComps.CreateAPIVersionRequest,
		opts ...kkOps.Option) (*kkOps.CreateAPIVersionResponse, error)
	ListAPIVersions(ctx context.Context, request kkOps.ListAPIVersionsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIVersionsResponse, error)
	UpdateAPIVersion(ctx context.Context, request kkOps.UpdateAPIVersionRequest,
		opts ...kkOps.Option) (*kkOps.UpdateAPIVersionResponse, error)
	DeleteAPIVersion(ctx context.Context, request kkOps.DeleteAPIVersionRequest,
		opts ...kkOps.Option) (*kkOps.DeleteAPIVersionResponse, error)

	// API Publication operations
	PublishAPIToPortal(ctx context.Context, request kkOps.PublishAPIToPortalRequest,
		opts ...kkOps.Option) (*kkOps.PublishAPIToPortalResponse, error)
	DeletePublication(ctx context.Context, apiID string, portalID string,
		opts ...kkOps.Option) (*kkOps.DeletePublicationResponse, error)
	ListAPIPublications(ctx context.Context, request kkOps.ListAPIPublicationsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIPublicationsResponse, error)

	// API Implementation operations
	// Note: SDK does not support create/update operations for implementations
	ListAPIImplementations(ctx context.Context, request kkOps.ListAPIImplementationsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIImplementationsResponse, error)

	// API Document operations
	CreateAPIDocument(ctx context.Context, apiID string, request kkComps.CreateAPIDocumentRequest,
		opts ...kkOps.Option) (*kkOps.CreateAPIDocumentResponse, error)
	UpdateAPIDocument(ctx context.Context, apiID string, documentID string, request kkComps.APIDocument,
		opts ...kkOps.Option) (*kkOps.UpdateAPIDocumentResponse, error)
	DeleteAPIDocument(ctx context.Context, apiID string, documentID string,
		opts ...kkOps.Option) (*kkOps.DeleteAPIDocumentResponse, error)
	ListAPIDocuments(ctx context.Context, request kkOps.ListAPIDocumentsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIDocumentsResponse, error)
	FetchAPIDocument(ctx context.Context, apiID string, documentID string,
		opts ...kkOps.Option) (*kkOps.FetchAPIDocumentResponse, error)
}

APIFullAPI defines the complete interface including child resources This is a temporary interface to maintain backward compatibility TODO: Remove this interface once all code is updated to use specific interfaces

type APIImplementationAPI added in v0.0.14

type APIImplementationAPI interface {
	// API Implementation operations
	ListAPIImplementations(ctx context.Context, request kkOps.ListAPIImplementationsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIImplementationsResponse, error)
	CreateAPIImplementation(ctx context.Context, apiID string, apiImplementation kkComponents.APIImplementation,
		opts ...kkOps.Option) (*kkOps.CreateAPIImplementationResponse, error)
	DeleteAPIImplementation(ctx context.Context, apiID string, implementationID string,
		opts ...kkOps.Option) (*kkOps.DeleteAPIImplementationResponse, error)
}

APIImplementationAPI defines the interface for operations on API Implementations

type APIImplementationAPIImpl added in v0.1.0

type APIImplementationAPIImpl struct {
	SDK *kkSDK.SDK
}

APIImplementationAPIImpl provides an implementation of the APIImplementationAPI interface

func (*APIImplementationAPIImpl) CreateAPIImplementation added in v0.2.0

func (a *APIImplementationAPIImpl) CreateAPIImplementation(ctx context.Context,
	apiID string, apiImplementation kkComponents.APIImplementation,
	opts ...kkOps.Option,
) (*kkOps.CreateAPIImplementationResponse, error)

CreateAPIImplementation implements the APIImplementationAPI interface

func (*APIImplementationAPIImpl) DeleteAPIImplementation added in v0.2.0

func (a *APIImplementationAPIImpl) DeleteAPIImplementation(ctx context.Context,
	apiID string, implementationID string,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIImplementationResponse, error)

DeleteAPIImplementation implements the APIImplementationAPI interface

func (*APIImplementationAPIImpl) ListAPIImplementations added in v0.1.0

ListAPIImplementations implements the APIImplementationAPI interface

type APIPublicationAPI added in v0.0.14

type APIPublicationAPI interface {
	// API Publication operations
	PublishAPIToPortal(ctx context.Context, request kkOps.PublishAPIToPortalRequest,
		opts ...kkOps.Option) (*kkOps.PublishAPIToPortalResponse, error)
	DeletePublication(ctx context.Context, apiID string, portalID string,
		opts ...kkOps.Option) (*kkOps.DeletePublicationResponse, error)
	ListAPIPublications(ctx context.Context, request kkOps.ListAPIPublicationsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIPublicationsResponse, error)
}

APIPublicationAPI defines the interface for operations on API Publications

type APIPublicationAPIImpl added in v0.1.0

type APIPublicationAPIImpl struct {
	SDK *kkSDK.SDK
}

APIPublicationAPIImpl provides an implementation of the APIPublicationAPI interface

func (*APIPublicationAPIImpl) DeletePublication added in v0.1.0

func (a *APIPublicationAPIImpl) DeletePublication(ctx context.Context, apiID string, portalID string,
	opts ...kkOps.Option,
) (*kkOps.DeletePublicationResponse, error)

DeletePublication implements the APIPublicationAPI interface

func (*APIPublicationAPIImpl) ListAPIPublications added in v0.1.0

ListAPIPublications implements the APIPublicationAPI interface

func (*APIPublicationAPIImpl) PublishAPIToPortal added in v0.1.0

PublishAPIToPortal implements the APIPublicationAPI interface

type APIVersionAPI added in v0.1.0

type APIVersionAPI interface {
	// API Version operations
	CreateAPIVersion(ctx context.Context, apiID string, request kkComps.CreateAPIVersionRequest,
		opts ...kkOps.Option) (*kkOps.CreateAPIVersionResponse, error)
	ListAPIVersions(ctx context.Context, request kkOps.ListAPIVersionsRequest,
		opts ...kkOps.Option) (*kkOps.ListAPIVersionsResponse, error)
	UpdateAPIVersion(ctx context.Context, request kkOps.UpdateAPIVersionRequest,
		opts ...kkOps.Option) (*kkOps.UpdateAPIVersionResponse, error)
	DeleteAPIVersion(ctx context.Context, apiID string, versionID string,
		opts ...kkOps.Option) (*kkOps.DeleteAPIVersionResponse, error)
	FetchAPIVersion(ctx context.Context, apiID string, versionID string,
		opts ...kkOps.Option) (*kkOps.FetchAPIVersionResponse, error)
}

APIVersionAPI defines the interface for operations on API Versions

type APIVersionAPIImpl added in v0.1.0

type APIVersionAPIImpl struct {
	SDK *kkSDK.SDK
}

APIVersionAPIImpl provides an implementation of the APIVersionAPI interface

func (*APIVersionAPIImpl) CreateAPIVersion added in v0.1.0

func (a *APIVersionAPIImpl) CreateAPIVersion(ctx context.Context, apiID string, request kkComps.CreateAPIVersionRequest,
	opts ...kkOps.Option,
) (*kkOps.CreateAPIVersionResponse, error)

CreateAPIVersion implements the APIVersionAPI interface

func (*APIVersionAPIImpl) DeleteAPIVersion added in v0.1.0

func (a *APIVersionAPIImpl) DeleteAPIVersion(ctx context.Context, apiID string, versionID string,
	opts ...kkOps.Option,
) (*kkOps.DeleteAPIVersionResponse, error)

DeleteAPIVersion implements the APIVersionAPI interface

func (*APIVersionAPIImpl) FetchAPIVersion added in v0.1.4

func (a *APIVersionAPIImpl) FetchAPIVersion(ctx context.Context, apiID string, versionID string,
	opts ...kkOps.Option,
) (*kkOps.FetchAPIVersionResponse, error)

FetchAPIVersion implements the APIVersionAPI interface

func (*APIVersionAPIImpl) ListAPIVersions added in v0.1.0

ListAPIVersions implements the APIVersionAPI interface

func (*APIVersionAPIImpl) UpdateAPIVersion added in v0.1.0

UpdateAPIVersion implements the APIVersionAPI interface

type AppAuthStrategiesAPI added in v0.0.14

type AppAuthStrategiesAPI interface {
	ListAppAuthStrategies(ctx context.Context, request kkOPS.ListAppAuthStrategiesRequest,
		opts ...kkOPS.Option) (*kkOPS.ListAppAuthStrategiesResponse, error)
	GetAppAuthStrategy(ctx context.Context, id string) (*kkOPS.GetAppAuthStrategyResponse, error)
	CreateAppAuthStrategy(ctx context.Context,
		strategy kkComps.CreateAppAuthStrategyRequest) (*kkOPS.CreateAppAuthStrategyResponse, error)
	UpdateAppAuthStrategy(ctx context.Context, id string,
		strategy kkComps.UpdateAppAuthStrategyRequest) (*kkOPS.UpdateAppAuthStrategyResponse, error)
	DeleteAppAuthStrategy(ctx context.Context, id string) (*kkOPS.DeleteAppAuthStrategyResponse, error)
}

type AppAuthStrategiesAPIImpl added in v0.1.0

type AppAuthStrategiesAPIImpl struct {
	SDK *kkSDK.SDK
}

AppAuthStrategiesAPIImpl provides an implementation of the AppAuthStrategiesAPI interface

func (*AppAuthStrategiesAPIImpl) CreateAppAuthStrategy added in v0.1.0

CreateAppAuthStrategy implements the AppAuthStrategiesAPI interface

func (*AppAuthStrategiesAPIImpl) DeleteAppAuthStrategy added in v0.1.0

DeleteAppAuthStrategy implements the AppAuthStrategiesAPI interface

func (*AppAuthStrategiesAPIImpl) GetAppAuthStrategy added in v0.1.0

GetAppAuthStrategy implements the AppAuthStrategiesAPI interface

func (*AppAuthStrategiesAPIImpl) ListAppAuthStrategies added in v0.1.0

ListAppAuthStrategies implements the AppAuthStrategiesAPI interface

func (*AppAuthStrategiesAPIImpl) UpdateAppAuthStrategy added in v0.1.0

UpdateAppAuthStrategy implements the AppAuthStrategiesAPI interface

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 ControlPlaneGroupsAPI added in v0.3.0

type ControlPlaneGroupsAPI interface {
	GetControlPlanesIDGroupMemberships(
		ctx context.Context,
		request kkOPS.GetControlPlanesIDGroupMembershipsRequest,
		opts ...kkOPS.Option,
	) (*kkOPS.GetControlPlanesIDGroupMembershipsResponse, error)

	PutControlPlanesIDGroupMemberships(
		ctx context.Context,
		id string,
		groupMembership *kkCOM.GroupMembership,
		opts ...kkOPS.Option,
	) (*kkOPS.PutControlPlanesIDGroupMembershipsResponse, error)
}

ControlPlaneGroupsAPI defines the subset of SDK operations required for managing control plane group memberships.

type GatewayServiceAPI added in v0.2.0

type GatewayServiceAPI interface {
	ListService(ctx context.Context, request kkOps.ListServiceRequest,
		opts ...kkOps.Option) (*kkOps.ListServiceResponse, error)
}

GatewayServiceAPI defines the interface for gateway service operations needed by the CLI.

type Key

type Key struct{}

type KonnectSDK

type KonnectSDK struct {
	SDK *kkSDK.SDK
	// contains filtered or unexported fields
}

This is the real implementation of the SDKAPI which wraps the actual SDK implmentation

func (*KonnectSDK) GetAPIAPI added in v0.0.14

func (k *KonnectSDK) GetAPIAPI() APIFullAPI

Returns the implementation of the APIAPI interface

func (*KonnectSDK) GetAPIDocumentAPI added in v0.0.14

func (k *KonnectSDK) GetAPIDocumentAPI() APIDocumentAPI

Returns the implementation of the APIDocumentAPI interface

func (*KonnectSDK) GetAPIImplementationAPI added in v0.0.14

func (k *KonnectSDK) GetAPIImplementationAPI() APIImplementationAPI

Returns the implementation of the APIImplementationAPI interface

func (*KonnectSDK) GetAPIPublicationAPI added in v0.0.14

func (k *KonnectSDK) GetAPIPublicationAPI() APIPublicationAPI

Returns the implementation of the APIPublicationAPI interface

func (*KonnectSDK) GetAPIVersionAPI added in v0.1.0

func (k *KonnectSDK) GetAPIVersionAPI() APIVersionAPI

Returns the implementation of the APIVersionAPI interface

func (*KonnectSDK) GetAppAuthStrategiesAPI added in v0.0.14

func (k *KonnectSDK) GetAppAuthStrategiesAPI() AppAuthStrategiesAPI

Returns the implementation of the AppAuthStrategiesAPI interface

func (*KonnectSDK) GetControlPlaneAPI

func (k *KonnectSDK) GetControlPlaneAPI() ControlPlaneAPI

Returns the real implementation of the GetControlPlaneAPI from the Konnect SDK

func (*KonnectSDK) GetControlPlaneGroupsAPI added in v0.3.0

func (k *KonnectSDK) GetControlPlaneGroupsAPI() ControlPlaneGroupsAPI

Returns the implementation of the ControlPlaneGroupsAPI interface

func (*KonnectSDK) GetGatewayServiceAPI added in v0.2.0

func (k *KonnectSDK) GetGatewayServiceAPI() GatewayServiceAPI

Returns the implementation of the GatewayServiceAPI interface

func (*KonnectSDK) GetMeAPI added in v0.1.0

func (k *KonnectSDK) GetMeAPI() MeAPI

Returns the implementation of the MeAPI interface

func (*KonnectSDK) GetPortalAPI added in v0.0.14

func (k *KonnectSDK) GetPortalAPI() PortalAPI

Returns the implementation of the PortalAPI interface

func (*KonnectSDK) GetPortalApplicationAPI added in v0.1.6

func (k *KonnectSDK) GetPortalApplicationAPI() PortalApplicationAPI

Returns the implementation of the PortalApplicationAPI interface

func (*KonnectSDK) GetPortalCustomDomainAPI added in v0.1.0

func (k *KonnectSDK) GetPortalCustomDomainAPI() PortalCustomDomainAPI

Returns the implementation of the PortalCustomDomainAPI interface

func (*KonnectSDK) GetPortalCustomizationAPI added in v0.1.0

func (k *KonnectSDK) GetPortalCustomizationAPI() PortalCustomizationAPI

Returns the implementation of the PortalCustomizationAPI interface

func (*KonnectSDK) GetPortalDeveloperAPI added in v0.1.6

func (k *KonnectSDK) GetPortalDeveloperAPI() PortalDeveloperAPI

Returns the implementation of the PortalDeveloperAPI interface

func (*KonnectSDK) GetPortalPageAPI added in v0.1.0

func (k *KonnectSDK) GetPortalPageAPI() PortalPageAPI

Returns the implementation of the PortalPageAPI interface

func (*KonnectSDK) GetPortalSnippetAPI added in v0.1.0

func (k *KonnectSDK) GetPortalSnippetAPI() PortalSnippetAPI

Returns the implementation of the PortalSnippetAPI interface

func (*KonnectSDK) GetPortalTeamAPI added in v0.1.6

func (k *KonnectSDK) GetPortalTeamAPI() PortalTeamAPI

Returns the implementation of the PortalTeamAPI interface

type MeAPI added in v0.1.0

type MeAPI interface {
	GetUsersMe(ctx context.Context, opts ...kkOps.Option) (*kkOps.GetUsersMeResponse, error)
}

MeAPI interface for the Me API operations

type MockControlPlaneAPI

type MockControlPlaneAPI struct {
	mock.Mock
}

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

CreateControlPlane provides a mock function with given fields: ctx, request, opts

func (*MockControlPlaneAPI) DeleteControlPlane

DeleteControlPlane provides a mock function with given fields: ctx, id, opts

func (*MockControlPlaneAPI) EXPECT

func (*MockControlPlaneAPI) GetControlPlane

GetControlPlane provides a mock function with given fields: ctx, id, opts

func (*MockControlPlaneAPI) ListControlPlanes

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

type MockControlPlaneAPI_CreateControlPlane_Call struct {
	*mock.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 (*MockControlPlaneAPI_CreateControlPlane_Call) Run

type MockControlPlaneAPI_DeleteControlPlane_Call

type MockControlPlaneAPI_DeleteControlPlane_Call struct {
	*mock.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 (*MockControlPlaneAPI_DeleteControlPlane_Call) Run

type MockControlPlaneAPI_Expecter

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

func (*MockControlPlaneAPI_Expecter) CreateControlPlane

func (_e *MockControlPlaneAPI_Expecter) CreateControlPlane(ctx any, request any, opts ...any) *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 any, id any, opts ...any) *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 any, id any, opts ...any) *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 any, request any, opts ...any) *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 any, id any, updateControlPlaneRequest any, opts ...any) *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

type MockControlPlaneAPI_GetControlPlane_Call struct {
	*mock.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 (*MockControlPlaneAPI_GetControlPlane_Call) Run

type MockControlPlaneAPI_ListControlPlanes_Call

type MockControlPlaneAPI_ListControlPlanes_Call struct {
	*mock.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 (*MockControlPlaneAPI_ListControlPlanes_Call) Run

type MockControlPlaneAPI_UpdateControlPlane_Call

type MockControlPlaneAPI_UpdateControlPlane_Call struct {
	*mock.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 (*MockControlPlaneAPI_UpdateControlPlane_Call) Run

type MockControlPlaneGroupsAPI added in v0.3.0

type MockControlPlaneGroupsAPI struct {
	mock.Mock
}

MockControlPlaneGroupsAPI is a testify-based mock for ControlPlaneGroupsAPI.

func (*MockControlPlaneGroupsAPI) EXPECT added in v0.3.0

func (m *MockControlPlaneGroupsAPI) EXPECT() *mock.Mock

EXPECT provides access to the mock's expectation helper.

func (*MockControlPlaneGroupsAPI) GetControlPlanesIDGroupMemberships added in v0.3.0

GetControlPlanesIDGroupMemberships mocks the corresponding API call.

func (*MockControlPlaneGroupsAPI) PutControlPlanesIDGroupMemberships added in v0.3.0

func (m *MockControlPlaneGroupsAPI) PutControlPlanesIDGroupMemberships(
	ctx context.Context,
	id string,
	groupMembership *kkComps.GroupMembership,
	opts ...kkOps.Option,
) (*kkOps.PutControlPlanesIDGroupMembershipsResponse, error)

PutControlPlanesIDGroupMemberships mocks the upsert API call.

type MockKonnectSDK

type MockKonnectSDK struct {
	Token                     string
	T                         *testing.T
	CPAPIFactory              func() ControlPlaneAPI
	ControlPlaneGroupsFactory func() ControlPlaneGroupsAPI
	PortalFactory             func() PortalAPI
	APIFactory                func() APIFullAPI
	APIDocumentFactory        func() APIDocumentAPI
	APIVersionFactory         func() APIVersionAPI
	APIPublicationFactory     func() APIPublicationAPI
	APIImplementationFactory  func() APIImplementationAPI
	AppAuthStrategiesFactory  func() AppAuthStrategiesAPI
	MeFactory                 func() MeAPI
	GatewayServiceFactory     func() GatewayServiceAPI
	// Portal child resource factories
	PortalPageFactory          func() PortalPageAPI
	PortalCustomizationFactory func() PortalCustomizationAPI
	PortalCustomDomainFactory  func() PortalCustomDomainAPI
	PortalSnippetFactory       func() PortalSnippetAPI
	PortalApplicationFactory   func() PortalApplicationAPI
	PortalDeveloperFactory     func() PortalDeveloperAPI
	PortalTeamFactory          func() PortalTeamAPI
}

This is a mock implementation of the SDKAPI interface

func (*MockKonnectSDK) GetAPIAPI added in v0.0.14

func (m *MockKonnectSDK) GetAPIAPI() APIFullAPI

Returns a mock instance of the APIAPI

func (*MockKonnectSDK) GetAPIDocumentAPI added in v0.0.14

func (m *MockKonnectSDK) GetAPIDocumentAPI() APIDocumentAPI

Returns a mock instance of the APIDocumentAPI

func (*MockKonnectSDK) GetAPIImplementationAPI added in v0.0.14

func (m *MockKonnectSDK) GetAPIImplementationAPI() APIImplementationAPI

Returns a mock instance of the APIImplementationAPI

func (*MockKonnectSDK) GetAPIPublicationAPI added in v0.0.14

func (m *MockKonnectSDK) GetAPIPublicationAPI() APIPublicationAPI

Returns a mock instance of the APIPublicationAPI

func (*MockKonnectSDK) GetAPIVersionAPI added in v0.1.0

func (m *MockKonnectSDK) GetAPIVersionAPI() APIVersionAPI

Returns a mock instance of the APIVersionAPI

func (*MockKonnectSDK) GetAppAuthStrategiesAPI added in v0.0.14

func (m *MockKonnectSDK) GetAppAuthStrategiesAPI() AppAuthStrategiesAPI

Returns a mock instance of the AppAuthStrategiesAPI

func (*MockKonnectSDK) GetControlPlaneAPI

func (m *MockKonnectSDK) GetControlPlaneAPI() ControlPlaneAPI

Returns a mock instance of the ControlPlaneAPI

func (*MockKonnectSDK) GetControlPlaneGroupsAPI added in v0.3.0

func (m *MockKonnectSDK) GetControlPlaneGroupsAPI() ControlPlaneGroupsAPI

Returns a mock instance of the ControlPlaneGroupsAPI

func (*MockKonnectSDK) GetGatewayServiceAPI added in v0.2.0

func (m *MockKonnectSDK) GetGatewayServiceAPI() GatewayServiceAPI

Returns a mock instance of the GatewayServiceAPI

func (*MockKonnectSDK) GetMeAPI added in v0.1.0

func (m *MockKonnectSDK) GetMeAPI() MeAPI

Returns a mock instance of the MeAPI

func (*MockKonnectSDK) GetPortalAPI added in v0.0.14

func (m *MockKonnectSDK) GetPortalAPI() PortalAPI

Returns a mock instance of the PortalAPI

func (*MockKonnectSDK) GetPortalApplicationAPI added in v0.1.6

func (m *MockKonnectSDK) GetPortalApplicationAPI() PortalApplicationAPI

Returns a mock instance of the PortalApplicationAPI

func (*MockKonnectSDK) GetPortalCustomDomainAPI added in v0.1.0

func (m *MockKonnectSDK) GetPortalCustomDomainAPI() PortalCustomDomainAPI

Returns a mock instance of the PortalCustomDomainAPI

func (*MockKonnectSDK) GetPortalCustomizationAPI added in v0.1.0

func (m *MockKonnectSDK) GetPortalCustomizationAPI() PortalCustomizationAPI

Returns a mock instance of the PortalCustomizationAPI

func (*MockKonnectSDK) GetPortalDeveloperAPI added in v0.1.6

func (m *MockKonnectSDK) GetPortalDeveloperAPI() PortalDeveloperAPI

Returns a mock instance of the PortalDeveloperAPI

func (*MockKonnectSDK) GetPortalPageAPI added in v0.1.0

func (m *MockKonnectSDK) GetPortalPageAPI() PortalPageAPI

Returns a mock instance of the PortalPageAPI

func (*MockKonnectSDK) GetPortalSnippetAPI added in v0.1.0

func (m *MockKonnectSDK) GetPortalSnippetAPI() PortalSnippetAPI

Returns a mock instance of the PortalSnippetAPI

func (*MockKonnectSDK) GetPortalTeamAPI added in v0.1.6

func (m *MockKonnectSDK) GetPortalTeamAPI() PortalTeamAPI

Returns a mock instance of the PortalTeamAPI

type MockKonnectSDKFactory

type MockKonnectSDKFactory struct {
	T *testing.T
}

This is a mock implementation of the SDKFactory interface which can associate a Testing.T instance with any MockKonnectSDK instances Built by it

func (*MockKonnectSDKFactory) Build

func (m *MockKonnectSDKFactory) Build(token string) (SDKAPI, error)

Returns the mock implementation of the SDKAPI interface

type PageInfo added in v0.0.14

type PageInfo struct {
	ID   string
	Name string
	Slug string
}

PageInfo represents a portal page with minimal info needed for Terraform import

func GetPagesForPortal added in v0.0.14

func GetPagesForPortal(ctx context.Context, portalAPI PortalAPI, portalID string) ([]PageInfo, error)

GetPagesForPortal returns a list of pages for a portal with pagination This function is designed to be used with the dump command to export portal pages as Terraform import blocks.

type PortalAPI added in v0.0.14

type PortalAPI interface {
	// Portal operations
	ListPortals(ctx context.Context, request kkOps.ListPortalsRequest) (*kkOps.ListPortalsResponse, error)
	GetPortal(ctx context.Context, id string) (*kkOps.GetPortalResponse, error)
	CreatePortal(ctx context.Context, portal kkComps.CreatePortal) (*kkOps.CreatePortalResponse, error)
	UpdatePortal(ctx context.Context, id string,
		portal kkComps.UpdatePortal) (*kkOps.UpdatePortalResponse, error)
	DeletePortal(ctx context.Context, id string, force bool) (*kkOps.DeletePortalResponse, error)
}

PortalAPI defines the interface for operations on Developer Portals

type PortalAPIImpl added in v0.1.0

type PortalAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalAPIImpl provides an implementation of the PortalAPI interface

func (*PortalAPIImpl) CreatePortal added in v0.1.0

func (p *PortalAPIImpl) CreatePortal(
	ctx context.Context,
	portal kkComps.CreatePortal,
) (*kkOps.CreatePortalResponse, error)

CreatePortal implements the PortalAPI interface

func (*PortalAPIImpl) DeletePortal added in v0.1.0

func (p *PortalAPIImpl) DeletePortal(
	ctx context.Context,
	id string,
	force bool,
) (*kkOps.DeletePortalResponse, error)

DeletePortal implements the PortalAPI interface

func (*PortalAPIImpl) GetPortal added in v0.1.0

func (p *PortalAPIImpl) GetPortal(ctx context.Context, id string) (*kkOps.GetPortalResponse, error)

GetPortal implements the PortalAPI interface

func (*PortalAPIImpl) ListPortals added in v0.1.0

ListPortals implements the PortalAPI interface

func (*PortalAPIImpl) UpdatePortal added in v0.1.0

func (p *PortalAPIImpl) UpdatePortal(
	ctx context.Context,
	id string,
	portal kkComps.UpdatePortal,
) (*kkOps.UpdatePortalResponse, error)

UpdatePortal implements the PortalAPI interface

type PortalApplicationAPI added in v0.1.6

type PortalApplicationAPI interface {
	ListApplications(
		ctx context.Context,
		request kkOps.ListApplicationsRequest,
		opts ...kkOps.Option,
	) (*kkOps.ListApplicationsResponse, error)
	GetApplication(
		ctx context.Context,
		portalID string,
		applicationID string,
		opts ...kkOps.Option,
	) (*kkOps.GetApplicationResponse, error)
}

PortalApplicationAPI defines the interface for operations on Portal Applications

type PortalApplicationAPIImpl added in v0.1.6

type PortalApplicationAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalApplicationAPIImpl provides an implementation of the PortalApplicationAPI interface

func (*PortalApplicationAPIImpl) GetApplication added in v0.1.6

func (p *PortalApplicationAPIImpl) GetApplication(
	ctx context.Context, portalID string, applicationID string,
	opts ...kkOps.Option,
) (*kkOps.GetApplicationResponse, error)

GetApplication returns a specific application scoped to a portal

func (*PortalApplicationAPIImpl) ListApplications added in v0.1.6

ListApplications lists all applications for the given portal

type PortalCustomDomainAPI added in v0.1.0

type PortalCustomDomainAPI interface {
	// Portal Custom Domain operations (singleton resource per portal)
	CreatePortalCustomDomain(ctx context.Context, portalID string, request kkComponents.CreatePortalCustomDomainRequest,
		opts ...kkOps.Option) (*kkOps.CreatePortalCustomDomainResponse, error)
	UpdatePortalCustomDomain(ctx context.Context, portalID string, request kkComponents.UpdatePortalCustomDomainRequest,
		opts ...kkOps.Option) (*kkOps.UpdatePortalCustomDomainResponse, error)
	DeletePortalCustomDomain(ctx context.Context, portalID string,
		opts ...kkOps.Option) (*kkOps.DeletePortalCustomDomainResponse, error)
	GetPortalCustomDomain(ctx context.Context, portalID string,
		opts ...kkOps.Option) (*kkOps.GetPortalCustomDomainResponse, error)
}

PortalCustomDomainAPI defines the interface for operations on Portal Custom Domains

type PortalCustomDomainAPIImpl added in v0.1.0

type PortalCustomDomainAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalCustomDomainAPIImpl provides an implementation of the PortalCustomDomainAPI interface

func (*PortalCustomDomainAPIImpl) CreatePortalCustomDomain added in v0.1.0

CreatePortalCustomDomain implements the PortalCustomDomainAPI interface

func (*PortalCustomDomainAPIImpl) DeletePortalCustomDomain added in v0.1.0

func (p *PortalCustomDomainAPIImpl) DeletePortalCustomDomain(
	ctx context.Context, portalID string,
	opts ...kkOps.Option,
) (*kkOps.DeletePortalCustomDomainResponse, error)

DeletePortalCustomDomain implements the PortalCustomDomainAPI interface

func (*PortalCustomDomainAPIImpl) GetPortalCustomDomain added in v0.1.0

func (p *PortalCustomDomainAPIImpl) GetPortalCustomDomain(
	ctx context.Context, portalID string,
	opts ...kkOps.Option,
) (*kkOps.GetPortalCustomDomainResponse, error)

GetPortalCustomDomain implements the PortalCustomDomainAPI interface

func (*PortalCustomDomainAPIImpl) UpdatePortalCustomDomain added in v0.1.0

UpdatePortalCustomDomain implements the PortalCustomDomainAPI interface

type PortalCustomizationAPI added in v0.1.0

type PortalCustomizationAPI interface {
	// Portal Customization operations (singleton resource - no create/delete)
	UpdatePortalCustomization(ctx context.Context, portalID string, request *kkComponents.PortalCustomization,
		opts ...kkOps.Option) (*kkOps.UpdatePortalCustomizationResponse, error)
	GetPortalCustomization(ctx context.Context, portalID string,
		opts ...kkOps.Option) (*kkOps.GetPortalCustomizationResponse, error)
}

PortalCustomizationAPI defines the interface for operations on Portal Customizations

type PortalCustomizationAPIImpl added in v0.1.0

type PortalCustomizationAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalCustomizationAPIImpl provides an implementation of the PortalCustomizationAPI interface

func (*PortalCustomizationAPIImpl) GetPortalCustomization added in v0.1.0

func (p *PortalCustomizationAPIImpl) GetPortalCustomization(
	ctx context.Context, portalID string,
	opts ...kkOps.Option,
) (*kkOps.GetPortalCustomizationResponse, error)

GetPortalCustomization implements the PortalCustomizationAPI interface

func (*PortalCustomizationAPIImpl) UpdatePortalCustomization added in v0.1.0

func (p *PortalCustomizationAPIImpl) UpdatePortalCustomization(
	ctx context.Context, portalID string, request *kkComponents.PortalCustomization,
	opts ...kkOps.Option,
) (*kkOps.UpdatePortalCustomizationResponse, error)

UpdatePortalCustomization implements the PortalCustomizationAPI interface

type PortalDeveloperAPI added in v0.1.6

type PortalDeveloperAPI interface {
	ListPortalDevelopers(
		ctx context.Context,
		request kkOps.ListPortalDevelopersRequest,
		opts ...kkOps.Option,
	) (*kkOps.ListPortalDevelopersResponse, error)
	GetDeveloper(
		ctx context.Context,
		portalID string,
		developerID string,
		opts ...kkOps.Option,
	) (*kkOps.GetDeveloperResponse, error)
}

PortalDeveloperAPI defines the interface for operations on portal developers

type PortalDeveloperAPIImpl added in v0.1.6

type PortalDeveloperAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalDeveloperAPIImpl provides an implementation backed by the SDK

func (*PortalDeveloperAPIImpl) GetDeveloper added in v0.1.6

func (p *PortalDeveloperAPIImpl) GetDeveloper(
	ctx context.Context, portalID string, developerID string,
	opts ...kkOps.Option,
) (*kkOps.GetDeveloperResponse, error)

GetDeveloper fetches a specific developer for a portal

func (*PortalDeveloperAPIImpl) ListPortalDevelopers added in v0.1.6

ListPortalDevelopers lists developers for a portal

type PortalPageAPI added in v0.1.0

type PortalPageAPI interface {
	// Portal Page operations
	CreatePortalPage(ctx context.Context, portalID string, request kkComponents.CreatePortalPageRequest,
		opts ...kkOps.Option) (*kkOps.CreatePortalPageResponse, error)
	UpdatePortalPage(ctx context.Context, request kkOps.UpdatePortalPageRequest,
		opts ...kkOps.Option) (*kkOps.UpdatePortalPageResponse, error)
	DeletePortalPage(ctx context.Context, portalID string, pageID string,
		opts ...kkOps.Option) (*kkOps.DeletePortalPageResponse, error)
	ListPortalPages(ctx context.Context, request kkOps.ListPortalPagesRequest,
		opts ...kkOps.Option) (*kkOps.ListPortalPagesResponse, error)
	GetPortalPage(ctx context.Context, portalID string, pageID string,
		opts ...kkOps.Option) (*kkOps.GetPortalPageResponse, error)
}

PortalPageAPI defines the interface for operations on Portal Pages

type PortalPageAPIImpl added in v0.1.0

type PortalPageAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalPageAPIImpl provides an implementation of the PortalPageAPI interface

func (*PortalPageAPIImpl) CreatePortalPage added in v0.1.0

func (p *PortalPageAPIImpl) CreatePortalPage(
	ctx context.Context, portalID string, request kkComponents.CreatePortalPageRequest,
	opts ...kkOps.Option,
) (*kkOps.CreatePortalPageResponse, error)

CreatePortalPage implements the PortalPageAPI interface

func (*PortalPageAPIImpl) DeletePortalPage added in v0.1.0

func (p *PortalPageAPIImpl) DeletePortalPage(
	ctx context.Context, portalID string, pageID string,
	opts ...kkOps.Option,
) (*kkOps.DeletePortalPageResponse, error)

DeletePortalPage implements the PortalPageAPI interface

func (*PortalPageAPIImpl) GetPortalPage added in v0.1.0

func (p *PortalPageAPIImpl) GetPortalPage(
	ctx context.Context, portalID string, pageID string,
	opts ...kkOps.Option,
) (*kkOps.GetPortalPageResponse, error)

GetPortalPage implements the PortalPageAPI interface

func (*PortalPageAPIImpl) ListPortalPages added in v0.1.0

ListPortalPages implements the PortalPageAPI interface

func (*PortalPageAPIImpl) UpdatePortalPage added in v0.1.0

UpdatePortalPage implements the PortalPageAPI interface

type PortalSnippetAPI added in v0.1.0

type PortalSnippetAPI interface {
	// Portal Snippet operations
	CreatePortalSnippet(ctx context.Context, portalID string, request kkComponents.CreatePortalSnippetRequest,
		opts ...kkOps.Option) (*kkOps.CreatePortalSnippetResponse, error)
	UpdatePortalSnippet(ctx context.Context, request kkOps.UpdatePortalSnippetRequest,
		opts ...kkOps.Option) (*kkOps.UpdatePortalSnippetResponse, error)
	DeletePortalSnippet(ctx context.Context, portalID string, snippetID string,
		opts ...kkOps.Option) (*kkOps.DeletePortalSnippetResponse, error)
	ListPortalSnippets(ctx context.Context, request kkOps.ListPortalSnippetsRequest,
		opts ...kkOps.Option) (*kkOps.ListPortalSnippetsResponse, error)
	GetPortalSnippet(ctx context.Context, portalID string, snippetID string,
		opts ...kkOps.Option) (*kkOps.GetPortalSnippetResponse, error)
}

PortalSnippetAPI defines the interface for operations on Portal Snippets

type PortalSnippetAPIImpl added in v0.1.0

type PortalSnippetAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalSnippetAPIImpl provides an implementation of the PortalSnippetAPI interface

func (*PortalSnippetAPIImpl) CreatePortalSnippet added in v0.1.0

CreatePortalSnippet implements the PortalSnippetAPI interface

func (*PortalSnippetAPIImpl) DeletePortalSnippet added in v0.1.0

func (p *PortalSnippetAPIImpl) DeletePortalSnippet(
	ctx context.Context, portalID string, snippetID string,
	opts ...kkOps.Option,
) (*kkOps.DeletePortalSnippetResponse, error)

DeletePortalSnippet implements the PortalSnippetAPI interface

func (*PortalSnippetAPIImpl) GetPortalSnippet added in v0.1.0

func (p *PortalSnippetAPIImpl) GetPortalSnippet(
	ctx context.Context, portalID string, snippetID string,
	opts ...kkOps.Option,
) (*kkOps.GetPortalSnippetResponse, error)

GetPortalSnippet implements the PortalSnippetAPI interface

func (*PortalSnippetAPIImpl) ListPortalSnippets added in v0.1.0

ListPortalSnippets implements the PortalSnippetAPI interface

func (*PortalSnippetAPIImpl) UpdatePortalSnippet added in v0.1.0

UpdatePortalSnippet implements the PortalSnippetAPI interface

type PortalTeamAPI added in v0.1.6

type PortalTeamAPI interface {
	ListPortalTeams(
		ctx context.Context,
		request kkOps.ListPortalTeamsRequest,
		opts ...kkOps.Option,
	) (*kkOps.ListPortalTeamsResponse, error)
	GetPortalTeam(
		ctx context.Context,
		teamID string,
		portalID string,
		opts ...kkOps.Option,
	) (*kkOps.GetPortalTeamResponse, error)
}

PortalTeamAPI defines the interface for portal team operations

type PortalTeamAPIImpl added in v0.1.6

type PortalTeamAPIImpl struct {
	SDK *kkSDK.SDK
}

PortalTeamAPIImpl provides an implementation of PortalTeamAPI backed by the SDK

func (*PortalTeamAPIImpl) GetPortalTeam added in v0.1.6

func (p *PortalTeamAPIImpl) GetPortalTeam(
	ctx context.Context, teamID string, portalID string,
	opts ...kkOps.Option,
) (*kkOps.GetPortalTeamResponse, error)

GetPortalTeam fetches a single developer team for a portal

func (*PortalTeamAPIImpl) ListPortalTeams added in v0.1.6

ListPortalTeams lists developer teams for a portal

type SDKAPI

type SDKAPI interface {
	GetControlPlaneAPI() ControlPlaneAPI
	GetControlPlaneGroupsAPI() ControlPlaneGroupsAPI
	GetPortalAPI() PortalAPI
	GetAPIAPI() APIFullAPI // TODO: Change to APIAPI once refactoring is complete
	GetAPIDocumentAPI() APIDocumentAPI
	GetAPIVersionAPI() APIVersionAPI
	GetAPIPublicationAPI() APIPublicationAPI
	GetAPIImplementationAPI() APIImplementationAPI
	GetAppAuthStrategiesAPI() AppAuthStrategiesAPI
	GetMeAPI() MeAPI
	GetGatewayServiceAPI() GatewayServiceAPI
	// Portal child resource APIs
	GetPortalPageAPI() PortalPageAPI
	GetPortalCustomizationAPI() PortalCustomizationAPI
	GetPortalCustomDomainAPI() PortalCustomDomainAPI
	GetPortalSnippetAPI() PortalSnippetAPI
	GetPortalApplicationAPI() PortalApplicationAPI
	GetPortalDeveloperAPI() PortalDeveloperAPI
	GetPortalTeamAPI() PortalTeamAPI
}

Provides an interface for the Konnect Go SDK "github.com/Kong/sdk-konnect-go" SDK struct allowing for easier testing and mocking

type SDKAPIFactory added in v0.0.13

type SDKAPIFactory func(cfg config.Hook, logger *slog.Logger) (SDKAPI, error)

A function that can build an SDKAPI with a given configuration

var DefaultSDKFactory SDKAPIFactory

DefaultSDKFactory can be overridden for testing purposes

type SnippetInfo added in v0.0.14

type SnippetInfo struct {
	ID   string
	Name string
}

SnippetInfo represents a portal snippet with minimal info needed for Terraform import

func GetSnippetsForPortal added in v0.0.14

func GetSnippetsForPortal(ctx context.Context, portalAPI PortalAPI, portalID string) ([]SnippetInfo, error)

GetSnippetsForPortal returns a list of snippets for a portal with pagination

Jump to

Keyboard shortcuts

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