server

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 39 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServeGRPC

func ListenAndServeGRPC(addr string, opts []grpc.ServerOption,
	validateACDeps bool,
	mangleACKeys bool,
	enableRemoteAssetAPI bool,
	c *disk.Cache, a cache.Logger, e cache.Logger) error

ListenAndServeGRPC creates a new gRPC server and listens on the given address. This function either returns an error quickly, or triggers a blocking call to https://godoc.org/google.golang.org/grpc#Server.Serve

Types

type GrpcBasicAuth added in v1.1.0

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

GrpcBasicAuth wraps an auth.SecretProvider, and provides gRPC interceptors that verify that requests can be authenticated using HTTP basic auth.

func NewGrpcBasicAuth added in v1.1.0

func NewGrpcBasicAuth(secrets auth.SecretProvider) *GrpcBasicAuth

NewGrpcBasicAuth returns a GrpcBasicAuth that wraps the given auth.SecretProvider.

func (*GrpcBasicAuth) StreamServerInterceptor added in v1.1.0

func (b *GrpcBasicAuth) StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

StreamServerInterceptor returns a streaming server interceptor that verifies that each request can be authenticated using HTTP basic auth.

func (*GrpcBasicAuth) UnaryServerInterceptor added in v1.1.0

func (b *GrpcBasicAuth) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

UnaryServerInterceptor returns a unary server interceptor that verifies that each request can be authenticated using HTTP basic auth.

type GrpcIdleTimer added in v1.1.0

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

GrpcIdleTimer wraps an idle.Timer, and provides gRPC interceptors that reset the given idle.Timer at the start of each gRPC request.

func NewGrpcIdleTimer added in v1.1.0

func NewGrpcIdleTimer(idleTimer *idle.Timer) *GrpcIdleTimer

NewGrpcIdleTimer returns a GrpcIdleTimer that wraps the given idle.Timer.

func (*GrpcIdleTimer) StreamServerInterceptor added in v1.1.0

func (t *GrpcIdleTimer) StreamServerInterceptor(srv interface{},
	ss grpc.ServerStream, info *grpc.StreamServerInfo,
	handler grpc.StreamHandler) error

StreamServerInterceptor returns a streaming server interceptor that resets the idle.Timer at the start of each gRPC request.

func (*GrpcIdleTimer) UnaryServerInterceptor added in v1.1.0

func (t *GrpcIdleTimer) UnaryServerInterceptor(ctx context.Context,
	req interface{}, info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler) (interface{}, error)

UnaryServerInterceptor returns a unary server interceptor that resets the idle.Timer at the start of each gRPC request.

type HTTPCache

type HTTPCache interface {
	CacheHandler(w http.ResponseWriter, r *http.Request)
	StatusPageHandler(w http.ResponseWriter, r *http.Request)
}

HTTPCache ...

func NewHTTPCache

func NewHTTPCache(cache *disk.Cache, accessLogger cache.Logger, errorLogger cache.Logger, validateAC bool, mangleACKeys bool, commit string) HTTPCache

NewHTTPCache returns a new instance of the cache. accessLogger will print one line for each HTTP request to stdout. errorLogger will print unexpected server errors. Inexistent files and malformed URLs will not be reported.

Jump to

Keyboard shortcuts

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