server

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IndexReplacePlaceholder = `<!--INJECT GENERATED CODE HERE FROM BACKEND-->`

Functions

func CreateKHIServer

func CreateKHIServer(engine *gin.Engine, inspectionServer *coreinspection.InspectionTaskServer, serverConfig *ServerConfig) *gin.Engine

Types

type GetInspectionFeatureResponse

type GetInspectionFeatureResponse struct {
	Features []coreinspection.FeatureListItem `json:"features"`
}

type GetInspectionTypesResponse

type GetInspectionTypesResponse struct {
	Types []*coreinspection.InspectionType `json:"types"`
}

GetInspectionTypesResponse is the type of the response for /api/v3/inspection/types

type GetInspectionsResponse

type GetInspectionsResponse struct {
	Inspections map[string]SerializedMetadata `json:"inspections"`
	ServerStat  *ServerStat                   `json:"serverStat"`
}

GetInspectionsResponse is the type of the response for /api/v3/inspection

type PatchInspectionFeatureRequest

type PatchInspectionFeatureRequest struct {
	Features map[string]bool `json:"features"`
}

type PostInspectionDryRunRequest

type PostInspectionDryRunRequest = map[string]any

type PostInspectionResponse

type PostInspectionResponse struct {
	InspectionID string `json:"inspectionID"`
}

type PutInspectionFeatureRequest

type PutInspectionFeatureRequest struct {
	Features []string `json:"features"`
}

type PutInspectionFeatureResponse

type PutInspectionFeatureResponse struct {
}

type ResourceMonitor

type ResourceMonitor interface {
	GetUsedMemory() int
}

type ResourceMonitorImpl

type ResourceMonitorImpl struct {
}

func (*ResourceMonitorImpl) GetUsedMemory

func (r *ResourceMonitorImpl) GetUsedMemory() int

GetUsedMemory implements ResourceMonitor.

type ResourceMonitorMock

type ResourceMonitorMock struct {
	UsedMemory int
}

func (*ResourceMonitorMock) GetUsedMemory

func (r *ResourceMonitorMock) GetUsedMemory() int

GetUsedMemory implements ResourceMonitor.

type SerializedMetadata

type SerializedMetadata = map[string]any

type ServerConfig

type ServerConfig struct {
	ViewerMode       bool
	StaticFolderPath string
	ResourceMonitor  ResourceMonitor
	ServerBasePath   string
	UploadFileStore  *upload.UploadFileStore
}

type ServerFactory

type ServerFactory struct {
	Options []option.Option
	// contains filtered or unexported fields
}

ServerFactory is responsible for creating and configuring Gin engine instances.

var DefaultServerFactory *ServerFactory = &ServerFactory{}

DefaultServerFactory is the default instance of ServerFactory. This instance Options will be modified to extend the behavior of the gin server.

func (*ServerFactory) AddOptions

func (s *ServerFactory) AddOptions(opt ...option.Option)

AddOptions adds one or more Option instances to the factory's configuration.

func (*ServerFactory) CreateInstance

func (s *ServerFactory) CreateInstance(mode string) (*gin.Engine, error)

CreateInstance creates a new Gin engine and applies all registered options to it. It returns the configured Gin engine or an error if any option fails to apply.

type ServerStat

type ServerStat struct {
	TotalMemoryAvailable int `json:"totalMemoryAvailable"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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