kubernetes/staging/src/k8s.io/dynamic-resource-allocation/leaderelection/leaderelection.go

const defaultLeaseDuration

const defaultRenewDeadline

const defaultRetryPeriod

const defaultHealthCheckTimeout

const HealthCheckerAddress

type leaderElection

type Option

// New constructs a new leader election instance.
func New(clientset kubernetes.Interface, lockName string, runFunc func(ctx context.Context), opts ...Option) *leaderElection {}

func Identity(identity string) Option {}

func Namespace(namespace string) Option {}

func LeaseDuration(leaseDuration time.Duration) Option {}

func RenewDeadline(renewDeadline time.Duration) Option {}

func RetryPeriod(retryPeriod time.Duration) Option {}

func HealthCheckTimeout(timeout time.Duration) Option {}

func Context(ctx context.Context) Option {}

type Server

// PrepareHealthCheck creates a health check for this leader election object
// with the given healthCheckTimeout and registers its HTTP handler to the given
// server at the path specified by the constant "healthCheckerAddress".
// healthCheckTimeout determines the max duration beyond lease expiration
// allowed before reporting unhealthy.
// The caller sidecar should document the handler address in appropriate flag
// descriptions.
func (l *leaderElection) PrepareHealthCheck(s Server) {}

func (l *leaderElection) Run() error {}

func defaultLeaderElectionIdentity() (string, error) {}

// sanitizeName sanitizes the provided string so it can be consumed by leader election library
func sanitizeName(name string) string {}

// inClusterNamespace returns the namespace in which the pod is running in by checking
// the env var POD_NAMESPACE, then the file /var/run/secrets/kubernetes.io/serviceaccount/namespace.
// if neither returns a valid namespace, the "default" namespace is returned
func inClusterNamespace() string {}

// adaptCheckToHandler returns an http.HandlerFunc that serves the provided checks.
func adaptCheckToHandler(c func(r *http.Request) error) http.HandlerFunc {}