mirror of
https://github.com/micromdm/micromdm/
synced 2026-06-19 10:35:45 +08:00
Updated the command service to have the same structure as all the other services within platform/...
24 lines
500 B
Go
24 lines
500 B
Go
// Package command provides utilities for creating MDM Payloads.
|
|
package command
|
|
|
|
import (
|
|
"github.com/micromdm/micromdm/mdm/mdm"
|
|
"github.com/micromdm/micromdm/platform/pubsub"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
type Service interface {
|
|
NewCommand(context.Context, *mdm.CommandRequest) (*mdm.CommandPayload, error)
|
|
}
|
|
|
|
type CommandService struct {
|
|
publisher pubsub.Publisher
|
|
}
|
|
|
|
func New(pub pubsub.Publisher) (*CommandService, error) {
|
|
svc := CommandService{
|
|
publisher: pub,
|
|
}
|
|
return &svc, nil
|
|
}
|