server

package module
v0.0.0-...-35696f1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEnvPrefix          = "VMCLARITY_APISERVER"
	DefaultListenAddress      = "0.0.0.0:8888"
	DefaultHealthCheckAddress = "0.0.0.0:8081"
	DefaultDatabaseDriver     = dbtypes.DBDriverTypeLocal
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, config *Config)

Types

type Config

type Config struct {
	ListenAddress      string `json:"listen-address,omitempty" mapstructure:"listen_address"`
	HealthCheckAddress string `json:"healthcheck-address,omitempty" mapstructure:"healthcheck_address"`

	// database config
	DatabaseDriver   string `json:"database-driver,omitempty" mapstructure:"database_driver"`
	DBName           string `json:"db-name,omitempty" mapstructure:"db_name"`
	DBUser           string `json:"db-user,omitempty" mapstructure:"db_user"`
	DBPassword       string `json:"-" mapstructure:"db_pass"`
	DBHost           string `json:"db-host,omitempty" mapstructure:"db_host"`
	DBPort           string `json:"db-port,omitempty" mapstructure:"db_port"`
	EnableDBInfoLogs bool   `json:"enable-db-info-logs" mapstructure:"enable_db_info_logs"`

	LocalDBPath string `json:"local-db-path,omitempty" mapstructure:"local_db_path"`
}

func NewConfig

func NewConfig() (*Config, error)

type Server

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

func CreateRESTServer

func CreateRESTServer(address string, dbHandler dbtypes.Database) (*Server, error)

func (*Server) Start

func (s *Server) Start(ctx context.Context, errChan chan struct{})

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

type ServerImpl

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

func (*ServerImpl) DeleteAssetScanEstimationsAssetScanEstimationID

func (s *ServerImpl) DeleteAssetScanEstimationsAssetScanEstimationID(ctx echo.Context, assetScanEstimationID types.AssetScanEstimationID) error

func (*ServerImpl) DeleteAssetsAssetID

func (s *ServerImpl) DeleteAssetsAssetID(ctx echo.Context, assetID types.AssetID) error

func (*ServerImpl) DeleteFindingsFindingID

func (s *ServerImpl) DeleteFindingsFindingID(ctx echo.Context, findingID types.FindingID) error

func (*ServerImpl) DeleteProvidersProviderID

func (s *ServerImpl) DeleteProvidersProviderID(ctx echo.Context, providerID types.ProviderID) error

func (*ServerImpl) DeleteScanConfigsScanConfigID

func (s *ServerImpl) DeleteScanConfigsScanConfigID(ctx echo.Context, scanConfigID types.ScanConfigID) error

func (*ServerImpl) DeleteScanEstimationsScanEstimationID

func (s *ServerImpl) DeleteScanEstimationsScanEstimationID(ctx echo.Context, scanEstimationID types.ScanEstimationID) error

func (*ServerImpl) DeleteScansScanID

func (s *ServerImpl) DeleteScansScanID(ctx echo.Context, scanID types.ScanID) error

func (*ServerImpl) GetAssetScanEstimations

func (s *ServerImpl) GetAssetScanEstimations(ctx echo.Context, params types.GetAssetScanEstimationsParams) error

func (*ServerImpl) GetAssetScanEstimationsAssetScanEstimationID

func (s *ServerImpl) GetAssetScanEstimationsAssetScanEstimationID(ctx echo.Context, assetScanEstimationID types.AssetScanEstimationID, params types.GetAssetScanEstimationsAssetScanEstimationIDParams) error

func (*ServerImpl) GetAssetScans

func (s *ServerImpl) GetAssetScans(ctx echo.Context, params types.GetAssetScansParams) error

func (*ServerImpl) GetAssetScansAssetScanID

func (s *ServerImpl) GetAssetScansAssetScanID(ctx echo.Context, assetScanID types.AssetScanID, params types.GetAssetScansAssetScanIDParams) error

func (*ServerImpl) GetAssets

func (s *ServerImpl) GetAssets(ctx echo.Context, params types.GetAssetsParams) error

func (*ServerImpl) GetAssetsAssetID

func (s *ServerImpl) GetAssetsAssetID(ctx echo.Context, assetID types.AssetID, params types.GetAssetsAssetIDParams) error

func (*ServerImpl) GetFindings

func (s *ServerImpl) GetFindings(ctx echo.Context, params types.GetFindingsParams) error

func (*ServerImpl) GetFindingsFindingID

func (s *ServerImpl) GetFindingsFindingID(ctx echo.Context, findingID types.FindingID, params types.GetFindingsFindingIDParams) error

func (*ServerImpl) GetOpenAPISpec

func (s *ServerImpl) GetOpenAPISpec(ctx echo.Context) error

func (*ServerImpl) GetProviders

func (s *ServerImpl) GetProviders(ctx echo.Context, params types.GetProvidersParams) error

func (*ServerImpl) GetProvidersProviderID

func (s *ServerImpl) GetProvidersProviderID(ctx echo.Context, providerID types.ProviderID, params types.GetProvidersProviderIDParams) error

func (*ServerImpl) GetScanConfigs

func (s *ServerImpl) GetScanConfigs(ctx echo.Context, params types.GetScanConfigsParams) error

func (*ServerImpl) GetScanConfigsScanConfigID

func (s *ServerImpl) GetScanConfigsScanConfigID(ctx echo.Context, scanConfigID types.ScanConfigID, params types.GetScanConfigsScanConfigIDParams) error

func (*ServerImpl) GetScanEstimations

func (s *ServerImpl) GetScanEstimations(ctx echo.Context, params types.GetScanEstimationsParams) error

func (*ServerImpl) GetScanEstimationsScanEstimationID

func (s *ServerImpl) GetScanEstimationsScanEstimationID(ctx echo.Context, scanEstimationID types.ScanEstimationID, params types.GetScanEstimationsScanEstimationIDParams) error

func (*ServerImpl) GetScans

func (s *ServerImpl) GetScans(ctx echo.Context, params types.GetScansParams) error

func (*ServerImpl) GetScansScanID

func (s *ServerImpl) GetScansScanID(ctx echo.Context, scanID types.ScanID, params types.GetScansScanIDParams) error

func (*ServerImpl) PatchAssetScanEstimationsAssetScanEstimationID

func (s *ServerImpl) PatchAssetScanEstimationsAssetScanEstimationID(ctx echo.Context, assetScanEstimationID types.AssetScanEstimationID, params types.PatchAssetScanEstimationsAssetScanEstimationIDParams) error

nolint:cyclop

func (*ServerImpl) PatchAssetScansAssetScanID

func (s *ServerImpl) PatchAssetScansAssetScanID(ctx echo.Context, assetScanID types.AssetScanID, params types.PatchAssetScansAssetScanIDParams) error

nolint:cyclop

func (*ServerImpl) PatchAssetsAssetID

func (s *ServerImpl) PatchAssetsAssetID(ctx echo.Context, assetID types.AssetID, params types.PatchAssetsAssetIDParams) error

func (*ServerImpl) PatchFindingsFindingID

func (s *ServerImpl) PatchFindingsFindingID(ctx echo.Context, findingID types.FindingID) error

func (*ServerImpl) PatchProvidersProviderID

func (s *ServerImpl) PatchProvidersProviderID(ctx echo.Context, providerID types.ProviderID, params types.PatchProvidersProviderIDParams) error

func (*ServerImpl) PatchScanConfigsScanConfigID

func (s *ServerImpl) PatchScanConfigsScanConfigID(ctx echo.Context, scanConfigID types.ScanConfigID, params types.PatchScanConfigsScanConfigIDParams) error

func (*ServerImpl) PatchScanEstimationsScanEstimationID

func (s *ServerImpl) PatchScanEstimationsScanEstimationID(ctx echo.Context, scanEstimationID types.ScanEstimationID, params types.PatchScanEstimationsScanEstimationIDParams) error

func (*ServerImpl) PatchScansScanID

func (s *ServerImpl) PatchScansScanID(ctx echo.Context, scanID types.ScanID, params types.PatchScansScanIDParams) error

func (*ServerImpl) PostAssetScanEstimations

func (s *ServerImpl) PostAssetScanEstimations(ctx echo.Context) error

func (*ServerImpl) PostAssetScans

func (s *ServerImpl) PostAssetScans(ctx echo.Context) error

func (*ServerImpl) PostAssets

func (s *ServerImpl) PostAssets(ctx echo.Context) error

nolint:cyclop

func (*ServerImpl) PostFindings

func (s *ServerImpl) PostFindings(ctx echo.Context) error

func (*ServerImpl) PostProviders

func (s *ServerImpl) PostProviders(ctx echo.Context) error

nolint:cyclop

func (*ServerImpl) PostScanConfigs

func (s *ServerImpl) PostScanConfigs(ctx echo.Context) error

func (*ServerImpl) PostScanEstimations

func (s *ServerImpl) PostScanEstimations(ctx echo.Context) error

func (*ServerImpl) PostScans

func (s *ServerImpl) PostScans(ctx echo.Context) error

func (*ServerImpl) PutAssetScanEstimationsAssetScanEstimationID

func (s *ServerImpl) PutAssetScanEstimationsAssetScanEstimationID(ctx echo.Context, assetScanEstimationID types.AssetScanEstimationID, params types.PutAssetScanEstimationsAssetScanEstimationIDParams) error

nolint:cyclop

func (*ServerImpl) PutAssetScansAssetScanID

func (s *ServerImpl) PutAssetScansAssetScanID(ctx echo.Context, assetScanID types.AssetScanID, params types.PutAssetScansAssetScanIDParams) error

nolint:cyclop

func (*ServerImpl) PutAssetsAssetID

func (s *ServerImpl) PutAssetsAssetID(ctx echo.Context, assetID types.AssetID, params types.PutAssetsAssetIDParams) error

func (*ServerImpl) PutFindingsFindingID

func (s *ServerImpl) PutFindingsFindingID(ctx echo.Context, findingID types.FindingID) error

func (*ServerImpl) PutProvidersProviderID

func (s *ServerImpl) PutProvidersProviderID(ctx echo.Context, providerID types.ProviderID, params types.PutProvidersProviderIDParams) error

func (*ServerImpl) PutScanConfigsScanConfigID

func (s *ServerImpl) PutScanConfigsScanConfigID(ctx echo.Context, scanConfigID types.ScanConfigID, params types.PutScanConfigsScanConfigIDParams) error

func (*ServerImpl) PutScanEstimationsScanEstimationID

func (s *ServerImpl) PutScanEstimationsScanEstimationID(ctx echo.Context, scanEstimationID types.ScanEstimationID, params types.PutScanEstimationsScanEstimationIDParams) error

func (*ServerImpl) PutScansScanID

func (s *ServerImpl) PutScansScanID(ctx echo.Context, scanID types.ScanID, params types.PutScansScanIDParams) error

nolint:cyclop

Directories

Path Synopsis
odatasql
nolint:perfsprint
nolint:perfsprint
internal
server
Package server provides primitives to interact with the openapi HTTP API.
Package server provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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