Documentation
¶
Index ¶
- func ForbiddenHandler() http.Handler
- func ShardNameFrom(ctx context.Context) string
- func ShardURLFrom(ctx context.Context) *url.URL
- func WithClusterResolver(delegate http.Handler, mappings []types.PathMapping, idx index.Index) http.Handler
- func WithShardName(parent context.Context, shardName string) context.Context
- func WithShardURL(parent context.Context, shardURL *url.URL) context.Context
- func WithWorkspaceType(parent context.Context, wsType logicalcluster.Path) context.Context
- func WorkspaceTypeFrom(ctx context.Context) logicalcluster.Path
- type HttpHandler
- type ShardNameHolder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForbiddenHandler ¶ added in v0.34.0
ForbiddenHandler rejects every request with 403.
func ShardNameFrom ¶ added in v0.34.0
func WithClusterResolver ¶ added in v0.34.0
func WithShardName ¶ added in v0.34.0
func WithShardURL ¶ added in v0.34.0
func WithWorkspaceType ¶ added in v0.34.0
func WorkspaceTypeFrom ¶ added in v0.34.0
func WorkspaceTypeFrom(ctx context.Context) logicalcluster.Path
Types ¶
type HttpHandler ¶
type HttpHandler struct {
Mappings types.HttpHandlerMappings
DefaultHandler http.Handler
}
func (*HttpHandler) ServeHTTP ¶
func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ShardNameHolder ¶ added in v0.34.0
type ShardNameHolder struct {
Name string
}
ShardNameHolder is a mutable container for the shard name that can be stored in context before the shard is known, then updated later. This allows outer middleware to access the shard name even when inner handlers create new request objects with WithContext().
func ShardNameHolderFrom ¶ added in v0.34.0
func ShardNameHolderFrom(ctx context.Context) *ShardNameHolder
func WithShardNameHolder ¶ added in v0.34.0
func WithShardNameHolder(parent context.Context) (context.Context, *ShardNameHolder)
WithShardNameHolder stores a ShardNameHolder in the context. The holder can be updated later when WithShardName is called. If the context already has a holder, it is reused so that nested middlewares all observe the same name.