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
- Variables
- func SendError(w http.ResponseWriter, status int, msg string, args ...any)
- type Adapter
- type AdapterBuilder
- func (b *AdapterBuilder) Build() (result *Adapter, err error)
- func (b *AdapterBuilder) SetExcludeFields(values ...string) *AdapterBuilder
- func (b *AdapterBuilder) SetExternalAddress(value string) *AdapterBuilder
- func (b *AdapterBuilder) SetHandler(value any) *AdapterBuilder
- func (b *AdapterBuilder) SetIncludeFields(values ...string) *AdapterBuilder
- func (b *AdapterBuilder) SetLogger(logger *slog.Logger) *AdapterBuilder
- func (b *AdapterBuilder) SetNextPageMarkerKey(value []byte) *AdapterBuilder
- func (b *AdapterBuilder) SetNextPageMarkerNonce(value []byte) *AdapterBuilder
- func (b *AdapterBuilder) SetPathVariables(values ...string) *AdapterBuilder
- type AddHandler
- type AddRequest
- type AddResponse
- type AlarmDefinitionHandler
- type AlarmDefinitionHandlerBuilder
- type AlarmFetcher
- type AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) Build() (result *AlarmFetcher, err error)
- func (b *AlarmFetcherBuilder) SetBackendToken(value string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetBackendURL(value string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetCloudID(value string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetExtensions(values ...string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetFilters(value []string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetLogger(value *slog.Logger) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetResourceServerToken(value string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetResourceServerURL(value string) *AlarmFetcherBuilder
- func (b *AlarmFetcherBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *AlarmFetcherBuilder
- type AlarmHandler
- type AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) Build() (result *AlarmHandler, err error)
- func (b *AlarmHandlerBuilder) SetBackendToken(value string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetBackendURL(value string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetCloudID(value string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetExtensions(values ...string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetLogger(value *slog.Logger) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetResourceServerToken(value string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetResourceServerURL(value string) *AlarmHandlerBuilder
- func (b *AlarmHandlerBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *AlarmHandlerBuilder
- type AlarmMapper
- type AlarmMapperBuilder
- func (b *AlarmMapperBuilder) Build() (result *AlarmMapper, err error)
- func (b *AlarmMapperBuilder) SetBackendClient(value *http.Client) *AlarmMapperBuilder
- func (b *AlarmMapperBuilder) SetExtensions(values ...string) *AlarmMapperBuilder
- func (b *AlarmMapperBuilder) SetLogger(value *slog.Logger) *AlarmMapperBuilder
- func (b *AlarmMapperBuilder) SetResourceServerToken(value string) *AlarmMapperBuilder
- func (b *AlarmMapperBuilder) SetResourceServerURL(value string) *AlarmMapperBuilder
- type AlarmNotificationHandler
- type AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) Build(ctx context.Context) (result *AlarmNotificationHandler, err error)
- func (b *AlarmNotificationHandlerBuilder) SetConfigmapName(value string) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetGlobalCloudID(value string) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetKubeClient(kubeClient *k8s.Client) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetLogger(value *slog.Logger) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetLoggingWrapper(value func(http.RoundTripper) http.RoundTripper) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetNamespace(value string) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetResourceServerToken(value string) *AlarmNotificationHandlerBuilder
- func (b *AlarmNotificationHandlerBuilder) SetResourceServerURL(value string) *AlarmNotificationHandlerBuilder
- type AlarmProbableCauseHandler
- type AlarmProbableCauseHandlerBuilder
- type AlarmSeverity
- type AlertFilterOp
- type AlertFilterProperty
- type CloudInfoHandler
- type CloudInfoHandlerBuilder
- func (b *CloudInfoHandlerBuilder) Build() (result *CloudInfoHandler, err error)
- func (b *CloudInfoHandlerBuilder) SetCloudID(value string) *CloudInfoHandlerBuilder
- func (b *CloudInfoHandlerBuilder) SetExternalAddress(value string) *CloudInfoHandlerBuilder
- func (b *CloudInfoHandlerBuilder) SetGlobalCloudID(value string) *CloudInfoHandlerBuilder
- func (b *CloudInfoHandlerBuilder) SetLogger(value *slog.Logger) *CloudInfoHandlerBuilder
- type DeleteHandler
- type DeleteRequest
- type DeleteResponse
- type DeploymentManagerBackendType
- type DeploymentManagerHandler
- type DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) Build() (result *DeploymentManagerHandler, err error)
- func (b *DeploymentManagerHandlerBuilder) SetBackendToken(value string) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetBackendType(value DeploymentManagerBackendType) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetBackendURL(value string) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetCloudID(value string) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetEnableHack(value bool) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetExtensions(values ...string) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetLogger(value *slog.Logger) *DeploymentManagerHandlerBuilder
- func (b *DeploymentManagerHandlerBuilder) SetLoggingWrapper(value func(http.RoundTripper) http.RoundTripper) *DeploymentManagerHandlerBuilder
- type GetHandler
- type GetRequest
- type GetResponse
- type Handler
- type ListHandler
- type ListRequest
- type ListResponse
- type MockAddHandler
- type MockAddHandlerMockRecorder
- type MockDeleteHandler
- type MockDeleteHandlerMockRecorder
- type MockGetHandler
- type MockGetHandlerMockRecorder
- type MockHandler
- func (m *MockHandler) Add(ctx context.Context, request *AddRequest) (*AddResponse, error)
- func (m *MockHandler) Delete(ctx context.Context, request *DeleteRequest) (*DeleteResponse, error)
- func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
- func (m *MockHandler) Get(ctx context.Context, request *GetRequest) (*GetResponse, error)
- func (m *MockHandler) List(ctx context.Context, request *ListRequest) (*ListResponse, error)
- type MockHandlerMockRecorder
- type MockListHandler
- type MockListHandlerMockRecorder
- type ResourceFetcher
- type ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) Build() (result *ResourceFetcher, err error)
- func (b *ResourceFetcherBuilder) SetBackendToken(value string) *ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) SetBackendURL(value string) *ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) SetGraphqlQuery(value string) *ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) SetGraphqlVars(value *model.SearchInput) *ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) SetLogger(value *slog.Logger) *ResourceFetcherBuilder
- func (b *ResourceFetcherBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *ResourceFetcherBuilder
- type ResourceHandler
- type ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) Build() (result *ResourceHandler, err error)
- func (b *ResourceHandlerBuilder) SetBackendToken(value string) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetBackendURL(value string) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetExtensions(values ...string) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetGraphqlQuery(value string) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetGraphqlVars(value *model.SearchInput) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetLogger(value *slog.Logger) *ResourceHandlerBuilder
- func (b *ResourceHandlerBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *ResourceHandlerBuilder
- type ResourcePoolFetcher
- type ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) Build() (result *ResourcePoolFetcher, err error)
- func (b *ResourcePoolFetcherBuilder) SetBackendToken(value string) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetBackendURL(value string) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetCloudID(value string) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetExtensions(values ...string) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetGraphqlQuery(value string) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetGraphqlVars(value *model.SearchInput) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetLogger(value *slog.Logger) *ResourcePoolFetcherBuilder
- func (b *ResourcePoolFetcherBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *ResourcePoolFetcherBuilder
- type ResourcePoolHandler
- type ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) Build() (result *ResourcePoolHandler, err error)
- func (b *ResourcePoolHandlerBuilder) SetBackendToken(value string) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetBackendURL(value string) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetCloudID(value string) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetExtensions(values ...string) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetGraphqlQuery(value string) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetGraphqlVars(value *model.SearchInput) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetLogger(value *slog.Logger) *ResourcePoolHandlerBuilder
- func (b *ResourcePoolHandlerBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *ResourcePoolHandlerBuilder
- type ResourceTypeHandler
- type ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) Build() (result *ResourceTypeHandler, err error)
- func (b *ResourceTypeHandlerBuilder) SetBackendToken(value string) *ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) SetBackendURL(value string) *ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) SetGraphqlQuery(value string) *ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) SetGraphqlVars(value *model.SearchInput) *ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) SetLogger(value *slog.Logger) *ResourceTypeHandlerBuilder
- func (b *ResourceTypeHandlerBuilder) SetTransportWrapper(value func(http.RoundTripper) http.RoundTripper) *ResourceTypeHandlerBuilder
- type SubscriptionHandler
- func (h *SubscriptionHandler) Add(ctx context.Context, request *AddRequest) (response *AddResponse, err error)
- func (h *SubscriptionHandler) Delete(ctx context.Context, request *DeleteRequest) (response *DeleteResponse, err error)
- func (h *SubscriptionHandler) Get(ctx context.Context, request *GetRequest) (response *GetResponse, err error)
- func (h *SubscriptionHandler) List(ctx context.Context, request *ListRequest) (response *ListResponse, err error)
- type SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) Build(ctx context.Context) (result *SubscriptionHandler, err error)
- func (b *SubscriptionHandlerBuilder) SetConfigmapName(value string) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetExtensions(values ...string) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetGlobalCloudID(value string) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetKubeClient(kubeClient *k8s.Client) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetLogger(value *slog.Logger) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetLoggingWrapper(value func(http.RoundTripper) http.RoundTripper) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetNamespace(value string) *SubscriptionHandlerBuilder
- func (b *SubscriptionHandlerBuilder) SetSubscriptionIdString(subscriptionIdString string) *SubscriptionHandlerBuilder
- type VersionsHandler
- type VersionsHandlerBuilder
Constants ¶
const ( // default namespace should be changed to official namespace when it is available DefaultNamespace = utils.DefaultNamespace // TODO: consolidate DefaultAlarmConfigmapName = "oran-o2ims-alarm-subscriptions" DefaultInfraInventoryConfigmapName = "oran-o2ims-inventory-subscriptions" FieldOwner = "oran-o2ims" )
const ( SubscriptionIdAlarm = "alarmSubscriptionId" SubscriptionIdInfrastructureInventory = "subscriptionId" )
const ( KindNode = "Node" KindCluster = "Cluster" )
const ( ResourceClassCompute = "COMPUTE" ResourceClassNetworking = "NETWORKING" ResourceClassStorage = "STORAGE" ResourceClassUndefined = "UNDEFINED" ResourceKindPhysical = "PHYSICAL" ResourceKindLogical = "LOGICAL" ResourcekindUndefined = "UNDEFINED" )
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
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.
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 adapter.
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 ¶
func (b *AlarmDefinitionHandlerBuilder) SetLogger( value *slog.Logger) *AlarmDefinitionHandlerBuilder
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 ¶
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 alarm fetcher object 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) SetFilters ¶
func (b *AlarmFetcherBuilder) SetFilters( value []string) *AlarmFetcherBuilder
SetFilters sets the query filter to send to the Alertmanager server. This is optional.
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 AlarmMapper ¶
type AlarmMapper struct {
// contains filtered or unexported fields
}
type AlarmMapperBuilder ¶
type AlarmMapperBuilder struct {
// contains filtered or unexported fields
}
AlarmMapperBuilder contains the data and logic needed to create a new AlarmMapper.
func NewAlarmMapper ¶
func NewAlarmMapper() *AlarmMapperBuilder
AlarmMapper creates a builder that can then be used to configure and create a handler for the AlarmMapper.
func (*AlarmMapperBuilder) Build ¶
func (b *AlarmMapperBuilder) Build() ( result *AlarmMapper, err error)
Build uses the data stored in the builder to create and configure a new handler.
func (*AlarmMapperBuilder) SetBackendClient ¶
func (b *AlarmMapperBuilder) SetBackendClient(value *http.Client) *AlarmMapperBuilder
SetBackendClient sets the backend client used to connect to other servers. This is mandatory.
func (*AlarmMapperBuilder) SetExtensions ¶
func (b *AlarmMapperBuilder) SetExtensions(values ...string) *AlarmMapperBuilder
SetExtensions sets the fields that will be added to the extensions. This is optional.
func (*AlarmMapperBuilder) SetLogger ¶
func (b *AlarmMapperBuilder) SetLogger( value *slog.Logger) *AlarmMapperBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*AlarmMapperBuilder) SetResourceServerToken ¶
func (b *AlarmMapperBuilder) SetResourceServerToken( value string) *AlarmMapperBuilder
SetResourceServerToken sets the authentication token that will be used to authenticate with to the resource server. This is mandatory.
func (*AlarmMapperBuilder) SetResourceServerURL ¶
func (b *AlarmMapperBuilder) SetResourceServerURL( value string) *AlarmMapperBuilder
SetResourceServerURL sets the URL of the resource server. This is mandatory. The resource server is used for mapping Alarms to Resources.
type AlarmNotificationHandler ¶
type AlarmNotificationHandler struct {
// contains filtered or unexported fields
}
AlarmNotificationHander will receive the alarts from openshift alert manager, match alarm subscription filter rules with the alerts/alarm, and send out matched alarm notifications Don't create instances of this type directly, use the NewAlarmNotificationHandler function instead.
func (*AlarmNotificationHandler) ServeHTTP ¶
func (h *AlarmNotificationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AlarmNotificationHandlerBuilder ¶
type AlarmNotificationHandlerBuilder struct {
// contains filtered or unexported fields
}
AlarmNotificationManagerHandlerBuilder contains the data and logic needed to construct alarm notification handler. Don't create instances of this type directly, use the NewAlarmNotificationHandler function instead.
func NewAlarmNotificationHandler ¶
func NewAlarmNotificationHandler() *AlarmNotificationHandlerBuilder
NewAlarmNotificationHandler creates a builder that can then be used to configure and create a handler for AlarmNotificationHandler.
func (*AlarmNotificationHandlerBuilder) Build ¶
func (b *AlarmNotificationHandlerBuilder) Build(ctx context.Context) ( result *AlarmNotificationHandler, err error)
Build uses the data stored in the builder to create anad configure a new handler.
func (*AlarmNotificationHandlerBuilder) SetConfigmapName ¶
func (b *AlarmNotificationHandlerBuilder) SetConfigmapName( value string) *AlarmNotificationHandlerBuilder
SetNamespace sets the namespace.
func (*AlarmNotificationHandlerBuilder) SetGlobalCloudID ¶
func (b *AlarmNotificationHandlerBuilder) SetGlobalCloudID( value string) *AlarmNotificationHandlerBuilder
SetGlobalCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.
func (*AlarmNotificationHandlerBuilder) SetKubeClient ¶
func (b *AlarmNotificationHandlerBuilder) SetKubeClient( kubeClient *k8s.Client) *AlarmNotificationHandlerBuilder
SetKubeClient sets the kubeClient.
func (*AlarmNotificationHandlerBuilder) SetLogger ¶
func (b *AlarmNotificationHandlerBuilder) SetLogger( value *slog.Logger) *AlarmNotificationHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*AlarmNotificationHandlerBuilder) SetLoggingWrapper ¶
func (b *AlarmNotificationHandlerBuilder) SetLoggingWrapper( value func(http.RoundTripper) http.RoundTripper) *AlarmNotificationHandlerBuilder
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.
func (*AlarmNotificationHandlerBuilder) SetNamespace ¶
func (b *AlarmNotificationHandlerBuilder) SetNamespace( value string) *AlarmNotificationHandlerBuilder
SetNamespace sets the namespace.
func (*AlarmNotificationHandlerBuilder) SetResourceServerToken ¶
func (b *AlarmNotificationHandlerBuilder) SetResourceServerToken( value string) *AlarmNotificationHandlerBuilder
SetResourceServerToken sets the authentication token that will be used to authenticate with to the resource server. This is mandatory.
func (*AlarmNotificationHandlerBuilder) SetResourceServerURL ¶
func (b *AlarmNotificationHandlerBuilder) SetResourceServerURL( value string) *AlarmNotificationHandlerBuilder
SetResourceServerURL sets the URL of the resource server. This is mandatory. The resource server is used for mapping Alarms to Resources.
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 ¶
func (b *AlarmProbableCauseHandlerBuilder) Build() ( result *AlarmProbableCauseHandler, err error)
Build uses the data stored in the builder to create and configure a new handler.
func (*AlarmProbableCauseHandlerBuilder) SetLogger ¶
func (b *AlarmProbableCauseHandlerBuilder) SetLogger( value *slog.Logger) *AlarmProbableCauseHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
type AlarmSeverity ¶
type AlarmSeverity string
type AlertFilterOp ¶
func (AlertFilterOp) String ¶
func (o AlertFilterOp) String() (result string, err error)
String generates an Alertmanager string representation of the operator. It panics if used on an unknown operator.
type AlertFilterProperty ¶
type AlertFilterProperty string
func (AlertFilterProperty) MapProperty ¶
func (p AlertFilterProperty) MapProperty() string
MapProperty maps a specified O2 property to the Alertmanager property
type CloudInfoHandler ¶
type CloudInfoHandler struct {
// contains filtered or unexported fields
}
CloudInfoHandler knows how to respond to requests for the application endpoints. 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 ¶
func (b *CloudInfoHandlerBuilder) SetCloudID(value string) *CloudInfoHandlerBuilder
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) SetGlobalCloudID ¶
func (b *CloudInfoHandlerBuilder) SetGlobalCloudID(value string) *CloudInfoHandlerBuilder
SetGlobalCloudID sets the global identifier of the O-Cloud of this handler. This is mandatory.
func (*CloudInfoHandlerBuilder) SetLogger ¶
func (b *CloudInfoHandlerBuilder) SetLogger(value *slog.Logger) *CloudInfoHandlerBuilder
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 ¶
func (b *DeploymentManagerHandlerBuilder) Build() ( result *DeploymentManagerHandler, err error)
Build uses the data stored in the builder to create and configure a new handler.
func (*DeploymentManagerHandlerBuilder) SetBackendToken ¶
func (b *DeploymentManagerHandlerBuilder) SetBackendToken( value string) *DeploymentManagerHandlerBuilder
SetBackendToken sets the authentication token that will be used to authenticate to the backend server. This is mandatory.
func (*DeploymentManagerHandlerBuilder) SetBackendType ¶
func (b *DeploymentManagerHandlerBuilder) SetBackendType( value DeploymentManagerBackendType) *DeploymentManagerHandlerBuilder
SetBackendType sets the type of backend: global or regular ACM hub.
func (*DeploymentManagerHandlerBuilder) SetBackendURL ¶
func (b *DeploymentManagerHandlerBuilder) SetBackendURL( value string) *DeploymentManagerHandlerBuilder
SetBackendURL sets the URL of the backend server This is mandatory.
func (*DeploymentManagerHandlerBuilder) SetCloudID ¶
func (b *DeploymentManagerHandlerBuilder) SetCloudID( value string) *DeploymentManagerHandlerBuilder
SetCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.
func (*DeploymentManagerHandlerBuilder) SetEnableHack ¶
func (b *DeploymentManagerHandlerBuilder) SetEnableHack( value bool) *DeploymentManagerHandlerBuilder
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 ¶
func (b *DeploymentManagerHandlerBuilder) SetExtensions( values ...string) *DeploymentManagerHandlerBuilder
SetExtensions sets the fields that will be added to the extensions.
func (*DeploymentManagerHandlerBuilder) SetLogger ¶
func (b *DeploymentManagerHandlerBuilder) SetLogger( value *slog.Logger) *DeploymentManagerHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*DeploymentManagerHandlerBuilder) SetLoggingWrapper ¶
func (b *DeploymentManagerHandlerBuilder) SetLoggingWrapper( value func(http.RoundTripper) http.RoundTripper) *DeploymentManagerHandlerBuilder
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 ¶
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 ¶
func (m *MockAddHandler) EXPECT() *MockAddHandlerMockRecorder
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.
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 ¶
func (m *MockDeleteHandler) EXPECT() *MockDeleteHandlerMockRecorder
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.
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 ¶
func (m *MockGetHandler) EXPECT() *MockGetHandlerMockRecorder
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.
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.
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 ¶
func (m *MockListHandler) EXPECT() *MockListHandlerMockRecorder
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.
type ResourceFetcher ¶
type ResourceFetcher struct {
// contains filtered or unexported fields
}
func (*ResourceFetcher) FetchItems ¶
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) 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 ¶
func (b *ResourceFetcherBuilder) SetLogger( value *slog.Logger) *ResourceFetcherBuilder
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) 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 ¶
func (b *ResourceHandlerBuilder) SetLogger( value *slog.Logger) *ResourceHandlerBuilder
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 ¶
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 ¶
func (b *ResourcePoolFetcherBuilder) SetBackendURL( value string) *ResourcePoolFetcherBuilder
SetBackendURL sets the URL of the backend server This is mandatory.
func (*ResourcePoolFetcherBuilder) SetCloudID ¶
func (b *ResourcePoolFetcherBuilder) SetCloudID( value string) *ResourcePoolFetcherBuilder
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 ¶
func (b *ResourcePoolFetcherBuilder) SetGraphqlVars( value *model.SearchInput) *ResourcePoolFetcherBuilder
SetGraphqlVars sets the query vars to send to the search API server. This is mandatory.
func (*ResourcePoolFetcherBuilder) SetLogger ¶
func (b *ResourcePoolFetcherBuilder) SetLogger( value *slog.Logger) *ResourcePoolFetcherBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*ResourcePoolFetcherBuilder) SetTransportWrapper ¶
func (b *ResourcePoolFetcherBuilder) SetTransportWrapper( value func(http.RoundTripper) http.RoundTripper) *ResourcePoolFetcherBuilder
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 ¶
func (b *ResourcePoolHandlerBuilder) SetBackendURL( value string) *ResourcePoolHandlerBuilder
SetBackendURL sets the URL of the backend server This is mandatory.
func (*ResourcePoolHandlerBuilder) SetCloudID ¶
func (b *ResourcePoolHandlerBuilder) SetCloudID( value string) *ResourcePoolHandlerBuilder
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 ¶
func (b *ResourcePoolHandlerBuilder) SetGraphqlVars( value *model.SearchInput) *ResourcePoolHandlerBuilder
SetGraphqlVars sets the query vars to send to the search API server.
func (*ResourcePoolHandlerBuilder) SetLogger ¶
func (b *ResourcePoolHandlerBuilder) SetLogger( value *slog.Logger) *ResourcePoolHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*ResourcePoolHandlerBuilder) SetTransportWrapper ¶
func (b *ResourcePoolHandlerBuilder) SetTransportWrapper( value func(http.RoundTripper) http.RoundTripper) *ResourcePoolHandlerBuilder
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 ¶
func (b *ResourceTypeHandlerBuilder) SetBackendURL( value string) *ResourceTypeHandlerBuilder
SetBackendURL sets the URL of the backend server 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 ¶
func (b *ResourceTypeHandlerBuilder) SetGraphqlVars( value *model.SearchInput) *ResourceTypeHandlerBuilder
SetGraphqlVars sets the query vars to send to the search API server.
func (*ResourceTypeHandlerBuilder) SetLogger ¶
func (b *ResourceTypeHandlerBuilder) SetLogger( value *slog.Logger) *ResourceTypeHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*ResourceTypeHandlerBuilder) SetTransportWrapper ¶
func (b *ResourceTypeHandlerBuilder) SetTransportWrapper( value func(http.RoundTripper) http.RoundTripper) *ResourceTypeHandlerBuilder
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 SubscriptionHandler ¶
type SubscriptionHandler struct {
// contains filtered or unexported fields
}
SubscriptionHandler knows how to respond to requests to list alarm subscriptions. Don't create instances of this type directly, use the NewAlarmSubscriptionHandler function instead.
func (*SubscriptionHandler) Add ¶
func (h *SubscriptionHandler) Add(ctx context.Context, request *AddRequest) (response *AddResponse, err error)
Add is the implementation of the object handler ADD interface.
func (*SubscriptionHandler) Delete ¶
func (h *SubscriptionHandler) Delete(ctx context.Context, request *DeleteRequest) (response *DeleteResponse, err error)
Delete is the implementation of the object handler delete interface.
func (*SubscriptionHandler) Get ¶
func (h *SubscriptionHandler) Get(ctx context.Context, request *GetRequest) (response *GetResponse, err error)
Get is the implementation of the object handler interface.
func (*SubscriptionHandler) List ¶
func (h *SubscriptionHandler) List(ctx context.Context, request *ListRequest) (response *ListResponse, err error)
List is the implementation of the collection handler interface.
type SubscriptionHandlerBuilder ¶
type SubscriptionHandlerBuilder struct {
// contains filtered or unexported fields
}
SubscriptionHandlerBuilder contains the data and logic needed to create a new alarm subscription handler. Don't create instance of this type directly, use the NewAlarmSubscriptionHandler function instead.
func NewSubscriptionHandler ¶
func NewSubscriptionHandler() *SubscriptionHandlerBuilder
NewSubscriptionHandler creates a builder that can then be used to configure and create a handler for the collection of deployment managers.
func (*SubscriptionHandlerBuilder) Build ¶
func (b *SubscriptionHandlerBuilder) Build(ctx context.Context) ( result *SubscriptionHandler, err error)
Build uses the data stored in the builder to create anad configure a new handler.
func (*SubscriptionHandlerBuilder) SetConfigmapName ¶
func (b *SubscriptionHandlerBuilder) SetConfigmapName( value string) *SubscriptionHandlerBuilder
SetNamespace sets the namespace.
func (*SubscriptionHandlerBuilder) SetExtensions ¶
func (b *SubscriptionHandlerBuilder) SetExtensions( values ...string) *SubscriptionHandlerBuilder
SetExtensions sets the fields that will be added to the extensions.
func (*SubscriptionHandlerBuilder) SetGlobalCloudID ¶
func (b *SubscriptionHandlerBuilder) SetGlobalCloudID( value string) *SubscriptionHandlerBuilder
SetGlobalCloudID sets the identifier of the O-Cloud of this handler. This is mandatory.
func (*SubscriptionHandlerBuilder) SetKubeClient ¶
func (b *SubscriptionHandlerBuilder) SetKubeClient( kubeClient *k8s.Client) *SubscriptionHandlerBuilder
SetKubeClient sets the K8S client.
func (*SubscriptionHandlerBuilder) SetLogger ¶
func (b *SubscriptionHandlerBuilder) SetLogger( value *slog.Logger) *SubscriptionHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
func (*SubscriptionHandlerBuilder) SetLoggingWrapper ¶
func (b *SubscriptionHandlerBuilder) SetLoggingWrapper( value func(http.RoundTripper) http.RoundTripper) *SubscriptionHandlerBuilder
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.
func (*SubscriptionHandlerBuilder) SetNamespace ¶
func (b *SubscriptionHandlerBuilder) SetNamespace( value string) *SubscriptionHandlerBuilder
SetNamespace sets the namespace.
func (*SubscriptionHandlerBuilder) SetSubscriptionIdString ¶
func (b *SubscriptionHandlerBuilder) SetSubscriptionIdString( subscriptionIdString string) *SubscriptionHandlerBuilder
SetSubscriptionType sets the purpose of the subscription. So far alarm and infrastructure-inventory as supported.
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 ¶
func (b *VersionsHandlerBuilder) SetLogger(value *slog.Logger) *VersionsHandlerBuilder
SetLogger sets the logger that the handler will use to write to the log. This is mandatory.
Source Files ¶
- adapter.go
- alarm_definition_handler.go
- alarm_fetcher.go
- alarm_handler.go
- alarm_mapper.go
- alarm_notification_dispatcher.go
- alarm_notification_handler.go
- alarm_notification_searcher.go
- alarm_probable_cause_handler.go
- cloud_info_handler.go
- constants.go
- deployment_manager_handler.go
- errors.go
- handlers.go
- handlers_mock.go
- resource_fetcher.go
- resource_handler.go
- resource_pool_fetcher.go
- resource_pool_handler.go
- resource_type_handler.go
- subscription_handler.go
- versions_handler.go
Directories ¶
Path | Synopsis |
---|---|
api/generated
Package generated provides primitives to interact with the openapi HTTP API.
|
Package generated provides primitives to interact with the openapi HTTP API. |
internal/resourceserver/generated
Package generated provides primitives to interact with the openapi HTTP API.
|
Package generated provides primitives to interact with the openapi HTTP API. |
common
|
|
api/generated
Package generated provides primitives to interact with the openapi HTTP API.
|
Package generated provides primitives to interact with the openapi HTTP API. |
api/generated
Package generated provides primitives to interact with the openapi HTTP API.
|
Package generated provides primitives to interact with the openapi HTTP API. |