services

package
v3.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultOpts

func DefaultOpts() []grpc.ServerOption

DefaultOpts sets gRPC service options.

Types

type ALSv2

type ALSv2 struct {
	*GRPCALS
}

func (ALSv2) StreamAccessLogs

func (als ALSv2) StreamAccessLogs(srv alsv2.AccessLogService_StreamAccessLogsServer) error

type ALSv3

type ALSv3 struct {
	*GRPCALS
}

func (ALSv3) StreamAccessLogs

func (als ALSv3) StreamAccessLogs(srv alsv3.AccessLogService_StreamAccessLogsServer) error

type GRPC

type GRPC struct {
	Port          int16
	Backend       string
	SecurePort    int16
	SecureBackend string
	Cert          string
	Key           string

	pb.UnsafeEchoServiceServer
}

GRPC server object (all fields are required).

func (*GRPC) Echo

func (g *GRPC) Echo(ctx context.Context, r *pb.EchoRequest) (*pb.EchoResponse, error)

Echo returns the an object with the HTTP context of the request.

func (*GRPC) Start

func (g *GRPC) Start(ctx context.Context) <-chan bool

Start initializes the gRPC server.

type GRPCALS

type GRPCALS struct {
	HTTPListener
	// contains filtered or unexported fields
}

func (*GRPCALS) ServeLogs

func (als *GRPCALS) ServeLogs(w http.ResponseWriter, r *http.Request)

func (*GRPCALS) Start

func (als *GRPCALS) Start(ctx context.Context) <-chan bool

type GRPCAgent

type GRPCAgent struct {
	Port int16
}

func (*GRPCAgent) Start

func (a *GRPCAgent) Start(ctx context.Context) <-chan bool

type GRPCAuthV2

type GRPCAuthV2 struct {
	Port            int16
	Backend         string
	SecurePort      int16
	SecureBackend   string
	Cert            string
	Key             string
	ProtocolVersion string
}

GRPCAuthV2 server object (all fields are required).

func (*GRPCAuthV2) Check

Check checks the request object.

func (*GRPCAuthV2) Start

func (g *GRPCAuthV2) Start(ctx context.Context) <-chan bool

Start initializes the HTTP server.

type GRPCAuthV3

type GRPCAuthV3 struct {
	Port            int16
	Backend         string
	SecurePort      int16
	SecureBackend   string
	Cert            string
	Key             string
	ProtocolVersion string
}

GRPCAuthV3 server object (all fields are required).

func (*GRPCAuthV3) Check

Check checks the request object.

func (*GRPCAuthV3) Start

func (g *GRPCAuthV3) Start(ctx context.Context) <-chan bool

Start initializes the HTTP server.

type GRPCRLSV2

type GRPCRLSV2 struct {
	Port            int16
	Backend         string
	SecurePort      int16
	SecureBackend   string
	Cert            string
	Key             string
	ProtocolVersion string
}

GRPCRLSV2 server object (all fields are required).

func (*GRPCRLSV2) ShouldRateLimit

func (g *GRPCRLSV2) ShouldRateLimit(ctx context.Context, r *pb.RateLimitRequest) (*pb.RateLimitResponse, error)

Check checks the request object.

func (*GRPCRLSV2) Start

func (g *GRPCRLSV2) Start(ctx context.Context) <-chan bool

Start initializes the HTTP server.

type GRPCRLSV3

type GRPCRLSV3 struct {
	Port            int16
	Backend         string
	SecurePort      int16
	SecureBackend   string
	Cert            string
	Key             string
	ProtocolVersion string
}

GRPCRLSV3 server object (all fields are required).

func (*GRPCRLSV3) ShouldRateLimit

func (g *GRPCRLSV3) ShouldRateLimit(ctx context.Context, r *pb.RateLimitRequest) (*pb.RateLimitResponse, error)

Check checks the request object.

func (*GRPCRLSV3) Start

func (g *GRPCRLSV3) Start(ctx context.Context) <-chan bool

Start initializes the HTTP server.

type HTTP

type HTTP struct {
	Port          int16
	Backend       string
	SecurePort    int16
	SecureBackend string
	Cert          string
	Key           string
	TLSVersion    string
}

HTTP server object (all fields are required).

func (*HTTP) Start

func (h *HTTP) Start(ctx context.Context) <-chan bool

Start initializes the HTTP server.

type HTTPListener

type HTTPListener struct {
	CleartextPort int16
	TLSPort       int16
	TLSCert       string
	TLSKey        string
}

func (HTTPListener) Run

func (hl HTTPListener) Run(ctx context.Context, name string, httpHandler *http.ServeMux, grpcHandler *grpc.Server) <-chan bool

type HealthCheckServer added in v3.4.0

type HealthCheckServer struct {
	Port                int16
	Backend             string
	SecurePort          int16
	SecureBackend       string
	Cert                string
	Key                 string
	TLSVersion          string
	Healthy             bool
	HealthyStatusCode   int
	UnhealthyStatusCode int
}

HTTP server object (all fields are required).

func (*HealthCheckServer) Start added in v3.4.0

func (h *HealthCheckServer) Start(ctx context.Context) <-chan bool

Start initializes the Health Check HTTP server.

type RLSResponseV2

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

RLSResponseV2 constructs an rls response object.

func (*RLSResponseV2) AddHeader

func (r *RLSResponseV2) AddHeader(a bool, k, v string)

AddHeader adds a header to the response. When append param is true, Envoy will append the value to an existent request header instead of overriding it.

func (*RLSResponseV2) GetHTTPHeaderMap

func (r *RLSResponseV2) GetHTTPHeaderMap() *http.Header

GetHTTPHeaderMap returns HTTP header mapping of the response header-options.

func (*RLSResponseV2) GetOverallCode

func (r *RLSResponseV2) GetOverallCode() pb.RateLimitResponse_Code

GetOverallCode returns the rls response HTTP status code.

func (*RLSResponseV2) GetResponse

func (r *RLSResponseV2) GetResponse() *pb.RateLimitResponse

GetResponse returns the gRPC rls response object.

func (*RLSResponseV2) SetBody

func (r *RLSResponseV2) SetBody(s string)

SetBody sets the rls response message body.

func (*RLSResponseV2) SetOverallCode

func (r *RLSResponseV2) SetOverallCode(code pb.RateLimitResponse_Code)

SetOverallCode sets the rls response HTTP status code.

type RLSResponseV3

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

RLSResponseV3 constructs an rls response object.

func (*RLSResponseV3) AddHeader

func (r *RLSResponseV3) AddHeader(a bool, k, v string)

AddHeader adds a header to the response. When append param is true, Envoy will append the value to an existent request header instead of overriding it.

func (*RLSResponseV3) GetHTTPHeaderMap

func (r *RLSResponseV3) GetHTTPHeaderMap() *http.Header

GetHTTPHeaderMap returns HTTP header mapping of the response header-options.

func (*RLSResponseV3) GetOverallCode

func (r *RLSResponseV3) GetOverallCode() pb.RateLimitResponse_Code

GetOverallCode returns the rls response HTTP status code.

func (*RLSResponseV3) GetResponse

func (r *RLSResponseV3) GetResponse() *pb.RateLimitResponse

GetResponse returns the gRPC rls response object.

func (*RLSResponseV3) SetBody

func (r *RLSResponseV3) SetBody(s string)

SetBody sets the rls response message body.

func (*RLSResponseV3) SetOverallCode

func (r *RLSResponseV3) SetOverallCode(code pb.RateLimitResponse_Code)

SetOverallCode sets the rls response HTTP status code.

type ResponseV2

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

ResponseV2 constructs an authorization response object.

func (*ResponseV2) AddHeader

func (r *ResponseV2) AddHeader(a bool, k, v string)

AddHeader adds a header to the response. When append param is true, Envoy will append the value to an existent request header instead of overriding it.

func (*ResponseV2) GetHTTPHeaderMap

func (r *ResponseV2) GetHTTPHeaderMap() *http.Header

GetHTTPHeaderMap returns HTTP header mapping of the response header-options.

func (*ResponseV2) GetResponse

func (r *ResponseV2) GetResponse() *pb.CheckResponse

GetResponse returns the gRPC authorization response object.

func (*ResponseV2) GetStatus

func (r *ResponseV2) GetStatus() uint32

GetStatus returns the authorization response HTTP status code.

func (*ResponseV2) SetBody

func (r *ResponseV2) SetBody(s string)

SetBody sets the authorization response message body.

func (*ResponseV2) SetStatus

func (r *ResponseV2) SetStatus(ctx context.Context, s string)

SetStatus sets the authorization response HTTP status code.

type ResponseV3

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

ResponseV3 constructs an authorization response object.

func (*ResponseV3) AddHeader

func (r *ResponseV3) AddHeader(a bool, k, v string)

AddHeader adds a header to the response. When append param is true, Envoy will append the value to an existent request header instead of overriding it.

func (*ResponseV3) GetHTTPHeaderMap

func (r *ResponseV3) GetHTTPHeaderMap() *http.Header

GetHTTPHeaderMap returns HTTP header mapping of the response header-options.

func (*ResponseV3) GetResponse

func (r *ResponseV3) GetResponse() *pb.CheckResponse

GetResponse returns the gRPC authorization response object.

func (*ResponseV3) GetStatus

func (r *ResponseV3) GetStatus() uint32

GetStatus returns the authorization response HTTP status code.

func (*ResponseV3) SetBody

func (r *ResponseV3) SetBody(s string)

SetBody sets the authorization response message body.

func (*ResponseV3) SetStatus

func (r *ResponseV3) SetStatus(ctx context.Context, s string)

SetStatus sets the authorization response HTTP status code.

type Service

type Service interface {
	Start(context.Context) <-chan bool
}

Service defines a KAT backend service interface.

Jump to

Keyboard shortcuts

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