command

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: 13 Imported by: 0

Documentation

Overview

Package command provides utilities for creating MDM Payloads.

Index

Constants

View Source
const (
	// CommandTopic is a PubSub topic that events are published to.
	CommandTopic = "mdm.Command"
)

Variables

This section is empty.

Functions

func MakeNewCommandEndpoint

func MakeNewCommandEndpoint(svc Service) endpoint.Endpoint

MakeNewCommandEndpoint creates an endpoint which creates new MDM Commands.

func MarshalEvent

func MarshalEvent(e *Event) ([]byte, error)

MarshalEvent serializes an event to a protocol buffer wire format.

func RegisterHTTPHandlers

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

func UnmarshalEvent

func UnmarshalEvent(data []byte, e *Event) error

UnmarshalEvent parses a protocol buffer representation of data into the Event.

Types

type CommandService

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

func New

func New(pub pubsub.Publisher) (*CommandService, error)

func (*CommandService) NewCommand

func (svc *CommandService) NewCommand(ctx context.Context, request *mdm.CommandRequest) (*mdm.CommandPayload, error)

type Endpoints

type Endpoints struct {
	NewCommandEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

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

type Event

type Event struct {
	ID         string
	Time       time.Time
	Payload    *mdm.CommandPayload
	DeviceUDID string
}

func NewEvent

func NewEvent(payload *mdm.CommandPayload, udid string) *Event

NewEvent returns an Event with a unique ID and the current time.

type Service

type Service interface {
	NewCommand(context.Context, *mdm.CommandRequest) (*mdm.CommandPayload, error)
}

Directories

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

Jump to

Keyboard shortcuts

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