Support service types in runtime

This commit is contained in:
Asim Aslam
2019-11-29 11:35:00 +00:00
parent 114bc1e18b
commit c3ed83dfba
12 changed files with 171 additions and 164 deletions

View File

@@ -27,12 +27,8 @@ type Service struct {
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
// git url of the source
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
// local path of the source
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
// command to execute
Exec []string `protobuf:"bytes,5,rep,name=exec,proto3" json:"exec,omitempty"`
// service metadata
Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -84,20 +80,6 @@ func (m *Service) GetSource() string {
return ""
}
func (m *Service) GetPath() string {
if m != nil {
return m.Path
}
return ""
}
func (m *Service) GetExec() []string {
if m != nil {
return m.Exec
}
return nil
}
func (m *Service) GetMetadata() map[string]string {
if m != nil {
return m.Metadata
@@ -242,8 +224,12 @@ func (m *CreateResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_CreateResponse proto.InternalMessageInfo
type ReadOptions struct {
// service name
Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
// version of the service
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
// type of service
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -274,6 +260,13 @@ func (m *ReadOptions) XXX_DiscardUnknown() {
var xxx_messageInfo_ReadOptions proto.InternalMessageInfo
func (m *ReadOptions) GetService() string {
if m != nil {
return m.Service
}
return ""
}
func (m *ReadOptions) GetVersion() string {
if m != nil {
return m.Version
@@ -281,9 +274,15 @@ func (m *ReadOptions) GetVersion() string {
return ""
}
func (m *ReadOptions) GetType() string {
if m != nil {
return m.Type
}
return ""
}
type ReadRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Options *ReadOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
Options *ReadOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -314,13 +313,6 @@ func (m *ReadRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_ReadRequest proto.InternalMessageInfo
func (m *ReadRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ReadRequest) GetOptions() *ReadOptions {
if m != nil {
return m.Options
@@ -599,37 +591,36 @@ func init() {
}
var fileDescriptor_4bc91a8efec81434 = []byte{
// 498 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4b, 0x6f, 0xd3, 0x40,
0x10, 0xae, 0xe3, 0xd4, 0x2e, 0x63, 0x8c, 0xa2, 0x15, 0x42, 0x4b, 0x25, 0x20, 0xf2, 0xa5, 0xbd,
0xe0, 0x48, 0xae, 0x10, 0xaf, 0x63, 0x53, 0x71, 0x21, 0x42, 0x72, 0xc5, 0x85, 0xdb, 0xe2, 0x8c,
0x8a, 0x45, 0xed, 0x35, 0xde, 0x75, 0x44, 0x4f, 0x5c, 0xf9, 0xcb, 0xdc, 0xd0, 0xbe, 0x42, 0xe2,
0xda, 0x5c, 0x72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, 0x09, 0x5e, 0x98, 0x81, 0x05, 0x00, 0x00,
}

View File

@@ -17,12 +17,8 @@ message Service {
string version = 2;
// git url of the source
string source = 3;
// local path of the source
string path = 4;
// command to execute
repeated string exec = 5;
// service metadata
map<string,string> metadata = 6;
map<string,string> metadata = 4;
}
message CreateOptions {
@@ -42,13 +38,16 @@ message CreateRequest {
message CreateResponse {}
message ReadOptions {
// version of the service
string version = 2;
// service name
string service = 1;
// version of the service
string version = 2;
// type of service
string type = 3;
}
message ReadRequest {
string name = 1;
ReadOptions options = 2;
ReadOptions options = 1;
}
message ReadResponse {