pdclient

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 License: GPL-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrInvalidDispenserResponse - error for invalid statscode response on
	//dispenser call
	ErrInvalidDispenserResponse = errors.New("invalid dispenser response statuscode")
)

Functions

This section is empty.

Types

type LeaseCreateResponseBody

type LeaseCreateResponseBody struct {
	ID         string                 `json:"id"`
	Timestamp  int64                  `json:"timestamp"`
	Expires    int64                  `json:"expires"`
	Status     string                 `json:"status"`
	Profile    string                 `json:"profile"`
	CallerName string                 `json:"caller_name"`
	MetaData   map[string]interface{} `json:"meta_data"`
}

type LeaseRequestBody

type LeaseRequestBody struct {
	LeaseID              string                 `json:"lease_id"`
	InventoryID          string                 `json:"inventory_id"`
	Username             string                 `json:"username"`
	Sku                  string                 `json:"sku"`
	LeaseDuration        int64                  `json:"lease_duration"`
	LeaseEndDate         int64                  `json:"lease_end_date"`
	LeaseStartDate       int64                  `json:"lease_start_date"`
	LeaseProcurementMeta map[string]interface{} `json:"procurement_meta"`
}

type PDClient

type PDClient struct {
	APIKey string

	URL string
	// contains filtered or unexported fields
}

PDClient - dispenser client object

func NewClient

func NewClient(apiKey string, url string, client clientDoer) *PDClient

NewClient - constructor for a new dispenser client

func (*PDClient) PostLease

func (s *PDClient) PostLease(leaseID, inventoryID, skuID string, leaseDaysDuration int64) (leaseCreateResponse LeaseCreateResponseBody, res *http.Response, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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