...
Package leasehttp
Package leasehttp serves lease renewals made through HTTP requests.
- 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, rt http.RoundTripper) (*leasepb.LeaseInternalResponse, error)
Package files
doc.go
http.go
In the call graph viewer below, each node
is a function belonging to this package
and its children are the functions it
calls—perhaps dynamically.
The root nodes are the entry points of the
package: functions that may be called from
outside the package.
There may be non-exported or anonymous
functions among them if they are called
dynamically from another package.
Click a node to visit that function's source code.
From there you can visit its callers by
clicking its declaring func
token.
Functions may be omitted if they were
determined to be unreachable in the
particular programs or tests that were
analyzed.
Variables
var (
LeasePrefix = "/leases"
LeaseInternalPrefix = "/leases/internal"
ErrLeaseHTTPTimeout = errors.New("waiting for node to catch up its applied index has timed out")
)
func NewHandler(l lease.Lessor, waitch func() <-chan struct{}) http.Handler
NewHandler returns an http Handler for lease renewals
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(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.