client.pb.go 11.5 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 56 57 58
	// / The TTP address provided by the platform, to use in case of issue during signature.
	// / Empty if no TTP used.
	TtpAddrPort string `protobuf:"bytes,7,opt,name=ttpAddrPort" json:"ttpAddrPort,omitempty"`
	// / The TTP certificate SHA-512 hash
	TtpHash []byte `protobuf:"bytes,8,opt,name=ttpHash,proto3" json:"ttpHash,omitempty"`
59
	// / The signed metadata seal, as provided by the platform during the ready signal
60
	Seal []byte `protobuf:"bytes,10,opt,name=seal,proto3" json:"seal,omitempty"`
61 62 63 64 65 66 67
}

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
68
type Promise struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
69
	// / Metadata
70
	Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
71 72 73 74
	// / 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
75 76 77 78 79
}

func (m *Promise) Reset()                    { *m = Promise{} }
func (m *Promise) String() string            { return proto.CompactTextString(m) }
func (*Promise) ProtoMessage()               {}
80 81 82 83 84 85 86 87
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
88 89

type Signature struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
90
	// / Metadata
91
	Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
92 93
	// / 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
94 95 96 97 98
}

func (m *Signature) Reset()                    { *m = Signature{} }
func (m *Signature) String() string            { return proto.CompactTextString(m) }
func (*Signature) ProtoMessage()               {}
99 100 101 102 103 104 105 106
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
107

Loïck Bonniot's avatar
Loïck Bonniot committed
108
// / Hello message is used when discovering peers.
Caro Axel's avatar
Caro Axel committed
109
type Hello struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
110
	// / Used version of DFSS client
Caro Axel's avatar
Caro Axel committed
111 112 113 114 115 116
	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()               {}
117
func (*Hello) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
Caro Axel's avatar
Caro Axel committed
118 119

func init() {
120
	proto.RegisterType((*Context)(nil), "api.Context")
Caro Axel's avatar
Caro Axel committed
121 122 123 124 125 126 127 128 129
	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
130 131 132 133
// 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
134 135 136
// Client API for Client service

type ClientClient interface {
Loïck Bonniot's avatar
Loïck Bonniot committed
137
	// / Handle reception of promises.
Caro Axel's avatar
Caro Axel committed
138
	TreatPromise(ctx context.Context, in *Promise, opts ...grpc.CallOption) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
139
	// / Handle receptions of signatures.
Caro Axel's avatar
Caro Axel committed
140
	TreatSignature(ctx context.Context, in *Signature, opts ...grpc.CallOption) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
141
	// / Permits initial handshake for P2P between clients.
Caro Axel's avatar
Caro Axel committed
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 178 179 180 181 182
	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
183
	// / Handle reception of promises.
Caro Axel's avatar
Caro Axel committed
184
	TreatPromise(context.Context, *Promise) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
185
	// / Handle receptions of signatures.
Caro Axel's avatar
Caro Axel committed
186
	TreatSignature(context.Context, *Signature) (*api1.ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
187
	// / Permits initial handshake for P2P between clients.
Caro Axel's avatar
Caro Axel committed
188 189 190 191 192 193 194
	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
195
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
196 197 198 199
	in := new(Promise)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
200 201
	if interceptor == nil {
		return srv.(ClientServer).TreatPromise(ctx, in)
Caro Axel's avatar
Caro Axel committed
202
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
203 204 205 206 207 208 209 210
	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
211 212
}

Loïck Bonniot's avatar
Loïck Bonniot committed
213
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
214 215 216 217
	in := new(Signature)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
218 219
	if interceptor == nil {
		return srv.(ClientServer).TreatSignature(ctx, in)
Caro Axel's avatar
Caro Axel committed
220
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
221 222 223 224 225 226 227 228
	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
229 230
}

Loïck Bonniot's avatar
Loïck Bonniot committed
231
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
232 233 234 235
	in := new(Hello)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
236 237
	if interceptor == nil {
		return srv.(ClientServer).Discover(ctx, in)
Caro Axel's avatar
Caro Axel committed
238
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
239 240 241 242 243 244 245 246
	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
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
}

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{
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
	// 404 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x52, 0xdd, 0xca, 0xda, 0x40,
	0x10, 0xf5, 0x3f, 0x3a, 0x46, 0x29, 0x8b, 0x17,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, 0x1f, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x63, 0xf5, 0x69, 0x69,
	0xf1, 0x02, 0x00, 0x00,
Caro Axel's avatar
Caro Axel committed
297
}