client.pb.go 11.1 KB
Newer Older
Caro Axel's avatar
Caro Axel committed
1 2 3 4 5 6 7 8 9 10 11
// Code generated by protoc-gen-go.
// source: dfss/dfssc/api/client.proto
// DO NOT EDIT!

/*
Package api is a generated protocol buffer package.

It is generated from these files:
	dfss/dfssc/api/client.proto

It has these top-level messages:
12
	Context
Caro Axel's avatar
Caro Axel committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
	Promise
	Signature
	Hello
*/
package api

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import api1 "dfss/dfssp/api"

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

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.ProtoPackageIsVersion1

Loïck Bonniot's avatar
Loïck Bonniot committed
38 39
// / Context stores the current context of a specific promise or signature.
// It is a kind of "symbolic" promise, with no real cryptographic proofs inside.
40
type Context struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
41 42 43 44 45 46 47 48 49 50 51 52 53
	// / SHA-512 certificate hash
	RecipientKeyHash []byte `protobuf:"bytes,1,opt,name=recipientKeyHash,proto3" json:"recipientKeyHash,omitempty"`
	// / SHA-512 certificate hash
	SenderKeyHash []byte `protobuf:"bytes,2,opt,name=senderKeyHash,proto3" json:"senderKeyHash,omitempty"`
	// / The signing sequence used
	Sequence []uint32 `protobuf:"varint,3,rep,name=sequence" json:"sequence,omitempty"`
	// / The list of signers hashes, as provided by the dfss file.
	// The order is very important.
	Signers [][]byte `protobuf:"bytes,4,rep,name=signers,proto3" json:"signers,omitempty"`
	// / The contract document hash, as provided by the dfss file
	ContractDocumentHash []byte `protobuf:"bytes,5,opt,name=contractDocumentHash,proto3" json:"contractDocumentHash,omitempty"`
	// / The unique signature attemp ID, as provided by the platform during the ready signal
	SignatureUUID string `protobuf:"bytes,6,opt,name=signatureUUID" json:"signatureUUID,omitempty"`
54 55
	// / The signed metadata seal, as provided by the platform during the ready signal
	Seal []byte `protobuf:"bytes,7,opt,name=seal,proto3" json:"seal,omitempty"`
56 57 58 59 60 61 62
}

func (m *Context) Reset()                    { *m = Context{} }
func (m *Context) String() string            { return proto.CompactTextString(m) }
func (*Context) ProtoMessage()               {}
func (*Context) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

Caro Axel's avatar
Caro Axel committed
63
type Promise struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
64
	// / Metadata
65
	Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
66 67 68 69
	// / The index of the sequence for this promise
	Index uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
	// / The crypographic payload, currently NOT IMPLEMENTED
	Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
Caro Axel's avatar
Caro Axel committed
70 71 72 73 74
}

func (m *Promise) Reset()                    { *m = Promise{} }
func (m *Promise) String() string            { return proto.CompactTextString(m) }
func (*Promise) ProtoMessage()               {}
75 76 77 78 79 80 81 82
func (*Promise) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *Promise) GetContext() *Context {
	if m != nil {
		return m.Context
	}
	return nil
}
Caro Axel's avatar
Caro Axel committed
83 84

type Signature struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
85
	// / Metadata
86
	Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
87 88
	// / The crypographic payload, currently NOT IMPLEMENTED
	Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
Caro Axel's avatar
Caro Axel committed
89 90 91 92 93
}

func (m *Signature) Reset()                    { *m = Signature{} }
func (m *Signature) String() string            { return proto.CompactTextString(m) }
func (*Signature) ProtoMessage()               {}
94 95 96 97 98 99 100 101
func (*Signature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func (m *Signature) GetContext() *Context {
	if m != nil {
		return m.Context
	}
	return nil
}
Caro Axel's avatar
Caro Axel committed
102

Loïck Bonniot's avatar
Loïck Bonniot committed
103
// / Hello message is used when discovering peers.
Caro Axel's avatar
Caro Axel committed
104
type Hello struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
105
	// / Used version of DFSS client
Caro Axel's avatar
Caro Axel committed
106 107 108 109 110 111
	Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
}

func (m *Hello) Reset()                    { *m = Hello{} }
func (m *Hello) String() string            { return proto.CompactTextString(m) }
func (*Hello) ProtoMessage()               {}
112
func (*Hello) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
Caro Axel's avatar
Caro Axel committed
113 114

func init() {
115
	proto.RegisterType((*Context)(nil), "api.Context")
Caro Axel's avatar
Caro Axel committed
116 117 118 119 120 121 122 123 124
	proto.RegisterType((*Promise)(nil), "api.Promise")
	proto.RegisterType((*Signature)(nil), "api.Signature")
	proto.RegisterType((*Hello)(nil), "api.Hello")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

Loïck Bonniot's avatar
Loïck Bonniot committed
125 126 127 128
// 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.SupportPackageIsVersion2

Caro Axel's avatar
Caro Axel committed
129 130 131
// Client API for Client service

type ClientClient interface {
Loïck Bonniot's avatar
Loïck Bonniot committed
132
	// / Handle reception of promises.
Caro Axel's avatar
Caro Axel committed
133
	TreatPromise(ctx context.Context, in *Promise, opts ...grpc.CallOption) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
134
	// / Handle receptions of signatures.
Caro Axel's avatar
Caro Axel committed
135
	TreatSignature(ctx context.Context, in *Signature, opts ...grpc.CallOption) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
136
	// / Permits initial handshake for P2P between clients.
Caro Axel's avatar
Caro Axel committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
	Discover(ctx context.Context, in *Hello, opts ...grpc.CallOption) (*Hello, error)
}

type clientClient struct {
	cc *grpc.ClientConn
}

func NewClientClient(cc *grpc.ClientConn) ClientClient {
	return &clientClient{cc}
}

func (c *clientClient) TreatPromise(ctx context.Context, in *Promise, opts ...grpc.CallOption) (*api1.ErrorCode, error) {
	out := new(api1.ErrorCode)
	err := grpc.Invoke(ctx, "/api.Client/TreatPromise", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *clientClient) TreatSignature(ctx context.Context, in *Signature, opts ...grpc.CallOption) (*api1.ErrorCode, error) {
	out := new(api1.ErrorCode)
	err := grpc.Invoke(ctx, "/api.Client/TreatSignature", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *clientClient) Discover(ctx context.Context, in *Hello, opts ...grpc.CallOption) (*Hello, error) {
	out := new(Hello)
	err := grpc.Invoke(ctx, "/api.Client/Discover", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Client service

type ClientServer interface {
Loïck Bonniot's avatar
Loïck Bonniot committed
178
	// / Handle reception of promises.
Caro Axel's avatar
Caro Axel committed
179
	TreatPromise(context.Context, *Promise) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
180
	// / Handle receptions of signatures.
Caro Axel's avatar
Caro Axel committed
181
	TreatSignature(context.Context, *Signature) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
182
	// / Permits initial handshake for P2P between clients.
Caro Axel's avatar
Caro Axel committed
183 184 185 186 187 188 189
	Discover(context.Context, *Hello) (*Hello, error)
}

func RegisterClientServer(s *grpc.Server, srv ClientServer) {
	s.RegisterService(&_Client_serviceDesc, srv)
}

Loïck Bonniot's avatar
Loïck Bonniot committed
190
func _Client_TreatPromise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
Caro Axel's avatar
Caro Axel committed
191 192 193 194
	in := new(Promise)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
195 196
	if interceptor == nil {
		return srv.(ClientServer).TreatPromise(ctx, in)
Caro Axel's avatar
Caro Axel committed
197
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
198 199 200 201 202 203 204 205
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Client/TreatPromise",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClientServer).TreatPromise(ctx, req.(*Promise))
	}
	return interceptor(ctx, in, info, handler)
Caro Axel's avatar
Caro Axel committed
206 207
}

Loïck Bonniot's avatar
Loïck Bonniot committed
208
func _Client_TreatSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
Caro Axel's avatar
Caro Axel committed
209 210 211 212
	in := new(Signature)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
213 214
	if interceptor == nil {
		return srv.(ClientServer).TreatSignature(ctx, in)
Caro Axel's avatar
Caro Axel committed
215
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
216 217 218 219 220 221 222 223
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Client/TreatSignature",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClientServer).TreatSignature(ctx, req.(*Signature))
	}
	return interceptor(ctx, in, info, handler)
Caro Axel's avatar
Caro Axel committed
224 225
}

Loïck Bonniot's avatar
Loïck Bonniot committed
226
func _Client_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
Caro Axel's avatar
Caro Axel committed
227 228 229 230
	in := new(Hello)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
231 232
	if interceptor == nil {
		return srv.(ClientServer).Discover(ctx, in)
Caro Axel's avatar
Caro Axel committed
233
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
234 235 236 237 238 239 240 241
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Client/Discover",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClientServer).Discover(ctx, req.(*Hello))
	}
	return interceptor(ctx, in, info, handler)
Caro Axel's avatar
Caro Axel committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
}

var _Client_serviceDesc = grpc.ServiceDesc{
	ServiceName: "api.Client",
	HandlerType: (*ClientServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TreatPromise",
			Handler:    _Client_TreatPromise_Handler,
		},
		{
			MethodName: "TreatSignature",
			Handler:    _Client_TreatSignature_Handler,
		},
		{
			MethodName: "Discover",
			Handler:    _Client_Discover_Handler,
		},
	},
	Streams: []grpc.StreamDesc{},
}

var fileDescriptor0 = []byte{
Caro Axel's avatar
Caro Axel committed
265
	// 380 bytes of a gzipped FileDescriptorProto
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x52, 0xed, 0xaa, 0xda, 0x40,
	0x10, 0x35, 0x7e, 0x45, 0xa7, 0x51, 0xca, 0xe2, 0x8f, 0x90, 0x52, 0xb0, 0x41, 0x8a, 0xf4, 0x47,
	0x04, 0xfb, 0x08, 0x5a, 0xb0, 0x94, 0x42, 0x49, 0xeb, 0x03, 0x6c, 0x37, 0x63, 0xbb, 0x10, 0xb3,
	0xe9, 0xee, 0x5a, 0xf4, 0x35, 0x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