Documentation ¶
Overview ¶
Package leasehttp serves lease renewals made through HTTP requests.
Index ¶
- Variables
- func NewHandler(l lease.Lessor, waitch func() <-chan struct{}) http.Handler
- func RenewHTTP(ctx context.Context, id lease.LeaseID, url string, rt http.RoundTripper) (int64, error)
- func TimeToLiveHTTP(ctx context.Context, id lease.LeaseID, keys bool, url string, ...) (*leasepb.LeaseInternalResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LeasePrefix = "/leases" LeaseInternalPrefix = "/leases/internal" ErrLeaseHTTPTimeout = errors.New("waiting for node to catch up its applied index has timed out") )
Functions ¶
func NewHandler ¶
NewHandler returns an http Handler for lease renewals
func RenewHTTP ¶
func RenewHTTP(ctx context.Context, id lease.LeaseID, url string, rt http.RoundTripper) (int64, error)
RenewHTTP renews a lease at a given primary server. TODO: Batch request in future?
func TimeToLiveHTTP ¶
func TimeToLiveHTTP(ctx context.Context, id lease.LeaseID, keys bool, url string, rt http.RoundTripper) (*leasepb.LeaseInternalResponse, error)
TimeToLiveHTTP retrieves lease information of the given lease ID.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.