6b60852c76
This change moves the RPC definitions to the pkg/murpc package, underneath the proto folder. This is to ensure that the resulting Protobufs get a good package name "murpc" that is unique within the overall toolchain. It also includes a `generate.sh` script that can be used to manually regenerate client/server code. Finally, we are actually checking in the generated files underneath pkg/murpc.
375 lines
14 KiB
Go
375 lines
14 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: provider.proto
|
|
// DO NOT EDIT!
|
|
|
|
package murpc
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
|
|
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
type CreateRequest struct {
|
|
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
|
|
Properties *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *CreateRequest) Reset() { *m = CreateRequest{} }
|
|
func (m *CreateRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*CreateRequest) ProtoMessage() {}
|
|
func (*CreateRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
|
|
|
|
func (m *CreateRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CreateRequest) GetProperties() *google_protobuf1.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type CreateResponse struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *CreateResponse) Reset() { *m = CreateResponse{} }
|
|
func (m *CreateResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*CreateResponse) ProtoMessage() {}
|
|
func (*CreateResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
|
|
|
|
func (m *CreateResponse) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ReadRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
|
|
Properties *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *ReadRequest) Reset() { *m = ReadRequest{} }
|
|
func (m *ReadRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadRequest) ProtoMessage() {}
|
|
func (*ReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
|
|
|
|
func (m *ReadRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ReadRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ReadRequest) GetProperties() *google_protobuf1.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ReadResponse struct {
|
|
Properties *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *ReadResponse) Reset() { *m = ReadResponse{} }
|
|
func (m *ReadResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadResponse) ProtoMessage() {}
|
|
func (*ReadResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
|
|
|
|
func (m *ReadResponse) GetProperties() *google_protobuf1.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type UpdateRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
|
|
Properties *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
|
|
func (m *UpdateRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*UpdateRequest) ProtoMessage() {}
|
|
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
|
|
|
|
func (m *UpdateRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *UpdateRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *UpdateRequest) GetProperties() *google_protobuf1.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DeleteRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
|
|
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*DeleteRequest) ProtoMessage() {}
|
|
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
|
|
|
|
func (m *DeleteRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*CreateRequest)(nil), "murpc.CreateRequest")
|
|
proto.RegisterType((*CreateResponse)(nil), "murpc.CreateResponse")
|
|
proto.RegisterType((*ReadRequest)(nil), "murpc.ReadRequest")
|
|
proto.RegisterType((*ReadResponse)(nil), "murpc.ReadResponse")
|
|
proto.RegisterType((*UpdateRequest)(nil), "murpc.UpdateRequest")
|
|
proto.RegisterType((*DeleteRequest)(nil), "murpc.DeleteRequest")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for ResourceProvider service
|
|
|
|
type ResourceProviderClient interface {
|
|
// Create allocates a new instance of the provided resource and returns its unique ID afterwards. (The input ID
|
|
// must be blank.) If this call fails, the resource must not have been created (i.e., it is "transacational").
|
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
|
// Read read the instance state identifier by ID, returning a populated resource object, or an error if not found.
|
|
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
|
|
// Update updates an existing resource with new values. Only those values in the provided resource object's
|
|
// property bag are updated to new values. Nothing is returned; an error means the updates did not take place.
|
|
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
|
|
// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
|
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
|
|
}
|
|
|
|
type resourceProviderClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewResourceProviderClient(cc *grpc.ClientConn) ResourceProviderClient {
|
|
return &resourceProviderClient{cc}
|
|
}
|
|
|
|
func (c *resourceProviderClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
|
|
out := new(CreateResponse)
|
|
err := grpc.Invoke(ctx, "/murpc.ResourceProvider/Create", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
|
|
out := new(ReadResponse)
|
|
err := grpc.Invoke(ctx, "/murpc.ResourceProvider/Read", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
|
|
out := new(google_protobuf.Empty)
|
|
err := grpc.Invoke(ctx, "/murpc.ResourceProvider/Update", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
|
|
out := new(google_protobuf.Empty)
|
|
err := grpc.Invoke(ctx, "/murpc.ResourceProvider/Delete", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for ResourceProvider service
|
|
|
|
type ResourceProviderServer interface {
|
|
// Create allocates a new instance of the provided resource and returns its unique ID afterwards. (The input ID
|
|
// must be blank.) If this call fails, the resource must not have been created (i.e., it is "transacational").
|
|
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
|
// Read read the instance state identifier by ID, returning a populated resource object, or an error if not found.
|
|
Read(context.Context, *ReadRequest) (*ReadResponse, error)
|
|
// Update updates an existing resource with new values. Only those values in the provided resource object's
|
|
// property bag are updated to new values. Nothing is returned; an error means the updates did not take place.
|
|
Update(context.Context, *UpdateRequest) (*google_protobuf.Empty, error)
|
|
// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
|
|
Delete(context.Context, *DeleteRequest) (*google_protobuf.Empty, error)
|
|
}
|
|
|
|
func RegisterResourceProviderServer(s *grpc.Server, srv ResourceProviderServer) {
|
|
s.RegisterService(&_ResourceProvider_serviceDesc, srv)
|
|
}
|
|
|
|
func _ResourceProvider_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Create(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/murpc.ResourceProvider/Create",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Create(ctx, req.(*CreateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Read(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/murpc.ResourceProvider/Read",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Read(ctx, req.(*ReadRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/murpc.ResourceProvider/Update",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Update(ctx, req.(*UpdateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/murpc.ResourceProvider/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Delete(ctx, req.(*DeleteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _ResourceProvider_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "murpc.ResourceProvider",
|
|
HandlerType: (*ResourceProviderServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Create",
|
|
Handler: _ResourceProvider_Create_Handler,
|
|
},
|
|
{
|
|
MethodName: "Read",
|
|
Handler: _ResourceProvider_Read_Handler,
|
|
},
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _ResourceProvider_Update_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _ResourceProvider_Delete_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "provider.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("provider.proto", fileDescriptor1) }
|
|
|
|
var fileDescriptor1 = []byte{
|
|
// 309 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x52, 0xcd, 0x4a, 0xc3, 0x40,
|
|
0x10, 0x36, 0xb1, 0x16, 0x9c, 0x9a, 0x20, 0xe3, 0x5f, 0x89, 0x82, 0x21, 0xa7, 0x9e, 0xb6, 0x58,
|
|
0x0f, 0xf5, 0xae, 0xe2, 0x55, 0x22, 0xde, 0xbc, 0xb4, 0xc9, 0x58, 0x22, 0xa9, 0xbb, 0xee, 0x6e,
|
|
0x84, 0xbe, 0xb6, 0x4f, 0x20, 0xcd, 0x26, 0x21, 0x1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