device

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

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

DEPProfileStatus values

View Source
const DeviceEnrolledTopic = "mdm.DeviceEnrolled"

Variables

This section is empty.

Functions

func MakeListDevicesEndpoint

func MakeListDevicesEndpoint(svc Service) endpoint.Endpoint

func MakeRemoveDevicesEndpoint added in v1.3.1

func MakeRemoveDevicesEndpoint(svc Service) endpoint.Endpoint

func MarshalDevice

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

func RegisterHTTPHandlers

func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption)

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"

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
	LastSeen               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)

func (*DeviceService) RemoveDevices added in v1.3.1

func (svc *DeviceService) RemoveDevices(ctx context.Context, udids []string) error

type DeviceWorkerStore

type DeviceWorkerStore interface {
	Save(*Device) error
	DeviceByUDID(udid string) (*Device, error)
	DeviceBySerial(udid string) (*Device, error)
}

type Endpoints

type Endpoints struct {
	ListDevicesEndpoint   endpoint.Endpoint
	RemoveDevicesEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoint.Middleware) Endpoints

func (Endpoints) ListDevices

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

func (Endpoints) RemoveDevices added in v1.3.1

func (e Endpoints) RemoveDevices(ctx context.Context, ids []string) 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)
	RemoveDevices(ctx context.Context, udids []string) error
}

func NewHTTPClient

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

type Store

type Store interface {
	List(opt ListDevicesOption) ([]Device, error)
	Delete(udid string) error
}

type Worker

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

func NewWorker

func NewWorker(db DeviceWorkerStore, ps pubsub.PublishSubscriber, logger log.Logger) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) 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