device

package
v0.0.0-...-29c6822 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DeviceEnrolledTopic = "mdm.DeviceEnrolled"

Variables

This section is empty.

Functions

func MakeHTTPHandler

func MakeHTTPHandler(e Endpoints, logger log.Logger) *mux.Router

func MakeListDevicesEndpoint

func MakeListDevicesEndpoint(svc Service) endpoint.Endpoint

func MarshalDevice

func MarshalDevice(dev *Device) ([]byte, error)

func UnmarshalDevice

func UnmarshalDevice(data []byte, dev *Device) error

Types

type DEPProfileStatus

type DEPProfileStatus string

DEPProfileStatus is the status of the DEP Profile can be either "empty", "assigned", "pushed", or "removed"

const (
	EMPTY    DEPProfileStatus = "empty"
	ASSIGNED DEPProfileStatus = "assigned"
	PUSHED   DEPProfileStatus = "pushed"
	REMOVED  DEPProfileStatus = "removed"
)

DEPProfileStatus values

type Device

type Device struct {
	UUID                   string
	UDID                   string
	SerialNumber           string
	OSVersion              string
	BuildVersion           string
	ProductName            string
	IMEI                   string
	MEID                   string
	MDMTopic               string
	PushMagic              string
	AwaitingConfiguration  bool
	Token                  string
	UnlockToken            string
	Enrolled               bool
	DEPDevice              bool
	Description            string
	Model                  string
	ModelName              string
	DeviceName             string
	Color                  string
	AssetTag               string
	DEPProfileStatus       DEPProfileStatus
	DEPProfileUUID         string
	DEPProfileAssignTime   time.Time
	DEPProfilePushTime     time.Time
	DEPProfileAssignedDate time.Time
	DEPProfileAssignedBy   string
	LastCheckin            time.Time
	LastQueryResponse      []byte
}

type DeviceDTO

type DeviceDTO struct {
	SerialNumber     string    `json:"serial_number"`
	UDID             string    `json:"udid"`
	EnrollmentStatus bool      `json:"enrollment_status"`
	LastSeen         time.Time `json:"last_seen"`
}

type DeviceService

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

func New

func New(store Store) *DeviceService

func (*DeviceService) ListDevices

func (svc *DeviceService) ListDevices(ctx context.Context, opt ListDevicesOption) ([]DeviceDTO, error)

type Endpoints

type Endpoints struct {
	ListDevicesEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service) Endpoints

func (Endpoints) ListDevices

func (e Endpoints) ListDevices(ctx context.Context, opts ListDevicesOption) ([]DeviceDTO, error)

type ListDevicesOption

type ListDevicesOption struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`

	FilterSerial []string `json:"filter_serial"`
	FilterUDID   []string `json:"filter_udid"`
}

type Service

type Service interface {
	ListDevices(ctx context.Context, opt ListDevicesOption) ([]DeviceDTO, error)
}

func NewHTTPClient

func NewHTTPClient(instance, token string, logger log.Logger, opts ...httptransport.ClientOption) (Service, error)

type Store

type Store interface {
	List() ([]Device, error)
}

Directories

Path Synopsis
internal
deviceproto
Package deviceproto is a generated protocol buffer package.
Package deviceproto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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