server

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServiceScope added in v0.9.0

func WithServiceScope(handler http.Handler) http.Handler

WithServiceScope an HTTP filter that trims "/services/cache" prefix from the URL.

for example: /services/cache/shards/amber/clusters/*/apis/apis.kcp.io/v1alpha1/apiexports is truncated to /shards/amber/clusters/*/apis/apis.kcp.io/v1alpha1/apiexports.

func WithShardScope

func WithShardScope(handler http.Handler) http.Handler

WithShardScope reads a shard name from the URL path and puts it into the context. It also trims "/shards/" prefix from the URL. If the path doesn't contain the shard name then a 404 error is returned.

For example:

/shards/*/clusters/*/apis/apis.kcp.io/v1alpha1/apiexports

/shards/amber/clusters/*/apis/apis.kcp.io/v1alpha1/apiexports

/shards/sapphire/clusters/system:sapphire/apis/apis.kcp.io/v1alpha1/apiexports

/shards/amber/clusters/system:amber/apis/apis.kcp.io/v1alpha1/apiexports

Note: not all paths require to have a valid shard name, as of today the following paths pass through: "/livez", "/readyz", "/healthz".

func WithSyntheticDelay added in v0.11.0

func WithSyntheticDelay(handler http.Handler, delay time.Duration) http.Handler

WithSyntheticDelay injects a synthetic delay to calls, to exacerbate timing issues and expose inconsistent client behavior.

Types

type CompletedConfig

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

type Config

type Config struct {
	Options       *cacheserveroptions.CompletedOptions
	ApiExtensions *apiextensionsapiserver.Config
	EmbeddedEtcd  *embeddedetcd.Config

	ExtraConfig
}

func NewConfig

func NewConfig(opts *cacheserveroptions.CompletedOptions, optionalLocalShardRestConfig *rest.Config) (*Config, error)

NewConfig returns a new Config for the given options and optional rest.Config that point to the local server. Pass it only when you combine this server with a different one.

func (*Config) Complete

func (c *Config) Complete() (CompletedConfig, error)

Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.

type ExtraConfig

type ExtraConfig struct {
	ApiExtensionsClusterClient         kcpapiextensionsclientset.ClusterInterface
	ApiExtensionsSharedInformerFactory kcpapiextensionsinformers.SharedInformerFactory
}

type Server

type Server struct {
	CompletedConfig
	// contains filtered or unexported fields
}

func NewServer

func NewServer(c CompletedConfig) (*Server, error)

func (*Server) PrepareRun added in v0.9.0

func (s *Server) PrepareRun(ctx context.Context) (preparedServer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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