integration

package
v0.0.0-...-0557d4e Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevicesInventory string = "/api/0.1.0/devices/%s"
)

Routes

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name        string      `json:"name" valid:"length(1|4096),required"`
	Description string      `json:"description" valid:"optional"`
	Value       interface{} `json:"value" valid:"-"`
}

type Device

type Device struct {
	ID         DeviceID     `json:"id" valid:"required"`
	Updated    time.Time    `json:"updated_ts" valid:"required"`
	Attributes []*Attribute `json:"Attributes" valid:"optional"`
}

func (*Device) Validate

func (d *Device) Validate() error

type DeviceID

type DeviceID string

func (DeviceID) String

func (d DeviceID) String() string

type Inventory

type Inventory interface {
	// Fetch Device object from inventory service.
	GetDeviceInventory(id DeviceID) (*Device, error)
}

type MenderAPI

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

func NewMenderAPI

func NewMenderAPI(uri string, options ...MenderAPIOption) (*MenderAPI, error)

func (*MenderAPI) GetDeviceInventory

func (api *MenderAPI) GetDeviceInventory(ctx context.Context, id DeviceID) (*Device, error)

GetDeviceInventory returns device object from inventory If object is not found return nil, nil

type MenderAPIOption

type MenderAPIOption func(*MenderAPI) error

MenderAPIOption is the type of constructor options for NewMenderAPI

func WithHTTPClient

func WithHTTPClient(client *http.Client) MenderAPIOption

Jump to

Keyboard shortcuts

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