diff --git a/core/main.go b/core/main.go index 1a3e0f4de..a555c990b 100644 --- a/core/main.go +++ b/core/main.go @@ -74,11 +74,7 @@ func deployCoreServices(cfg *config.Config, sdk *enginesdk.SDK) error { } } logrus.WithField("module", "main").Infof("Service %q deployed with hash %q", srv.Sid, srv.Hash) - hsh, err := hash.Decode(srv.Hash) - if err != nil { - return err - } - instance, err := sdk.Instance.Create(hsh, xos.EnvMapToSlice(serviceConfig.Env)) + instance, err := sdk.Instance.Create(srv.Hash, xos.EnvMapToSlice(serviceConfig.Env)) if err != nil { existsError, ok := err.(*instancesdk.AlreadyExistsError) if ok { diff --git a/database/service_db.go b/database/service_db.go index 80f2672bc..3932ebc40 100644 --- a/database/service_db.go +++ b/database/service_db.go @@ -84,21 +84,14 @@ func (d *ServiceDB) Get(hash hash.Hash) (*service.Service, error) { // Save stores service in database. // If there is an another service that uses the same sid, it'll be deleted. func (d *ServiceDB) Save(s *service.Service) error { - if s.Hash == "" { - return errCannotSaveWithoutHash - } - h, err := hash.Decode(s.Hash) - if err != nil { - return err - } - if h.IsZero() { + if len(s.Hash) == 0 { return errCannotSaveWithoutHash } b, err := d.marshal(s) if err != nil { return err } - return d.s.Put(h, b) + return d.s.Put(s.Hash, b) } // Close closes database. diff --git a/database/service_db_test.go b/database/service_db_test.go index d12e55652..a58fcc065 100644 --- a/database/service_db_test.go +++ b/database/service_db_test.go @@ -32,7 +32,7 @@ func TestServiceDBSave(t *testing.T) { db, closer := openServiceDB(t) defer closer() - s1 := &service.Service{Hash: hash.Int(1).String()} + s1 := &service.Service{Hash: hash.Int(1)} require.NoError(t, db.Save(s1)) // save same service. should replace @@ -41,7 +41,7 @@ func TestServiceDBSave(t *testing.T) { require.Len(t, ss, 1) // different hash, different sid. should not replace anything. - s3 := &service.Service{Hash: hash.Int(2).String()} + s3 := &service.Service{Hash: hash.Int(2)} require.NoError(t, db.Save(s3)) ss, _ = db.All() require.Len(t, ss, 2) @@ -56,7 +56,7 @@ func TestServiceDBGet(t *testing.T) { hs1 := hash.Int(1) - want := &service.Service{Hash: hs1.String()} + want := &service.Service{Hash: hs1} require.NoError(t, db.Save(want)) defer db.Delete(hs1) @@ -77,7 +77,7 @@ func TestServiceDBDelete(t *testing.T) { hs1 := hash.Int(1) // hash. - s := &service.Service{Hash: hs1.String()} + s := &service.Service{Hash: hs1} require.NoError(t, db.Save(s)) require.NoError(t, db.Delete(hs1)) _, err := db.Get(hs1) @@ -92,7 +92,7 @@ func TestServiceDBDeleteConcurrency(t *testing.T) { defer closer() hs1 := hash.Int(1) - s := &service.Service{Hash: hs1.String()} + s := &service.Service{Hash: hs1} db.Save(s) var wg sync.WaitGroup @@ -126,8 +126,8 @@ func TestServiceDBAll(t *testing.T) { hs1 := hash.Int(1) hs2 := hash.Int(2) - s1 := &service.Service{Hash: hs1.String()} - s2 := &service.Service{Hash: hs2.String()} + s1 := &service.Service{Hash: hs1} + s2 := &service.Service{Hash: hs2} require.NoError(t, db.Save(s1)) require.NoError(t, db.Save(s2)) diff --git a/hash/hash.go b/hash/hash.go index 50b371690..125558e92 100644 --- a/hash/hash.go +++ b/hash/hash.go @@ -18,7 +18,6 @@ var DefaultHash = sha256.New // size is a default size for hashing algorithm. var size = DefaultHash().Size() -var base58size = len(Dump(0).String()) // Digest represents the partial evaluation of a checksum. type Digest struct { @@ -36,7 +35,7 @@ func (d *Digest) WriteObject(v interface{}) (int, error) { return d.Write(structhash.Dump(v, 0)) } -// A Hash is a type for representing hash with base58 encode and decode functions. +// A Hash is a type for representing common hash. type Hash []byte // New returns new hash from a given integer. @@ -76,25 +75,12 @@ func Random() (Hash, error) { return hash, nil } -// Decode decodes the base58 encoded hash. It returns error -// when a hash isn't base58,encoded or hash length is invalid. -func Decode(h string) (Hash, error) { - hash, err := base58.Decode(h) - if err != nil { - return nil, fmt.Errorf("hash: %s", err) - } - if len(hash) != size { - return nil, fmt.Errorf("hash: invalid length string") - } - return Hash(hash), nil -} - // IsZero reports whethere h represents empty hash. func (h Hash) IsZero() bool { return len(h) == 0 } -// String returns the base58 hash representation. +// String returns the hash hex representation. func (h Hash) String() string { return base58.Encode(h) } @@ -104,18 +90,14 @@ func (h Hash) Equal(h1 Hash) bool { return bytes.Equal(h, h1) } -// Marshal marshals hash into slice of base58 bytes. It's used by protobuf. +// Marshal marshals hash into slice of bytes. It's used by protobuf. func (h Hash) Marshal() ([]byte, error) { - return []byte(base58.Encode(h)), nil + return h, nil } -// Unmarshal unmarshals slice of base58 bytes into hash. It's used by protobuf. +// Unmarshal unmarshals slice of bytes into hash. It's used by protobuf. func (h *Hash) Unmarshal(data []byte) error { - h1, err := Decode(string(data)) - if err != nil { - return err - } - *h = h1 + *h = data return nil } @@ -124,29 +106,15 @@ func (h Hash) Size() int { if len(h) == 0 { return 0 } - return base58size + return size } -// MarshalJSON mashals hash into base58 encoded json string. +// MarshalJSON mashals hash into encoded json string. func (h Hash) MarshalJSON() ([]byte, error) { - return json.Marshal(base58.Encode(h)) + return json.Marshal([]byte(h)) } -// UnmarshalJSON unmashals base58 encoded json string into hash. +// UnmarshalJSON unmashals hex encoded json string into hash. func (h *Hash) UnmarshalJSON(data []byte) error { - var str string - if err := json.Unmarshal(data, &str); err != nil { - return err - } - - if str == "" { - return nil - } - - h1, err := Decode(str) - if err != nil { - return err - } - *h = h1 - return nil + return json.Unmarshal(data, (*[]byte)(h)) } diff --git a/hash/hash_test.go b/hash/hash_test.go index d53a87478..6d31374e2 100644 --- a/hash/hash_test.go +++ b/hash/hash_test.go @@ -9,10 +9,8 @@ import ( ) var ( - zero = Int(0) - one = Int(1) - oneStr = "4uQeVj5tqViQh7yWWGStvkEG1Zmhx6uasJtWCJziofM" - oneJSONStr = "\"" + oneStr + "\"" + zero = Int(0) + one = Int(1) ) func TestDigest(t *testing.T) { @@ -21,9 +19,6 @@ func TestDigest(t *testing.T) { hash := d.Sum(nil) assert.Equal(t, hash.String(), "8RBsoeyoRwajj86MZfZE6gMDJQVYGYcdSfx1zxqxNHbr") - - _, err := Decode(hash.String()) - assert.NoError(t, err) } func TestDump(t *testing.T) { @@ -55,24 +50,12 @@ func TestRandom(t *testing.T) { require.NoError(t, quick.Check(f, nil)) } -func TestDecode(t *testing.T) { - hash, err := Decode(oneStr) - assert.NoError(t, err) - assert.Equal(t, hash, one) - - _, err = Decode("0") - assert.Equal(t, "hash: invalid base58 digit ('0')", err.Error()) - - _, err = Decode("1") - assert.Equal(t, "hash: invalid length string", err.Error()) -} - func TestIsZero(t *testing.T) { assert.True(t, Hash{}.IsZero()) } func TestString(t *testing.T) { - assert.Equal(t, one.String(), oneStr) + assert.Equal(t, one.String(), "4uQeVj5tqViQh7yWWGStvkEG1Zmhx6uasJtWCJziofM") } func TestEqual(t *testing.T) { @@ -80,31 +63,7 @@ func TestEqual(t *testing.T) { assert.False(t, zero.Equal(one)) } -func TestMarshal(t *testing.T) { - b, err := one.Marshal() - assert.NoError(t, err) - assert.Equal(t, oneStr, string(b)) -} - -func TestUnmarshal(t *testing.T) { - var h Hash - assert.NoError(t, h.Unmarshal([]byte(oneStr))) - assert.Equal(t, one, h) -} - func TestSize(t *testing.T) { assert.Equal(t, 0, Hash(nil).Size()) - assert.Equal(t, base58size, zero.Size()) -} - -func TestMarshalJSON(t *testing.T) { - b, err := one.MarshalJSON() - assert.NoError(t, err) - assert.Equal(t, oneJSONStr, string(b)) -} - -func TestUnmarshalJSON(t *testing.T) { - var h Hash - assert.NoError(t, h.UnmarshalJSON([]byte(oneJSONStr))) - assert.Equal(t, one, h) + assert.Equal(t, size, zero.Size()) } diff --git a/protobuf/api/event.pb.go b/protobuf/api/event.pb.go index b22f14eb2..00e9e23ca 100644 --- a/protobuf/api/event.pb.go +++ b/protobuf/api/event.pb.go @@ -70,9 +70,9 @@ func (m *StreamEventRequest) GetFilter() *StreamEventRequest_Filter { // Filter contains filtering criteria. type StreamEventRequest_Filter struct { // hash to filter events. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // instance's hash to filter events. - InstanceHash string `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // key is the key of the event. Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -105,18 +105,18 @@ func (m *StreamEventRequest_Filter) XXX_DiscardUnknown() { var xxx_messageInfo_StreamEventRequest_Filter proto.InternalMessageInfo -func (m *StreamEventRequest_Filter) GetHash() string { +func (m *StreamEventRequest_Filter) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } -func (m *StreamEventRequest_Filter) GetInstanceHash() string { +func (m *StreamEventRequest_Filter) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *StreamEventRequest_Filter) GetKey() string { @@ -129,7 +129,7 @@ func (m *StreamEventRequest_Filter) GetKey() string { // CreateEventRequest defines request for execution update. type CreateEventRequest struct { // instanceHash is hash of instance that can proceed an execution. - InstanceHash string `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // key is the key of the event. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // data is the data for the event. @@ -164,11 +164,11 @@ func (m *CreateEventRequest) XXX_DiscardUnknown() { var xxx_messageInfo_CreateEventRequest proto.InternalMessageInfo -func (m *CreateEventRequest) GetInstanceHash() string { +func (m *CreateEventRequest) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *CreateEventRequest) GetKey() string { @@ -188,7 +188,7 @@ func (m *CreateEventRequest) GetData() *_struct.Struct { // CreateEventResponse defines response for execution update. type CreateEventResponse struct { // Hash represents event. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -219,11 +219,11 @@ func (m *CreateEventResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateEventResponse proto.InternalMessageInfo -func (m *CreateEventResponse) GetHash() string { +func (m *CreateEventResponse) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } func init() { @@ -236,25 +236,26 @@ func init() { func init() { proto.RegisterFile("protobuf/api/event.proto", fileDescriptor_c0ad091fa003d2ac) } var fileDescriptor_c0ad091fa003d2ac = []byte{ - // 287 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x51, 0xcd, 0x4a, 0xc3, 0x40, - 0x10, 0x6e, 0xda, 0x1a, 0x70, 0xda, 0x83, 0x8c, 0x87, 0x86, 0x45, 0x44, 0xf6, 0xa4, 0x08, 0x5b, - 0x69, 0xc1, 0x9b, 0x27, 0x51, 0x3c, 0xc7, 0x27, 0xd8, 0xc6, 0x69, 0x1b, 0xac, 0xc9, 0x9a, 0x9d, - 0x28, 0xc5, 0x97, 0xf1, 0x51, 0x25, 0x93, 0x18, 0x8c, 0xd1, 0xdb, 0xf0, 0xfd, 0xed, 0xcc, 0xb7, - 0x10, 0xb9, 0x22, 0xe7, 0x7c, 0x55, 0xae, 0xe7, 0xd6, 0xa5, 0x73, 0x7a, 0xa3, 0x8c, 0x8d, 0x40, - 0x38, 0xb2, 0x2e, 0x55, 0x27, 0x9b, 0x3c, 0xdf, 0xec, 0x68, 0xde, 0xaa, 0x3c, 0x17, 0x65, 0xd2, - 0x48, 0x94, 0x6a, 0x61, 0xde, 0x3b, 0xf2, 0x3f, 0xed, 0xfa, 0x33, 0x00, 0x7c, 0xe4, 0x82, 0xec, - 0xcb, 0x5d, 0x85, 0xc6, 0xf4, 0x5a, 0x92, 0x67, 0xbc, 0x86, 0x70, 0x9d, 0xee, 0x98, 0x8a, 0x28, - 0x38, 0x0b, 0xce, 0x27, 0x8b, 0x53, 0x63, 0x5d, 0x6a, 0xfa, 0x42, 0x73, 0x2f, 0xaa, 0xb8, 0x51, - 0xab, 0x18, 0xc2, 0x1a, 0x41, 0x84, 0xf1, 0xd6, 0xfa, 0xad, 0xf8, 0x0f, 0x63, 0x99, 0x51, 0xc3, - 0x34, 0xcd, 0x3c, 0xdb, 0x2c, 0xa1, 0x87, 0x8a, 0x1b, 0x0a, 0xd7, 0xc1, 0xf0, 0x08, 0x46, 0xcf, - 0xb4, 0x8f, 0x46, 0x42, 0x55, 0xa3, 0x7e, 0x07, 0xbc, 0x2d, 0xc8, 0x32, 0x75, 0x36, 0xfc, 0x9d, - 0x15, 0xfc, 0x9f, 0x35, 0x6c, 0xb3, 0xf0, 0x12, 0xc6, 0x4f, 0x96, 0xad, 0xc4, 0x4f, 0x16, 0x33, - 0x53, 0xf7, 0x66, 0xbe, 0x0b, 0xaa, 0x2e, 0x2c, 0x13, 0x8e, 0x45, 0xa4, 0x2f, 0xe0, 0xb8, 0xf3, - 0xb0, 0x77, 0x79, 0xe6, 0xe9, 0xaf, 0xcb, 0x16, 0x1f, 0x70, 0x20, 0x22, 0xbc, 0x81, 0xb0, 0xf6, - 0xe0, 0x4c, 0x2a, 0xeb, 0x6f, 0xae, 0xa2, 0x3e, 0x51, 0x27, 0xeb, 0x01, 0x2e, 0x21, 0xac, 0x4b, - 0x6e, 0xec, 0xfd, 0xc6, 0xd5, 0xd4, 0xc8, 0x2f, 0x1a, 0x01, 0xf5, 0xe0, 0x2a, 0x58, 0x85, 0xb2, - 0xfe, 0xf2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x68, 0x3c, 0x8a, 0x99, 0x25, 0x02, 0x00, 0x00, + // 293 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74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b5, 0xe1, 0xef, 0x2c, 0xf1, 0x7f, 0x56, 0xbf, 0xc9, 0xc2, 0x4b, 0x18, 0x3e, 0xd9, + 0x60, 0x39, 0x7e, 0xb4, 0x98, 0xe8, 0xaa, 0x37, 0xfd, 0x5d, 0x50, 0x79, 0x61, 0xb1, 0x0e, 0x86, + 0x21, 0x75, 0x01, 0xa7, 0xad, 0x0f, 0x7b, 0x97, 0xa5, 0x9e, 0xfe, 0xba, 0x6c, 0xf1, 0x01, 0x47, + 0x0c, 0xe1, 0x0d, 0x44, 0x95, 0x07, 0x27, 0x5c, 0x59, 0x77, 0x73, 0x19, 0x77, 0x07, 0x55, 0xb2, + 0xea, 0xe1, 0x12, 0xa2, 0xaa, 0xe4, 0xda, 0xde, 0x6d, 0x5c, 0x8e, 0x35, 0xff, 0x45, 0xcd, 0xa2, + 0xea, 0x5d, 0x89, 0x55, 0xc4, 0xeb, 0x2f, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xca, 0x30, + 0x0e, 0x25, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/api/event.proto b/protobuf/api/event.proto index e8920bf0e..0b765195c 100644 --- a/protobuf/api/event.proto +++ b/protobuf/api/event.proto @@ -24,10 +24,10 @@ message StreamEventRequest { // Filter contains filtering criteria. message Filter { // hash to filter events. - string hash = 1; + bytes hash = 1; // instance's hash to filter events. - string instanceHash = 2; + bytes instanceHash = 2; // key is the key of the event. string key = 3; @@ -40,7 +40,7 @@ message StreamEventRequest { // CreateEventRequest defines request for execution update. message CreateEventRequest { // instanceHash is hash of instance that can proceed an execution. - string instanceHash = 1; + bytes instanceHash = 1; // key is the key of the event. string key = 2; @@ -52,5 +52,5 @@ message CreateEventRequest { // CreateEventResponse defines response for execution update. message CreateEventResponse { // Hash represents event. - string hash = 1; + bytes hash = 1; } diff --git a/protobuf/api/execution.pb.go b/protobuf/api/execution.pb.go index e5b3c9771..840dd060d 100644 --- a/protobuf/api/execution.pb.go +++ b/protobuf/api/execution.pb.go @@ -28,7 +28,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // CreateExecutionRequest defines request to create a single execution. type CreateExecutionRequest struct { - InstanceHash string `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` TaskKey string `protobuf:"bytes,2,opt,name=taskKey,proto3" json:"taskKey,omitempty"` Inputs *_struct.Struct `protobuf:"bytes,3,opt,name=inputs,proto3" json:"inputs,omitempty"` Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"` @@ -62,11 +62,11 @@ func (m *CreateExecutionRequest) XXX_DiscardUnknown() { var xxx_messageInfo_CreateExecutionRequest proto.InternalMessageInfo -func (m *CreateExecutionRequest) GetInstanceHash() string { +func (m *CreateExecutionRequest) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *CreateExecutionRequest) GetTaskKey() string { @@ -93,7 +93,7 @@ func (m *CreateExecutionRequest) GetTags() []string { // CreateExecutionResponse defines response for execution creation. type CreateExecutionResponse struct { // Execution's hash. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -124,17 +124,17 @@ func (m *CreateExecutionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateExecutionResponse proto.InternalMessageInfo -func (m *CreateExecutionResponse) GetHash() string { +func (m *CreateExecutionResponse) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // GetExecutionRequest defines request to retrieve a single execution. type GetExecutionRequest struct { // Execution's hash to fetch. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -165,11 +165,11 @@ func (m *GetExecutionRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetExecutionRequest proto.InternalMessageInfo -func (m *GetExecutionRequest) GetHash() string { +func (m *GetExecutionRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // StreamExecutionRequest defines request to retrieve a stream of executions. @@ -218,7 +218,7 @@ type StreamExecutionRequest_Filter struct { // Statuses to filter executions. One status needs to be present in the execution. Statuses []types.Status `protobuf:"varint,1,rep,packed,name=statuses,proto3,enum=types.Status" json:"statuses,omitempty"` // Instance's hash to filter executions. - InstanceHash string `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // taskKey to filter executions. TaskKey string `protobuf:"bytes,3,opt,name=taskKey,proto3" json:"taskKey,omitempty"` // tags to filter executions. All tags needs to be present in the execution. @@ -260,11 +260,11 @@ func (m *StreamExecutionRequest_Filter) GetStatuses() []types.Status { return nil } -func (m *StreamExecutionRequest_Filter) GetInstanceHash() string { +func (m *StreamExecutionRequest_Filter) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *StreamExecutionRequest_Filter) GetTaskKey() string { @@ -284,7 +284,7 @@ func (m *StreamExecutionRequest_Filter) GetTags() []string { // UpdateExecutionRequest defines request for execution update. type UpdateExecutionRequest struct { // Hash represents execution. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // result pass to execution // // Types that are valid to be assigned to Result: @@ -321,11 +321,11 @@ func (m *UpdateExecutionRequest) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateExecutionRequest proto.InternalMessageInfo -func (m *UpdateExecutionRequest) GetHash() string { +func (m *UpdateExecutionRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } type isUpdateExecutionRequest_Result interface { @@ -418,35 +418,35 @@ func init() { func init() { proto.RegisterFile("protobuf/api/execution.proto", fileDescriptor_96e2c86581f82f05) } var fileDescriptor_96e2c86581f82f05 = []byte{ - // 433 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x6e, 0x13, 0x31, - 0x14, 0x5c, 0x67, 0xcb, 0xb6, 0x79, 0x05, 0x84, 0x8c, 0x94, 0x2c, 0x4b, 0x84, 0x22, 0x9f, 0xd2, - 0x03, 0x0e, 0x4a, 0x6e, 0x70, 0x03, 0x95, 0x46, 0xe2, 0xb6, 0x11, 0x1f, 0xe0, 0x86, 0xd7, 0x74, - 0x45, 0xd8, 0x35, 0xf6, 0xb3, 0x44, 0xcf, 0x88, 0x13, 0x9f, 0xc0, 0xaf, 0xf1, 0x31, 0xa8, 0xf6, - 0xee, 0xa2, 0xb2, 0xa6, 0x37, 0x7b, 0x66, 0x9e, 0x3d, 0x9e, 0x31, 0xcc, 0xb4, 0x69, 0xa8, 0xb9, - 0x74, 0x57, 0x4b, 0xa5, 0xab, 0x25, 0x7e, 0xc3, 0x9d, 0xa3, 0xaa, 0xa9, 0xa5, 0x87, 0x79, 0xaa, - 0x74, 0x55, 0xcc, 0xf6, 0x4d, 0xb3, 0x3f, 0xe0, 0xb2, 0x57, 0x5a, 0x32, 0x6e, 0x47, 0x41, 0x52, - 0xbc, 0xe8, 0x61, 0xba, 0xd1, 0x68, 0xff, 0x3d, 0x42, 0xfc, 0x62, 0x30, 0x79, 0x67, 0x50, 0x11, - 0x9e, 0x77, 0x4c, 0x89, 0x5f, 0x1d, 0x5a, 0xe2, 0x02, 0x1e, 0x56, 0xb5, 0x25, 0x55, 0xef, 0x70, - 0xa3, 0xec, 0x75, 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e0, 0x67, 0x93, 0x94, 0x61, 0xfb, 0xf6, 0x04, - 0x32, 0x83, 0xd6, 0x1d, 0x48, 0x3c, 0x83, 0xe9, 0xc0, 0x44, 0xa8, 0x6f, 0xf5, 0x73, 0x04, 0xe3, - 0x1e, 0xe5, 0xe7, 0x90, 0x85, 0x9e, 0xf9, 0x73, 0x1f, 0x76, 0xfc, 0x47, 0x16, 0xb3, 0x38, 0x19, - 0x8e, 0x14, 0x09, 0x5f, 0x43, 0x7a, 0x81, 0xc4, 0x73, 0x2f, 0x8b, 0xfc, 0x84, 0xe2, 0x49, 0xdb, - 0x40, 0x4f, 0x88, 0x84, 0xbf, 0x81, 0x2c, 0x74, 0xdb, 0xde, 0x1d, 0x2f, 0x3a, 0x36, 0xfa, 0x8a, - 0xdd, 0x1a, 0x0f, 0x2f, 0x6c, 0x87, 0xe3, 0x99, 0xb7, 0xc6, 0xff, 0x93, 0x85, 0x48, 0x2e, 0x33, - 0x1f, 0xf3, 0xfa, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x21, 0x44, 0x6d, 0xef, 0x03, 0x00, - 0x00, + // 437 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0xe3, 0x66, 0x64, 0xeb, 0xdb, 0x40, 0xc8, 0x48, 0x6d, 0x08, 0x15, 0x8a, 0x7c, 0xca, + 0x0e, 0xb8, 0xa8, 0xbd, 0xc1, 0x0d, 0x34, 0x56, 0x89, 0x9b, 0x2b, 0x3e, 0x80, 0x57, 0xde, 0xba, + 0x88, 0x92, 0x04, 0xfb, 0x45, 0x62, 0x67, 0xc4, 0x89, 0x8f, 0xc0, 0x57, 0xe3, 0xc3, 0xa0, 0xd9, + 0x69, 0xd0, 0x88, 0xd7, 0x9b, 0xfd, 0xde, 0xef, 0xd9, 0x7f, 0xff, 0xff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0x18, 0x96, 0x1f, 0x1c, 0xa9, 0xba, 0x89, 0xec, 0x27, 0x83, 0xc4, 0x97, 0xf8, 0x39, 0x9c, 0x58, + 0xd2, 0xd4, 0x5a, 0xb4, 0x29, 0xcb, 0xe3, 0xe2, 0xc9, 0xe2, 0xb1, 0x74, 0x19, 0xc8, 0xb5, 0x2b, + 0xab, 0xbe, 0x3d, 0x70, 0x7a, 0x74, 0xd8, 0xe9, 0xf8, 0xbe, 0xd3, 0x21, 0xe3, 0x7e, 0x30, 0x98, + 0x7c, 0x6a, 0x3e, 0x87, 0x62, 0x0d, 0xb8, 0xc1, 0x97, 0x70, 0x5c, 0xb7, 0xe4, 0xd2, 0x1a, 0x1d, + 0x4c, 0x6b, 0x15, 0xa9, 0x3d, 0xc9, 0x27, 0xf0, 0x08, 0x8d, 0xa9, 0x8d, 0xd7, 0xb3, 0x8a, 0x94, + 0xdf, 0xbe, 0x3b, 0x81, 0xc4, 0xa0, 0x6d, 0x77, 0x24, 0x9e, 0xc3, 0x74, 0x20, 0xc2, 0xc7, 0xb7, + 0xf8, 0x35, 0x82, 0x71, 0x5f, 0xe5, 0x17, 0x90, 0xf8, 0x9c, 0xf9, 0x0b, 0x67, 0x76, 0xf8, 0x47, + 0x66, 0xb3, 0x70, 0xd3, 0x1f, 0x29, 0x22, 0xbe, 0x84, 0xf8, 0x12, 0x89, 0xa7, 0x0e, 0x0b, 0xfc, + 0x84, 0xec, 0x69, 0x97, 0x40, 0xdf, 0x10, 0x11, 0x7f, 0x0b, 0x89, 0xcf, 0xb6, 0xbb, 0x3b, 0x1c, + 0x74, 0x68, 0xf4, 0x35, 0xbb, 0x13, 0xee, 0x5f, 0xd8, 0x0d, 0x87, 0x3d, 0xef, 0x84, 0x3f, 0xe0, + 0x85, 0x88, 0xae, 0x12, 0x67, 0xf3, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x39, 0x7a, + 0x49, 0xef, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/api/execution.proto b/protobuf/api/execution.proto index b9e1e6ecc..fc1ca26d0 100644 --- a/protobuf/api/execution.proto +++ b/protobuf/api/execution.proto @@ -28,7 +28,7 @@ service Execution { // CreateExecutionRequest defines request to create a single execution. message CreateExecutionRequest { - string instanceHash = 1; + bytes instanceHash = 1; string taskKey = 2; google.protobuf.Struct inputs = 3; repeated string tags = 4; @@ -37,13 +37,13 @@ message CreateExecutionRequest { // CreateExecutionResponse defines response for execution creation. message CreateExecutionResponse { // Execution's hash. - string hash = 1; + bytes hash = 1; } // GetExecutionRequest defines request to retrieve a single execution. message GetExecutionRequest { // Execution's hash to fetch. - string hash = 1; + bytes hash = 1; } // StreamExecutionRequest defines request to retrieve a stream of executions. @@ -54,7 +54,7 @@ message StreamExecutionRequest{ repeated types.Status statuses = 1; // Instance's hash to filter executions. - string instanceHash = 2; + bytes instanceHash = 2; // taskKey to filter executions. string taskKey = 3; @@ -70,7 +70,7 @@ message StreamExecutionRequest{ // UpdateExecutionRequest defines request for execution update. message UpdateExecutionRequest { // Hash represents execution. - string hash = 1; + bytes hash = 1; // result pass to execution oneof result { diff --git a/protobuf/api/instance.pb.go b/protobuf/api/instance.pb.go index 744512ddc..07aa6d571 100644 --- a/protobuf/api/instance.pb.go +++ b/protobuf/api/instance.pb.go @@ -27,7 +27,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // The request's data for the `Get` API. type GetInstanceRequest struct { - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -58,17 +58,17 @@ func (m *GetInstanceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetInstanceRequest proto.InternalMessageInfo -func (m *GetInstanceRequest) GetHash() string { +func (m *GetInstanceRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `List` API. type ListInstancesRequest struct { // Filter by Services' hash. - ServiceHash string `protobuf:"bytes,1,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` + ServiceHash []byte `protobuf:"bytes,1,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -99,11 +99,11 @@ func (m *ListInstancesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ListInstancesRequest proto.InternalMessageInfo -func (m *ListInstancesRequest) GetServiceHash() string { +func (m *ListInstancesRequest) GetServiceHash() []byte { if m != nil { return m.ServiceHash } - return "" + return nil } // The response's data for the `List` API. @@ -150,7 +150,7 @@ func (m *ListInstancesResponse) GetInstances() []*types.Instance { // The request's data for the `Create` API. type CreateInstanceRequest struct { // Service's hash. - ServiceHash string `protobuf:"bytes,1,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` + ServiceHash []byte `protobuf:"bytes,1,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` // Environmental variables to apply to the Instance. Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -183,11 +183,11 @@ func (m *CreateInstanceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_CreateInstanceRequest proto.InternalMessageInfo -func (m *CreateInstanceRequest) GetServiceHash() string { +func (m *CreateInstanceRequest) GetServiceHash() []byte { if m != nil { return m.ServiceHash } - return "" + return nil } func (m *CreateInstanceRequest) GetEnv() []string { @@ -200,7 +200,7 @@ func (m *CreateInstanceRequest) GetEnv() []string { // The response's data for the `Create` API. type CreateInstanceResponse struct { // The instance's hash created. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -231,17 +231,17 @@ func (m *CreateInstanceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateInstanceResponse proto.InternalMessageInfo -func (m *CreateInstanceResponse) GetHash() string { +func (m *CreateInstanceResponse) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `Delete` API. type DeleteInstanceRequest struct { // Instance's hash - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // If true, any persistent data (volumes) that belongs to the instance and its dependencies will also be deleted. DeleteData bool `protobuf:"varint,2,opt,name=deleteData,proto3" json:"deleteData,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -274,11 +274,11 @@ func (m *DeleteInstanceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteInstanceRequest proto.InternalMessageInfo -func (m *DeleteInstanceRequest) GetHash() string { +func (m *DeleteInstanceRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } func (m *DeleteInstanceRequest) GetDeleteData() bool { @@ -333,27 +333,27 @@ func init() { func init() { proto.RegisterFile("protobuf/api/instance.proto", fileDescriptor_71d44b8f4a870f63) } var fileDescriptor_71d44b8f4a870f63 = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4f, 0x4f, 0xfa, 0x40, - 0x10, 0xa5, 0x94, 0x10, 0x18, 0x0e, 0xbf, 0x5f, 0x26, 0x82, 0xb5, 0x44, 0xd3, 0xec, 0xa9, 0x07, - 0x2d, 0x11, 0x2f, 0xde, 0x3c, 0x40, 0x44, 0x83, 0xa7, 0x7e, 0x83, 0x05, 0xc7, 0xb0, 0x89, 0x69, - 0xd7, 0xee, 0x42, 0xe2, 0x37, 0xf0, 0x63,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4f, 0x17, 0x06, 0x35, 0x88, - 0xf7, 0xe0, 0xaf, 0x48, 0xe3, 0x65, 0xc2, 0xa5, 0x48, 0xce, 0x8f, 0x14, 0xda, 0x51, 0xb1, 0x0e, - 0x3e, 0x41, 0xef, 0x98, 0x34, 0x5e, 0x99, 0x1e, 0xd7, 0xb9, 0xc2, 0xd0, 0x55, 0x2a, 0xc7, 0xb3, - 0x0e, 0x2e, 0xa0, 0x5f, 0xa6, 0x82, 0x25, 0xcf, 0x99, 0x77, 0x38, 0x75, 0xd6, 0xda, 0x22, 0xe5, - 0x7e, 0x95, 0x88, 0x33, 0xb9, 0x4a, 0xc4, 0x1d, 0x04, 0xeb, 0x6c, 0xfa, 0xe6, 0x7f, 0x3e, 0xfc, - 0x06, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xea, 0xdb, 0x48, 0xe2, 0x02, 0x00, 0x00, + // 316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4d, 0x4f, 0xc2, 0x40, + 0x10, 0xa5, 0x94, 0x10, 0x18, 0x4c, 0x34, 0x13, 0xc1, 0x5a, 0xa2, 0x69, 0xf6, 0xd4, 0x83, 0x96, + 0x88, 0x17, 0x6f, 0x1e, 0x20, 0xa2, 0xc1, 0x53, 0xff, 0xc1, 0x82, 0x63, 0xd8, 0xc4, 0x94, 0xb5, + 0xbb, 0x90, 0xf8, 0x0f, 0xfc, 0xd9, 0x86, 0xed, 0x07, 0xcd, 0xb2, 0x89, 0xb7, 0xcd, 0x9b, 0x37, + 0x6f, 0xde, 0xbc, 0x59, 0x18, 0xcb, 0x7c, 0xab, 0xb7, 0xab, 0xdd, 0xe7, 0x84, 0x4b, 0x31, 0x11, + 0x99, 0xd2, 0x3c, 0x5b, 0x53, 0x62, 0x50, 0xf4, 0xb9, 0x14, 0xe1, 0x4d, 0xcd, 0xd0, 0x3f, 0x92, + 0x94, 0xc5,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e7, 0xcc, 0x3b, 0x1c, 0x3b, 0x6b, 0x4d, 0x91, 0x62, 0xbf, + 0x52, 0xc4, 0x99, 0x5c, 0x29, 0xe2, 0x0e, 0x82, 0xb5, 0x56, 0x5d, 0xf3, 0x3f, 0x1f, 0xff, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xf7, 0xd0, 0xc5, 0xdf, 0xe2, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/api/instance.proto b/protobuf/api/instance.proto index 29e7761a8..12c769167 100644 --- a/protobuf/api/instance.proto +++ b/protobuf/api/instance.proto @@ -27,13 +27,13 @@ service Instance { // The request's data for the `Get` API. message GetInstanceRequest { - string hash = 1; + bytes hash = 1; } // The request's data for the `List` API. message ListInstancesRequest { // Filter by Services' hash. - string serviceHash = 1; + bytes serviceHash = 1; } // The response's data for the `List` API. @@ -45,7 +45,7 @@ message ListInstancesResponse { // The request's data for the `Create` API. message CreateInstanceRequest { // Service's hash. - string serviceHash = 1; + bytes serviceHash = 1; // Environmental variables to apply to the Instance. repeated string env = 2; @@ -54,13 +54,13 @@ message CreateInstanceRequest { // The response's data for the `Create` API. message CreateInstanceResponse { // The instance's hash created. - string hash = 1; + bytes hash = 1; } // The request's data for the `Delete` API. message DeleteInstanceRequest { // Instance's hash - string hash = 1; + bytes hash = 1; // If true, any persistent data (volumes) that belongs to the instance and its dependencies will also be deleted. bool deleteData = 2; diff --git a/protobuf/api/service.pb.go b/protobuf/api/service.pb.go index 4c520b730..501896489 100644 --- a/protobuf/api/service.pb.go +++ b/protobuf/api/service.pb.go @@ -141,7 +141,7 @@ func (m *CreateServiceRequest) GetSource() string { // The response's data for the `Create` API. type CreateServiceResponse struct { // The service's hash created. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -172,17 +172,17 @@ func (m *CreateServiceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateServiceResponse proto.InternalMessageInfo -func (m *CreateServiceResponse) GetHash() string { +func (m *CreateServiceResponse) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `Delete` API. type DeleteServiceRequest struct { // The service's hash to delete. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -213,11 +213,11 @@ func (m *DeleteServiceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteServiceRequest proto.InternalMessageInfo -func (m *DeleteServiceRequest) GetHash() string { +func (m *DeleteServiceRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The response's data for the `Delete` API, doesn't contain anything. @@ -255,7 +255,7 @@ var xxx_messageInfo_DeleteServiceResponse proto.InternalMessageInfo // The request's data for the `Get` API. type GetServiceRequest struct { // The service's hash to fetch. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -286,11 +286,11 @@ func (m *GetServiceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetServiceRequest proto.InternalMessageInfo -func (m *GetServiceRequest) GetHash() string { +func (m *GetServiceRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `List` API. @@ -379,34 +379,34 @@ func init() { func init() { proto.RegisterFile("protobuf/api/service.proto", fileDescriptor_0615fe53b372bcb1) } var fileDescriptor_0615fe53b372bcb1 = []byte{ - // 424 bytes of a gzipped FileDescriptorPro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a2, 0xd9, 0x34, 0x8c, - 0x18, 0x8a, 0x28, 0x8c, 0x18, 0x4e, 0x64, 0x84, 0x0b, 0x88, 0xaf, 0xc9, 0xe1, 0xb1, 0x87, 0x7a, - 0xe9, 0xa4, 0x9d, 0x55, 0xb2, 0x11, 0x7e, 0x84, 0x71, 0x9d, 0x02, 0x9e, 0xf8, 0x8e, 0x7e, 0x4c, - 0xa9, 0xe8, 0x1b, 0x8f, 0xa7, 0xdd, 0x24, 0xfe, 0x7b, 0xfb, 0xf0, 0x2f, 0x00, 0x00, 0xff, 0xff, - 0x08, 0x1c, 0xaf, 0x2d, 0xb0, 0x03, 0x00, 0x00, + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6f, 0xd3, 0x40, + 0x10, 0x85, 0xe3, 0x3a, 0x75, 0xdb, 0x49, 0x41, 0x30, 0x4d, 0xdb, 0xad, 0x55, 0xa1, 0xc8, 0x17, + 0x42, 0x41, 0x8e, 0x14, 0x8e, 0x88, 0x43, 0x69, 0x51, 0x2f, 0x9c, 0x0c, 0x7f, 0x60, 0xeb, 0x4c, + 0xe9, 0xaa, 0x60, 0x2f, 0x9e, 0x4d, 0xa5, 0xfc, 0x6d, 0xee, 0x48, 0xc8, 0xe3, 0x6d, 0x14, 0x3b, + 0x3e, 0xf4, 0x36, 0x79, 0xef, 0x9b, 0xd9, 0x9d, 0x97, 0x35, 0xc4, 0xb6, 0x2a, 0x5d, 0x79, 0xbb, + 0xbc, 0x9b, 0x69, 0x6b, 0x66, 0x4c, 0xd5, 0xa3, 0xc9, 0x29, 0x15, 0x11, 0x43, 0x6d, 0x4d, 0x7c, + 0xbe, 0x06, 0xdc, 0xca, 0x12, 0xb7, 0x91, 0xe4, 0xef, 0x0e, 0x8c, 0xaf, 0x2a, 0xd2, 0x8e, 0xbe, + 0x37, 0x7a, 0x46, 0x7f, 0x96, 0xc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x29, 0x1c, 0x77, 0xd8, + 0x66, 0x70, 0xf2, 0x16, 0x5e, 0xdf, 0x90, 0x7b, 0xc6, 0x84, 0x31, 0xe0, 0x37, 0xc3, 0x1d, 0x32, + 0xb9, 0x84, 0xa3, 0x96, 0xea, 0xaf, 0x7b, 0x01, 0xfb, 0xfe, 0x35, 0xb1, 0x0a, 0x24, 0xba, 0x97, + 0xed, 0xe8, 0xb2, 0xb5, 0x3f, 0xff, 0x17, 0xc0, 0x9e, 0x57, 0xf1, 0x12, 0xa2, 0x66, 0x7f, 0x3c, + 0x4b, 0xb5, 0x35, 0x69, 0xdf, 0x03, 0x8c, 0xe3, 0x3e, 0xcb, 0xaf, 0x33, 0xa8, 0x47, 0x34, 0x9b, + 0xfa, 0x11, 0x7d, 0x11, 0xf9, 0x11, 0xfd, 0x89, 0x0c, 0x70, 0x06, 0xe1, 0x0d, 0x39, 0x3c, 0x11, + 0x68, 0x2b, 0x9d, 0xb8, 0xb3, 0x4a, 0x32, 0xc0, 0x4f, 0x30, 0xac, 0x53, 0xc0, 0x53, 0xe9, 0xd8, + 0x8e, 0x29, 0x56, 0xdb, 0xc6, 0xd3, 0x69, 0xb7, 0x91, 0x7c, 0x6f, 0x1f, 0xff, 0x07, 0x00, 0x00, + 0xff, 0xff, 0x1c, 0xc9, 0xd4, 0xd8, 0xb0, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/api/service.proto b/protobuf/api/service.proto index c63909caa..9dbaa2ce1 100644 --- a/protobuf/api/service.proto +++ b/protobuf/api/service.proto @@ -59,13 +59,13 @@ message CreateServiceRequest { // The response's data for the `Create` API. message CreateServiceResponse { // The service's hash created. - string hash = 1; + bytes hash = 1; } // The request's data for the `Delete` API. message DeleteServiceRequest { // The service's hash to delete. - string hash = 1; + bytes hash = 1; } // The response's data for the `Delete` API, doesn't contain anything. @@ -75,7 +75,7 @@ message DeleteServiceResponse { // The request's data for the `Get` API. message GetServiceRequest { // The service's hash to fetch. - string hash = 1; + bytes hash = 1; } // The request's data for the `List` API. diff --git a/protobuf/api/workflow.pb.go b/protobuf/api/workflow.pb.go index 460f799be..aa9c107e8 100644 --- a/protobuf/api/workflow.pb.go +++ b/protobuf/api/workflow.pb.go @@ -92,7 +92,7 @@ func (m *CreateWorkflowRequest) GetEdges() []*types.Workflow_Edge { // The response's data for the `Create` API. type CreateWorkflowResponse struct { // The workflow's hash created. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -123,17 +123,17 @@ func (m *CreateWorkflowResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateWorkflowResponse proto.InternalMessageInfo -func (m *CreateWorkflowResponse) GetHash() string { +func (m *CreateWorkflowResponse) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `Delete` API. type DeleteWorkflowRequest struct { // The workflow's hash to delete. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -164,11 +164,11 @@ func (m *DeleteWorkflowRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteWorkflowRequest proto.InternalMessageInfo -func (m *DeleteWorkflowRequest) GetHash() string { +func (m *DeleteWorkflowRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The response's data for the `Delete` API, doesn't contain anything. @@ -206,7 +206,7 @@ var xxx_messageInfo_DeleteWorkflowResponse proto.InternalMessageInfo // The request's data for the `Get` API. type GetWorkflowRequest struct { // The workflow's hash to fetch. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -237,11 +237,11 @@ func (m *GetWorkflowRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetWorkflowRequest proto.InternalMessageInfo -func (m *GetWorkflowRequest) GetHash() string { +func (m *GetWorkflowRequest) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } // The request's data for the `List` API. @@ -330,29 +330,29 @@ func init() { func init() { proto.RegisterFile("protobuf/api/workflow.proto", fileDescriptor_2568c098005b7b27) } var fileDescriptor_2568c098005b7b27 = []byte{ - // 342 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x4f, 0xfa, 0x40, - 0x10, 0xc6, 0x29, 0x05, 0xfe, 0x7f, 0x86, 0x83, 0x66, 0xe4, 0x65, 0x2d, 0x31, 0x21, 0x3d, 0x35, - 0xbe, 0x94, 0x80, 0x67, 0x4f, 0x48, 0xb8, 0x18, 0x0f, 0x8d, 0x89, 0xe7, 0x92, 0x0e, 0xa5, 0x81, - 0xb0, 0xb5, 0xbb, 0x84, 0xf0, 0x05, 0xfc, 0x44, 0x7e, 0x40, 0xd3, 0x6d, 0xab, 0x71, 0x59, 0x13, - 0x6f, 0x9b, 0x99, 0xdf, 0x3c, 0x9d, 0xe7, 0x99, 0xc2, 0x30, 0xcd, 0xb8, 0xe4, 0xcb, 0xfd, 0x6a, - 0x1c, 0xa6, 0xc9, 0xf8, 0xc0, 0xb3, 0xcd, 0x6a, 0xcb, 0x0f, 0xbe, 0xaa, 0xa2, 0x1d, 0xa6, 0x89, - 0x73, 0xf5, 0x45, 0xc8, 0x63, 0x4a, 0x42, 0x63, 0xdc, 0x0f, 0x0b, 0x7a, 0xb3, 0x8c, 0x42, 0x49, - 0xaf, 0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x5e, 0x90, 0xc4, 0x81, 0xa2, 0x4e, 0x83, 0x72, - 0x74, 0x4b, 0x6e, 0x0d, 0x1f, 0xa0, 0x91, 0x07, 0x82, 0x4c, 0xcd, 0x18, 0x22, 0x73, 0x2e, 0x0d, - 0x9d, 0xea, 0x8b, 0xcb, 0x96, 0xfa, 0x87, 0xef, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xfd, - 0xb2, 0x54, 0x06, 0x03, 0x00, 0x00, + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x4e, 0xc2, 0x40, + 0x14, 0x85, 0x29, 0x05, 0x94, 0x8b, 0x89, 0x66, 0xe4, 0x67, 0x2c, 0x31, 0x69, 0xba, 0x6a, 0xfc, + 0x29, 0x01, 0xd7, 0xae, 0x90, 0xb0, 0x31, 0x2e, 0x26, 0x26, 0xae, 0x4b, 0x7a, 0x29, 0x0d, 0x84, + 0xa9, 0x9d, 0x21, 0x84, 0x17, 0xf0, 0x89, 0x7c, 0x40, 0xd3, 0x69, 0xab, 0x71, 0x18, 0x13, 0x77, + 0x93, 0x7b, 0xbe, 0x7b, 0x3a, 0xe7, 0x4c, 0x61, 0x98, 0x66, 0x5c, 0xf2, 0xc5, 0x6e, 0x39, 0x0a, + 0xd3, 0x64, 0xb4, 0xe7, 0xd9, 0x7a, 0xb9, 0xe1, 0xfb, 0x40, 0x4d, 0x89, 0x1d, 0xa6, 0x89, 0x73, + 0xfd, 0x4d, 0xc8, 0x43, 0x8a, 0x42, 0x63, 0xbc, 0x4f, 0x0b, 0x7a, 0xd3, 0x0c, 0x43, 0x89, 0x6f, + 0xa5, 0xc0, 0xf0, 0x7d, 0x87, 0x42, 0x92, 0x0b, 0xb0, 0xd7, 0x78, 0xa0, 0x75, 0xd7, 0xf2, 0xdb, + 0x2c, 0x3f, 0x92, 0x31, 0x9c, 0xc8,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0x63, 0xa8, 0xcc, 0xb9, + 0x32, 0x28, 0xd5, 0x17, 0x17, 0x2d, 0xf5, 0x0f, 0x3f, 0x7c, 0x05, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xa2, 0x03, 0x66, 0x06, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protobuf/api/workflow.proto b/protobuf/api/workflow.proto index adffb7250..8e690c8af 100644 --- a/protobuf/api/workflow.proto +++ b/protobuf/api/workflow.proto @@ -37,13 +37,13 @@ message CreateWorkflowRequest { // The response's data for the `Create` API. message CreateWorkflowResponse { // The workflow's hash created. - string hash = 1; + bytes hash = 1; } // The request's data for the `Delete` API. message DeleteWorkflowRequest { // The workflow's hash to delete. - string hash = 1; + bytes hash = 1; } // The response's data for the `Delete` API, doesn't contain anything. @@ -53,7 +53,7 @@ message DeleteWorkflowResponse { // The request's data for the `Get` API. message GetWorkflowRequest { // The workflow's hash to fetch. - string hash = 1; + bytes hash = 1; } // The request's data for the `List` API. diff --git a/protobuf/types/event.pb.go b/protobuf/types/event.pb.go index 14a172128..6d5a423ff 100644 --- a/protobuf/types/event.pb.go +++ b/protobuf/types/event.pb.go @@ -24,9 +24,9 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // Event represents a single event run in engine. type Event struct { // Hash is a unique hash to identify event. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // instanceHash is hash of instance that can proceed an execution. - InstanceHash string `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // key is the key of the event. Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // data is the data for the event. @@ -61,18 +61,18 @@ func (m *Event) XXX_DiscardUnknown() { var xxx_messageInfo_Event proto.InternalMessageInfo -func (m *Event) GetHash() string { +func (m *Event) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } -func (m *Event) GetInstanceHash() string { +func (m *Event) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *Event) GetKey() string { @@ -96,18 +96,18 @@ func init() { func init() { proto.RegisterFile("protobuf/types/event.proto", fileDescriptor_118d36ccf50c3798) } var fileDescriptor_118d36ccf50c3798 = []byte{ - // 202 bytes of a gzipped FileDescriptorProto + // 205 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x03, 0x0b, 0x0a, 0xb1, 0x82, 0x85, 0xa4, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xe1, 0x2a, 0x8b, 0x4b, 0x8a, 0x4a, 0x93, 0xa1, 0x8a, 0x94, 0xea, 0xb8, 0x58, 0x5d, 0x41, 0x7a, - 0x84, 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, + 0x84, 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0x21, 0x25, 0x2e, 0x9e, 0xcc, 0xbc, 0xe2, 0x92, 0xc4, 0xbc, 0xe4, 0x54, 0x0f, 0x90, 0x1c, - 0x13, 0x58, 0x0e, 0x45, 0x4c, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x19, 0x2c, 0x05, - 0x62, 0x0a, 0x69, 0x73, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0xb0, 0x28, 0x30, 0x6a, 0x70, 0x1b, - 0x89, 0xeb, 0x41, 0xec, 0xd7, 0x83, 0xd9, 0xaf, 0x17, 0x0c, 0xb6, 0x3f, 0x08, 0xac, 0xc8, 0xc9, - 0x28, 0xca, 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x37, 0xb5, - 0x38, 0x5d, 0x37, 0x2d, 0xbf, 0x34, 0x2f, 0x25, 0xb1, 0x24, 0x33, 0x3f, 0x4f, 0x3f, 0x35, 0x2f, - 0x3d, 0x33, 0x0f, 0xc9, 0xe9, 0x60, 0x1f, 0x25, 0xb1, 0x81, 0xf9, 0xc6, 0x80, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xb4, 0x6b, 0x0b, 0x88, 0xfd, 0x00, 0x00, 0x00, + 0x13, 0x58, 0x0e, 0x45, 0x4c, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x59, 0x81, 0x51, + 0x83, 0x33, 0x08, 0xc4, 0x14, 0xd2, 0xe6, 0x62, 0x49, 0x49, 0x2c, 0x49, 0x94, 0x60, 0x51, 0x60, + 0xd4, 0xe0, 0x36, 0x12, 0xd7, 0x83, 0xd8, 0xaf, 0x07, 0xb3, 0x5f, 0x2f, 0x18, 0x6c, 0x7f, 0x10, + 0x58, 0x91, 0x93, 0x51, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, + 0x7e, 0x6e, 0x6a, 0x71, 0xba, 0x6e, 0x5a, 0x7e, 0x69, 0x5e, 0x4a, 0x62, 0x49, 0x66, 0x7e, 0x9e, + 0x7e, 0x6a, 0x5e, 0x7a, 0x66, 0x1e, 0x92, 0xd3, 0xc1, 0x3e, 0x4a, 0x62, 0x03, 0xf3, 0x8d, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x8e, 0x9f, 0xcd, 0xfd, 0x00, 0x00, 0x00, } diff --git a/protobuf/types/event.proto b/protobuf/types/event.proto index d93ef0adf..81fc5c29b 100644 --- a/protobuf/types/event.proto +++ b/protobuf/types/event.proto @@ -8,10 +8,10 @@ option go_package = "github.com/mesg-foundation/engine/protobuf/types"; // Event represents a single event run in engine. message Event { // Hash is a unique hash to identify event. - string hash = 1; + bytes hash = 1; // instanceHash is hash of instance that can proceed an execution. - string instanceHash = 2; + bytes instanceHash = 2; // key is the key of the event. string key = 3; diff --git a/protobuf/types/execution.pb.go b/protobuf/types/execution.pb.go index 3554b79b7..c86172f28 100644 --- a/protobuf/types/execution.pb.go +++ b/protobuf/types/execution.pb.go @@ -66,15 +66,15 @@ func (Status) EnumDescriptor() ([]byte, []int) { // Execution represents a single execution run in engine. type Execution struct { // Hash is a unique hash to identify execution. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // parentHash is the unique hash of parent execution. if execution is triggered by another one, dependency execution considered as the parent. - ParentHash string `protobuf:"bytes,2,opt,name=parentHash,proto3" json:"parentHash,omitempty"` + ParentHash []byte `protobuf:"bytes,2,opt,name=parentHash,proto3" json:"parentHash,omitempty"` // eventHash is unique event hash. - EventHash string `protobuf:"bytes,3,opt,name=eventHash,proto3" json:"eventHash,omitempty"` + EventHash []byte `protobuf:"bytes,3,opt,name=eventHash,proto3" json:"eventHash,omitempty"` // Status is the current status of execution. Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=types.Status" json:"status,omitempty"` // instanceHash is hash of the instance that can proceed an execution - InstanceHash string `protobuf:"bytes,5,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,5,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // taskKey is the key of the task of this execution. TaskKey string `protobuf:"bytes,6,opt,name=taskKey,proto3" json:"taskKey,omitempty"` // inputs data of the execution. @@ -86,7 +86,7 @@ type Execution struct { // tags are optionally associated with execution by the user. Tags []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty"` // workflowHash is the unique hash of the workflow associated to this execution. - WorkflowHash string `protobuf:"bytes,11,opt,name=workflowHash,proto3" json:"workflowHash,omitempty"` + WorkflowHash []byte `protobuf:"bytes,11,opt,name=workflowHash,proto3" json:"workflowHash,omitempty"` // step of the workflow. StepID string `protobuf:"bytes,12,opt,name=stepID,proto3" json:"stepID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -119,25 +119,25 @@ func (m *Execution) XXX_DiscardUnknown() { var xxx_messageInfo_Execution proto.InternalMessageInfo -func (m *Execution) GetHash() string { +func (m *Execution) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } -func (m *Execution) GetParentHash() string { +func (m *Execution) GetParentHash() []byte { if m != nil { return m.ParentHash } - return "" + return nil } -func (m *Execution) GetEventHash() string { +func (m *Execution) GetEventHash() []byte { if m != nil { return m.EventHash } - return "" + return nil } func (m *Execution) GetStatus() Status { @@ -147,11 +147,11 @@ func (m *Execution) GetStatus() Status { return Status_Unknown } -func (m *Execution) GetInstanceHash() string { +func (m *Execution) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *Execution) GetTaskKey() string { @@ -189,11 +189,11 @@ func (m *Execution) GetTags() []string { return nil } -func (m *Execution) GetWorkflowHash() string { +func (m *Execution) GetWorkflowHash() []byte { if m != nil { return m.WorkflowHash } - return "" + return nil } func (m *Execution) GetStepID() string { @@ -211,29 +211,29 @@ func init() { func init() { proto.RegisterFile("protobuf/types/execution.proto", fileDescriptor_42e00237fcad5e7f) } var fileDescriptor_42e00237fcad5e7f = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x6f, 0x8b, 0xd3, 0x40, - 0x10, 0xc6, 0xcd, 0xa5, 0x4d, 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 0xac, 0x48, 0x8b, 0x68, - 0x3e, 0x5b, 0x3c, 0x2b, 0x87, 0xcc, 0xe5, 0x98, 0xb9, 0xbc, 0xe7, 0xcc, 0xcb, 0x63, 0x19, 0xbe, - 0x81, 0x54, 0x7b, 0xc7, 0x1d, 0x8f, 0xff, 0xdf, 0x31, 0xd6, 0xe1, 0x13, 0x98, 0x92, 0x31, 0xda, - 0x88, 0x8c, 0xbf, 0x3d, 0x88, 0x30, 0x30, 0x27, 0x1b, 0x2b, 0xa0, 0x88, 0xc3, 0xc0, 0xc2, 0x39, - 0x64, 0x39, 0x68, 0xb3, 0xdb, 0x74, 0xfa, 0xc0, 0x59, 0x66, 0x43, 0x96, 0x53, 0x0f, 0x9f, 0x86, - 0xb1, 0x50, 0x7f, 0xf7, 0x5e, 0x9c, 0x33, 0x3d, 0xaa, 0x97, 0x5f, 0x20, 0x19, 0x26, 0x83, 0x33, - 0x48, 0xbf, 0xa9, 0x9d, 0xd2, 0x07, 0x95, 0x3f, 0x0a, 0xe2, 0xd6, 0x90, 0x74, 0xb4, 0xce, 0x23, - 0xbc, 0x04, 0xb8, 0x53, 0x5f, 0x8d, 0x6e, 0x0c, 0x59, 0x9b, 0x9f, 0xe1, 0x05, 0x64, 0xb7, 0x7a, - 0xdf, 0x77, 0x14, 0x70, 0x8c, 0x00, 0xc9, 0x47, 0xd9, 0x76, 0xb4, 0xce, 0x27, 0xef, 0x16, 0xdf, - 0x5f, 0x37, 0xad, 0xdb, 0xfa, 0x55, 0x59, 0xeb, 0x7d, 0xb5, 0x27, 0xdb, 0xbc, 0xda, 0x68, 0xaf, - 0xd6, 0x32, 0x6c, 0xbb, 0x22, 0xd5, 0xb4, 0xea, 0xe4, 0x61, 0xf0, 0x66, 0x56, 0x09, 0xeb, 0xb7, - 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xd6, 0x46, 0xe1, 0x5f, 0x02, 0x00, 0x00, + // 383 bytes of a gzipped FileDescriptorProto + 0x1f, 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f1, + 0xdb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xee, 0x11, 0xb1, 0xcc, 0x5f, 0x02, 0x00, 0x00, } diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index b3279e87f..6da4f2452 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -28,19 +28,19 @@ enum Status { // Execution represents a single execution run in engine. message Execution { // Hash is a unique hash to identify execution. - string hash = 1; + bytes hash = 1; // parentHash is the unique hash of parent execution. if execution is triggered by another one, dependency execution considered as the parent. - string parentHash = 2; + bytes parentHash = 2; // eventHash is unique event hash. - string eventHash = 3; + bytes eventHash = 3; // Status is the current status of execution. Status status = 4; // instanceHash is hash of the instance that can proceed an execution - string instanceHash = 5; + bytes instanceHash = 5; // taskKey is the key of the task of this execution. string taskKey = 6; @@ -58,7 +58,7 @@ message Execution { repeated string tags = 10; // workflowHash is the unique hash of the workflow associated to this execution. - string workflowHash = 11; + bytes workflowHash = 11; // step of the workflow. string stepID = 12; diff --git a/protobuf/types/instance.pb.go b/protobuf/types/instance.pb.go index 04cc83473..f2349ceb9 100644 --- a/protobuf/types/instance.pb.go +++ b/protobuf/types/instance.pb.go @@ -22,8 +22,8 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // Instance represents service's instance. type Instance struct { - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - ServiceHash string `protobuf:"bytes,2,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + ServiceHash []byte `protobuf:"bytes,2,opt,name=serviceHash,proto3" json:"serviceHash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -54,18 +54,18 @@ func (m *Instance) XXX_DiscardUnknown() { var xxx_messageInfo_Instance proto.InternalMessageInfo -func (m *Instance) GetHash() string { +func (m *Instance) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } -func (m *Instance) GetServiceHash() string { +func (m *Instance) GetServiceHash() []byte { if m != nil { return m.ServiceHash } - return "" + return nil } func init() { @@ -79,10 +79,10 @@ var fileDescriptor_69e8075b449ec9df = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0xcf, 0xcc, 0x2b, 0x2e, 0x49, 0xcc, 0x4b, 0x4e, 0xd5, 0x03, 0x8b, 0x0b, 0xb1, 0x82, 0x45, 0x95, 0x1c, 0xb8, 0x38, 0x3c, 0xa1, - 0x12, 0x42, 0x42, 0x5c, 0x2c, 0x19, 0x89, 0xc5, 0x19, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, + 0x12, 0x42, 0x42, 0x5c, 0x2c, 0x19, 0x89, 0xc5, 0x19, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x90, 0x02, 0x17, 0x77, 0x71, 0x6a, 0x51, 0x59, 0x66, 0x72, 0xaa, 0x07, 0x48, 0x8a, 0x09, 0x2c, 0x85, 0x2c, 0xe4, 0x64, 0x14, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9b, 0x5a, 0x9c, 0xae, 0x9b, 0x96, 0x5f, 0x9a, 0x97, 0x92, 0x58, 0x92, 0x99, 0x9f, 0xa7, 0x9f, 0x9a, 0x97, 0x9e, 0x99, 0x97, 0xaa, 0x8f, 0xea, 0x96, 0x24, 0x36, 0x30, - 0xdf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xae, 0x44, 0x6d, 0xa4, 0x00, 0x00, 0x00, + 0xdf, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x38, 0x7c, 0xa3, 0x79, 0xa4, 0x00, 0x00, 0x00, } diff --git a/protobuf/types/instance.proto b/protobuf/types/instance.proto index f0c53d1ee..5731fbb76 100644 --- a/protobuf/types/instance.proto +++ b/protobuf/types/instance.proto @@ -5,6 +5,6 @@ option go_package = "github.com/mesg-foundation/engine/protobuf/types"; // Instance represents service's instance. message Instance { - string hash = 1; - string serviceHash = 2; + bytes hash = 1; + bytes serviceHash = 2; } diff --git a/protobuf/types/service.proto b/protobuf/types/service.proto index 8d6d44154..867705899 100644 --- a/protobuf/types/service.proto +++ b/protobuf/types/service.proto @@ -177,7 +177,7 @@ message Service { } // Service's hash. - string hash = 10 [ + bytes hash = 10 [ (gogoproto.moretags) = 'validate:"required"' ]; diff --git a/protobuf/types/workflow.pb.go b/protobuf/types/workflow.pb.go index 784660816..2afe78820 100644 --- a/protobuf/types/workflow.pb.go +++ b/protobuf/types/workflow.pb.go @@ -48,7 +48,7 @@ func (Workflow_Trigger_Filter_Predicate) EnumDescriptor() ([]byte, []int) { // A workflow is a configuration to trigger a specific task when certains conditions of a trigger are valid. type Workflow struct { - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Trigger *Workflow_Trigger `protobuf:"bytes,3,opt,name=trigger,proto3" json:"trigger,omitempty"` Nodes []*Workflow_Node `protobuf:"bytes,4,rep,name=nodes,proto3" json:"nodes,omitempty"` @@ -83,11 +83,11 @@ func (m *Workflow) XXX_DiscardUnknown() { var xxx_messageInfo_Workflow proto.InternalMessageInfo -func (m *Workflow) GetHash() string { +func (m *Workflow) GetHash() []byte { if m != nil { return m.Hash } - return "" + return nil } func (m *Workflow) GetKey() string { @@ -120,7 +120,7 @@ func (m *Workflow) GetEdges() []*Workflow_Edge { // Trigger is the configuration that will trigger a workflow. type Workflow_Trigger struct { - InstanceHash string `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,1,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` // Workflow can be trigger by either an Event or a Task (not both). // // Types that are valid to be assigned to Key: @@ -159,11 +159,11 @@ func (m *Workflow_Trigger) XXX_DiscardUnknown() { var xxx_messageInfo_Workflow_Trigger proto.InternalMessageInfo -func (m *Workflow_Trigger) GetInstanceHash() string { +func (m *Workflow_Trigger) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } type isWorkflow_Trigger_Key interface { @@ -284,7 +284,7 @@ func (m *Workflow_Trigger_Filter) GetValue() string { // Definition of the node to execute when the workflow is triggered. type Workflow_Node struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - InstanceHash string `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` + InstanceHash []byte `protobuf:"bytes,2,opt,name=instanceHash,proto3" json:"instanceHash,omitempty"` TaskKey string `protobuf:"bytes,3,opt,name=taskKey,proto3" json:"taskKey,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -323,11 +323,11 @@ func (m *Workflow_Node) GetKey() string { return "" } -func (m *Workflow_Node) GetInstanceHash() string { +func (m *Workflow_Node) GetInstanceHash() []byte { if m != nil { return m.InstanceHash } - return "" + return nil } func (m *Workflow_Node) GetTaskKey() string { @@ -526,36 +526,36 @@ func init() { func init() { proto.RegisterFile("protobuf/types/workflow.proto", fileDescriptor_980f671c228050a1) } var fileDescriptor_980f671c228050a1 = []byte{ - // 484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x8f, 0xd3, 0x30, - 0x10, 0xdd, 0x34, 0x4d, 0xb2, 0x9d, 0x22, 0x54,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a1, 0x1d, 0x33, 0xfa, 0xee, 0x80, 0x67, 0x90, 0x9e, 0xd1, 0xcf, 0xc1, 0x15, - 0x58, 0x9a, 0x0e, 0xe3, 0xf4, 0xd9, 0xfd, 0xc5, 0x62, 0x8a, 0x25, 0x0a, 0xd4, 0x6a, 0x4e, 0xa8, - 0xbe, 0x12, 0xbd, 0x81, 0xd1, 0x1e, 0xfb, 0x7b, 0xb3, 0xce, 0xd1, 0x66, 0xff, 0xfd, 0x34, 0x8b, - 0xa0, 0x5b, 0xc3, 0x22, 0xfd, 0xf6, 0xb2, 0xaa, 0xd5, 0xaa, 0x59, 0xc6, 0x39, 0xbf, 0x4e, 0xae, - 0x51, 0x56, 0x2f, 0x4a, 0xde, 0xb0, 0x22, 0x53, 0x35, 0x67, 0x09, 0xb2, 0xaa, 0x66, 0x98, 0x1c, - 0x7f, 0xdd, 0xa5, 0x6f, 0xe2, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x13, 0xaa, 0xc2, - 0xd3, 0x03, 0x00, 0x00, + // 487 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x8b, 0xdb, 0x30, + 0x10, 0x8d, 0xe2, 0x38, 0xde, 0x4c, 0x96, 0x12, 0xc4, 0x42, 0x8d, 0x69, 0x4b, 0x08, 0x3d, 0x84, + 0x42, 0x9d, 0xd6, 0x3d, 0x74, 0xcf, 0x81, 0x5d, 0xb6, 0x14, 0x4a, 0x2b, 0xfa, 0x01, 0xbd, 0x39, + 0xf1, 0xd8, 0x31, 0xc9, 0x4a, 0x41, 0x92, 0x37, 0xec, 0x0f, 0xe9, 0xa5, 0x7f, 0xae, 0xff, 0xa0, + 0xc7, 0x9e, 0x8b, 0x64, 0x2b, 0x69, 0xb6, 0xde, 0xbd, 0x69, 0xde, 0x3c, 0xcd, 0xcc, 0x7b, 0x23, + 0xc1,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 0x5e, 0x8a, + 0xeb, 0xd9, 0x35, 0xaa, 0xe2, 0x65, 0x2e, 0x2a, 0x9e, 0xa5, 0xba, 0x14, 0x7c, 0x86, 0xbc, 0x28, + 0x39, 0xce, 0x8e, 0xbf, 0xee, 0xa2, 0x6f, 0xe3, 0x37, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x36, + 0xd7, 0x3a, 0x33, 0xd3, 0x03, 0x00, 0x00, } diff --git a/protobuf/types/workflow.proto b/protobuf/types/workflow.proto index fe0143d61..440903cc0 100644 --- a/protobuf/types/workflow.proto +++ b/protobuf/types/workflow.proto @@ -22,7 +22,7 @@ message Workflow { string value = 3; // Value of the filter } - string instanceHash = 1; // Hash of the instance that triggers the workflow. + bytes instanceHash = 1; // Hash of the instance that triggers the workflow. // Workflow can be trigger by either an Event or a Task (not both). oneof key { string taskKey = 2; // Key of the task that triggers the workflow. @@ -35,7 +35,7 @@ message Workflow { // Definition of the node to execute when the workflow is triggered. message Node { string key = 1; // Key that identifies the node. - string instanceHash = 2; // Hash of the instance to execute. + bytes instanceHash = 2; // Hash of the instance to execute. string taskKey = 3; // Task of the instance to execute. } @@ -56,7 +56,7 @@ message Workflow { repeated Input inputs = 3; // Inputs for the destination task. } - string hash = 1; // Workflow's hash + bytes hash = 1; // Workflow's hash string key = 2; // Workflow's key Trigger trigger = 3; // Trigger for the workflow. repeated Node nodes = 4; // Nodes with information related to the execution to trigger. diff --git a/sdk/execution/execution_test.go b/sdk/execution/execution_test.go index 6952d110a..e2f04f566 100644 --- a/sdk/execution/execution_test.go +++ b/sdk/execution/execution_test.go @@ -78,7 +78,7 @@ var hs1 = hash.Int(1) var testService = &service.Service{ Name: "1", Sid: "2", - Hash: hs1.String(), + Hash: hs1, Tasks: []*service.Service_Task{ {Key: "4"}, }, diff --git a/sdk/instance/instance.go b/sdk/instance/instance.go index 46b5f3d15..47a789a3e 100644 --- a/sdk/instance/instance.go +++ b/sdk/instance/instance.go @@ -107,11 +107,7 @@ func (i *Instance) Create(serviceHash hash.Hash, env []string) (*instance.Instan // calculate instance's hash. h := hash.New() - hsh, err := hash.Decode(srv.Hash) - if err != nil { - return nil, err - } - h.Write(hsh) + h.Write(srv.Hash) h.Write([]byte(xos.EnvMapToString(instanceEnv))) instanceHash := h.Sum(nil) @@ -125,7 +121,7 @@ func (i *Instance) Create(serviceHash hash.Hash, env []string) (*instance.Instan // save & start instance. inst := &instance.Instance{ Hash: instanceHash, - ServiceHash: hsh, + ServiceHash: srv.Hash, } if err := i.instanceDB.Save(inst); err != nil { return nil, err diff --git a/sdk/instance/start.go b/sdk/instance/start.go index 42afd3ba1..43e11c23a 100644 --- a/sdk/instance/start.go +++ b/sdk/instance/start.go @@ -5,6 +5,7 @@ import ( "github.com/mesg-foundation/engine/instance" "github.com/mesg-foundation/engine/service" "github.com/mesg-foundation/engine/x/xos" + "github.com/mr-tron/base58" ) // Start starts the service. @@ -38,7 +39,7 @@ func (i *Instance) start(inst *instance.Instance, imageHash string, env []string Labels: map[string]string{ "mesg.engine": i.engineName, "mesg.sid": srv.Sid, - "mesg.service": srv.Hash, + "mesg.service": base58.Encode(srv.Hash), // TODO: change to srv.Hash.String() after set custom type in proto "mesg.instance": inst.Hash.String(), "mesg.dependency": d.Key, }, @@ -66,7 +67,7 @@ func (i *Instance) start(inst *instance.Instance, imageHash string, env []string Labels: map[string]string{ "mesg.engine": i.engineName, "mesg.sid": srv.Sid, - "mesg.service": srv.Hash, + "mesg.service": base58.Encode(srv.Hash), // TODO: change to srv.Hash.String() after set custom type in proto "mesg.instance": inst.Hash.String(), "mesg.dependency": service.MainServiceKey, }, diff --git a/sdk/service/utils.go b/sdk/service/utils.go index 030ebdbef..4d45afc76 100644 --- a/sdk/service/utils.go +++ b/sdk/service/utils.go @@ -13,6 +13,7 @@ import ( "github.com/mesg-foundation/engine/hash/dirhash" "github.com/mesg-foundation/engine/service" "github.com/mesg-foundation/engine/service/validator" + "github.com/mr-tron/base58" ) func create(container container.Container, db *database.ServiceDB, srv *service.Service) (*service.Service, error) { @@ -38,16 +39,14 @@ func create(container container.Container, db *database.ServiceDB, srv *service. // calculate and apply hash to service. dh := dirhash.New(path) - h, err := dh.Sum(hash.Dump(srv)) + srv.Hash, err = dh.Sum(hash.Dump(srv)) if err != nil { return nil, err } - hsh := hash.Hash(h) - srv.Hash = hsh.String() // check if service already exists. - if _, err := db.Get(hsh); err == nil { - return nil, &AlreadyExistsError{Hash: hsh} + if _, err := db.Get(srv.Hash); err == nil { + return nil, &AlreadyExistsError{Hash: srv.Hash} } // build service's Docker image. @@ -58,7 +57,7 @@ func create(container container.Container, db *database.ServiceDB, srv *service. // TODO: the following test should be moved in New function if srv.Sid == "" { // make sure that sid doesn't have the same length with id. - srv.Sid = "_" + hsh.String() + srv.Sid = "_" + base58.Encode(srv.Hash) // TODO: use string method after change type to hash.Hash } if err := validator.ValidateService(srv); err != nil { diff --git a/server/grpc/api/event.go b/server/grpc/api/event.go index 1f45cef46..cf7073b1e 100644 --- a/server/grpc/api/event.go +++ b/server/grpc/api/event.go @@ -7,7 +7,6 @@ import ( structpb "github.com/golang/protobuf/ptypes/struct" "github.com/mesg-foundation/engine/event" - "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/protobuf/acknowledgement" "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/protobuf/convert" @@ -28,11 +27,6 @@ func NewEventServer(sdk *sdk.SDK) *EventServer { // Create creates a new event. func (s *EventServer) Create(ctx context.Context, req *api.CreateEventRequest) (*api.CreateEventResponse, error) { - instanceHash, err := hash.Decode(req.InstanceHash) - if err != nil { - return nil, fmt.Errorf("create event: instance %s", err) - } - if req.Key == "" { return nil, errors.New("create event: key missing") } @@ -42,29 +36,21 @@ func (s *EventServer) Create(ctx context.Context, req *api.CreateEventRequest) ( return nil, err } - event, err := s.sdk.Event.Create(instanceHash, req.Key, data) + event, err := s.sdk.Event.Create(req.InstanceHash, req.Key, data) if err != nil { return nil, fmt.Errorf("create event: data %s", err) } - return &api.CreateEventResponse{Hash: event.Hash.String()}, nil + return &api.CreateEventResponse{Hash: event.Hash}, nil } // Stream returns stream of events. func (s *EventServer) Stream(req *api.StreamEventRequest, resp api.Event_StreamServer) error { var f *eventsdk.Filter if req.Filter != nil { - instanceHash, err := hash.Decode(req.Filter.InstanceHash) - if req.Filter.InstanceHash != "" && err != nil { - return err - } - hash, err := hash.Decode(req.Filter.Hash) - if req.Filter.Hash != "" && err != nil { - return err - } f = &eventsdk.Filter{ - Hash: hash, - InstanceHash: instanceHash, + Hash: req.Filter.Hash, + InstanceHash: req.Filter.InstanceHash, Key: req.Filter.Key, } } @@ -97,8 +83,8 @@ func toProtoEvent(e *event.Event) (*types.Event, error) { } return &types.Event{ - Hash: e.Hash.String(), - InstanceHash: e.InstanceHash.String(), + Hash: e.Hash, + InstanceHash: e.InstanceHash, Key: e.Key, Data: data, }, nil diff --git a/server/grpc/api/execution.go b/server/grpc/api/execution.go index 178ff7408..8017a8c7d 100644 --- a/server/grpc/api/execution.go +++ b/server/grpc/api/execution.go @@ -30,11 +30,6 @@ func NewExecutionServer(sdk *sdk.SDK) *ExecutionServer { // Create creates an execution. func (s *ExecutionServer) Create(ctx context.Context, req *api.CreateExecutionRequest) (*api.CreateExecutionResponse, error) { - instanceHash, err := hash.Decode(req.InstanceHash) - if err != nil { - return nil, err - } - inputs := make(map[string]interface{}) if err := convert.Marshal(req.Inputs, &inputs); err != nil { return nil, err @@ -43,24 +38,19 @@ func (s *ExecutionServer) Create(ctx context.Context, req *api.CreateExecutionRe if err != nil { return nil, err } - executionHash, err := s.sdk.Execution.Execute(nil, instanceHash, eventHash, nil, "", req.TaskKey, inputs, req.Tags) + executionHash, err := s.sdk.Execution.Execute(nil, req.InstanceHash, eventHash, nil, "", req.TaskKey, inputs, req.Tags) if err != nil { return nil, err } return &api.CreateExecutionResponse{ - Hash: executionHash.String(), + Hash: executionHash, }, nil } // Get returns execution from given hash. func (s *ExecutionServer) Get(ctx context.Context, req *api.GetExecutionRequest) (*types.Execution, error) { - hash, err := hash.Decode(req.Hash) - if err != nil { - return nil, err - } - - exec, err := s.sdk.Execution.Get(hash) + exec, err := s.sdk.Execution.Get(req.Hash) if err != nil { return nil, err } @@ -72,18 +62,13 @@ func (s *ExecutionServer) Stream(req *api.StreamExecutionRequest, resp api.Execu var f *executionsdk.Filter if req.Filter != nil { - instanceHash, err := hash.Decode(req.Filter.InstanceHash) - if req.Filter.InstanceHash != "" && err != nil { - return err - } - var statuses []execution.Status for _, status := range req.Filter.Statuses { statuses = append(statuses, execution.Status(status)) } f = &executionsdk.Filter{ - InstanceHash: instanceHash, + InstanceHash: req.Filter.InstanceHash, Statuses: statuses, Tags: req.Filter.Tags, TaskKey: req.Filter.TaskKey, @@ -114,10 +99,7 @@ func (s *ExecutionServer) Stream(req *api.StreamExecutionRequest, resp api.Execu // Update updates execution from given hash. func (s *ExecutionServer) Update(ctx context.Context, req *api.UpdateExecutionRequest) (*api.UpdateExecutionResponse, error) { - hash, err := hash.Decode(req.Hash) - if err != nil { - return nil, err - } + var err error switch res := req.Result.(type) { case *api.UpdateExecutionRequest_Outputs: outputs := make(map[string]interface{}) @@ -125,9 +107,9 @@ func (s *ExecutionServer) Update(ctx context.Context, req *api.UpdateExecutionRe return nil, err } - err = s.sdk.Execution.Update(hash, outputs, nil) + err = s.sdk.Execution.Update(req.Hash, outputs, nil) case *api.UpdateExecutionRequest_Error: - err = s.sdk.Execution.Update(hash, nil, errors.New(res.Error)) + err = s.sdk.Execution.Update(req.Hash, nil, errors.New(res.Error)) default: err = ErrNoOutput } @@ -151,12 +133,12 @@ func toProtoExecution(exec *execution.Execution) (*types.Execution, error) { } return &types.Execution{ - Hash: exec.Hash.String(), - WorkflowHash: exec.WorkflowHash.String(), - ParentHash: exec.ParentHash.String(), - EventHash: exec.EventHash.String(), + Hash: exec.Hash, + WorkflowHash: exec.WorkflowHash, + ParentHash: exec.ParentHash, + EventHash: exec.EventHash, Status: types.Status(exec.Status), - InstanceHash: exec.InstanceHash.String(), + InstanceHash: exec.InstanceHash, TaskKey: exec.TaskKey, Inputs: inputs, Outputs: outputs, diff --git a/server/grpc/api/execution_test.go b/server/grpc/api/execution_test.go index 313736ba1..a8a7c64fd 100644 --- a/server/grpc/api/execution_test.go +++ b/server/grpc/api/execution_test.go @@ -29,7 +29,7 @@ func TestGet(t *testing.T) { sdk := sdk.NewDeprecated(nil, nil, nil, db, nil, "", "") s := NewExecutionServer(sdk) - got, err := s.Get(context.Background(), &api.GetExecutionRequest{Hash: exec.Hash.String()}) + got, err := s.Get(context.Background(), &api.GetExecutionRequest{Hash: exec.Hash}) require.NoError(t, err) require.Equal(t, got, want) } @@ -46,6 +46,6 @@ func TestUpdate(t *testing.T) { sdk := sdk.NewDeprecated(nil, nil, nil, db, nil, "", "") s := NewExecutionServer(sdk) - _, err = s.Update(context.Background(), &api.UpdateExecutionRequest{Hash: exec.Hash.String()}) + _, err = s.Update(context.Background(), &api.UpdateExecutionRequest{Hash: exec.Hash}) require.Equal(t, ErrNoOutput, err) } diff --git a/server/grpc/api/instance.go b/server/grpc/api/instance.go index 35c375a8d..5e44fd22c 100644 --- a/server/grpc/api/instance.go +++ b/server/grpc/api/instance.go @@ -3,7 +3,6 @@ package api import ( "context" - "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/instance" protobuf_api "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/protobuf/types" @@ -23,17 +22,7 @@ func NewInstanceServer(sdk *sdk.SDK) *InstanceServer { // List instances. func (s *InstanceServer) List(ctx context.Context, request *protobuf_api.ListInstancesRequest) (*protobuf_api.ListInstancesResponse, error) { - var ( - h hash.Hash - err error - ) - if request.ServiceHash != "" { - h, err = hash.Decode(request.ServiceHash) - if err != nil { - return nil, err - } - } - instances, err := s.sdk.Instance.List(&instancesdk.Filter{ServiceHash: h}) + instances, err := s.sdk.Instance.List(&instancesdk.Filter{ServiceHash: request.ServiceHash}) if err != nil { return nil, err } @@ -42,25 +31,16 @@ func (s *InstanceServer) List(ctx context.Context, request *protobuf_api.ListIns // Create creates a new instance from service. func (s *InstanceServer) Create(ctx context.Context, request *protobuf_api.CreateInstanceRequest) (*protobuf_api.CreateInstanceResponse, error) { - hash, err := hash.Decode(request.ServiceHash) - if err != nil { - return nil, err - } - - i, err := s.sdk.Instance.Create(hash, request.Env) + i, err := s.sdk.Instance.Create(request.ServiceHash, request.Env) if err != nil { return nil, err } - return &protobuf_api.CreateInstanceResponse{Hash: i.Hash.String()}, nil + return &protobuf_api.CreateInstanceResponse{Hash: i.Hash}, nil } // Get retrives instance. func (s *InstanceServer) Get(ctx context.Context, request *protobuf_api.GetInstanceRequest) (*types.Instance, error) { - hash, err := hash.Decode(request.Hash) - if err != nil { - return nil, err - } - i, err := s.sdk.Instance.Get(hash) + i, err := s.sdk.Instance.Get(request.Hash) if err != nil { return nil, err } @@ -69,11 +49,7 @@ func (s *InstanceServer) Get(ctx context.Context, request *protobuf_api.GetInsta // Delete an instance func (s *InstanceServer) Delete(ctx context.Context, request *protobuf_api.DeleteInstanceRequest) (*protobuf_api.DeleteInstanceResponse, error) { - hash, err := hash.Decode(request.Hash) - if err != nil { - return nil, err - } - if err := s.sdk.Instance.Delete(hash, request.DeleteData); err != nil { + if err := s.sdk.Instance.Delete(request.Hash, request.DeleteData); err != nil { return nil, err } return &protobuf_api.DeleteInstanceResponse{}, nil @@ -89,7 +65,7 @@ func toProtoInstances(instances []*instance.Instance) []*types.Instance { func toProtoInstance(i *instance.Instance) *types.Instance { return &types.Instance{ - Hash: i.Hash.String(), - ServiceHash: i.ServiceHash.String(), + Hash: i.Hash, + ServiceHash: i.ServiceHash, } } diff --git a/server/grpc/api/service.go b/server/grpc/api/service.go index 093a8482b..52b36a809 100644 --- a/server/grpc/api/service.go +++ b/server/grpc/api/service.go @@ -4,7 +4,6 @@ import ( "context" "errors" - "github.com/mesg-foundation/engine/hash" protobuf_api "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/sdk" instancesdk "github.com/mesg-foundation/engine/sdk/instance" @@ -43,29 +42,20 @@ func (s *ServiceServer) Create(ctx context.Context, req *protobuf_api.CreateServ // Delete deletes service by hash or sid. func (s *ServiceServer) Delete(ctx context.Context, request *protobuf_api.DeleteServiceRequest) (*protobuf_api.DeleteServiceResponse, error) { - hash, err := hash.Decode(request.Hash) - if err != nil { - return nil, err - } // first, check if service has any running instances. - instances, err := s.sdk.Instance.List(&instancesdk.Filter{ServiceHash: hash}) + instances, err := s.sdk.Instance.List(&instancesdk.Filter{ServiceHash: request.Hash}) if err != nil { return nil, err } if len(instances) > 0 { return nil, errors.New("service has running instances. in order to delete the service, stop its instances first") } - return &protobuf_api.DeleteServiceResponse{}, s.sdk.Service.Delete(hash) + return &protobuf_api.DeleteServiceResponse{}, s.sdk.Service.Delete(request.Hash) } // Get returns service from given hash. func (s *ServiceServer) Get(ctx context.Context, req *protobuf_api.GetServiceRequest) (*service.Service, error) { - hash, err := hash.Decode(req.Hash) - if err != nil { - return nil, err - } - - service, err := s.sdk.Service.Get(hash) + service, err := s.sdk.Service.Get(req.Hash) if err != nil { return nil, err } diff --git a/server/grpc/api/workflow.go b/server/grpc/api/workflow.go index c0f64f596..27532418e 100644 --- a/server/grpc/api/workflow.go +++ b/server/grpc/api/workflow.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/protobuf/api" "github.com/mesg-foundation/engine/protobuf/types" "github.com/mesg-foundation/engine/sdk" @@ -36,26 +35,17 @@ func (s *WorkflowServer) Create(ctx context.Context, req *api.CreateWorkflowRequ if err != nil { return nil, err } - return &api.CreateWorkflowResponse{Hash: wf.Hash.String()}, nil + return &api.CreateWorkflowResponse{Hash: wf.Hash}, nil } // Delete deletes service by hash or sid. func (s *WorkflowServer) Delete(ctx context.Context, request *api.DeleteWorkflowRequest) (*api.DeleteWorkflowResponse, error) { - hash, err := hash.Decode(request.Hash) - if err != nil { - return nil, err - } - return &api.DeleteWorkflowResponse{}, s.sdk.Workflow.Delete(hash) + return &api.DeleteWorkflowResponse{}, s.sdk.Workflow.Delete(request.Hash) } // Get returns service from given hash. func (s *WorkflowServer) Get(ctx context.Context, req *api.GetWorkflowRequest) (*types.Workflow, error) { - hash, err := hash.Decode(req.Hash) - if err != nil { - return nil, err - } - - wf, err := s.sdk.Workflow.Get(hash) + wf, err := s.sdk.Workflow.Get(req.Hash) if err != nil { return nil, err } @@ -91,20 +81,16 @@ func fromProtoFilters(filters []*types.Workflow_Trigger_Filter) []*workflow.Trig return fs } -func fromProtoWorkflowNodes(nodes []*types.Workflow_Node) ([]workflow.Node, error) { +func fromProtoWorkflowNodes(nodes []*types.Workflow_Node) []workflow.Node { res := make([]workflow.Node, len(nodes)) for i, node := range nodes { - instanceHash, err := hash.Decode(node.InstanceHash) - if err != nil { - return nil, err - } res[i] = workflow.Node{ Key: node.Key, - InstanceHash: instanceHash, + InstanceHash: node.InstanceHash, TaskKey: node.TaskKey, } } - return res, nil + return res } func fromProtoWorkflowEdges(edges []*types.Workflow_Edge) ([]workflow.Edge, error) { @@ -134,20 +120,13 @@ func fromProtoWorkflowEdges(edges []*types.Workflow_Edge) ([]workflow.Edge, erro } func fromProtoWorkflow(wf *types.Workflow) (*workflow.Workflow, error) { - instanceHash, err := hash.Decode(wf.Trigger.InstanceHash) - if err != nil { - return nil, err - } - nodes, err := fromProtoWorkflowNodes(wf.Nodes) - if err != nil { - return nil, err - } + nodes := fromProtoWorkflowNodes(wf.Nodes) edges, err := fromProtoWorkflowEdges(wf.Edges) if err != nil { return nil, err } trigger := workflow.Trigger{ - InstanceHash: instanceHash, + InstanceHash: wf.Trigger.InstanceHash, NodeKey: wf.Trigger.NodeKey, Filters: fromProtoFilters(wf.Trigger.Filters), } @@ -189,7 +168,7 @@ func toProtoWorkflowNodes(nodes []workflow.Node) []*types.Workflow_Node { for i, node := range nodes { res[i] = &types.Workflow_Node{ Key: node.Key, - InstanceHash: node.InstanceHash.String(), + InstanceHash: node.InstanceHash, TaskKey: node.TaskKey, } } @@ -223,7 +202,7 @@ func toProtoWorkflowEdges(edges []workflow.Edge) []*types.Workflow_Edge { func toProtoWorkflow(wf *workflow.Workflow) *types.Workflow { trigger := &types.Workflow_Trigger{ - InstanceHash: wf.Trigger.InstanceHash.String(), + InstanceHash: wf.Trigger.InstanceHash, Filters: toProtoFilters(wf.Trigger.Filters), NodeKey: wf.Trigger.NodeKey, } @@ -234,7 +213,7 @@ func toProtoWorkflow(wf *workflow.Workflow) *types.Workflow { trigger.Key = &types.Workflow_Trigger_EventKey{EventKey: wf.Trigger.EventKey} } return &types.Workflow{ - Hash: wf.Hash.String(), + Hash: wf.Hash, Key: wf.Key, Trigger: trigger, Nodes: toProtoWorkflowNodes(wf.Nodes), diff --git a/service/service.pb.go b/service/service.pb.go index bd77b0c09..6b28b174c 100644 --- a/service/service.pb.go +++ b/service/service.pb.go @@ -25,7 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package // Service represents the service's type. type Service struct { // Service's hash. - Hash string `protobuf:"bytes,10,opt,name=hash,proto3" json:"hash,omitempty" validate:"required"` + Hash []byte `protobuf:"bytes,10,opt,name=hash,proto3" json:"hash,omitempty" validate:"required"` // Service's sid. Sid string `protobuf:"bytes,12,opt,name=sid,proto3" json:"sid,omitempty" validate:"required,printascii,max=63,domain"` // Service's name. @@ -336,9 +336,9 @@ func init() { func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) } var fileDescriptor_a0b84a42fa06f626 = []byte{ - // 925 bytes of a gzipped FileDescriptorProto + // 928 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0xc7, 0x93, 0xda, 0x49, 0x9a, 0xe9, 0xe6, 0x82, 0x59, 0xa4, 0x1d, 0x22, 0x14, 0x1b, 0x23, + 0x14, 0xc7, 0x93, 0xb5, 0x93, 0x34, 0xd3, 0xe6, 0x82, 0x59, 0xa4, 0x1d, 0x22, 0x14, 0x1b, 0x23, 0x41, 0x16, 0xd2, 0x84, 0x4d, 0xba, 0xed, 0x6e, 0x51, 0x11, 0x1b, 0x96, 0xe5, 0x43, 0xe2, 0x43, 0x2e, 0x2b, 0x56, 0x08, 0x21, 0x4d, 0xec, 0xa9, 0x3b, 0xb4, 0x9e, 0xf1, 0x8e, 0xc7, 0x11, 0x79, 0x02, 0x6e, 0x79, 0x08, 0x5e, 0x82, 0x5b, 0xae, 0x7a, 0xb9, 0x97, 0x5c, 0x19, 0x68, 0xdf, 0xc0, @@ -346,55 +346,55 @@ var fileDescriptor_a0b84a42fa06f626 = []byte{ 0xff, 0x8e, 0x73, 0xce, 0xff, 0x9c, 0x91, 0x41, 0x2d, 0x24, 0x62, 0x48, 0x1d, 0xd2, 0x0e, 0x04, 0x97, 0x1c, 0x96, 0xe4, 0x28, 0x20, 0x61, 0xdd, 0xf2, 0xb8, 0xc7, 0x3b, 0xea, 0xd1, 0x20, 0x3a, 0xe8, 0xa4, 0x77, 0xea, 0x46, 0x5d, 0x8d, 0x43, 0xad, 0x3f, 0x6f, 0x81, 0xca, 0xfe, 0x58, 0x0c, - 0xdf, 0x05, 0xfa, 0x21, 0x0e, 0x0f, 0x11, 0x30, 0x8b, 0xcd, 0x6a, 0xff, 0x56, 0x12, 0x1b, 0x37, - 0x87, 0xf8, 0x98, 0xba, 0x58, 0x92, 0x5d, 0x4b, 0x90, 0xa7, 0x11, 0x15, 0xc4, 0xb5, 0x6c, 0x15, - 0x04, 0xfb, 0x40, 0x0b, 0xa9, 0x8b, 0x6e, 0xa8, 0xd8, 0xf7, 0x92, 0xd8, 0x68, 0x2d, 0xc6, 0xb6, - 0x02, 0x41, 0x99, 0xc4, 0xa1, 0x43, 0x69, 0xcb, 0xc7, 0x3f, 0xed, 0x6d, 0xf7, 0x5a, 0x2e, 0xf7, - 0x31, 0x65, 0x96, 0x9d, 0x8a, 0xe1, 0x43, 0xa0, 0x33, 0xec, 0x13, 0x54, 0xbc, 0x80, 0xa4, 0xec, - 0x5d, 0x2b, 0x7d, 0xba, 0xdb, 0xb5, 0xcc, 0x95, 0x48, 0xcb, 0x56, 0x6a, 0xf8, 0x19, 0xd8, 0x70, - 0x49, 0xe8, 0x08, 0x1a, 0x48, 0xca, 0x19, 0x5a, 0x53, 0xb0, 0xb7, 0x93, 0xd8, 0x78, 0x33, 0x03, - 0xeb, 0x65, 0x61, 0x59, 0x46, 0x56, 0x0b, 0x7d, 0x50, 0x73, 0x38, 0x3b, 0xa0, 0x5e, 0x24, 0xb0, - 0x82, 0xad, 0x9b, 0xc5, 0xe6, 0x46, 0xf7, 0xf5, 0xb6, 0x2a, 0x68, 0x7b, 0x52, 0xa8, 0xf6, 0x47, - 0xd9, 0x98, 0xfe, 0xed, 0x93, 0xd8, 0x28, 0x24, 0xb1, 0xf1, 0x46, 0x26, 0xdd, 0xbd, 0xbc, 0x77, - 0xb7, 0xec, 0x59, 0x3a, 0x7c, 0x0c, 0x4a, 0x12, 0x87, 0x47, 0x21, 0x2a, 0x99, 0x5a, 0x73, 0xa3, - 0x7b, 0x73, 0x2e, 0xcd, 0x37, 0x38, 0x3c, 0xea, 0xbf, 0x93, 0xc4, 0xc6, 0x5b, 0x19, 0xf2, 0x56, - 0x96, 0xec, 0xd2, 0x21, 0x69, 0x5d, 0xe0, 0xc7, 0x34, 0xf8, 0x04, 0x94, 0xc9, 0x90, 0x30, 0x19, - 0xa2, 0xb2, 0xe2, 0xbe, 0x3a, 0xc7, 0xfd, 0x38, 0xfd, 0x71, 0x01, 0x7c, 0x77, 0x05, 0x78, 0xc2, - 0x83, 0x14, 0xdc, 0x70, 0x49, 0x40, 0x98, 0x4b, 0x98, 0x43, 0x49, 0x88, 0x2a, 0x8a, 0xff, 0xda, - 0x1c, 0xff, 0xe1, 0x34, 0x64, 0xb4, 0x90, 0x64, 0x7b, 0x45, 0x92, 0x19, 0x34, 0xfc, 0x1c, 0x00, - 0x41, 0x02, 0x1e, 0x52, 0xc9, 0xc5, 0x08, 0x55, 0x55, 0x53, 0xe7, 0x69, 0x3b, 0x59, 0x1a, 0xf7, - 0xa9, 0x24, 0x7e, 0x20, 0x47, 0xad, 0x48, 0x50, 0xcb, 0xce, 0xa8, 0xe1, 0xa7, 0xa0, 0x1c, 0xf2, - 0x48, 0x38, 0x04, 0xd5, 0x72, 0x9d, 0x76, 0xff, 0x52, 0xa7, 0x4d, 0xf4, 0xf5, 0x5f, 0xd7, 0x40, - 0x49, 0x95, 0x0f, 0xde, 0x07, 0xda, 0x11, 0x19, 0x21, 0x3d, 0xd7, 0x6d, 0x77, 0x96, 0xb9, 0x2d, - 0xd5, 0xc0, 0xf7, 0x67, 0x6c, 0x3f, 0xaf, 0xed, 0x2e, 0xd3, 0xbe, 0x74, 0xb7, 0x3f, 0x01, 0xba, - 0x8b, 0x25, 0x46, 0x9a, 0xea, 0x22, 0x9a, 0xeb, 0xe2, 0xd7, 0x58, 0x60, 0x9f, 0x48, 0x22, 0xae, - 0x65, 0x41, 0x45, 0xac, 0xff, 0xac, 0x01, 0x3d, 0x75, 0xef, 0xb4, 0x4a, 0xeb, 0xff, 0xe1, 0x2a, - 0x7d, 0x0f, 0xca, 0x94, 0x05, 0xd1, 0xf9, 0x34, 0xbd, 0x9c, 0x3a, 0x4d, 0x98, 0xf0, 0x07, 0x50, - 0xe1, 0x91, 0x54, 0xf8, 0xca, 0x35, 0xf1, 0xab, 0x06, 0x76, 0x0a, 0xad, 0xff, 0xa3, 0x81, 0xea, - 0x39, 0xe2, 0xff, 0xd0, 0x8e, 0x23, 0xa0, 0xa7, 0x05, 0x42, 0x9a, 0x62, 0x7c, 0x9b, 0xc4, 0xc6, - 0xfe, 0xb2, 0x92, 0xe7, 0x1d, 0x43, 0x9c, 0x11, 0x7e, 0xb0, 0xb7, 0x2f, 0x05, 0x65, 0x9e, 0xf9, - 0x65, 0xe4, 0x0f,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e, 0xc7, 0x27, 0xa1, 0xb7, 0x79, 0xc0, + 0x23, 0xe6, 0xaa, 0x45, 0xd1, 0x21, 0xcc, 0xa3, 0x8c, 0x74, 0x26, 0xdf, 0x16, 0x83, 0xb2, 0xfa, + 0x62, 0xe8, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x33, 0x20, 0xa7, 0x6d, 0x0c, 0x00, 0x00, } func (m *Service) Marshal() (dAtA []byte, err error) { @@ -1417,7 +1417,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -1427,23 +1427,25 @@ func (m *Service) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = string(dAtA[iNdEx:postIndex]) + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } iNdEx = postIndex case 12: if wireType != 2 {