client.pb.go 8.65 KB
Newer Older
Caro Axel's avatar
Caro Axel committed
1 2 3 4 5 6 7 8 9 10 11 12 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
// 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:
	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

// Promise message contains all the required information to verify
38
// the identity of the sender and receiver, and the actual promise
39 40 41
//
// * sequence is transmitted by platform and identical across clients
// * TODO implement an global signature for content
Caro Axel's avatar
Caro Axel committed
42
type Promise struct {
43 44 45 46 47 48
	RecipientKeyHash     []byte `protobuf:"bytes,1,opt,name=recipientKeyHash,proto3" json:"recipientKeyHash,omitempty"`
	SenderKeyHash        []byte `protobuf:"bytes,2,opt,name=senderKeyHash,proto3" json:"senderKeyHash,omitempty"`
	Index                uint32 `protobuf:"varint,3,opt,name=index" json:"index,omitempty"`
	ContractDocumentHash string `protobuf:"bytes,4,opt,name=contractDocumentHash" json:"contractDocumentHash,omitempty"`
	SignatureUuid        string `protobuf:"bytes,5,opt,name=signatureUuid" json:"signatureUuid,omitempty"`
	ContractUuid         string `protobuf:"bytes,6,opt,name=contractUuid" json:"contractUuid,omitempty"`
Caro Axel's avatar
Caro Axel committed
49 50 51 52 53 54 55 56
}

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

// Signature message contains all the required information to verify
57
// the identity of the sender and receiver, and the actual signature
Caro Axel's avatar
Caro Axel committed
58 59 60 61 62 63 64 65 66 67 68 69 70
type Signature struct {
	RecipientKeyHash []byte `protobuf:"bytes,1,opt,name=recipientKeyHash,proto3" json:"recipientKeyHash,omitempty"`
	SenderKeyHash    []byte `protobuf:"bytes,2,opt,name=senderKeyHash,proto3" json:"senderKeyHash,omitempty"`
	Signature        string `protobuf:"bytes,3,opt,name=signature" json:"signature,omitempty"`
	SignatureUuid    string `protobuf:"bytes,4,opt,name=signatureUuid" json:"signatureUuid,omitempty"`
	ContractUuid     string `protobuf:"bytes,5,opt,name=contractUuid" json:"contractUuid,omitempty"`
}

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

71 72
// Hello message is used when discovering peers.
// It contains the current version of the software.
Caro Axel's avatar
Caro Axel committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
type Hello struct {
	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()               {}
func (*Hello) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func init() {
	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
92 93 94 95
// 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.SupportPackageIsVersion1

Caro Axel's avatar
Caro Axel committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
// Client API for Client service

type ClientClient interface {
	TreatPromise(ctx context.Context, in *Promise, opts ...grpc.CallOption) (*api1.ErrorCode, error)
	TreatSignature(ctx context.Context, in *Signature, opts ...grpc.CallOption) (*api1.ErrorCode, error)
	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 {
	TreatPromise(context.Context, *Promise) (*api1.ErrorCode, error)
	TreatSignature(context.Context, *Signature) (*api1.ErrorCode, error)
	Discover(context.Context, *Hello) (*Hello, error)
}

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

func _Client_TreatPromise_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(Promise)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(ClientServer).TreatPromise(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Client_TreatSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(Signature)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(ClientServer).TreatSignature(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Client_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(Hello)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(ClientServer).Discover(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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{
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
	// 303 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x51, 0xdd, 0x4a, 0xf4, 0x30,
	0x10, 0xdd, 0x7e, 0xfb, 0xf7, 0x75, 0x68, 0x57, 0x0d, 0x2b, 0x94, 0xaa, 0x20, 0xc5, 0x0b, 0xaf,
	0x5a, 0x58, 0x1f, 0x61, 0x57, 0x58, 0xf0, 0x46, 0x50, 0x1f, 0x20, 0xa6, 0x59, 0x0d, 0xb4, 0x4d,
	0x99, 0xa4, 0xa2, 0xe0, 0x53, 0x88, 0x0f, 0x6c, 0x3a, 0x6b, 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, 0x6e, 0xbd, 0xe9, 0x37, 0x8a, 0x17, 0x84, 0xae, 0x11, 0x35, 0xae, 0x75, 0x2e, 0x93,
	0x11, 0x5b, 0xc1, 0x82, 0xf4, 0x3f, 0xef, 0xda, 0x6b, 0x7a, 0x3c, 0xd0, 0x73, 0x01, 0xff, 0x37,
	0xca, 0x08, 0xed, 0x42, 0x30, 0xa0, 0x2a, 0xe5, 0x8a, 0x7f, 0xdd, 0x93, 0xd1, 0xe3, 0x8c, 0xbe,
	0xf2, 0xea, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x9f, 0xc1, 0xc3, 0x0d, 0x02, 0x00, 0x00,
Caro Axel's avatar
Caro Axel committed
228
}