...

Package services

import "github.com/emissary-ingress/emissary/v3/cmd/kat-server/services"
Overview
Index

Overview ▾

Index ▾

func DefaultOpts() []grpc.ServerOption
type ALSv2
    func (als ALSv2) StreamAccessLogs(srv alsv2.AccessLogService_StreamAccessLogsServer) error
type ALSv3
    func (als ALSv3) StreamAccessLogs(srv alsv3.AccessLogService_StreamAccessLogsServer) error
type GRPC
    func (g *GRPC) Echo(ctx context.Context, r *pb.EchoRequest) (*pb.EchoResponse, error)
    func (g *GRPC) Start(ctx context.Context) <-chan bool
type GRPCALS
    func (als *GRPCALS) ServeLogs(w http.ResponseWriter, r *http.Request)
    func (als *GRPCALS) Start(ctx context.Context) <-chan bool
type GRPCAgent
    func (a *GRPCAgent) Start(ctx context.Context) <-chan bool
type GRPCAuthV2
    func (g *GRPCAuthV2) Check(ctx context.Context, r *pb.CheckRequest) (*pb.CheckResponse, error)
    func (g *GRPCAuthV2) Start(ctx context.Context) <-chan bool
type GRPCAuthV3
    func (g *GRPCAuthV3) Check(ctx context.Context, r *pb.CheckRequest) (*pb.CheckResponse, error)
    func (g *GRPCAuthV3) Start(ctx context.Context) <-chan bool
type GRPCRLSV2
    func (g *GRPCRLSV2) ShouldRateLimit(ctx context.Context, r *pb.RateLimitRequest) (*pb.RateLimitResponse, error)
    func (g *GRPCRLSV2) Start(ctx context.Context) <-chan bool
type GRPCRLSV3
    func (g *GRPCRLSV3) ShouldRateLimit(ctx context.Context, r *pb.RateLimitRequest) (*pb.RateLimitResponse, error)
    func (g *GRPCRLSV3) Start(ctx context.Context) <-chan bool
type HTTP
    func (h *HTTP) Start(ctx context.Context) <-chan bool
type HTTPListener
    func (hl HTTPListener) Run(ctx context.Context, name string, httpHandler *http.ServeMux, grpcHandler *grpc.Server) <-chan bool
type HealthCheckServer
    func (h *HealthCheckServer) Start(ctx context.Context) <-chan bool
type RLSResponseV2
    func (r *RLSResponseV2) AddHeader(a bool, k, v string)
    func (r *RLSResponseV2) GetHTTPHeaderMap() *http.Header
    func (r *RLSResponseV2) GetOverallCode() pb.RateLimitResponse_Code
    func (r *RLSResponseV2) GetResponse() *pb.RateLimitResponse
    func (r *RLSResponseV2) SetBody(s string)
    func (r *RLSResponseV2) SetOverallCode(code pb.RateLimitResponse_Code)
type RLSResponseV3
    func (r *RLSResponseV3) AddHeader(a bool, k, v string)
    func (r *RLSResponseV3) GetHTTPHeaderMap() *http.Header
    func (r *RLSResponseV3) GetOverallCode() pb.RateLimitResponse_Code
    func (r *RLSResponseV3) GetResponse() *pb.RateLimitResponse
    func (r *RLSResponseV3) SetBody(s string)
    func (r *RLSResponseV3) SetOverallCode(code pb.RateLimitResponse_Code)
type ResponseV2
    func (r *ResponseV2) AddHeader(a bool, k, v string)
    func (r *ResponseV2) GetHTTPHeaderMap() *http.Header
    func (r *ResponseV2) GetResponse() *pb.CheckResponse
    func (r *ResponseV2) GetStatus() uint32
    func (r *ResponseV2) SetBody(s string)
    func (r *ResponseV2) SetStatus(ctx context.Context, s string)
type ResponseV3
    func (r *ResponseV3) AddHeader(a bool, k, v string)
    func (r *ResponseV3) GetHTTPHeaderMap() *http.Header
    func (r *ResponseV3) GetResponse() *pb.CheckResponse
    func (r *ResponseV3) GetStatus() uint32
    func (r *ResponseV3) SetBody(s string)
    func (r *ResponseV3) SetStatus(ctx context.Context, s string)
type Service

Package files

grpc-agent.go grpc-als.go grpc-auth-v2.go grpc-auth-v3.go grpc-echo.go grpc-rls-v2.go grpc-rls-v3.go health_check_server.go http.go service.go

func DefaultOpts

func DefaultOpts() []grpc.ServerOption

DefaultOpts sets gRPC service options.

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

GRPC server object (all fields are required).

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

    pb.UnsafeEchoServiceServer
}

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

GRPCAuthV2 server object (all fields are required).

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

func (*GRPCAuthV2) Check

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

Check checks the request object.

func (*GRPCAuthV2) Start

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

Start initializes the HTTP server.

type GRPCAuthV3

GRPCAuthV3 server object (all fields are required).

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

func (*GRPCAuthV3) Check

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

Check checks the request object.

func (*GRPCAuthV3) Start

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

Start initializes the HTTP server.

type GRPCRLSV2

GRPCRLSV2 server object (all fields are required).

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

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

GRPCRLSV3 server object (all fields are required).

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

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

HTTP server object (all fields are required).

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

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

HTTP server object (all fields are required).

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

func (*HealthCheckServer) Start

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

Start initializes the Health Check HTTP server.

type RLSResponseV2

RLSResponseV2 constructs an rls response object.

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

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

RLSResponseV3 constructs an rls response object.

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

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

ResponseV2 constructs an authorization response object.

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

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

ResponseV3 constructs an authorization response object.

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

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

Service defines a KAT backend service interface.

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