services

package
v1.8.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 27 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 GRPC

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

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() <-chan bool

Start initializes the gRPC server.

type GRPCAUTH

type GRPCAUTH struct {
	Port          int16
	Backend       string
	SecurePort    int16
	SecureBackend string
	Cert          string
	Key           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() <-chan bool

Start initializes the HTTP server.

type GRPCRLS added in v1.8.0

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

GRPCRLS server object (all fields are required).

func (*GRPCRLS) ShouldRateLimit added in v1.8.0

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

Check checks the request object.

func (*GRPCRLS) Start added in v1.8.0

func (g *GRPCRLS) Start() <-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() <-chan bool

Start initializes the HTTP server.

type RLSResponse added in v1.8.0

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

RLSResponse constructs an rls response object.

func (*RLSResponse) AddHeader added in v1.8.0

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 added in v1.8.0

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

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

func (*RLSResponse) GetOverallCode added in v1.8.0

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

GetOverallCode returns the rls response HTTP status code.

func (*RLSResponse) GetResponse added in v1.8.0

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

GetResponse returns the gRPC rls response object.

func (*RLSResponse) SetBody added in v1.8.0

func (r *RLSResponse) SetBody(s string)

SetBody sets the rls response message body.

func (*RLSResponse) SetOverallCode added in v1.8.0

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

SetStatus sets the authorization response HTTP status code.

type Service

type Service interface {
	Start() <-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