organize essential APIs into platform, workflow and pkg folders (#337)

Add more logic to the way code is organized.

	/pkg -- library code not directly connected to micromdm
	/mdm -- packages meant for the services devices interract with. The MDM protocol.
	/dep -- DEP API and related packages.
	/platform -- Core APIs the server provides. Commands API, Devices API, queue, pubsub etc.
	/workflow -- Packages/API that build on top of platform. Today that's the webhook package.
		     Depending on what ends up here, the workflow folder might become its own repository.
This commit is contained in:
Victor Vrantchan
2017-11-23 22:07:57 -05:00
committed by GitHub
parent bc34ace413
commit 91c236c8c3
112 changed files with 165 additions and 233 deletions

View File

@@ -0,0 +1,3 @@
package deviceproto
//go:generate protoc --go_out=. device.proto

View File

@@ -0,0 +1,315 @@
// Code generated by protoc-gen-go.
// source: device.proto
// DO NOT EDIT!
/*
Package deviceproto is a generated protocol buffer package.
It is generated from these files:
device.proto
It has these top-level messages:
Device
*/
package deviceproto
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Device struct {
Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"`
Udid string `protobuf:"bytes,2,opt,name=udid" json:"udid,omitempty"`
SerialNumber string `protobuf:"bytes,3,opt,name=serial_number,json=serialNumber" json:"serial_number,omitempty"`
OsVersion string `protobuf:"bytes,4,opt,name=os_version,json=osVersion" json:"os_version,omitempty"`
BuildVersion string `protobuf:"bytes,5,opt,name=build_version,json=buildVersion" json:"build_version,omitempty"`
ProductName string `protobuf:"bytes,6,opt,name=product_name,json=productName" json:"product_name,omitempty"`
Imei string `protobuf:"bytes,7,opt,name=imei" json:"imei,omitempty"`
Meid string `protobuf:"bytes,8,opt,name=meid" json:"meid,omitempty"`
Token string `protobuf:"bytes,9,opt,name=token" json:"token,omitempty"`
PushMagic string `protobuf:"bytes,10,opt,name=push_magic,json=pushMagic" json:"push_magic,omitempty"`
MdmTopic string `protobuf:"bytes,11,opt,name=mdm_topic,json=mdmTopic" json:"mdm_topic,omitempty"`
UnlockToken string `protobuf:"bytes,12,opt,name=unlock_token,json=unlockToken" json:"unlock_token,omitempty"`
Enrolled bool `protobuf:"varint,13,opt,name=enrolled" json:"enrolled,omitempty"`
AwaitingConfiguration bool `protobuf:"varint,14,opt,name=awaiting_configuration,json=awaitingConfiguration" json:"awaiting_configuration,omitempty"`
DeviceName string `protobuf:"bytes,15,opt,name=device_name,json=deviceName" json:"device_name,omitempty"`
Model string `protobuf:"bytes,16,opt,name=model" json:"model,omitempty"`
ModelName string `protobuf:"bytes,17,opt,name=model_name,json=modelName" json:"model_name,omitempty"`
Description string `protobuf:"bytes,18,opt,name=description" json:"description,omitempty"`
Color string `protobuf:"bytes,19,opt,name=color" json:"color,omitempty"`
AssetTag string `protobuf:"bytes,20,opt,name=asset_tag,json=assetTag" json:"asset_tag,omitempty"`
DepDevice bool `protobuf:"varint,21,opt,name=dep_device,json=depDevice" json:"dep_device,omitempty"`
DepProfileStatus string `protobuf:"bytes,22,opt,name=dep_profile_status,json=depProfileStatus" json:"dep_profile_status,omitempty"`
DepProfileUuid string `protobuf:"bytes,23,opt,name=dep_profile_uuid,json=depProfileUuid" json:"dep_profile_uuid,omitempty"`
DepProfileAssignTime int64 `protobuf:"varint,24,opt,name=dep_profile_assign_time,json=depProfileAssignTime" json:"dep_profile_assign_time,omitempty"`
DepProfilePushTime int64 `protobuf:"varint,25,opt,name=dep_profile_push_time,json=depProfilePushTime" json:"dep_profile_push_time,omitempty"`
DepProfileAssignedDate int64 `protobuf:"varint,26,opt,name=dep_profile_assigned_date,json=depProfileAssignedDate" json:"dep_profile_assigned_date,omitempty"`
DepProfileAssignedBy string `protobuf:"bytes,27,opt,name=dep_profile_assigned_by,json=depProfileAssignedBy" json:"dep_profile_assigned_by,omitempty"`
LastCheckIn int64 `protobuf:"varint,28,opt,name=last_check_in,json=lastCheckIn" json:"last_check_in,omitempty"`
LastQueryResponse []byte `protobuf:"bytes,29,opt,name=last_query_response,json=lastQueryResponse,proto3" json:"last_query_response,omitempty"`
}
func (m *Device) Reset() { *m = Device{} }
func (m *Device) String() string { return proto.CompactTextString(m) }
func (*Device) ProtoMessage() {}
func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Device) GetUuid() string {
if m != nil {
return m.Uuid
}
return ""
}
func (m *Device) GetUdid() string {
if m != nil {
return m.Udid
}
return ""
}
func (m *Device) GetSerialNumber() string {
if m != nil {
return m.SerialNumber
}
return ""
}
func (m *Device) GetOsVersion() string {
if m != nil {
return m.OsVersion
}
return ""
}
func (m *Device) GetBuildVersion() string {
if m != nil {
return m.BuildVersion
}
return ""
}
func (m *Device) GetProductName() string {
if m != nil {
return m.ProductName
}
return ""
}
func (m *Device) GetImei() string {
if m != nil {
return m.Imei
}
return ""
}
func (m *Device) GetMeid() string {
if m != nil {
return m.Meid
}
return ""
}
func (m *Device) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
func (m *Device) GetPushMagic() string {
if m != nil {
return m.PushMagic
}
return ""
}
func (m *Device) GetMdmTopic() string {
if m != nil {
return m.MdmTopic
}
return ""
}
func (m *Device) GetUnlockToken() string {
if m != nil {
return m.UnlockToken
}
return ""
}
func (m *Device) GetEnrolled() bool {
if m != nil {
return m.Enrolled
}
return false
}
func (m *Device) GetAwaitingConfiguration() bool {
if m != nil {
return m.AwaitingConfiguration
}
return false
}
func (m *Device) GetDeviceName() string {
if m != nil {
return m.DeviceName
}
return ""
}
func (m *Device) GetModel() string {
if m != nil {
return m.Model
}
return ""
}
func (m *Device) GetModelName() string {
if m != nil {
return m.ModelName
}
return ""
}
func (m *Device) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *Device) GetColor() string {
if m != nil {
return m.Color
}
return ""
}
func (m *Device) GetAssetTag() string {
if m != nil {
return m.AssetTag
}
return ""
}
func (m *Device) GetDepDevice() bool {
if m != nil {
return m.DepDevice
}
return false
}
func (m *Device) GetDepProfileStatus() string {
if m != nil {
return m.DepProfileStatus
}
return ""
}
func (m *Device) GetDepProfileUuid() string {
if m != nil {
return m.DepProfileUuid
}
return ""
}
func (m *Device) GetDepProfileAssignTime() int64 {
if m != nil {
return m.DepProfileAssignTime
}
return 0
}
func (m *Device) GetDepProfilePushTime() int64 {
if m != nil {
return m.DepProfilePushTime
}
return 0
}
func (m *Device) GetDepProfileAssignedDate() int64 {
if m != nil {
return m.DepProfileAssignedDate
}
return 0
}
func (m *Device) GetDepProfileAssignedBy() string {
if m != nil {
return m.DepProfileAssignedBy
}
return ""
}
func (m *Device) GetLastCheckIn() int64 {
if m != nil {
return m.LastCheckIn
}
return 0
}
func (m *Device) GetLastQueryResponse() []byte {
if m != nil {
return m.LastQueryResponse
}
return nil
}
func init() {
proto.RegisterType((*Device)(nil), "deviceproto.Device")
}
func init() { proto.RegisterFile("device.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 565 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0x4f, 0x6f, 0x13, 0x31,
0x10, 0xc5, 0x15, 0xda, 0xa6, 0x89, 0x93, 0x94, 0xd4, 0x4d, 0x52, 0xb7, 0xa5, 0x22, 0x94, 0x4b,
0x0e, 0xa8, 0x12, 0x42, 0x3d, 0x70, 0x84, 0xf6, 0xc2, 0x81, 0xaa, 0x84, 0xc0, 0xd5, 0x72, 0xd6,
0xd3, 0x8d, 0x95, 0xb5, 0xbd, 0xf8, 0x4f, 0x51, 0xbe, 0x3c, 0x42, 0x1e, 0xa7, 0x4d, 0x44, 0xb9,
0x79, 0x7e, 0xf3, 0xde, 0x78, 0x66, 0xd6, 0x5a, 0xd2, 0x95, 0xf0, 0xa0, 0x0a, 0xb8, 0xac, 0x9d,
0x0d, 0x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0b, 0x34, 0x9d, 0xa0, 0x89, 0x6e, 0x4c, 0x77, 0xd1, 0x2f, 0xd0, 0xf2, 0x91,
0x9c, 0x3c, 0xbf, 0x09, 0x24, 0x97, 0x22, 0x00, 0x3b, 0x45, 0xdb, 0xe8, 0xdf, 0xbb, 0x40, 0xde,
0x88, 0x00, 0xff, 0x6f, 0x12, 0x24, 0x9f, 0xaf, 0xd8, 0x19, 0x4e, 0x35, 0x78, 0x6e, 0xfc, 0xbc,
0xa2, 0x17, 0xa4, 0x57, 0x09, 0x1f, 0x78, 0xb1, 0x80, 0x62, 0xc9, 0x95, 0x61, 0xaf, 0xf0, 0x96,
0x4e, 0x82, 0xd7, 0x89, 0x7d, 0x31, 0xf4, 0x92, 0x1c, 0xa1, 0xe6, 0x57, 0x04, 0xb7, 0xe2, 0x0e,
0x7c, 0x6d, 0x8d, 0x07, 0x76, 0x3e, 0x6e, 0x4c, 0xba, 0xd3, 0xc3, 0x94, 0xfa, 0x96, 0x32, 0xd3,
0x75, 0x62, 0xde, 0xc4, 0xff, 0xc0, 0x87, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x53, 0xe5,
0xaa, 0x24, 0x04, 0x00, 0x00,
}

View File

@@ -0,0 +1,37 @@
syntax = "proto3";
package deviceproto;
message Device {
string uuid = 1;
string udid = 2;
string serial_number = 3;
string os_version = 4;
string build_version = 5;
string product_name = 6;
string imei = 7;
string meid = 8;
string token = 9;
string push_magic = 10;
string mdm_topic = 11;
string unlock_token = 12;
bool enrolled = 13;
bool awaiting_configuration = 14;
string device_name = 15;
string model = 16;
string model_name =17;
string description =18;
string color =19;
string asset_tag =20;
bool dep_device =21;
string dep_profile_status =22;
string dep_profile_uuid =23;
int64 dep_profile_assign_time =24;
int64 dep_profile_push_time =25;
int64 dep_profile_assigned_date =26;
string dep_profile_assigned_by =27;
int64 last_check_in =28;
bytes last_query_response =29;
}