server

package
v0.0.0-...-c1cf610 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const INSTALLDIR = "INSTALLDIR"

INSTALLDIR installation directory environment

Variables

This section is empty.

Functions

func AdaptConfig

func AdaptConfig(config string)

AdaptConfig adapt and reload xml configuration file

func CloseTable

func CloseTable(id common.RegDbID)

CloseTable close table id

func ConnectTable

func ConnectTable(ctx *clu.Context, table string) (common.RegDbID, error)

ConnectTable connect table id

func ConvertByteArrayToString

func ConvertByteArrayToString(name []byte, max int) string

ConvertByteArrayToString convert byte array to string by evaluating \0 end and create string from sub array

func DefaultPIDFile

func DefaultPIDFile() string

DefaultPIDFile default PID file location

func GenerateJWToken

func GenerateJWToken(ctx context.Context) (interface{}, error)

GenerateJWToken generate JWT token on given context and returning the authorization instance containing session information

func GenerateShutdownHash

func GenerateShutdownHash() string

GenerateShutdownHash generates shutdown hash dependent on pass code time

func InitConfig

func InitConfig(watch bool) error

InitConfig load xml configuration file The components are used to load and inject the configuration

func InitDatabaseStores

func InitDatabaseStores() error

InitDatabaseStores init database session store

func InitDatabases

func InitDatabases()

InitDatabases initialize database reference IDs

func NewAPIError

func NewAPIError(code string, err error) *api.Error

NewAPIError new API error

func RegisterExtend

func RegisterExtend(extend RestExtend)

RegisterExtend register the extend handler

func RemoteHost

func RemoteHost(r *http.Request) string

RemoteHost check if X-Forwarded-For is available and use this remote host

func StoreConfig

func StoreConfig() error

StoreConfig store the current config, wraps the REST server configuration and uses components to store the current configuration

Types

type Handler

type Handler struct {
}

Handler server handler to ogen API

func (Handler) AdaptPermission

func (Handler) AdaptPermission(ctx context.Context, params api.AdaptPermissionParams) (r api.AdaptPermissionRes, _ error)

AdaptPermission implements adaptPermission operation.

Add RBAC role.

PUT /admin/database/{table}/permission

func (Handler) AddView

func (Handler) AddView(ctx context.Context, params api.AddViewParams) (r api.AddViewRes, _ error)

AddView implements addView operation.

Add configuration in View repositories.

POST /admin/config/views

func (Handler) BatchParameterQuery

func (Handler) BatchParameterQuery(ctx context.Context, params api.BatchParameterQueryParams) (r api.BatchParameterQueryRes, _ error)

BatchParameterQuery implements batchParameterQuery operation.

Call a SQL query batch command posted in query.

GET /rest/batch/{table}/{query}

func (Handler) BatchQuery

func (Handler) BatchQuery(ctx context.Context, req api.BatchQueryReq,
	params api.BatchQueryParams) (r api.BatchQueryRes, _ error)

BatchQuery implements batchQuery operation.

Call a SQL query batch command posted in body.

POST /rest/batch/{table}

func (Handler) BatchSelect

func (Handler) BatchSelect(ctx context.Context,
	params api.BatchSelectParams) (r api.BatchSelectRes, _ error)

BatchSelect implements batchSelect operation.

Call a SQL query batch command out of the stored query list.

GET /rest/batch/{table}

func (Handler) BrowseList

func (Handler) BrowseList(ctx context.Context) (r api.BrowseListRes, _ error)

BrowseList implements browseList operation.

Retrieves a list of Browseable locations.

GET /rest/file/browse

func (Handler) BrowseLocation

func (Handler) BrowseLocation(ctx context.Context, params api.BrowseLocationParams) (r api.BrowseLocationRes, _ error)

BrowseLocation implements browseLocation operation.

Retrieves a list of files in the defined location.

GET /rest/file/browse/{path}

func (Handler) CallExtend

func (Handler) CallExtend(ctx context.Context, params api.CallExtendParams) (r api.CallExtendRes, _ error)

CallExtend implements callExtend operation.

Call plugin extend.

GET /rest/extend/{path}

func (Handler) CallPostExtend

CallPostExtend implements callPostExtend operation.

Post extend/plugin.

POST /rest/extend/{path}

func (Handler) CreateDirectory

func (Handler) CreateDirectory(ctx context.Context, params api.CreateDirectoryParams) (r api.CreateDirectoryRes, _ error)

CreateDirectory implements createDirectory operation.

Create a new directory.

PUT /rest/file/{path}

func (Handler) DeleteExtend

func (Handler) DeleteExtend(ctx context.Context, params api.DeleteExtendParams) (r api.DeleteExtendRes, _ error)

DeleteExtend implements deleteExtend operation.

Delete extend/plugin data.

DELETE /rest/extend/{path}

func (Handler) DeleteFileLocation

func (Handler) DeleteFileLocation(ctx context.Context, params api.DeleteFileLocationParams) (r api.DeleteFileLocationRes, _ error)

DeleteFileLocation implements deleteFileLocation operation.

Delete the file on the given location.

DELETE /rest/file/{path}

func (Handler) DeleteJobResult

func (Handler) DeleteJobResult(ctx context.Context, params api.DeleteJobResultParams) (r api.DeleteJobResultRes, _ error)

DeleteJobResult implements deleteJobResult operation.

Delete a specific job result.

DELETE /tasks/{jobName}/result/{jobId}

func (Handler) DeleteRecordsSearched

func (Handler) DeleteRecordsSearched(ctx context.Context, params api.DeleteRecordsSearchedParams) (r api.DeleteRecordsSearchedRes, _ error)

DeleteRecordsSearched implements deleteRecordsSearched operation.

Delete a record with a given search.

DELETE /rest/view/{table}/{search}

func (Handler) DeleteView

func (Handler) DeleteView(ctx context.Context, params api.DeleteViewParams) (r api.DeleteViewRes, _ error)

DeleteView implements deleteView operation.

Delete entry in configuration.

DELETE /admin/config/views

func (Handler) DisconnectTCP

func (Handler) DisconnectTCP(ctx context.Context, params api.DisconnectTCPParams) (r api.DisconnectTCPRes, _ error)

DisconnectTCP implements disconnectTCP operation.

Disconnect connection in the database with the given dbid.

DELETE /admin/database/{table}/connection

func (Handler) DownloadFile

func (Handler) DownloadFile(ctx context.Context, params api.DownloadFileParams) (r api.DownloadFileRes, _ error)

DownloadFile implements downloadFile operation.

Download a file out of file location.

GET /rest/file/{path}

func (Handler) GetConfig

func (Handler) GetConfig(ctx context.Context) (r api.GetConfigRes, _ error)

GetConfig implements getConfig operation.

Get configuration.

GET /admin/config

func (Handler) GetConnections

func (Handler) GetConnections(ctx context.Context, params api.GetConnectionsParams) (r api.GetConnectionsRes, _ error)

GetConnections implements getConnections operation.

Retrieve the current TCP connection.

GET /admin/database/{table}/connection

func (Handler) GetDatabaseSessions

func (Handler) GetDatabaseSessions(ctx context.Context, params api.GetDatabaseSessionsParams) (r api.GetDatabaseSessionsRes, _ error)

GetDatabaseSessions implements getDatabaseSessions operation.

Retrieve a list of user queue entries.

GET /admin/database/{table}/sessions

func (Handler) GetDatabases

func (Handler) GetDatabases(ctx context.Context) (r api.GetDatabasesRes, _ error)

GetDatabases implements getDatabases operation.

Retrieves a list of databases known by Interface.

GET /admin/database

func (Handler) GetFields

func (Handler) GetFields(ctx context.Context, params api.GetFieldsParams) (r api.GetFieldsRes, _ error)

GetFields implements getFields operation.

Retrieves all fields of an file.

GET /rest/tables/{table}/fields

func (Handler) GetImage

func (Handler) GetImage(ctx context.Context, params api.GetImageParams) (r api.GetImageRes, _ error)

GetImage implements getImage operation.

Retrieves a field of a specific ISN of a Map definition.

GET /image/{table}/{field}/{search}

func (Handler) GetJobExecutionResult

func (Handler) GetJobExecutionResult(ctx context.Context, params api.GetJobExecutionResultParams) (r api.GetJobExecutionResultRes, _ error)

GetJobExecutionResult implements getJobExecutionResult operation.

Retrieves a specific job result.

GET /tasks/results

func (Handler) GetJobFullInfo

func (Handler) GetJobFullInfo(ctx context.Context, params api.GetJobFullInfoParams) (r api.GetJobFullInfoRes, _ error)

GetJobFullInfo implements getJobFullInfo operation.

Retrieves a full job definition.

GET /tasks/{jobName}/full

func (Handler) GetJobResult

func (Handler) GetJobResult(ctx context.Context, params api.GetJobResultParams) (r api.GetJobResultRes, _ error)

GetJobResult implements getJobResult operation.

Delete a specific job result.

GET /rest/tasks/{jobName}/{jobId}

func (Handler) GetJobs

func (Handler) GetJobs(ctx context.Context, params api.GetJobsParams) (r api.GetJobsRes, _ error)

GetJobs implements getJobs operation.

Retrieves a list of jobs known by the Interface.

GET /tasks

func (Handler) GetJobsConfig

func (Handler) GetJobsConfig(ctx context.Context) (r api.GetJobsConfigRes, _ error)

GetJobsConfig implements getJobsConfig operation.

Read job configuration section.

GET /admin/config/jobs

func (Handler) GetLobByMap

func (Handler) GetLobByMap(ctx context.Context, params api.GetLobByMapParams) (r api.GetLobByMapRes, _ error)

GetLobByMap implements getLobByMap operation.

Retrieves a lob of a specific ISN of an field in a Map.

GET /binary/{table}/{field}/{search}

func (Handler) GetLoginSession

func (Handler) GetLoginSession(ctx context.Context) (r api.GetLoginSessionRes, _ error)

GetLoginSession implements getLoginSession operation.

Login receiving JWT.

GET /login

func (Handler) GetMapMetadata

func (Handler) GetMapMetadata(ctx context.Context, params api.GetMapMetadataParams) (r api.GetMapMetadataRes, _ error)

GetMapMetadata implements getMapMetadata operation.

Retrieves metadata of a Map definition.

GET /rest/metadata/view/{table}

func (Handler) GetMapRecordsFields

func (Handler) GetMapRecordsFields(ctx context.Context, params api.GetMapRecordsFieldsParams) (r api.GetMapRecordsFieldsRes, _ error)

GetMapRecordsFields implements getMapRecordsFields operation.

Retrieves a field of a specific ISN of a Map definition.

GET /rest/view/{table}/{fields}/{search}

func (Handler) GetMaps

func (Handler) GetMaps(ctx context.Context) (r api.GetMapsRes, _ error)

GetMaps implements getMaps operation.

Retrieves a list of available views.

GET /rest/view

func (Handler) GetPermission

func (Handler) GetPermission(ctx context.Context, params api.GetPermissionParams) (r api.GetPermissionRes, _ error)

GetPermission implements getPermission operation.

List RBAC assignments permission.

GET /admin/database/{table}/permission

func (Handler) GetUserInfo

func (Handler) GetUserInfo(ctx context.Context) (r api.GetUserInfoRes, _ error)

GetUserInfo implements getUserInfo operation.

Retrieves the user information.

GET /rest/user

func (Handler) GetVersion

func (Handler) GetVersion(ctx context.Context) (r api.GetVersionRes, _ error)

GetVersion implements getVersion operation.

Retrieves the current version.

GET /version

func (Handler) GetVideo

func (Handler) GetVideo(ctx context.Context, params api.GetVideoParams) (r api.GetVideoRes, _ error)

GetVideo implements getVideo operation.

Retrieves a video stream of a specific ISN of a Map definition.

GET /video/{table}/{field}/{search}

func (Handler) GetViews

func (Handler) GetViews(ctx context.Context) (r api.GetViewsRes, _ error)

GetViews implements getViews operation.

Defines the current views.

GET /admin/config/views

func (Handler) InsertMapFileRecords

func (Handler) InsertMapFileRecords(ctx context.Context, req api.OptInsertMapFileRecordsReq) (r api.InsertMapFileRecordsRes, _ error)

InsertMapFileRecords implements insertMapFileRecords operation.

Store send records into Map definition.

POST /rest/view

func (Handler) InsertRecord

InsertRecord implements insertRecord operation.

Insert given record.

POST /rest/view/{table}

func (Handler) ListModelling

func (Handler) ListModelling(ctx context.Context) (r api.ListModellingRes, _ error)

ListModelling implements listModelling operation.

Retrieves all fields of an file.

GET /rest/map

func (Handler) ListTables

func (Handler) ListTables(ctx context.Context) (r api.ListTablesRes, _ error)

ListTables implements listTables operation.

Retrieves all tables of databases.

GET /rest/tables

func (Handler) LoginSession

func (Handler) LoginSession(ctx context.Context) (r api.LoginSessionRes, _ error)

LoginSession implements loginSession operation.

Login receiving JWT.

PUT /login

func (Handler) LogoutSessionCompat

func (Handler) LogoutSessionCompat(ctx context.Context) (r api.LogoutSessionCompatRes, _ error)

LogoutSessionCompat implements logoutSessionCompat operation.

Logout the session.

PUT /logout

func (Handler) NewError

func (Handler) NewError(ctx context.Context, err error) (r *api.ErrorStatusCode)

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (Handler) PostDatabase

func (Handler) PostDatabase(ctx context.Context, req *api.Database) (r api.PostDatabaseRes, _ error)

PostDatabase implements postDatabase operation.

Create a new database, the input need to be JSON. A structure level parameter indicate version to be used.

POST /admin/database

func (Handler) PostJob

func (Handler) PostJob(ctx context.Context, req api.PostJobReq) (r api.PostJobRes, _ error)

PostJob implements postJob operation.

Create a new Job database.

POST /tasks

func (Handler) PushLoginSession

func (Handler) PushLoginSession(ctx context.Context) (r api.PushLoginSessionRes, _ error)

PushLoginSession implements pushLoginSession operation.

Login receiving JWT.

POST /login

func (Handler) RemovePermission

func (Handler) RemovePermission(ctx context.Context, params api.RemovePermissionParams) (r api.RemovePermissionRes, _ error)

RemovePermission implements removePermission operation.

Add RBAC role.

DELETE /admin/database/{table}/permission

func (Handler) RemoveSessionCompat

func (Handler) RemoveSessionCompat(ctx context.Context) (r api.RemoveSessionCompatRes, _ error)

RemoveSessionCompat implements removeSessionCompat operation.

Remove the session.

GET /logoff

func (Handler) SearchModelling

func (Handler) SearchModelling(ctx context.Context, params api.SearchModellingParams) (r api.SearchModellingRes, _ error)

SearchModelling implements searchModelling operation.

Retrieves all fields of an file.

GET /rest/map/{path}

func (Handler) SearchRecordsFields

func (Handler) SearchRecordsFields(ctx context.Context, params api.SearchRecordsFieldsParams) (r api.SearchRecordsFieldsRes, _ error)

SearchRecordsFields implements searchRecordsFields operation.

Retrieves a field of a specific ISN of a Map definition.

GET /rest/view/{table}/{fields}

func (Handler) SearchTable

func (Handler) SearchTable(ctx context.Context, params api.SearchTableParams) (r api.SearchTableRes, _ error)

SearchTable implements searchTable operation.

Retrieves all fields of an file.

GET /rest/tables/{table}/{fields}/{search}

func (Handler) SetConfig

func (Handler) SetConfig(ctx context.Context, req api.SetConfigReq) (r api.SetConfigRes, _ error)

SetConfig implements setConfig operation.

Store configuration.

PUT /admin/config

func (Handler) SetJobsConfig

func (Handler) SetJobsConfig(ctx context.Context, req api.OptJobStore) (r api.SetJobsConfigRes, _ error)

SetJobsConfig implements setJobsConfig operation.

Set the ADADATADIR.

PUT /admin/config/jobs

func (Handler) ShutdownServer

func (Handler) ShutdownServer(ctx context.Context, params api.ShutdownServerParams) (r api.ShutdownServerRes, _ error)

ShutdownServer implements shutdownServer operation.

Init shutdown procedure.

PUT /shutdown/{hash}

func (Handler) StoreConfig

func (Handler) StoreConfig(ctx context.Context) (r api.StoreConfigRes, _ error)

StoreConfig implements storeConfig operation.

Store configuration.

POST /admin/config

func (Handler) TriggerExtend

func (Handler) TriggerExtend(ctx context.Context, params api.TriggerExtendParams) (r api.TriggerExtendRes, _ error)

TriggerExtend implements triggerExtend operation.

Put extend/plugin request.

PUT /rest/extend/{path}

func (Handler) TriggerJob

func (Handler) TriggerJob(ctx context.Context, params api.TriggerJobParams) (r api.TriggerJobRes, _ error)

TriggerJob implements triggerJob operation.

Trigger a job.

PUT /rest/tasks/{jobName}

func (Handler) UpdateLobByMap

UpdateLobByMap implements updateLobByMap operation.

Set a lob at a specific ISN of an field in a Map.

PUT /binary/{table}/{field}/{search}

func (Handler) UpdateRecordsByFields

UpdateRecordsByFields implements updateRecordsByFields operation.

Update a record dependent on field(s) of a specific table.

PUT /rest/view/{table}/{search}

func (Handler) UploadFile

func (Handler) UploadFile(ctx context.Context, req *api.UploadFileReq, params api.UploadFileParams) (r api.UploadFileRes, _ error)

UploadFile implements uploadFile operation.

Upload a new file to the given location.

POST /rest/file/{location}

type Loader

type Loader struct {
}

Loader config loader structure calling static configurations

func (*Loader) Current

func (loader *Loader) Current() interface{}

Current current active config

func (*Loader) Default

func (loader *Loader) Default() interface{}

Default empty default config

func (*Loader) IsServer

func (loader *Loader) IsServer() bool

IsServer indicate interface to be a server

func (*Loader) Loaded

func (loader *Loader) Loaded(nv interface{}) error

Loaded executed after data load

func (*Loader) Logging

func (loader *Loader) Logging(v interface{}) *services.Logging

Logging logging configuration

func (*Loader) SetLogging

func (loader *Loader) SetLogging(l *services.Logging)

SetLogging set logging configuration

type Printer

type Printer struct {
}

Printer temporary

func (*Printer) Walk

func (p *Printer) Walk(name exif.FieldName, tag *tiff.Tag) error

Walk walk in printer

type RestExtend

type RestExtend interface {
	EntryPoint() string
	CallGet(path string, req *http.Request) (r api.CallExtendRes, _ error)
	CallPut(path string, req *http.Request) (r api.TriggerExtendRes, _ error)
	CallPost(path string, req *http.Request) (r api.CallPostExtendRes, _ error)
}

RestExtend Adabas method to send to plugin

type StreamRead

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

StreamRead stream control structure to handle data streams Video or big pictures

func NewStreamRead

func NewStreamRead(table, field, mimetypeField string) *StreamRead

NewStreamRead new stream read instance

Jump to

Keyboard shortcuts

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