rest

package
v0.0.0-...-3ec0304 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIGatewayPath = "/api/"

	StaticHomepagePath    = "/"
	StaticProtobufPath    = "/protobuf/"
	StaticSwaggerPath     = "/swagger/"
	StaticSwaggerUIPath   = "/swagger-ui/"
	StaticSwaggerUIPrefix = "swagger-ui"

	AccessControlAllowHeaders    = "Access-Control-Allow-Headers"
	AccessControlAllowMethods    = "Access-Control-Allow-Methods"
	AccessControlAllowOrigin     = "Access-Control-Allow-Origin"
	AccessControlRequestMethod   = "Access-Control-Request-Method"
	HTTPMethodOptions            = "OPTIONS"
	HTTPHeaderContentType        = "Content-Type"
	JSONContentType              = "application/json"
	JSONFileExtension            = ".json"
	OriginHeaderKey              = "Origin"
	PreFlightHeaderAccept        = "Accept"
	PreFlightHeaderAuthorization = "Authorization"
	PreFlightHeaderContentType   = HTTPHeaderContentType
	PreFlightMethodDelete        = "DELETE"
	PreFlightMethodGet           = "GET"
	PreFlightMethodHead          = "HEAD"
	PreFlightMethodPost          = "POST"
	PreFlightMethodPut           = "PUT"
	SVGContentType               = "image/svg+xml"
	SVGFileExtension             = ".svg"
	WebhookContentType           = "application/raw-webhook"
	WebhookPath                  = "webhook"

	LogPreFlightNoticeMessage      = "preflight request for"
	LogPreFlightNoticeURL          = "url"
	LogRegisteringGRPCAddress      = "grpcAddress"
	LogRegisteringGRPCMessage      = "registering grpc server"
	LogRegisteringHomepageHandler  = "registering homepage handler (/)"
	LogRegisteringProtobufHandler  = "registering protobuf handler (/protobuf/)"
	LogRegisteringSwaggerHandler   = "registering protobuf handler (/swagger/)"
	LogRegisteringSwaggerUIHandler = "registering protobuf handler (/swagger-ui/)"
	LogStartingServerListAddress   = "listenAddress"
	LogStartingServerMessage       = "starting server"
)
View Source
const (
	LoggingPackageName = "internal.apiserver.rest"
)

Variables

Functions

This section is empty.

Types

type Server

type Server interface {
	Serve()
}

func New

func New(inputConfig ServerConfiguration) Server

type ServerConfiguration

type ServerConfiguration struct {
	ErrorChannel chan<- error

	GRPCListenAddress string
	RESTListenAddress string

	GRPCDialerOptions []grpc.DialOption
	Logger            *zap.Logger
}

Jump to

Keyboard shortcuts

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