Documentation ¶
Overview ¶
Package command provides utilities for creating MDM Payloads.
Index ¶
- Constants
- func MakeClearQueueEndpoint(svc Service) endpoint.Endpoint
- func MakeNewCommandEndpoint(svc Service) endpoint.Endpoint
- func MakeNewRawCommandEndpoint(svc Service) endpoint.Endpoint
- func MakeViewQueueEndpoint(svc Service) endpoint.Endpoint
- func MarshalEvent(e *Event) ([]byte, error)
- func MarshalRawEvent(e *RawEvent) ([]byte, error)
- func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption)
- func UnmarshalEvent(data []byte, e *Event) error
- func UnmarshalRawEvent(data []byte, e *RawEvent) error
- type CommandService
- func (svc *CommandService) ClearQueue(ctx context.Context, udid string) error
- func (svc *CommandService) NewCommand(ctx context.Context, request *mdm.CommandRequest) (*mdm.CommandPayload, error)
- func (svc *CommandService) NewRawCommand(ctx context.Context, cmd *RawCommand) error
- func (svc *CommandService) ViewQueue(ctx context.Context, udid string) ([]*mdm.Command, error)
- type Endpoints
- type Event
- type Queue
- type RawCommand
- type RawEvent
- type Service
Constants ¶
const ( // CommandTopic is a PubSub topic that events are published to. CommandTopic = "mdm.Command" // RawCommandTopic is a PubSub topic that events are published to. RawCommandTopic = "mdm.RawCommand" )
Variables ¶
This section is empty.
Functions ¶
func MakeClearQueueEndpoint ¶ added in v1.11.0
MakeClearQueueEndpoint creates an endpoint which clears device queues.
func MakeNewCommandEndpoint ¶
MakeNewCommandEndpoint creates an endpoint which creates new MDM Commands.
func MakeNewRawCommandEndpoint ¶ added in v1.11.0
MakeNewRawCommandEndpoint creates an endpoint which creates new raw MDM Commands.
func MakeViewQueueEndpoint ¶ added in v1.12.0
MakeViewQueueEndpoint creates an endpoint which views device queues.
func MarshalEvent ¶
MarshalEvent serializes an event to a protocol buffer wire format.
func MarshalRawEvent ¶ added in v1.11.0
MarshalRawEvent serializes a RawEvent to a protocol buffer wire format.
func RegisterHTTPHandlers ¶
func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption)
func UnmarshalEvent ¶
UnmarshalEvent parses a protocol buffer representation of data into the Event.
func UnmarshalRawEvent ¶ added in v1.11.0
UnmarshalRawEvent parses a protocol buffer representation of data into the RawEvent.
Types ¶
type CommandService ¶
type CommandService struct {
// contains filtered or unexported fields
}
func (*CommandService) ClearQueue ¶ added in v1.11.0
func (svc *CommandService) ClearQueue(ctx context.Context, udid string) error
func (*CommandService) NewCommand ¶
func (svc *CommandService) NewCommand(ctx context.Context, request *mdm.CommandRequest) (*mdm.CommandPayload, error)
func (*CommandService) NewRawCommand ¶ added in v1.11.0
func (svc *CommandService) NewRawCommand(ctx context.Context, cmd *RawCommand) error
type Endpoints ¶
type Endpoints struct { NewCommandEndpoint endpoint.Endpoint NewRawCommandEndpoint endpoint.Endpoint ClearQueueEndpoint endpoint.Endpoint ViewQueueEndpoint endpoint.Endpoint }
func MakeServerEndpoints ¶
func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoint.Middleware) Endpoints
type Queue ¶ added in v1.11.0
type Queue interface { Clear(context.Context, mdmsvc.CheckinEvent) error ViewQueue(context.Context, mdmsvc.CheckinEvent) ([]*mdmsvc.Command, error) }
Queue is an MDM Command Queue.
type RawCommand ¶ added in v1.11.0
type RawEvent ¶ added in v1.11.0
func NewRawEvent ¶ added in v1.11.0
func NewRawEvent(cmd *RawCommand) *RawEvent
NewRawEvent returns a RawEvent with the current time.