github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/edge/pkg/devicetwin/dtcommon/common.go (about)

     1  package dtcommon
     2  
     3  import "time"
     4  
     5  const (
     6  	// RetryTimes for retry times
     7  	RetryTimes = 5
     8  	// RetryInterval for retry interval
     9  	RetryInterval = 10 * time.Second
    10  
    11  	// LifeCycleConnectETPrefix the topic prefix for connected event
    12  	LifeCycleConnectETPrefix = "$hw/events/connected/"
    13  	// LifeCycleDisconnectETPrefix the topic prefix for disconnected event
    14  	LifeCycleDisconnectETPrefix = "$hw/events/disconnected/"
    15  
    16  	// MemETPrefix the topic prefix for membership event
    17  	MemETPrefix = "$hw/events/node/"
    18  	// MemETUpdateSuffix the topic suffix for membership updated event
    19  	MemETUpdateSuffix = "/membership/updated"
    20  	// MemETDetailSuffix the topic suffix for membership detail
    21  	MemETDetailSuffix = "/membership/detail"
    22  	// MemETDetailResultSuffix the topic suffix for membership detail event
    23  	MemETDetailResultSuffix = "/membership/detail/result"
    24  	// MemETGetSuffix the topic suffix for membership get
    25  	MemETGetSuffix = "/membership/get"
    26  	// MemETGetResultSuffix the topic suffix for membership get event
    27  	MemETGetResultSuffix = "/membership/get/result"
    28  
    29  	// DeviceETPrefix the topic prefix for device event
    30  	DeviceETPrefix = "$hw/events/device/"
    31  	// TwinETUpdateSuffix the topic suffix for twin update event
    32  	TwinETUpdateSuffix = "/twin/update"
    33  	// TwinETUpdateResultSuffix the topic suffix for twin update result event
    34  	TwinETUpdateResultSuffix = "/twin/update/result"
    35  	// TwinETGetSuffix the topic suffix for twin get
    36  	TwinETGetSuffix = "/twin/get"
    37  	// TwinETGetResultSuffix the topic suffix for twin get event
    38  	TwinETGetResultSuffix = "/twin/get/result"
    39  	// TwinETCloudSyncSuffix the topic suffix for twin sync event
    40  	TwinETCloudSyncSuffix = "/twin/cloud_updated"
    41  	// TwinETEdgeSyncSuffix the topic suffix for twin sync event
    42  	TwinETEdgeSyncSuffix = "/twin/edge_updated"
    43  	// TwinETDeltaSuffix the topic suffix for twin delta event
    44  	TwinETDeltaSuffix = "/twin/update/delta"
    45  	// TwinETDocumentSuffix the topic suffix for twin document event
    46  	TwinETDocumentSuffix = "/twin/update/document"
    47  
    48  	// DeviceETUpdatedSuffix the topic suffix for device updated event
    49  	DeviceETUpdatedSuffix = "/updated"
    50  	// DeviceETStateUpdateSuffix the topic suffix for device state update event
    51  	DeviceETStateUpdateSuffix = "/state/update"
    52  	// DeviceETStateGetSuffix the topipc suffix for device state get event
    53  	DeviceETStateGetSuffix = "/state/get"
    54  
    55  	// MemDetailResult membership detail result
    56  	MemDetailResult = "MemDetailResult"
    57  	// MemDetail membership detail
    58  	MemDetail = "MemDetail"
    59  	// MemGet get
    60  	MemGet = "MemGet"
    61  	// MemUpdated membership updated
    62  	MemUpdated = "MemUpdated"
    63  
    64  	// TwinGet get twin
    65  	TwinGet = "TwinGet"
    66  	// TwinUpdate twin update
    67  	TwinUpdate = "TwinUpdate"
    68  	// TwinCloudSync twin cloud sync
    69  	TwinCloudSync = "TwinCloudSync"
    70  	// TwinEdgeSync twin edge sync
    71  	TwinEdgeSync = "TwinEdgeSync"
    72  
    73  	// DeviceUpdated device attributes update
    74  	DeviceUpdated = "DeviceUpdated"
    75  	// DeviceStateGet device state get
    76  	DeviceStateGet = "DeviceStateGet"
    77  	// DeviceStateUpdate device state update
    78  	DeviceStateUpdate = "DeviceStateUpdate"
    79  
    80  	// SendToEdge send info to edge
    81  	SendToEdge = "SendToEdge"
    82  	// SendToCloud send info to cloud
    83  	SendToCloud = "SendToCloud"
    84  	// LifeCycle life cycle
    85  	LifeCycle = "LifeCycle"
    86  	// Connected event
    87  	Connected = "connected"
    88  	// Confirm event
    89  	Confirm = "Confirm"
    90  	// Disconnected event
    91  	Disconnected = "disconnected"
    92  
    93  	// CommModule communicate module
    94  	CommModule = "CommModule"
    95  	// DeviceModule device module
    96  	DeviceModule = "DeviceModule"
    97  	// MemModule membership module
    98  	MemModule = "MemModule"
    99  	// TwinModule twin module
   100  	TwinModule = "TwinModule"
   101  	// HubModule the name of hub module
   102  	HubModule = "websocket"
   103  	// EventHubModule the name of event hub module
   104  	EventHubModule = "eventbus"
   105  	// DeviceTwinModule the name of twin module
   106  	DeviceTwinModule = "twin"
   107  
   108  	// BadRequestCode bad request
   109  	BadRequestCode = 400
   110  	// NotFoundCode device not found
   111  	NotFoundCode = 404
   112  	// ConflictCode version conflict
   113  	ConflictCode = 409
   114  	// InternalErrorCode server internal error
   115  	InternalErrorCode = 500
   116  )