server

package
v0.0.0-...-1062e33 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package server contains the server-side interceptor for caching. The Interceptor here estimates for how long an object should be possible to cache, based on how often responses to queries seem to generate different responses. The intended use is for a reverse proxy, or embedded into a process which serves data that is amenable for caching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurableValidityEstimator

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

ConfigurableValidityEstimator is a configurable ValidityEstimator.

func (*ConfigurableValidityEstimator) Initialize

func (e *ConfigurableValidityEstimator) Initialize(csvLog *log.Logger)

Initialize new ConfigurableValidityEstimator.

func (*ConfigurableValidityEstimator) UnaryClientInterceptor

func (e *ConfigurableValidityEstimator) UnaryClientInterceptor() grpc.UnaryClientInterceptor

UnaryClientInterceptor catches outgoing calls and stores information about them to enable verification of estimated cache validity times.

func (*ConfigurableValidityEstimator) UnaryServerInterceptor

func (e *ConfigurableValidityEstimator) UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor creates the server-side gRPC Unary Interceptor that is used to inject the cache-control header and the estimated maximum age of the response object.

type ValidityEstimator

type ValidityEstimator interface {

	// UnaryServerInterceptor returns the gRPC Interceptor for Unary operations
	// that uses the EstimateMaxAge function on the request/response objects.
	UnaryServerInterceptor() grpc.UnaryServerInterceptor
	// UnaryClientInterceptor creates a gRPC Interceptor for outgoing calls,
	// and is used for capturing information needed to make estimations
	// more accurate by polling the origin server.
	UnaryClientInterceptor() grpc.UnaryClientInterceptor
	// contains filtered or unexported methods
}

A ValidityEstimator hooks into the server side, and performs estimation of how long responses may be stored in cache.

Jump to

Keyboard shortcuts

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