Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway provides a RESTful API into LogCache's gRPC API.
func NewGateway ¶
func NewGateway(logCacheAddr, gatewayAddr string, opts ...GatewayOption) *Gateway
NewGateway creates a new Gateway. It will listen on the gatewayAddr and submit requests via gRPC to the LogCache on logCacheAddr. Start() must be invoked before using the Gateway.
type GatewayOption ¶
type GatewayOption func(*Gateway)
GatewayOption configures a Gateway.
func WithGatewayBlock ¶
func WithGatewayBlock() GatewayOption
WithGatewayBlock returns a GatewayOption that determines if Start launches a go-routine or not. It defaults to launching a go-routine. If this is set, start will block on serving the HTTP endpoint.
func WithGatewayLogCacheDialOpts ¶
func WithGatewayLogCacheDialOpts(opts ...grpc.DialOption) GatewayOption
WithGatewayLogCacheDialOpts returns a GatewayOption that sets grpc.DialOptions on the log-cache dial
func WithGatewayLogger ¶
func WithGatewayLogger(l *log.Logger) GatewayOption
WithGatewayLogger returns a GatewayOption that configures the logger for the Gateway. It defaults to no logging.
func WithGatewayVersion ¶
func WithGatewayVersion(version string) GatewayOption
WithGatewayLogCacheDialOpts returns a GatewayOption that the log-cache version returned by the info endpoint.