leasehttp

package
v3.1.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: Apache-2.0 Imports: 10 Imported by: 16

Documentation

Overview

Package leasehttp serves lease renewals made through HTTP requests.

Index

Constants

This section is empty.

Variables

View Source
var (
	LeasePrefix         = "/leases"
	LeaseInternalPrefix = "/leases/internal"
)

Functions

func NewHandler

func NewHandler(l lease.Lessor) http.Handler

NewHandler returns an http Handler for lease renewals

func RenewHTTP

func RenewHTTP(id lease.LeaseID, url string, rt http.RoundTripper, timeout time.Duration) (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.

Jump to

Keyboard shortcuts

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