pdclient

package
v0.0.125 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 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 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"`
}

LeaseRequestBody - request lease body object structure

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) GetTask added in v0.0.124

func (s *PDClient) GetTask(taskID string) (task TaskResponse, res *http.Response, err error)

GetTask - wrapper to rest call to GET task from dispenser

func (*PDClient) PostLease

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

PostLease -- allows a client user to post a lease to dispenser

type TaskResponse added in v0.0.124

type TaskResponse struct {
	ID         string                 `json:"ID"`
	Timestamp  int64                  `json:"Timestamp"`
	Expires    int64                  `json:"Expires"`
	Status     string                 `json:"Status"`
	Profile    string                 `json:"Profile"`
	CallerName string                 `json:"CallerName"`
	MetaData   map[string]interface{} `json:"MetaData"`
}

TaskResponse - a response object for a get task call

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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