add OK and FAIL types

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-24 06:43:58 +00:00
parent f8a1a95310
commit 1e9df6046f
3 changed files with 72 additions and 46 deletions

View File

@ -33,19 +33,21 @@ const (
Event_GET Event_EventType = 7 Event_GET Event_EventType = 7
Event_LOGIN Event_EventType = 8 Event_LOGIN Event_EventType = 8
Event_OK Event_EventType = 9 Event_OK Event_EventType = 9
Event_FAIL Event_EventType = 10
) )
var Event_EventType_name = map[int32]string{ var Event_EventType_name = map[int32]string{
0: "ADD", 0: "ADD",
1: "DELETE", 1: "DELETE",
2: "POWERON", 2: "POWERON",
3: "POWEROFF", 3: "POWEROFF",
4: "HIBERNATE", 4: "HIBERNATE",
5: "MIGRATE", 5: "MIGRATE",
6: "DEMO", 6: "DEMO",
7: "GET", 7: "GET",
8: "LOGIN", 8: "LOGIN",
9: "OK", 9: "OK",
10: "FAIL",
} }
var Event_EventType_value = map[string]int32{ var Event_EventType_value = map[string]int32{
@ -59,6 +61,7 @@ var Event_EventType_value = map[string]int32{
"GET": 7, "GET": 7,
"LOGIN": 8, "LOGIN": 8,
"OK": 9, "OK": 9,
"FAIL": 10,
} }
func (x Event_EventType) String() string { func (x Event_EventType) String() string {
@ -436,39 +439,39 @@ func init() {
func init() { proto.RegisterFile("events.proto", fileDescriptor_8f22242cb04491f9) } func init() { proto.RegisterFile("events.proto", fileDescriptor_8f22242cb04491f9) }
var fileDescriptor_8f22242cb04491f9 = []byte{ var fileDescriptor_8f22242cb04491f9 = []byte{
// 536 bytes of a gzipped FileDescriptorProto // 542 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6e, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x4d, 0x6f, 0xd3, 0x40,
0x18, 0xc4, 0x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dc, 0xce, 0xe3,
0xbb, 0x5a, 0x39, 0x1a, 0xde, 0x12, 0x0d, 0x3c, 0x14, 0x82, 0x3b, 0x48, 0x47, 0x93, 0xd8, 0xd7, 0xd0, 0x56, 0xca, 0x71, 0x32, 0x24, 0x0a, 0x38, 0xc8, 0x07, 0x7b, 0x10, 0x8f, 0xa7, 0xa1, 0xab,
0xff, 0x7a, 0x9b, 0xce, 0xe2, 0x00, 0x45, 0xe0, 0xdd, 0x4d, 0x6e, 0x87, 0xe3, 0x38, 0x44, 0x3e, 0xfe, 0x75, 0x18, 0xcf, 0x43, 0x0f, 0x05, 0xe0, 0x8c, 0xa6, 0xc3, 0x64, 0x12, 0xfa, 0xc8, 0x05,
0xd8, 0x93, 0x4f, 0x71, 0x34, 0xf7, 0xcd, 0xd7, 0xfd, 0xf6, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73, 0xfa, 0x29, 0x0c, 0x94, 0xea, 0xee, 0x36, 0x19, 0x85, 0xb0, 0x70, 0xf5, 0x87, 0xfe, 0xf6,
0x4a, 0xac, 0x74, 0xbe, 0xed, 0x03, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xa5, 0x22, 0xd5, 0xf8, 0x03, 0x00, 0x00,
} }

View File

@ -25,6 +25,7 @@ message Event {
GET = 7; // request something GET = 7; // request something
LOGIN = 8; // attempt to login LOGIN = 8; // attempt to login
OK = 9; // everything is ok OK = 9; // everything is ok
FAIL = 10; // everything failed
} }
message Response { message Response {

View File

@ -83,7 +83,7 @@ func MakeOkResponse() *Event {
e := &Event{ e := &Event{
Id: 1234, Id: 1234,
Email: "test+protobuf@wit.com", Email: "test+protobuf@wit.com",
Comment: "this is a sample event", Comment: "everything is OK",
Type: Event_OK, Type: Event_OK,
Results: []*Event_Response{ Results: []*Event_Response{
{Name: "fooadd", Type: Event_OK}, {Name: "fooadd", Type: Event_OK},
@ -98,3 +98,25 @@ func MakeOkResponse() *Event {
} }
return e return e
} }
func MakeFailResponse() *Event {
log.Println("CreateSampleEvent() is generating a example protobuf Event")
e := &Event{
Id: 1234,
Email: "test+protobuf@wit.com",
Comment: "something failed",
Type: Event_FAIL,
Results: []*Event_Response{
{Name: "fooadd", Type: Event_FAIL},
{Name: "foodelete", Type: Event_DELETE},
{
Name: "foopoweron",
Type: Event_POWERON,
Error: "No error happened",
Id: 54321,
},
},
}
return e
}