server

package
v0.0.0-...-f07b5d3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalloutServer

type CalloutServer struct {
	Config Config
	Cert   tls.Certificate
}

CalloutServer represents a server that handles callouts.

func NewCalloutServer

func NewCalloutServer(config Config) *CalloutServer

NewCalloutServer creates a new CalloutServer with the given configuration.

func (*CalloutServer) StartGRPC

func (s *CalloutServer) StartGRPC(service extproc.ExternalProcessorServer)

StartGRPC starts the gRPC server with the specified service.

func (*CalloutServer) StartHealthCheck

func (s *CalloutServer) StartHealthCheck()

StartHealthCheck starts a health check server.

func (*CalloutServer) StartInsecureGRPC

func (s *CalloutServer) StartInsecureGRPC(service extproc.ExternalProcessorServer)

StartInsecureGRPC starts the gRPC server without TLS.

type Config

type Config struct {
	Address              string
	InsecureAddress      string
	HealthCheckAddress   string
	CertFile             string
	KeyFile              string
	EnableInsecureServer bool
}

Config holds the server configuration parameters.

type GRPCCalloutService

type GRPCCalloutService struct {
	extproc.UnimplementedExternalProcessorServer
	Handlers HandlerRegistry
}

GRPCCalloutService implements the gRPC ExternalProcessorServer.

func (*GRPCCalloutService) HandleRequestBody

func (s *GRPCCalloutService) HandleRequestBody(body *extproc.HttpBody) (*extproc.ProcessingResponse, error)

HandleRequestBody handles request bodies.

func (*GRPCCalloutService) HandleRequestHeaders

func (s *GRPCCalloutService) HandleRequestHeaders(headers *extproc.HttpHeaders) (*extproc.ProcessingResponse, error)

HandleRequestHeaders handles request headers.

func (*GRPCCalloutService) HandleRequestTrailers

func (s *GRPCCalloutService) HandleRequestTrailers(trailers *extproc.HttpTrailers) (*extproc.ProcessingResponse, error)

HandleRequestTrailers handles request trailers.

func (*GRPCCalloutService) HandleResponseBody

func (s *GRPCCalloutService) HandleResponseBody(body *extproc.HttpBody) (*extproc.ProcessingResponse, error)

HandleResponseBody handles response bodies.

func (*GRPCCalloutService) HandleResponseHeaders

func (s *GRPCCalloutService) HandleResponseHeaders(headers *extproc.HttpHeaders) (*extproc.ProcessingResponse, error)

HandleResponseHeaders handles response headers.

func (*GRPCCalloutService) HandleResponseTrailers

func (s *GRPCCalloutService) HandleResponseTrailers(trailers *extproc.HttpTrailers) (*extproc.ProcessingResponse, error)

HandleResponseTrailers handles response trailers.

func (*GRPCCalloutService) Process

Process processes incoming gRPC streams.

type HandlerRegistry

type HandlerRegistry struct {
	RequestHeadersHandler   RequestHeadersHandler
	ResponseHeadersHandler  ResponseHeadersHandler
	RequestBodyHandler      RequestBodyHandler
	ResponseBodyHandler     ResponseBodyHandler
	RequestTrailersHandler  RequestTrailersHandler
	ResponseTrailersHandler ResponseTrailersHandler
}

HandlerRegistry registers various handlers.

type RequestBodyHandler

type RequestBodyHandler func(*extproc.HttpBody) (*extproc.ProcessingResponse, error)

RequestBodyHandler handles request bodies.

type RequestHeadersHandler

type RequestHeadersHandler func(*extproc.HttpHeaders) (*extproc.ProcessingResponse, error)

RequestHeadersHandler handles request headers.

type RequestTrailersHandler

type RequestTrailersHandler func(*extproc.HttpTrailers) (*extproc.ProcessingResponse, error)

RequestTrailersHandler handles request trailers.

type ResponseBodyHandler

type ResponseBodyHandler func(*extproc.HttpBody) (*extproc.ProcessingResponse, error)

ResponseBodyHandler handles response bodies.

type ResponseHeadersHandler

type ResponseHeadersHandler func(*extproc.HttpHeaders) (*extproc.ProcessingResponse, error)

ResponseHeadersHandler handles response headers.

type ResponseTrailersHandler

type ResponseTrailersHandler func(*extproc.HttpTrailers) (*extproc.ProcessingResponse, error)

ResponseTrailersHandler handles response trailers.

Jump to

Keyboard shortcuts

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