service

package
v0.0.0-...-99b6106 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: handlers.go

Generated by this command:

mockgen -source=handlers.go -package=service -destination=handlers_mock.go

Package service is a generated GoMock package.

Index

Constants

View Source
const (
	ResourceClassCompute    = "COMPUTE"
	ResourceClassNetworking = "NETWORKING"
	ResourceClassStorage    = "STORAGE"
	ResourceClassUndefined  = "UNDEFINED"

	ResourceKindPhysical  = "PHYSICAL"
	ResourceKindLogical   = "LOGICAL"
	ResourcekindUndefined = "UNDEFINED"
)
View Source
const (
	KindNode = "Node"
)

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func NewAlarmSubscriptionHandler

func NewAlarmSubscriptionHandler() *alarmSubscriptionHandlerBuilder

NewAlarmSubscriptionHandler creates a builder that can then be used to configure and create a handler for the collection of deployment managers.

func SendError

func SendError(w http.ResponseWriter, status int, msg string, args ...any)

Types

type Adapter

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

Adapter knows how to translate an HTTP request into a request for a collection of objects. Don't create instances of this type directly, use the NewAdapter function instead.

func (*Adapter) ServeHTTP

func (a *Adapter) ServeHTTP(w http.ResponseWriter, r *http.Request)

Serve is the implementation of the http.Handler interface.

type AdapterBuilder

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

AdapterBuilder contains the data and logic needed to create adapters. Don't create instances of this type directly, use the NewAdapter function instead.

func NewAdapter

func NewAdapter() *AdapterBuilder

NewAdapter creates a builder that can be used to configure and create an adatper.

func (*AdapterBuilder) Build

func (b *AdapterBuilder) Build() (result *Adapter, err error)

Build uses the data stored in the builder to create and configure a new adapter.

func (*AdapterBuilder) SetExcludeFields

func (b *AdapterBuilder) SetExcludeFields(values ...string) *AdapterBuilder

SetExcludeFields sets the collection of fields that will be excluded by default from the response. Each field is specified using the same syntax accepted by paths parsers.

func (*AdapterBuilder) SetExternalAddress

func (b *AdapterBuilder) SetExternalAddress(value string) *AdapterBuilder

SetExternalAddress set the URL of the service as seen by external users.

func (*AdapterBuilder) SetHandler

func (b *AdapterBuilder) SetHandler(value any) *AdapterBuilder

SetHandler sets the object that will handle the requests. The value must implement at least one of the handler interfaces. This is mandatory.

func (*AdapterBuilder) SetIncludeFields

func (b *AdapterBuilder) SetIncludeFields(values ...string) *AdapterBuilder

SetIncludeFields set thes collection of fields that will be included by default from the response. Each field is specified using the same syntax accepted by paths parsers.

func (*AdapterBuilder) SetLogger

func (b *AdapterBuilder) SetLogger(logger *slog.Logger) *AdapterBuilder

SetLogger sets the logger that the adapter will use to write to the log. This is mandatory.

func (*AdapterBuilder) SetNextPageMarkerKey

func (b *AdapterBuilder) SetNextPageMarkerKey(value []byte) *AdapterBuilder

SetNextPageMarkerKey sets the key that is used to encrypt and decrypt the next page opaque tokens. The purpose of this encryption is to discourage clients from assuming the format of the marker. By default a hard coded key is used. That key is effectively public because it is part of the source code. There is usually no reason to change it, but you can use this method if you really need.

func (*AdapterBuilder) SetNextPageMarkerNonce

func (b *AdapterBuilder) SetNextPageMarkerNonce(value []byte) *AdapterBuilder

SetNextPageMarkerNonce sets the nonce that is used to encrypt and decrypt the next page opaque tokens. The purpose of this encryption is to discourage clients from assuming the format of the marker. By default a random nonce is usually each time that a marker is encrypted, but for unit tests it is convenient to be able to explicitly specify it, so that the resulting encrypted marker will be predictable.

func (*AdapterBuilder) SetPathVariables

func (b *AdapterBuilder) SetPathVariables(values ...string) *AdapterBuilder

SetPathVariables sets the names of the path variables, in the same order that they appear in the path. For example, if the path is the following:

/o2ims-infrastructureEnvironment/v1/resourcePools/{resourcePoolId}/resources/{resourceId}

Then the values passed to this method should be `resourcePoolId` and `resourceId`.

At least one path variable is required.

type AddHandler

type AddHandler interface {
	Add(ctx context.Context, request *AddRequest) (response *AddResponse, err error)
}

AddHandler is the interface implemented by objects that know how add items to a collection of objects.

type AddRequest

type AddRequest struct {
	// Variables contains the values of the path variables. For example, if the request path is
	// like this:
	//
	//	/o2ims-infrastructureInventory/v1/resourcePools/123/resources/456
	//
	// Then it will contain '456' and '123'.
	//
	// These path variables are ordered from more specific to less specific, the opposite of
	// what appears in the request path. This is intended to simplify things because most
	// handlers will only be interested in the most specific identifier and therefore they
	// can just use index zero.
	Variables []string

	// Object is the definition of the object.
	Object data.Object
}

AddRequest represents a request to create a new object inside a collection.

type AddResponse

type AddResponse struct {
	// Object is the definition of the object that was created.
	Object data.Object
}

AddResponse represents the response to the request to create a new object inside a collection.

type AlarmDefinitionHandler

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

AlarmDefinitionHandler knows how to respond to requests to list alarms. Don't create instances of this type directly, use the NewAlarmDefinitionHandler function instead.

func (*AlarmDefinitionHandler) Get

func (h *AlarmDefinitionHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*AlarmDefinitionHandler) List

func (h *AlarmDefinitionHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type AlarmDefinitionHandlerBuilder

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

AlarmDefinitionHandlerBuilder contains the data and logic needed to create a new alarm definition collection handler. Don't create instances of this type directly, use the NewAlarmDefinitionHandler function instead.

func NewAlarmDefinitionHandler

func NewAlarmDefinitionHandler() *AlarmDefinitionHandlerBuilder

NewAlarmDefinitionHandler creates a builder that can then be used to configure and create a handler for the collection of alarms.

func (*AlarmDefinitionHandlerBuilder) Build

func (b *AlarmDefinitionHandlerBuilder) Build() (
	result *AlarmDefinitionHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*AlarmDefinitionHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

type AlarmFetcher

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

func (*AlarmFetcher) FetchItems

func (r *AlarmFetcher) FetchItems(
	ctx context.Context) (alarms data.Stream, err error)

FetchItems returns a data stream of O2 Alarms. The items are converted from Alerts fetched from the Alertmanager API.

type AlarmFetcherBuilder

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

AlarmFetcherBuilder contains the data and logic needed to create a new AlarmFetcher.

func NewAlarmFetcher

func NewAlarmFetcher() *AlarmFetcherBuilder

NewAlarmFetcher creates a builder that can then be used to configure and create a handler for the AlarmFetcher.

func (*AlarmFetcherBuilder) Build

func (b *AlarmFetcherBuilder) Build() (
	result *AlarmFetcher, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*AlarmFetcherBuilder) SetBackendToken

func (b *AlarmFetcherBuilder) SetBackendToken(
	value string) *AlarmFetcherBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*AlarmFetcherBuilder) SetBackendURL

func (b *AlarmFetcherBuilder) SetBackendURL(
	value string) *AlarmFetcherBuilder

SetBackendURL sets the URL of the backend server This is mandatory.

func (*AlarmFetcherBuilder) SetCloudID

func (b *AlarmFetcherBuilder) SetCloudID(
	value string) *AlarmFetcherBuilder

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*AlarmFetcherBuilder) SetExtensions

func (b *AlarmFetcherBuilder) SetExtensions(values ...string) *AlarmFetcherBuilder

SetExtensions sets the fields that will be added to the extensions.

func (*AlarmFetcherBuilder) SetLogger

func (b *AlarmFetcherBuilder) SetLogger(
	value *slog.Logger) *AlarmFetcherBuilder

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*AlarmFetcherBuilder) SetResourceServerToken

func (b *AlarmFetcherBuilder) SetResourceServerToken(
	value string) *AlarmFetcherBuilder

SetResourceServerToken sets the authentication token that will be used to authenticate with to the resource server. This is mandatory.

func (*AlarmFetcherBuilder) SetResourceServerURL

func (b *AlarmFetcherBuilder) SetResourceServerURL(
	value string) *AlarmFetcherBuilder

SetResourceServerURL sets the URL of the resource server. This is mandatory. The resource server is used for mapping Alarms to Resources.

func (*AlarmFetcherBuilder) SetTransportWrapper

func (b *AlarmFetcherBuilder) SetTransportWrapper(
	value func(http.RoundTripper) http.RoundTripper) *AlarmFetcherBuilder

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type AlarmHandler

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

AlarmHandler knows how to respond to requests to list alarms. Don't create instances of this type directly, use the NewAlarmHandler function instead.

func (*AlarmHandler) Get

func (h *AlarmHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*AlarmHandler) List

func (h *AlarmHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type AlarmHandlerBuilder

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

AlarmHandlerBuilder contains the data and logic needed to create a new alarm collection handler. Don't create instances of this type directly, use the NewAlarmHandler function instead.

func NewAlarmHandler

func NewAlarmHandler() *AlarmHandlerBuilder

NewAlarmHandler creates a builder that can then be used to configure and create a handler for the collection of alarms.

func (*AlarmHandlerBuilder) Build

func (b *AlarmHandlerBuilder) Build() (
	result *AlarmHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*AlarmHandlerBuilder) SetBackendToken

func (b *AlarmHandlerBuilder) SetBackendToken(
	value string) *AlarmHandlerBuilder

SetBackendToken sets the authentication token that will be used to authenticate with the backend server. This is mandatory.

func (*AlarmHandlerBuilder) SetBackendURL

func (b *AlarmHandlerBuilder) SetBackendURL(
	value string) *AlarmHandlerBuilder

SetBackendURL sets the URL of the backend server. This is mandatory.

func (*AlarmHandlerBuilder) SetCloudID

func (b *AlarmHandlerBuilder) SetCloudID(
	value string) *AlarmHandlerBuilder

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*AlarmHandlerBuilder) SetExtensions

func (b *AlarmHandlerBuilder) SetExtensions(values ...string) *AlarmHandlerBuilder

SetExtensions sets the fields that will be added to the extensions.

func (*AlarmHandlerBuilder) SetLogger

func (b *AlarmHandlerBuilder) SetLogger(
	value *slog.Logger) *AlarmHandlerBuilder

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*AlarmHandlerBuilder) SetResourceServerToken

func (b *AlarmHandlerBuilder) SetResourceServerToken(
	value string) *AlarmHandlerBuilder

SetResourceServerToken sets the authentication token that will be used to authenticate with to the resource server. This is mandatory.

func (*AlarmHandlerBuilder) SetResourceServerURL

func (b *AlarmHandlerBuilder) SetResourceServerURL(
	value string) *AlarmHandlerBuilder

SetResourceServerURL sets the URL of the resource server. This is mandatory. The resource server is used for mapping Alarms to Resources.

func (*AlarmHandlerBuilder) SetTransportWrapper

func (b *AlarmHandlerBuilder) SetTransportWrapper(
	value func(http.RoundTripper) http.RoundTripper) *AlarmHandlerBuilder

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type AlarmProbableCauseHandler

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

AlarmProbableCauseHandler knows how to respond to requests to list alarms. Don't create instances of this type directly, use the NewAlarmProbableCauseHandler function instead.

func (*AlarmProbableCauseHandler) Get

func (h *AlarmProbableCauseHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*AlarmProbableCauseHandler) List

func (h *AlarmProbableCauseHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type AlarmProbableCauseHandlerBuilder

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

AlarmProbableCauseHandlerBuilder contains the data and logic needed to create a new alarm probable cause collection handler. Don't create instances of this type directly, use the NewAlarmProbableCauseHandler function instead.

func NewAlarmProbableCauseHandler

func NewAlarmProbableCauseHandler() *AlarmProbableCauseHandlerBuilder

NewAlarmProbableCauseHandler creates a builder that can then be used to configure and create a handler for the collection of alarms.

func (*AlarmProbableCauseHandlerBuilder) Build

Build uses the data stored in the builder to create and configure a new handler.

func (*AlarmProbableCauseHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

type AlarmSeverity

type AlarmSeverity string

type CloudInfoHandler

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

RootHander knows how to respond to requests for the application root. Don't create instances of this type directly, use the NewCloudInfoHandler function instead.

func (*CloudInfoHandler) Get

func (h *CloudInfoHandler) Get(ctx context.Context, request *GetRequest) (response *GetResponse,
	err error)

Get is part of the implementation of the object handler interface.

type CloudInfoHandlerBuilder

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

CloudInfoHandlerBuilder contains the data and logic needed to create a new handler for the application root. Don't create instances of this type directly, use the NewCloudInfoHandler function instead.

func NewCloudInfoHandler

func NewCloudInfoHandler() *CloudInfoHandlerBuilder

NewCloudInfoHandler creates a builder that can then be used to configure and create a handler for the root of the application.

func (*CloudInfoHandlerBuilder) Build

func (b *CloudInfoHandlerBuilder) Build() (result *CloudInfoHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*CloudInfoHandlerBuilder) SetCloudID

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*CloudInfoHandlerBuilder) SetExternalAddress

func (b *CloudInfoHandlerBuilder) SetExternalAddress(value string) *CloudInfoHandlerBuilder

SetExternalAddress set the URL of the service as seen by external users.

func (*CloudInfoHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

type DeleteHandler

type DeleteHandler interface {
	Delete(ctx context.Context, request *DeleteRequest) (response *DeleteResponse, err error)
}

DeleteHandler is the interface implemented by objects that know how delete items from a collection of objects.

type DeleteRequest

type DeleteRequest struct {
	// Variables contains the values of the path variables. For example, if the request path is
	// like this:
	//
	//	/o2ims-infrastructureInventory/v1/resourcePools/123/resources/456
	//
	// Then it will contain '456' and '123'.
	//
	// These path variables are ordered from more specific to less specific, the opposite of
	// what appears in the request path. This is intended to simplify things because most
	// handlers will only be interested in the most specific identifier and therefore they
	// can just use index zero.
	Variables []string
}

DeleteRequest represents a request to delete an object from a collection.

type DeleteResponse

type DeleteResponse struct {
}

DeleteResponse represents the response to the request to delete an object from a collection.

type DeploymentManagerBackendType

type DeploymentManagerBackendType string

DeploymentManagerBackendType defines the types of backends supported by the deployment manager: global or regular ACM hub.

const (
	DeploymentManagerBackendTypeGlobalHub  DeploymentManagerBackendType = "global-hub"
	DeploymentManagerBackendTypeRegularHub DeploymentManagerBackendType = "regular-hub"
)

type DeploymentManagerHandler

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

DeploymentManagerCollectionHander knows how to respond to requests to list deployment managers. Don't create instances of this type directly, use the NewDeploymentManagerHandler function instead.

func (*DeploymentManagerHandler) Get

func (h *DeploymentManagerHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is the implementation of the object handler interface.

func (*DeploymentManagerHandler) List

func (h *DeploymentManagerHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is the implementation of the collection handler interface.

type DeploymentManagerHandlerBuilder

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

DeploymentManagerHandlerBuilder contains the data and logic needed to create a new deployment manager collection handler. Don't create instances of this type directly, use the NewDeploymentManagerHandler function instead.

func NewDeploymentManagerHandler

func NewDeploymentManagerHandler() *DeploymentManagerHandlerBuilder

NewDeploymentManagerHandler creates a builder that can then be used to configure and create a handler for the collection of deployment managers.

func (*DeploymentManagerHandlerBuilder) Build

Build uses the data stored in the builder to create and configure a new handler.

func (*DeploymentManagerHandlerBuilder) SetBackendToken

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*DeploymentManagerHandlerBuilder) SetBackendType

SetBackendType sets the type of backend: global or regular ACM hub.

func (*DeploymentManagerHandlerBuilder) SetBackendURL

SetBackendURL sets the URL of the backend server This is mandatory.

func (*DeploymentManagerHandlerBuilder) SetCloudID

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*DeploymentManagerHandlerBuilder) SetEnableHack

SetEnableHack sets or clears the flag that indicates if the hack used to fetch authentication details from clusters should be enabled. This is intended for unit tests, where we don't currently have a way to test that hack. By the default the hack is disabled.

func (*DeploymentManagerHandlerBuilder) SetExtensions

SetExtensions sets the fields that will be added to the extensions.

func (*DeploymentManagerHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*DeploymentManagerHandlerBuilder) SetLoggingWrapper

SetLoggingWrapper sets the wrapper that will be used to configure logging for the HTTP clients used to connect to other servers, including the backend server. This is optional.

type GetHandler

type GetHandler interface {
	Get(ctx context.Context, request *GetRequest) (response *GetResponse, err error)
}

GetHandler is the interface implemented by objects that now how to get the details of an object.

type GetRequest

type GetRequest struct {
	// Variables contains the values of the path variables. For example, if the request path is
	// like this:
	//
	//	/o2ims-infrastructureInventory/v1/resourcePools/123/resources/456
	//
	// Then it will contain '456' and '123'.
	//
	// These path variables are ordered from more specific to less specific, the opposite of
	// what appears in the request path. This is intended to simplify things because most
	// handlers will only be interested in the most specific identifier and therefore they
	// can just use index zero.
	Variables []string

	// Projector describes how to remove fields from the result.
	Projector *search.Projector
}

GetRequest represents a request for an individual object.

type GetResponse

type GetResponse struct {
	Object data.Object
}

GetResponse represents the response to the request to get an individual object.

type Handler

type Handler interface {
	ListHandler
	GetHandler
	AddHandler
	DeleteHandler
}

Handler aggregates all the other specific handlers. This is intended for unit/ tests, where it is convenient to have a single mock that implements all the operations.

type ListHandler

type ListHandler interface {
	List(ctx context.Context, request *ListRequest) (response *ListResponse, err error)
}

ListHandler is the interface implemented by objects that know how to get list of items of a collection of objects.

type ListRequest

type ListRequest struct {
	// Variables contains the values of the path variables. For example, if the request path is
	// like this:
	//
	//	/o2ims-infrastructureInventory/v1/resourcePools/123/resources
	//
	// Then it will contain '123'.
	//
	// These path variables are ordered from more specific to less specific, the opposite of
	// what appears in the request path. This is intended to simplify things because most
	// handlers will only be interested in the most specific variable and therefore they
	// can just use index zero.
	//
	// This will be empty for top level collections, where there are no path variables, for
	// example:
	//
	//	/o2ims-infrastructureInventory/v1/resourcePools
	Variables []string

	// Selector selects the objects to return.
	Selector *search.Selector

	// Projector is the list of field paths to return.
	Projector *search.Projector

	// NextPageMarker contains the next page marker extracted from the `nextpage_opaque_marker`
	// of the request.
	NextPageMarker []byte
}

ListRequest represents a request for a collection of objects.

type ListResponse

type ListResponse struct {
	// Items is the stream of results.
	Items data.Stream

	// NextPageMarker is the information that will be added to the next page marker link. It
	// encrypted and added to the `next` link in the response header.
	NextPageMarker []byte
}

ListResponse represents the response to the request to get the list of items of a collection.

type MockAddHandler

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

MockAddHandler is a mock of AddHandler interface.

func NewMockAddHandler

func NewMockAddHandler(ctrl *gomock.Controller) *MockAddHandler

NewMockAddHandler creates a new mock instance.

func (*MockAddHandler) Add

func (m *MockAddHandler) Add(ctx context.Context, request *AddRequest) (*AddResponse, error)

Add mocks base method.

func (*MockAddHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockAddHandlerMockRecorder

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

MockAddHandlerMockRecorder is the mock recorder for MockAddHandler.

func (*MockAddHandlerMockRecorder) Add

func (mr *MockAddHandlerMockRecorder) Add(ctx, request any) *gomock.Call

Add indicates an expected call of Add.

type MockDeleteHandler

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

MockDeleteHandler is a mock of DeleteHandler interface.

func NewMockDeleteHandler

func NewMockDeleteHandler(ctrl *gomock.Controller) *MockDeleteHandler

NewMockDeleteHandler creates a new mock instance.

func (*MockDeleteHandler) Delete

func (m *MockDeleteHandler) Delete(ctx context.Context, request *DeleteRequest) (*DeleteResponse, error)

Delete mocks base method.

func (*MockDeleteHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockDeleteHandlerMockRecorder

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

MockDeleteHandlerMockRecorder is the mock recorder for MockDeleteHandler.

func (*MockDeleteHandlerMockRecorder) Delete

func (mr *MockDeleteHandlerMockRecorder) Delete(ctx, request any) *gomock.Call

Delete indicates an expected call of Delete.

type MockGetHandler

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

MockGetHandler is a mock of GetHandler interface.

func NewMockGetHandler

func NewMockGetHandler(ctrl *gomock.Controller) *MockGetHandler

NewMockGetHandler creates a new mock instance.

func (*MockGetHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGetHandler) Get

func (m *MockGetHandler) Get(ctx context.Context, request *GetRequest) (*GetResponse, error)

Get mocks base method.

type MockGetHandlerMockRecorder

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

MockGetHandlerMockRecorder is the mock recorder for MockGetHandler.

func (*MockGetHandlerMockRecorder) Get

func (mr *MockGetHandlerMockRecorder) Get(ctx, request any) *gomock.Call

Get indicates an expected call of Get.

type MockHandler

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

MockHandler is a mock of Handler interface.

func NewMockHandler

func NewMockHandler(ctrl *gomock.Controller) *MockHandler

NewMockHandler creates a new mock instance.

func (*MockHandler) Add

func (m *MockHandler) Add(ctx context.Context, request *AddRequest) (*AddResponse, error)

Add mocks base method.

func (*MockHandler) Delete

func (m *MockHandler) Delete(ctx context.Context, request *DeleteRequest) (*DeleteResponse, error)

Delete mocks base method.

func (*MockHandler) EXPECT

func (m *MockHandler) EXPECT() *MockHandlerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHandler) Get

func (m *MockHandler) Get(ctx context.Context, request *GetRequest) (*GetResponse, error)

Get mocks base method.

func (*MockHandler) List

func (m *MockHandler) List(ctx context.Context, request *ListRequest) (*ListResponse, error)

List mocks base method.

type MockHandlerMockRecorder

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

MockHandlerMockRecorder is the mock recorder for MockHandler.

func (*MockHandlerMockRecorder) Add

func (mr *MockHandlerMockRecorder) Add(ctx, request any) *gomock.Call

Add indicates an expected call of Add.

func (*MockHandlerMockRecorder) Delete

func (mr *MockHandlerMockRecorder) Delete(ctx, request any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockHandlerMockRecorder) Get

func (mr *MockHandlerMockRecorder) Get(ctx, request any) *gomock.Call

Get indicates an expected call of Get.

func (*MockHandlerMockRecorder) List

func (mr *MockHandlerMockRecorder) List(ctx, request any) *gomock.Call

List indicates an expected call of List.

type MockListHandler

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

MockListHandler is a mock of ListHandler interface.

func NewMockListHandler

func NewMockListHandler(ctrl *gomock.Controller) *MockListHandler

NewMockListHandler creates a new mock instance.

func (*MockListHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockListHandler) List

func (m *MockListHandler) List(ctx context.Context, request *ListRequest) (*ListResponse, error)

List mocks base method.

type MockListHandlerMockRecorder

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

MockListHandlerMockRecorder is the mock recorder for MockListHandler.

func (*MockListHandlerMockRecorder) List

func (mr *MockListHandlerMockRecorder) List(ctx, request any) *gomock.Call

List indicates an expected call of List.

type ResourceFetcher

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

func (*ResourceFetcher) FetchItems

func (r *ResourceFetcher) FetchItems(
	ctx context.Context) (items data.Stream, err error)

FetchItems returns a data stream of O2 Resources. The items are converted from objects fetched using the search API.

func (*ResourceFetcher) GetResourceTypeID

func (h *ResourceFetcher) GetResourceTypeID(from data.Object) (resourceTypeID string, err error)

GetResourceTypeID generates a typeID from a search API object.

type ResourceFetcherBuilder

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

ResourceFetcherBuilder contains the data and logic needed to create a new ResourceFetcher.

func NewResourceFetcher

func NewResourceFetcher() *ResourceFetcherBuilder

NewResourceFetcher creates a builder that can then be used to configure and create a handler for the ResourceFetcher.

func (*ResourceFetcherBuilder) Build

func (b *ResourceFetcherBuilder) Build() (
	result *ResourceFetcher, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*ResourceFetcherBuilder) SetBackendToken

func (b *ResourceFetcherBuilder) SetBackendToken(
	value string) *ResourceFetcherBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*ResourceFetcherBuilder) SetBackendURL

func (b *ResourceFetcherBuilder) SetBackendURL(
	value string) *ResourceFetcherBuilder

SetBackendURL sets the URL of the backend server This is mandatory.

func (*ResourceFetcherBuilder) SetCloudID

func (b *ResourceFetcherBuilder) SetCloudID(
	value string) *ResourceFetcherBuilder

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*ResourceFetcherBuilder) SetGraphqlQuery

func (b *ResourceFetcherBuilder) SetGraphqlQuery(
	value string) *ResourceFetcherBuilder

SetGraphqlQuery sets the query to send to the search API server. This is mandatory.

func (*ResourceFetcherBuilder) SetGraphqlVars

func (b *ResourceFetcherBuilder) SetGraphqlVars(
	value *model.SearchInput) *ResourceFetcherBuilder

SetGraphqlVars sets the query vars to send to the search API server. This is mandatory.

func (*ResourceFetcherBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*ResourceFetcherBuilder) SetTransportWrapper

func (b *ResourceFetcherBuilder) SetTransportWrapper(
	value func(http.RoundTripper) http.RoundTripper) *ResourceFetcherBuilder

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type ResourceHandler

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

ResourceHandler knows how to respond to requests to list resources. Don't create instances of this type directly, use the NewResourceHandler function instead.

func (*ResourceHandler) Get

func (h *ResourceHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*ResourceHandler) List

func (h *ResourceHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type ResourceHandlerBuilder

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

ResourceHandlerBuilder contains the data and logic needed to create a new resource collection handler. Don't create instances of this type directly, use the NewResourceHandler function instead.

func NewResourceHandler

func NewResourceHandler() *ResourceHandlerBuilder

NewResourceHandler creates a builder that can then be used to configure and create a handler for the collection of resources.

func (*ResourceHandlerBuilder) Build

func (b *ResourceHandlerBuilder) Build() (
	result *ResourceHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*ResourceHandlerBuilder) SetBackendToken

func (b *ResourceHandlerBuilder) SetBackendToken(
	value string) *ResourceHandlerBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*ResourceHandlerBuilder) SetBackendURL

func (b *ResourceHandlerBuilder) SetBackendURL(
	value string) *ResourceHandlerBuilder

SetBackendURL sets the URL of the backend server This is mandatory.

func (*ResourceHandlerBuilder) SetCloudID

func (b *ResourceHandlerBuilder) SetCloudID(
	value string) *ResourceHandlerBuilder

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*ResourceHandlerBuilder) SetExtensions

func (b *ResourceHandlerBuilder) SetExtensions(values ...string) *ResourceHandlerBuilder

SetExtensions sets the fields that will be added to the extensions.

func (*ResourceHandlerBuilder) SetGraphqlQuery

func (b *ResourceHandlerBuilder) SetGraphqlQuery(
	value string) *ResourceHandlerBuilder

SetGraphqlQuery sets the query to send to the search API server.

func (*ResourceHandlerBuilder) SetGraphqlVars

func (b *ResourceHandlerBuilder) SetGraphqlVars(
	value *model.SearchInput) *ResourceHandlerBuilder

SetGraphqlVars sets the query vars to send to the search API server.

func (*ResourceHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*ResourceHandlerBuilder) SetTransportWrapper

func (b *ResourceHandlerBuilder) SetTransportWrapper(
	value func(http.RoundTripper) http.RoundTripper) *ResourceHandlerBuilder

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type ResourcePoolFetcher

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

func (*ResourcePoolFetcher) FetchItems

func (r *ResourcePoolFetcher) FetchItems(
	ctx context.Context) (resourcePools data.Stream, err error)

FetchItems returns a data stream of O2 ResourcePools. The items are converted from Clusters fetched from the search API.

type ResourcePoolFetcherBuilder

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

ResourcePoolFetcherBuilder contains the data and logic needed to create a new ResourcePoolFetcher.

func NewResourcePoolFetcher

func NewResourcePoolFetcher() *ResourcePoolFetcherBuilder

NewResourcePoolFetcher creates a builder that can then be used to configure and create a handler for the ResourcePoolFetcher.

func (*ResourcePoolFetcherBuilder) Build

func (b *ResourcePoolFetcherBuilder) Build() (
	result *ResourcePoolFetcher, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*ResourcePoolFetcherBuilder) SetBackendToken

func (b *ResourcePoolFetcherBuilder) SetBackendToken(
	value string) *ResourcePoolFetcherBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*ResourcePoolFetcherBuilder) SetBackendURL

SetBackendURL sets the URL of the backend server This is mandatory.

func (*ResourcePoolFetcherBuilder) SetCloudID

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*ResourcePoolFetcherBuilder) SetExtensions

func (b *ResourcePoolFetcherBuilder) SetExtensions(values ...string) *ResourcePoolFetcherBuilder

SetExtensions sets the fields that will be added to the extensions.

func (*ResourcePoolFetcherBuilder) SetGraphqlQuery

func (b *ResourcePoolFetcherBuilder) SetGraphqlQuery(
	value string) *ResourcePoolFetcherBuilder

SetGraphqlQuery sets the query to send to the search API server. This is mandatory.

func (*ResourcePoolFetcherBuilder) SetGraphqlVars

SetGraphqlVars sets the query vars to send to the search API server. This is mandatory.

func (*ResourcePoolFetcherBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*ResourcePoolFetcherBuilder) SetTransportWrapper

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type ResourcePoolHandler

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

ResourcePoolHandler knows how to respond to requests to list resource pools. Don't create instances of this type directly, use the NewResourcePoolHandler function instead.

func (*ResourcePoolHandler) Get

func (h *ResourcePoolHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*ResourcePoolHandler) List

func (h *ResourcePoolHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type ResourcePoolHandlerBuilder

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

ResourcePoolHandlerBuilder contains the data and logic needed to create a new resource pool collection handler. Don't create instances of this type directly, use the NewResourcePoolHandler function instead.

func NewResourcePoolHandler

func NewResourcePoolHandler() *ResourcePoolHandlerBuilder

NewResourcePoolHandler creates a builder that can then be used to configure and create a handler for the collection of resource pools.

func (*ResourcePoolHandlerBuilder) Build

func (b *ResourcePoolHandlerBuilder) Build() (
	result *ResourcePoolHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*ResourcePoolHandlerBuilder) SetBackendToken

func (b *ResourcePoolHandlerBuilder) SetBackendToken(
	value string) *ResourcePoolHandlerBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*ResourcePoolHandlerBuilder) SetBackendURL

SetBackendURL sets the URL of the backend server This is mandatory.

func (*ResourcePoolHandlerBuilder) SetCloudID

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*ResourcePoolHandlerBuilder) SetExtensions

func (b *ResourcePoolHandlerBuilder) SetExtensions(values ...string) *ResourcePoolHandlerBuilder

SetExtensions sets the fields that will be added to the extensions.

func (*ResourcePoolHandlerBuilder) SetGraphqlQuery

func (b *ResourcePoolHandlerBuilder) SetGraphqlQuery(
	value string) *ResourcePoolHandlerBuilder

SetGraphqlQuery sets the query to send to the search API server.

func (*ResourcePoolHandlerBuilder) SetGraphqlVars

SetGraphqlVars sets the query vars to send to the search API server.

func (*ResourcePoolHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*ResourcePoolHandlerBuilder) SetTransportWrapper

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type ResourceTypeHandler

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

ResourceTypeHandler knows how to respond to requests to list resource types. Don't create instances of this type directly, use the NewResourceTypeHandler function instead.

func (*ResourceTypeHandler) Get

func (h *ResourceTypeHandler) Get(ctx context.Context,
	request *GetRequest) (response *GetResponse, err error)

Get is part of the implementation of the object handler interface.

func (*ResourceTypeHandler) List

func (h *ResourceTypeHandler) List(ctx context.Context,
	request *ListRequest) (response *ListResponse, err error)

List is part of the implementation of the collection handler interface.

type ResourceTypeHandlerBuilder

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

ResourceTypeHandlerBuilder contains the data and logic needed to create a new resource type collection handler. Don't create instances of this type directly, use the NewResourceTypeHandler function instead.

func NewResourceTypeHandler

func NewResourceTypeHandler() *ResourceTypeHandlerBuilder

NewResourceTypeHandler creates a builder that can then be used to configure and create a handler for the collection of resource types.

func (*ResourceTypeHandlerBuilder) Build

func (b *ResourceTypeHandlerBuilder) Build() (
	result *ResourceTypeHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*ResourceTypeHandlerBuilder) SetBackendToken

func (b *ResourceTypeHandlerBuilder) SetBackendToken(
	value string) *ResourceTypeHandlerBuilder

SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.

func (*ResourceTypeHandlerBuilder) SetBackendURL

SetBackendURL sets the URL of the backend server This is mandatory.

func (*ResourceTypeHandlerBuilder) SetCloudID

SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.

func (*ResourceTypeHandlerBuilder) SetGraphqlQuery

func (b *ResourceTypeHandlerBuilder) SetGraphqlQuery(
	value string) *ResourceTypeHandlerBuilder

SetGraphqlQuery sets the query to send to the search API server.

func (*ResourceTypeHandlerBuilder) SetGraphqlVars

SetGraphqlVars sets the query vars to send to the search API server.

func (*ResourceTypeHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

func (*ResourceTypeHandlerBuilder) SetTransportWrapper

SetTransportWrapper sets the wrapper that will be used to configure the HTTP clients used to connect to other servers, including the backend server. This is optional.

type VersionsHandler

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

RootHander knows how to respond to requests for the the list of versions of the API. Don't create instances of this type directly, use the NewVersionsHandler function instead.

func (*VersionsHandler) Get

func (h *VersionsHandler) Get(ctx context.Context, request *GetRequest) (response *GetResponse,
	err error)

Get is part of the implementation of the handler interface.

type VersionsHandlerBuilder

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

VersionsHandlerBuilder contains the data and logic needed to create a new handler that servers the list of versions of the API. Don't create instances of this type directly, use the NewVersionsHandler function instead.

func NewVersionsHandler

func NewVersionsHandler() *VersionsHandlerBuilder

NewVersionsHandler creates a builder that can then be used to configure and create a handler for the list of versions of the API.

func (*VersionsHandlerBuilder) Build

func (b *VersionsHandlerBuilder) Build() (result *VersionsHandler, err error)

Build uses the data stored in the builder to create and configure a new handler.

func (*VersionsHandlerBuilder) SetLogger

SetLogger sets the logger that the handler will use to write to the log. This is mandatory.

Jump to

Keyboard shortcuts

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