Add grpc service to shim

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-01-19 14:16:50 -08:00
parent e6de7ea4b5
commit c08e0e610c
8 changed files with 402 additions and 229 deletions

View file

@ -51,6 +51,9 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type CreateRequest struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"`
Runtime string `protobuf:"bytes,3,opt,name=runtime,proto3" json:"runtime,omitempty"`
}
func (m *CreateRequest) Reset() { *m = CreateRequest{} }
@ -126,8 +129,11 @@ func (this *CreateRequest) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 4)
s := make([]string, 0, 7)
s = append(s, "&shim.CreateRequest{")
s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n")
s = append(s, "Bundle: "+fmt.Sprintf("%#v", this.Bundle)+",\n")
s = append(s, "Runtime: "+fmt.Sprintf("%#v", this.Runtime)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
@ -446,6 +452,24 @@ func (m *CreateRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if len(m.Bundle) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintShim(dAtA, i, uint64(len(m.Bundle)))
i += copy(dAtA[i:], m.Bundle)
}
if len(m.Runtime) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintShim(dAtA, i, uint64(len(m.Runtime)))
i += copy(dAtA[i:], m.Runtime)
}
return i, nil
}
@ -636,6 +660,18 @@ func encodeVarintShim(dAtA []byte, offset int, v uint64) int {
func (m *CreateRequest) Size() (n int) {
var l int
_ = l
l = len(m.ID)
if l > 0 {
n += 1 + l + sovShim(uint64(l))
}
l = len(m.Bundle)
if l > 0 {
n += 1 + l + sovShim(uint64(l))
}
l = len(m.Runtime)
if l > 0 {
n += 1 + l + sovShim(uint64(l))
}
return n
}
@ -718,6 +754,9 @@ func (this *CreateRequest) String() string {
return "nil"
}
s := strings.Join([]string{`&CreateRequest{`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`,
`Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`,
`}`,
}, "")
return s
@ -828,6 +867,93 @@ func (m *CreateRequest) Unmarshal(dAtA []byte) error {
return fmt.Errorf("proto: CreateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthShim
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthShim
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Bundle = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthShim
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Runtime = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShim(dAtA[iNdEx:])
@ -1431,30 +1557,32 @@ var (
func init() { proto.RegisterFile("shim.proto", fileDescriptorShim) }
var fileDescriptorShim = []byte{
// 385 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x51, 0xbd, 0x6e, 0xf2, 0x40,
0x10, 0xc4, 0xe6, 0xc3, 0xd2, 0xb7, 0x60, 0xf8, 0x74, 0x42, 0x88, 0xcf, 0x10, 0x83, 0x5c, 0xa5,
0x32, 0x22, 0x69, 0x52, 0x44, 0x8a, 0x44, 0xa0, 0x48, 0x87, 0xec, 0x07, 0x88, 0x0c, 0xde, 0xd8,
0x27, 0x01, 0xe7, 0xd8, 0x07, 0x81, 0x2e, 0x8f, 0x47, 0x99, 0x22, 0x45, 0xaa, 0x28, 0xf8, 0x09,
0xf2, 0x08, 0x91, 0xff, 0x04, 0x98, 0xd0, 0xed, 0xce, 0xce, 0x8d, 0xe6, 0x66, 0x00, 0x02, 0x97,
0xce, 0x75, 0xcf, 0x67, 0x9c, 0x11, 0x79, 0xca, 0x16, 0xdc, 0xa2, 0x0b, 0xf4, 0x6d, 0x7d, 0xd5,
0x57, 0x5a, 0x0e, 0x63, 0xce, 0x0c, 0x7b, 0xf1, 0x71, 0xb2, 0x7c, 0xea, 0xe1, 0xdc, 0xe3,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, 0x59, 0x7d, 0xfa, 0x28, 0xaa, 0x2f, 0x32, 0x91,
0x84, 0x79, 0x62, 0xe2, 0x28, 0xf4, 0x13, 0x13, 0xb9, 0x06, 0xee, 0xe0, 0x4f, 0x94, 0x28, 0x51,
0x72, 0xb4, 0x83, 0xd4, 0x95, 0xd6, 0xaf, 0xb7, 0x54, 0xe0, 0x06, 0x8a, 0x63, 0xbe, 0x21, 0xff,
0x73, 0x9c, 0x7d, 0x09, 0xe7, 0x7e, 0x30, 0x68, 0x6f, 0x77, 0x6a, 0xe1, 0x63, 0xa7, 0x16, 0xbe,
0x77, 0xaa, 0xf0, 0x1a, 0xaa, 0xc2, 0x36, 0x54, 0x85, 0xb7, 0x50, 0x15, 0xbe, 0x42, 0x55, 0x98,
0x48, 0x31, 0xfb, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x9a, 0x8d, 0xf1, 0xd9, 0x02, 0x00,
0x00,
// 419 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x92, 0xbf, 0x8e, 0xd3, 0x40,
0x10, 0xc6, 0xcf, 0x0e, 0x67, 0xc4, 0xe4, 0x1c, 0xd0, 0xea, 0x14, 0x19, 0xe7, 0xf0, 0x9d, 0x5c,
0x51, 0x39, 0x3a, 0x68, 0x28, 0x90, 0x90, 0x42, 0x52, 0xd0, 0x45, 0x76, 0x45, 0x85, 0x9c, 0x78,
0xb0, 0x57, 0x8a, 0xbd, 0xc6, 0x5e, 0x87, 0xa4, 0xe3, 0xf1, 0x52, 0x52, 0x50, 0x50, 0x21, 0xe2,
0x27, 0xe0, 0x11, 0xd0, 0xae, 0xd7, 0x90, 0x38, 0x44, 0x74, 0x3b, 0x7f, 0xf4, 0xed, 0x37, 0xbf,
0x19, 0x80, 0x32, 0xa1, 0xa9, 0x97, 0x17, 0x8c, 0x33, 0x62, 0x2e, 0x59, 0xc6, 0x43, 0x9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