changeset 33:7f084f715214

Add schema for clusterrpc implementation
author Lewin Bormann <lbo@spheniscida.de>
date Fri, 14 Oct 2016 22:25:56 +0200
parents e9b41018f5e4
children 8fa310d9bb1d
files example_clusterrpc/proto/consensus.pb.go example_clusterrpc/proto/consensus.proto
diffstat 2 files changed, 456 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example_clusterrpc/proto/consensus.pb.go	Fri Oct 14 22:25:56 2016 +0200
@@ -0,0 +1,394 @@
+// Code generated by protoc-gen-go.
+// source: consensus.proto
+// DO NOT EDIT!
+
+/*
+Package proto is a generated protocol buffer package.
+
+It is generated from these files:
+	consensus.proto
+
+It has these top-level messages:
+	Error
+	Change
+	Member
+	Version
+	GenericResponse
+	PrepareRequest
+	PrepareResponse
+	AcceptRequest
+	AddMemberRequest
+	RemoveMemberRequest
+	StartParticipation
+	SubmitRequest
+*/
+package proto
+
+import proto1 "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto1.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
+
+type Error struct {
+	Error            *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
+	Type             *string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
+	XXX_unrecognized []byte  `json:"-"`
+}
+
+func (m *Error) Reset()                    { *m = Error{} }
+func (m *Error) String() string            { return proto1.CompactTextString(m) }
+func (*Error) ProtoMessage()               {}
+func (*Error) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+
+func (m *Error) GetError() string {
+	if m != nil && m.Error != nil {
+		return *m.Error
+	}
+	return ""
+}
+
+func (m *Error) GetType() string {
+	if m != nil && m.Type != nil {
+		return *m.Type
+	}
+	return ""
+}
+
+type Change struct {
+	Change           []byte `protobuf:"bytes,1,opt,name=change" json:"change,omitempty"`
+	XXX_unrecognized []byte `json:"-"`
+}
+
+func (m *Change) Reset()                    { *m = Change{} }
+func (m *Change) String() string            { return proto1.CompactTextString(m) }
+func (*Change) ProtoMessage()               {}
+func (*Change) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
+
+func (m *Change) GetChange() []byte {
+	if m != nil {
+		return m.Change
+	}
+	return nil
+}
+
+type Member struct {
+	Address          *string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
+	XXX_unrecognized []byte  `json:"-"`
+}
+
+func (m *Member) Reset()                    { *m = Member{} }
+func (m *Member) String() string            { return proto1.CompactTextString(m) }
+func (*Member) ProtoMessage()               {}
+func (*Member) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
+
+func (m *Member) GetAddress() string {
+	if m != nil && m.Address != nil {
+		return *m.Address
+	}
+	return ""
+}
+
+type Version struct {
+	Instance         *uint64 `protobuf:"varint,1,req,name=instance" json:"instance,omitempty"`
+	Sequence         *uint64 `protobuf:"varint,2,req,name=sequence" json:"sequence,omitempty"`
+	XXX_unrecognized []byte  `json:"-"`
+}
+
+func (m *Version) Reset()                    { *m = Version{} }
+func (m *Version) String() string            { return proto1.CompactTextString(m) }
+func (*Version) ProtoMessage()               {}
+func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
+
+func (m *Version) GetInstance() uint64 {
+	if m != nil && m.Instance != nil {
+		return *m.Instance
+	}
+	return 0
+}
+
+func (m *Version) GetSequence() uint64 {
+	if m != nil && m.Sequence != nil {
+		return *m.Sequence
+	}
+	return 0
+}
+
+type GenericResponse struct {
+	Accepted         *bool  `protobuf:"varint,1,req,name=accepted" json:"accepted,omitempty"`
+	Error            *Error `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
+	XXX_unrecognized []byte `json:"-"`
+}
+
+func (m *GenericResponse) Reset()                    { *m = GenericResponse{} }
+func (m *GenericResponse) String() string            { return proto1.CompactTextString(m) }
+func (*GenericResponse) ProtoMessage()               {}
+func (*GenericResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
+
+func (m *GenericResponse) GetAccepted() bool {
+	if m != nil && m.Accepted != nil {
+		return *m.Accepted
+	}
+	return false
+}
+
+func (m *GenericResponse) GetError() *Error {
+	if m != nil {
+		return m.Error
+	}
+	return nil
+}
+
+type PrepareRequest struct {
+	Instance         *uint64 `protobuf:"varint,1,req,name=instance" json:"instance,omitempty"`
+	Master           *Member `protobuf:"bytes,2,req,name=master" json:"master,omitempty"`
+	XXX_unrecognized []byte  `json:"-"`
+}
+
+func (m *PrepareRequest) Reset()                    { *m = PrepareRequest{} }
+func (m *PrepareRequest) String() string            { return proto1.CompactTextString(m) }
+func (*PrepareRequest) ProtoMessage()               {}
+func (*PrepareRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
+
+func (m *PrepareRequest) GetInstance() uint64 {
+	if m != nil && m.Instance != nil {
+		return *m.Instance
+	}
+	return 0
+}
+
+func (m *PrepareRequest) GetMaster() *Member {
+	if m != nil {
+		return m.Master
+	}
+	return nil
+}
+
+type PrepareResponse struct {
+	Instance         *uint64 `protobuf:"varint,1,req,name=instance" json:"instance,omitempty"`
+	Error            *Error  `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
+	XXX_unrecognized []byte  `json:"-"`
+}
+
+func (m *PrepareResponse) Reset()                    { *m = PrepareResponse{} }
+func (m *PrepareResponse) String() string            { return proto1.CompactTextString(m) }
+func (*PrepareResponse) ProtoMessage()               {}
+func (*PrepareResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
+
+func (m *PrepareResponse) GetInstance() uint64 {
+	if m != nil && m.Instance != nil {
+		return *m.Instance
+	}
+	return 0
+}
+
+func (m *PrepareResponse) GetError() *Error {
+	if m != nil {
+		return m.Error
+	}
+	return nil
+}
+
+type AcceptRequest struct {
+	Version          *Version  `protobuf:"bytes,1,req,name=version" json:"version,omitempty"`
+	Changes          []*Change `protobuf:"bytes,2,rep,name=changes" json:"changes,omitempty"`
+	XXX_unrecognized []byte    `json:"-"`
+}
+
+func (m *AcceptRequest) Reset()                    { *m = AcceptRequest{} }
+func (m *AcceptRequest) String() string            { return proto1.CompactTextString(m) }
+func (*AcceptRequest) ProtoMessage()               {}
+func (*AcceptRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
+
+func (m *AcceptRequest) GetVersion() *Version {
+	if m != nil {
+		return m.Version
+	}
+	return nil
+}
+
+func (m *AcceptRequest) GetChanges() []*Change {
+	if m != nil {
+		return m.Changes
+	}
+	return nil
+}
+
+type AddMemberRequest struct {
+	Version          *Version `protobuf:"bytes,1,req,name=version" json:"version,omitempty"`
+	Member           *Member  `protobuf:"bytes,2,req,name=member" json:"member,omitempty"`
+	XXX_unrecognized []byte   `json:"-"`
+}
+
+func (m *AddMemberRequest) Reset()                    { *m = AddMemberRequest{} }
+func (m *AddMemberRequest) String() string            { return proto1.CompactTextString(m) }
+func (*AddMemberRequest) ProtoMessage()               {}
+func (*AddMemberRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
+
+func (m *AddMemberRequest) GetVersion() *Version {
+	if m != nil {
+		return m.Version
+	}
+	return nil
+}
+
+func (m *AddMemberRequest) GetMember() *Member {
+	if m != nil {
+		return m.Member
+	}
+	return nil
+}
+
+type RemoveMemberRequest struct {
+	Version          *Version `protobuf:"bytes,1,req,name=version" json:"version,omitempty"`
+	Member           *Member  `protobuf:"bytes,2,req,name=member" json:"member,omitempty"`
+	XXX_unrecognized []byte   `json:"-"`
+}
+
+func (m *RemoveMemberRequest) Reset()                    { *m = RemoveMemberRequest{} }
+func (m *RemoveMemberRequest) String() string            { return proto1.CompactTextString(m) }
+func (*RemoveMemberRequest) ProtoMessage()               {}
+func (*RemoveMemberRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
+
+func (m *RemoveMemberRequest) GetVersion() *Version {
+	if m != nil {
+		return m.Version
+	}
+	return nil
+}
+
+func (m *RemoveMemberRequest) GetMember() *Member {
+	if m != nil {
+		return m.Member
+	}
+	return nil
+}
+
+type StartParticipation struct {
+	Version          *Version  `protobuf:"bytes,1,req,name=version" json:"version,omitempty"`
+	Cluster          *string   `protobuf:"bytes,2,req,name=cluster" json:"cluster,omitempty"`
+	Self             *Member   `protobuf:"bytes,3,req,name=self" json:"self,omitempty"`
+	Master           *Member   `protobuf:"bytes,4,req,name=master" json:"master,omitempty"`
+	Members          []*Member `protobuf:"bytes,5,rep,name=members" json:"members,omitempty"`
+	Snapshot         []byte    `protobuf:"bytes,6,req,name=snapshot" json:"snapshot,omitempty"`
+	XXX_unrecognized []byte    `json:"-"`
+}
+
+func (m *StartParticipation) Reset()                    { *m = StartParticipation{} }
+func (m *StartParticipation) String() string            { return proto1.CompactTextString(m) }
+func (*StartParticipation) ProtoMessage()               {}
+func (*StartParticipation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
+
+func (m *StartParticipation) GetVersion() *Version {
+	if m != nil {
+		return m.Version
+	}
+	return nil
+}
+
+func (m *StartParticipation) GetCluster() string {
+	if m != nil && m.Cluster != nil {
+		return *m.Cluster
+	}
+	return ""
+}
+
+func (m *StartParticipation) GetSelf() *Member {
+	if m != nil {
+		return m.Self
+	}
+	return nil
+}
+
+func (m *StartParticipation) GetMaster() *Member {
+	if m != nil {
+		return m.Master
+	}
+	return nil
+}
+
+func (m *StartParticipation) GetMembers() []*Member {
+	if m != nil {
+		return m.Members
+	}
+	return nil
+}
+
+func (m *StartParticipation) GetSnapshot() []byte {
+	if m != nil {
+		return m.Snapshot
+	}
+	return nil
+}
+
+type SubmitRequest struct {
+	Changes          []*Change `protobuf:"bytes,1,rep,name=changes" json:"changes,omitempty"`
+	XXX_unrecognized []byte    `json:"-"`
+}
+
+func (m *SubmitRequest) Reset()                    { *m = SubmitRequest{} }
+func (m *SubmitRequest) String() string            { return proto1.CompactTextString(m) }
+func (*SubmitRequest) ProtoMessage()               {}
+func (*SubmitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
+
+func (m *SubmitRequest) GetChanges() []*Change {
+	if m != nil {
+		return m.Changes
+	}
+	return nil
+}
+
+func init() {
+	proto1.RegisterType((*Error)(nil), "proto.Error")
+	proto1.RegisterType((*Change)(nil), "proto.Change")
+	proto1.RegisterType((*Member)(nil), "proto.Member")
+	proto1.RegisterType((*Version)(nil), "proto.Version")
+	proto1.RegisterType((*GenericResponse)(nil), "proto.GenericResponse")
+	proto1.RegisterType((*PrepareRequest)(nil), "proto.PrepareRequest")
+	proto1.RegisterType((*PrepareResponse)(nil), "proto.PrepareResponse")
+	proto1.RegisterType((*AcceptRequest)(nil), "proto.AcceptRequest")
+	proto1.RegisterType((*AddMemberRequest)(nil), "proto.AddMemberRequest")
+	proto1.RegisterType((*RemoveMemberRequest)(nil), "proto.RemoveMemberRequest")
+	proto1.RegisterType((*StartParticipation)(nil), "proto.StartParticipation")
+	proto1.RegisterType((*SubmitRequest)(nil), "proto.SubmitRequest")
+}
+
+func init() { proto1.RegisterFile("consensus.proto", fileDescriptor0) }
+
+var fileDescriptor0 = []byte{
+	// 387 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x92, 0xcd, 0x6e, 0xe2, 0x30,
+	0x10, 0xc7, 0x15, 0xc8, 0x07, 0x0c, 0x09, 0x20, 0xef, 0x25, 0xab, 0xd5, 0x7e, 0xc8, 0xda, 0x03,
+	0x97, 0x65, 0x25, 0x9e, 0x60, 0xd1, 0xaa, 0xea, 0xa9, 0x12, 0x0a, 0x6a, 0xef, 0xc6, 0x99, 0x96,
+	0x48, 0xc4, 0x49, 0x6d, 0x07, 0xa9, 0xef, 0xd5, 0x07, 0x6c, 0x6c, 0x03, 0xa5, 0x55, 0xd4, 0xf6,
+	0xd0, 0x03, 0xc2, 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xf8, 0x09, 0xd1, 0xde, 0xd9, 0x60, 0xcb,
+	0x47, 0x8b, 0xf1, 0x21, 0xff, 0x68, 0xce, 0x0f, 0x88, 0x9c, 0xa5, 0xaa, 0x15, 0xec, 0x9f, 0x31,
+	0x39, 0xcb, 0x69, 0x06, 0xd3, 0x65, 0x9e, 0x3b, 0xc0, 0x0f, 0x8b, 0x9a, 0x39, 0x6d, 0x45, 0xf7,
+	0x9c, 0xd7, 0xf0, 0x25, 0xc3, 0xb2, 0xda, 0xe3, 0xe7, 0xca, 0x3e, 0x7a, 0x40, 0xd6, 0x9a, 0x49,
+	0xbd, 0x6a, 0x7f, 0x05, 0x2f, 0x6a, 0xa6, 0x4d, 0xd5, 0xbb, 0xb2, 0xed, 0xdb, 0xe1, 0xbb, 0xe6,
+	0xb4, 0x96, 0x61, 0x6b, 0xb1, 0xaf, 0x70, 0x77, 0x9b, 0xf6, 0x3b, 0xba, 0x9c, 0xed, 0xd0, 0xef,
+	0xba, 0x6e, 0xfd, 0x74, 0x8c, 0x2a, 0x0d, 0x5e, 0xf8, 0x79, 0xb8, 0x37, 0x4f, 0x4f, 0xb0, 0x5a,
+	0x6d, 0x2b, 0x9d, 0x86, 0xad, 0x40, 0x4c, 0xff, 0x42, 0xb2, 0x6e, 0x36, 0x65, 0x71, 0xda, 0xd9,
+	0xd9, 0x4a, 0xbc, 0x8e, 0x95, 0x3c, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x7d, 0x23, 0xac, 0x4e,
+	0x03, 0x00, 0x00,
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example_clusterrpc/proto/consensus.proto	Fri Oct 14 22:25:56 2016 +0200
@@ -0,0 +1,62 @@
+package proto;
+
+message Error {
+    optional string error = 1;
+    optional string type = 2;
+}
+
+message Change {
+    optional bytes change = 1;
+}
+
+message Member {
+    optional string address = 1;
+}
+
+message Version {
+    required uint64 instance = 1;
+    required uint64 sequence = 2;
+}
+
+message GenericResponse {
+    required bool accepted = 1;
+    optional Error error = 2;
+}
+
+message PrepareRequest {
+    required uint64 instance = 1;
+    required Member master = 2;
+}
+
+message PrepareResponse {
+    required uint64 instance = 1;
+    optional Error error = 2;
+}
+
+message AcceptRequest {
+    required Version version = 1;
+    repeated Change changes = 2;
+}
+
+message AddMemberRequest {
+    required Version version = 1;
+    required Member member = 2;
+}
+
+message RemoveMemberRequest {
+    required Version version = 1;
+    required Member member = 2;
+}
+
+message StartParticipation {
+    required Version version = 1;
+    required string cluster = 2;
+    required Member self = 3;
+    required Member master = 4;
+    repeated Member members = 5;
+    required bytes snapshot = 6;
+}
+
+message SubmitRequest {
+    repeated Change changes = 1;
+}