sharder

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HandlerName is the name of the webhook handler.
	HandlerName = "sharder"
	// WebhookPathPrefix is the path prefix at which the handler should be registered.
	WebhookPathPrefix = "/webhooks/sharder/"
)

Variables

This section is empty.

Functions

func NewContextWithRequestPath

func NewContextWithRequestPath(ctx context.Context, r *http.Request) context.Context

NewContextWithRequestPath augments the given context with the request's path.

func RequestPathFromContext

func RequestPathFromContext(ctx context.Context) (string, error)

RequestPathFromContext returns the request's path stored in the given context.

func RingForRequest

func RingForRequest(ctx context.Context, c client.Reader) (sharding.Ring, error)

RingForRequest returns the Ring object matching the requests' path.

func RingForWebhookPath

func RingForWebhookPath(requestPath string) (sharding.Ring, error)

RingForWebhookPath returns the ring object that is associated with the given webhook handler path. It is the reverse of WebhookPathFor.

func WebhookPathFor

func WebhookPathFor(obj client.Object) (string, error)

WebhookPathFor returns the webhook handler path that should be used for implementing the given ring object. It is the reverse of RingForWebhookPath.

Types

type Handler

type Handler struct {
	Reader client.Reader
	Clock  clock.PassiveClock
}

Handler handles admission requests and invalidates the static token in Secret resources related to ServiceAccounts.

func (*Handler) AddToManager

func (h *Handler) AddToManager(mgr manager.Manager) error

AddToManager adds Handler to the given manager.

func (*Handler) Handle

Jump to

Keyboard shortcuts

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