httpserver

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayDefaultPort - default port at which the http server listens
	GatewayDefaultPort = "9010"

	// APIVersion - default api version for REST endpoints
	APIVersion = "v1"

	// TerrascanServerPort allows user to configure server at a port other than default
	TerrascanServerPort = "TERRASCAN_SERVER_PORT"
)

Variables

This section is empty.

Functions

func Start

func Start(port, certFile, privateKeyFile string)

Start initializes api routes and starts http server

Types

type APIHandler

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

APIHandler struct for http api server

func NewAPIHandler

func NewAPIHandler() *APIHandler

NewAPIHandler returns a new APIHandler{}

func (*APIHandler) Health

func (g *APIHandler) Health(w http.ResponseWriter, r *http.Request)

Health returns the health of the http server

type APIServer

type APIServer struct {
}

APIServer struct for http api server

func NewAPIServer

func NewAPIServer() *APIServer

NewAPIServer returns a new APIServer{}

func (*APIServer) Routes

func (g *APIServer) Routes() []*Route

Routes returns a slice of routes of API endpoints to be registered with http server

type IacProvider added in v1.16.0

type IacProvider struct {
	Type           string   `json:"type"`
	Versions       []string `json:"versions"`
	DefaultVersion string   `json:"defaultVersion"`
}

IacProvider contains response body for iac providers

type Route

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

Route is a specification and handler for a REST endpoint.

Jump to

Keyboard shortcuts

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