client

package
v0.0.0-...-7220889 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DMDevURL     = "device-lease-service-dev-thnumbwdvq-uc.a.run.app"
	DMProdURL    = "device-lease-service-prod-bbx5lsj5jq-uc.a.run.app"
	DMLeasesPort = 443
	// LeaseExtensionAmount is the default amount we extend DM leases by.
	LeaseExtensionAmount = 7 * time.Minute
	// LeaseExtensionInterval is the default interval between DM lease extensions.
	LeaseExtensionInterval = 5 * time.Minute
	// SchedukeDevPool is the pool that the DM and Scheduke dev instances manages.
	SchedukeDevPool = "schedukeTest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, pool string) (*Client, error)

func (*Client) Extend

func (c *Client) Extend(ctx context.Context, leaseID string, dur time.Duration) (time.Time, error)

Extend extends the lease with the given ID by the given duration, and returns the new deadline.

func (*Client) Release

func (c *Client) Release(ctx context.Context, leaseID string) error

Release releases the lease with the given ID.

Jump to

Keyboard shortcuts

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