Documentation ¶
Index ¶
- Constants
- func AddPublicEndpoints(api *openapi.API, config extensionController.ExtensionManagerConfig) error
- func CreateInstance(apiContext *ApiContext) *openapi.Post
- func CreateOpenApi() (*openapi.API, error)
- func DecodeJSONBody(writer http.ResponseWriter, request *http.Request, dst interface{}) error
- func DeleteInstance(apiContext *ApiContext) *openapi.Delete
- func GetExtensionDetails(apiContext *ApiContext) *openapi.Get
- func GetLogger(context context.Context) *log.Entry
- func InstallExtension(apiContext *ApiContext) *openapi.Put
- func ListAvailableExtensions(apiContext *ApiContext) *openapi.Get
- func ListInstalledExtensions(apiContext *ApiContext) *openapi.Get
- func ListInstances(apiContext *ApiContext) *openapi.Get
- func SendJSON(ctx context.Context, writer http.ResponseWriter, data interface{}) error
- func SendJSONWithStatus(ctx context.Context, status int, writer http.ResponseWriter, data interface{}) error
- func SendNoContent(ctx context.Context, writer http.ResponseWriter) error
- func UninstallExtension(apiContext *ApiContext) *openapi.Delete
- func UpgradeExtension(apiContext *ApiContext) *openapi.Post
- type ApiContext
- type CreateInstanceRequest
- type CreateInstanceResponse
- type ExtensionDetailsResponse
- type ExtensionVersion
- type ExtensionsResponse
- type ExtensionsResponseExtension
- type InstallExtensionRequest
- type InstallationsResponse
- type InstallationsResponseInstallation
- type Instance
- type ListInstancesResponse
- type ParamDefinition
- type ParameterValue
- type RestAPI
- type UpgradeExtensionResponse
Constants ¶
const ( /* [impl -> const~use-reserved-schema~1]. */ EXTENSION_SCHEMA_NAME = "EXA_EXTENSIONS" TagExtension = "Extension" TagInstallation = "Installation" TagInstance = "Instance" BearerAuth = "DbAccessToken" BasicAuth = "DbUsernamePassword" )
const ( ContentTypeJson = "application/json" HeaderContentType = "Content-Type" )
Variables ¶
This section is empty.
Functions ¶
func AddPublicEndpoints ¶
func AddPublicEndpoints(api *openapi.API, config extensionController.ExtensionManagerConfig) error
AddPublicEndpoints adds the extension manager endpoints to the API. The config struct contains configuration options for the extension manager.
[impl -> dsn~go-library~1].
func CreateInstance ¶
func CreateInstance(apiContext *ApiContext) *openapi.Post
func CreateOpenApi ¶
func DecodeJSONBody ¶
func DecodeJSONBody(writer http.ResponseWriter, request *http.Request, dst interface{}) error
func DeleteInstance ¶
func DeleteInstance(apiContext *ApiContext) *openapi.Delete
func GetExtensionDetails ¶
func GetExtensionDetails(apiContext *ApiContext) *openapi.Get
[impl -> dsn~parameter-versioning~1].
func InstallExtension ¶
func InstallExtension(apiContext *ApiContext) *openapi.Put
func ListAvailableExtensions ¶
func ListAvailableExtensions(apiContext *ApiContext) *openapi.Get
func ListInstalledExtensions ¶
func ListInstalledExtensions(apiContext *ApiContext) *openapi.Get
func ListInstances ¶
func ListInstances(apiContext *ApiContext) *openapi.Get
func SendJSON ¶
func SendJSON(ctx context.Context, writer http.ResponseWriter, data interface{}) error
SendJSON converts the given data to JSON and sends it to the writer.
func SendJSONWithStatus ¶
func SendNoContent ¶
func SendNoContent(ctx context.Context, writer http.ResponseWriter) error
func UninstallExtension ¶
func UninstallExtension(apiContext *ApiContext) *openapi.Delete
func UpgradeExtension ¶ added in v0.5.0
func UpgradeExtension(apiContext *ApiContext) *openapi.Post
[impl -> dsn~upgrade-extension~1].
Types ¶
type ApiContext ¶
type ApiContext struct { Controller extensionController.TransactionController // contains filtered or unexported fields }
func NewApiContext ¶
func NewApiContext(controller extensionController.TransactionController, addCauseToInternalServerError bool) *ApiContext
type CreateInstanceRequest ¶
type CreateInstanceRequest struct {
ParameterValues []ParameterValue `json:"parameterValues"` // The parameters for the new instance
}
Request data for creating a new instance of an extension.
type CreateInstanceResponse ¶
type CreateInstanceResponse struct { InstanceId string `json:"instanceId"` // The ID of the newly created instance InstanceName string `json:"instanceName"` // The name of the newly created instance }
Response data for creating a new instance of an extension.
type ExtensionDetailsResponse ¶
type ExtensionDetailsResponse struct { Id string `json:"id"` // ID of this extension Version string `json:"version"` // Version of this extension ParamDefinitions []ParamDefinition `json:"parameterDefinitions"` // Parameters required for creating an instance of this extension. }
ExtensionDetailsResponse is the response for the GetExtensionDetails request.
type ExtensionVersion ¶
type ExtensionsResponse ¶
type ExtensionsResponse struct {
Extensions []ExtensionsResponseExtension `json:"extensions"` // All available extensions.
}
ExtensionsResponse contains all available extensions.
type ExtensionsResponseExtension ¶
type ExtensionsResponseExtension struct { Id string `json:"id"` // ID of the extension. Don't store this as it may change when restarting the server. Name string `json:"name"` // The name of the extension to be displayed to the user. Category string `json:"category"` // The category of the extension, e.g. "driver" or "virtual-schema". Description string `json:"description"` // The description of the extension to be displayed to the user. InstallableVersions []ExtensionVersion `json:"installableVersions"` // A list of versions of this extension available for installation. }
ExtensionsResponseExtension contains information about an available extension that can be installed.
type InstallExtensionRequest ¶
type InstallExtensionRequest struct {
IgnoredProperty string // Some code generators like swagger-codegen fail when the request body is empty.
}
type InstallationsResponse ¶
type InstallationsResponse struct {
Installations []InstallationsResponseInstallation `json:"installations"`
}
InstallationsResponse contains all installed extensions.
type InstallationsResponseInstallation ¶
type InstallationsResponseInstallation struct { ID string `json:"id"` Name string `json:"name"` Version string `json:"version"` }
InstallationsResponseInstallation contains information about installed extensions.
type Instance ¶
type Instance struct { Id string `json:"id"` // The ID of the instance Name string `json:"name"` // The name of the instance }
Instance represents an instance of an extension, e.g. a virtual schema.
type ListInstancesResponse ¶
type ListInstancesResponse struct {
Instances []Instance `json:"instances"` // Instances of the extension.
}
Response data for listing all instances of an extension.
type ParamDefinition ¶
type ParamDefinition struct { Id string `json:"id"` // ID of this parameter Name string `json:"name"` // Name of this parameter RawDefinition interface{} `json:"definition"` // Raw parameter definition to be used as input for the Parameter Validator (https://github.com/exasol/extension-parameter-validator) }
This represents a parameter required for creating a new instance of an extension.
type ParameterValue ¶
type ParameterValue struct { Name string `json:"name"` // The name of the parameter Value string `json:"value"` // The value of the parameter }
Parameter values for creating a new instance.
type RestAPI ¶
type RestAPI interface { // Serve starts the server. This method blocks until the server is stopped or fails. Serve() // StartInBackground starts the server in the background and blocks until it is ready, i.e. reacts to HTTP requests. StartInBackground() // Stop stops the server. Stop() }
RestAPI is the interface that provides the REST API server of the extension-manager.
func Create ¶
func Create(controller extensionController.TransactionController, serverAddress string, addCauseToInternalServerError bool) RestAPI
Create creates a new RestAPI.
type UpgradeExtensionResponse ¶ added in v0.5.0
type UpgradeExtensionResponse struct { PreviousVersion string `json:"previousVersion"` // Version that was installed before the upgrade. NewVersion string `json:"newVersion"` // New version that is installed after the upgrade. }
Response data for upgrading an extension.
Source Files ¶
- apiContext.go
- common.go
- dbConnection.go
- mocks.go
- public.go
- requestCreateInstance.go
- requestDeleteInstance.go
- requestGetExtensionDetails.go
- requestInstallExtension.go
- requestListAvailableExtensions.go
- requestListInstalledExtensions.go
- requestListInstances.go
- requestResponseHelper.go
- requestTestUtil.go
- requestUninstallExtension.go
- requestUpgradeExtension.go
- restApi.go
- standaloneApi.go