service

package
v0.0.0-...-a7d64e5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Generated by this command:

mockgen -source=collection_handler.go -package=service -destination=collection_handler_mock.go

Package service is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendError

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

Types

type CollectionAdapter

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

func (*CollectionAdapter) ServeHTTP

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

Serve is the implementation of the http.Handler interface.

type CollectionAdapterBuilder

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

func NewCollectionAdapter

func NewCollectionAdapter() *CollectionAdapterBuilder

func (*CollectionAdapterBuilder) Build

func (b *CollectionAdapterBuilder) Build() (result *CollectionAdapter, err error)

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

func (*CollectionAdapterBuilder) SetHandler

SetHandler sets the object that will handle the requests. This is mandatory.

func (*CollectionAdapterBuilder) SetLogger

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

type CollectionHandler

type CollectionHandler interface {
	Get(ctx context.Context, request *CollectionRequest) (response *CollectionResponse, err error)
}

CollectionHandler is the interface implemented by objects that know how to handle requests to list the items in a collection of objects.

type CollectionRequest

type CollectionRequest struct {
	Filter   *search.Selector
	Selector [][]string
}

CollectionRequest represents a request for a collection of objects.

type CollectionResponse

type CollectionResponse struct {
	Items data.Stream
}

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

type DeploymentManagerCollectionHandler

type DeploymentManagerCollectionHandler 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 NewDeploymentManagerCollectionHandler function instead.

func (*DeploymentManagerCollectionHandler) Get

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

type DeploymentManagerCollectionHandlerBuilder

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

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

func NewDeploymentManagerCollectionHandler

func NewDeploymentManagerCollectionHandler() *DeploymentManagerCollectionHandlerBuilder

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

func (*DeploymentManagerCollectionHandlerBuilder) Build

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

func (*DeploymentManagerCollectionHandlerBuilder) SetBackendToken

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

func (*DeploymentManagerCollectionHandlerBuilder) SetBackendURL

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

func (*DeploymentManagerCollectionHandlerBuilder) SetCloudID

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

func (*DeploymentManagerCollectionHandlerBuilder) SetLogger

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

func (*DeploymentManagerCollectionHandlerBuilder) 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 DeploymentManagerObjectHandler

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

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

func (*DeploymentManagerObjectHandler) Get

func (h *DeploymentManagerObjectHandler) Get(ctx context.Context,
	request *ObjectRequest) (response *ObjectResponse, err error)

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

type DeploymentManagerObjectHandlerBuilder

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

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

func NewDeploymentManagerObjectHandler

func NewDeploymentManagerObjectHandler() *DeploymentManagerObjectHandlerBuilder

NewDeploymentManagerObjectHandler creates a builder that can then be used to configure and create a handler for an individual deployment manager.

func (*DeploymentManagerObjectHandlerBuilder) Build

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

func (*DeploymentManagerObjectHandlerBuilder) SetBackendToken

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

func (*DeploymentManagerObjectHandlerBuilder) SetBackendURL

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

func (*DeploymentManagerObjectHandlerBuilder) SetCloudID

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

func (*DeploymentManagerObjectHandlerBuilder) SetLogger

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

func (*DeploymentManagerObjectHandlerBuilder) 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 MockCollectionHandler

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

MockCollectionHandler is a mock of CollectionHandler interface.

func NewMockCollectionHandler

func NewMockCollectionHandler(ctrl *gomock.Controller) *MockCollectionHandler

NewMockCollectionHandler creates a new mock instance.

func (*MockCollectionHandler) EXPECT

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

func (*MockCollectionHandler) Get

Get mocks base method.

type MockCollectionHandlerMockRecorder

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

MockCollectionHandlerMockRecorder is the mock recorder for MockCollectionHandler.

func (*MockCollectionHandlerMockRecorder) Get

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

Get indicates an expected call of Get.

type ObjectAdapter

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

func (*ObjectAdapter) ServeHTTP

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

Serve is the implementation of the http.Handler interface.

type ObjectAdapterBuilder

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

func NewObjectAdapter

func NewObjectAdapter() *ObjectAdapterBuilder

func (*ObjectAdapterBuilder) Build

func (b *ObjectAdapterBuilder) Build() (result *ObjectAdapter, err error)

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

func (*ObjectAdapterBuilder) SetHandler

SetHandler sets the object that will handle the requests. This is mandatory.

func (*ObjectAdapterBuilder) SetID

SetID sets the name of the path variable that contains the identifier of the object. This is mandatory.

func (*ObjectAdapterBuilder) SetLogger

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

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

type ObjectHandler

type ObjectHandler interface {
	Get(ctx context.Context, request *ObjectRequest) (response *ObjectResponse, err error)
}

ObjectHandler is the interface implemented by objects that know how to handle requests to get individual objects.

type ObjectRequest

type ObjectRequest struct {
	ID string
}

ObjectHandler represents a request for an individual object.

type ObjectResponse

type ObjectResponse struct {
	Object data.Object
}

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

Jump to

Keyboard shortcuts

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