inv

package
v0.0.0-...-e4c96ca Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2017 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

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

func NewInventory

func NewInventory(d store.DataStore) *Inventory

func (*Inventory) AddDevice

func (i *Inventory) AddDevice(ctx context.Context, dev *model.Device) error

func (*Inventory) DeleteDevice

func (i *Inventory) DeleteDevice(ctx context.Context, id model.DeviceID) error

func (*Inventory) GetDevice

func (i *Inventory) GetDevice(ctx context.Context, id model.DeviceID) (*model.Device, error)

func (*Inventory) GetDeviceGroup

func (i *Inventory) GetDeviceGroup(ctx context.Context, id model.DeviceID) (model.GroupName, error)

func (*Inventory) ListDevices

func (i *Inventory) ListDevices(ctx context.Context, skip int, limit int, filters []store.Filter, sort *store.Sort, hasGroup *bool) ([]model.Device, error)

func (*Inventory) ListDevicesByGroup

func (i *Inventory) ListDevicesByGroup(ctx context.Context, group model.GroupName, skip, limit int) ([]model.DeviceID, error)

func (*Inventory) ListGroups

func (i *Inventory) ListGroups(ctx context.Context) ([]model.GroupName, error)

func (*Inventory) UnsetDeviceGroup

func (i *Inventory) UnsetDeviceGroup(ctx context.Context, id model.DeviceID, groupName model.GroupName) error

func (*Inventory) UpdateDeviceGroup

func (i *Inventory) UpdateDeviceGroup(ctx context.Context, devid model.DeviceID, group model.GroupName) error

func (*Inventory) UpsertAttributes

func (i *Inventory) UpsertAttributes(ctx context.Context, id model.DeviceID, attrs model.DeviceAttributes) error

type InventoryApp

type InventoryApp interface {
	ListDevices(ctx context.Context, skip int, limit int, filters []store.Filter, sort *store.Sort, hasGroup *bool) ([]model.Device, error)
	GetDevice(ctx context.Context, id model.DeviceID) (*model.Device, error)
	AddDevice(ctx context.Context, d *model.Device) error
	UpsertAttributes(ctx context.Context, id model.DeviceID, attrs model.DeviceAttributes) error
	UnsetDeviceGroup(ctx context.Context, id model.DeviceID, groupName model.GroupName) error
	UpdateDeviceGroup(ctx context.Context, id model.DeviceID, group model.GroupName) error
	ListGroups(ctx context.Context) ([]model.GroupName, error)
	ListDevicesByGroup(ctx context.Context, group model.GroupName, skip int, limit int) ([]model.DeviceID, error)
	GetDeviceGroup(ctx context.Context, id model.DeviceID) (model.GroupName, error)
	DeleteDevice(ctx context.Context, id model.DeviceID) error
}

this inventory service interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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