services

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 41 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 added in v2.3.0

type ALSv2 struct {
	*GRPCALS
}

func (ALSv2) StreamAccessLogs added in v2.3.0

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

type ALSv3 added in v2.3.0

type ALSv3 struct {
	*GRPCALS
}

func (ALSv3) StreamAccessLogs added in v2.3.0

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 added in v2.3.0

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

func (*GRPCALS) ServeLogs added in v2.3.0

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

func (*GRPCALS) Start added in v2.3.0

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

type GRPCAUTH

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

GRPCAUTH server object (all fields are required).

func (*GRPCAUTH) Check

func (g *GRPCAUTH) Check(ctx context.Context, r *pb.CheckRequest) (*pb.CheckResponse, error)

Check checks the request object.

func (*GRPCAUTH) Start

func (g *GRPCAUTH) 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 GRPCAgent

type GRPCAgent struct {
	Port int16
}

func (*GRPCAgent) Start

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

type GRPCRLS

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

GRPCRLS server object (all fields are required).

func (*GRPCRLS) ShouldRateLimit

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

Check checks the request object.

func (*GRPCRLS) Start

func (g *GRPCRLS) 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 added in v2.3.0

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

func (HTTPListener) Run added in v2.3.0

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

type RLSResponse

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

RLSResponse constructs an rls response object.

func (*RLSResponse) AddHeader

func (r *RLSResponse) 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 (*RLSResponse) GetHTTPHeaderMap

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

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

func (*RLSResponse) GetOverallCode

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

GetOverallCode returns the rls response HTTP status code.

func (*RLSResponse) GetResponse

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

GetResponse returns the gRPC rls response object.

func (*RLSResponse) SetBody

func (r *RLSResponse) SetBody(s string)

SetBody sets the rls response message body.

func (*RLSResponse) SetOverallCode

func (r *RLSResponse) 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 Response

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

Response constructs an authorization response object.

func (*Response) AddHeader

func (r *Response) 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 (*Response) GetHTTPHeaderMap

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

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

func (*Response) GetResponse

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

GetResponse returns the gRPC authorization response object.

func (*Response) GetStatus

func (r *Response) GetStatus() uint32

GetStatus returns the authorization response HTTP status code.

func (*Response) SetBody

func (r *Response) SetBody(s string)

SetBody sets the authorization response message body.

func (*Response) SetStatus

func (r *Response) 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