gRPCServices.pb.go 5.61 KB
Newer Older
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
// Code generated by protoc-gen-go.
// source: gRPCServices.proto
// DO NOT EDIT!

/*
Package api is a generated protocol buffer package.

It is generated from these files:
	gRPCServices.proto

It has these top-level messages:
	AlertRequest
	RecoverRequest
	TTPResponse
*/
package api

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

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

// Alert message sent by a signer
type AlertRequest struct {
}

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

// RecoverRequest message to get a signed contract
type RecoverRequest struct {
}

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

// TTPResponse message to answer an Alert or Recover message
type TTPResponse struct {
	// Yes for abort token, No for signed contract
	Abort bool `protobuf:"varint,1,opt,name=abort" json:"abort,omitempty"`
	// Nil for abort token, non-empty otherwise
	Contract []byte `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
}

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

func init() {
	proto.RegisterType((*AlertRequest)(nil), "api.AlertRequest")
	proto.RegisterType((*RecoverRequest)(nil), "api.RecoverRequest")
	proto.RegisterType((*TTPResponse)(nil), "api.TTPResponse")
}

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

// Client API for TTP service

type TTPClient interface {
	Alert(ctx context.Context, in *AlertRequest, opts ...grpc.CallOption) (*TTPResponse, error)
	Recover(ctx context.Context, in *RecoverRequest, opts ...grpc.CallOption) (*TTPResponse, error)
}

type tTPClient struct {
	cc *grpc.ClientConn
}

func NewTTPClient(cc *grpc.ClientConn) TTPClient {
	return &tTPClient{cc}
}

func (c *tTPClient) Alert(ctx context.Context, in *AlertRequest, opts ...grpc.CallOption) (*TTPResponse, error) {
	out := new(TTPResponse)
	err := grpc.Invoke(ctx, "/api.TTP/Alert", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tTPClient) Recover(ctx context.Context, in *RecoverRequest, opts ...grpc.CallOption) (*TTPResponse, error) {
	out := new(TTPResponse)
	err := grpc.Invoke(ctx, "/api.TTP/Recover", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for TTP service

type TTPServer interface {
	Alert(context.Context, *AlertRequest) (*TTPResponse, error)
	Recover(context.Context, *RecoverRequest) (*TTPResponse, error)
}

func RegisterTTPServer(s *grpc.Server, srv TTPServer) {
	s.RegisterService(&_TTP_serviceDesc, srv)
}

func _TTP_Alert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(AlertRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(TTPServer).Alert(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _TTP_Recover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(RecoverRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(TTPServer).Recover(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

var _TTP_serviceDesc = grpc.ServiceDesc{
	ServiceName: "api.TTP",
	HandlerType: (*TTPServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Alert",
			Handler:    _TTP_Alert_Handler,
		},
		{
			MethodName: "Recover",
			Handler:    _TTP_Recover_Handler,
		},
	},
	Streams: []grpc.StreamDesc{},
}

var fileDescriptor0 = []byte{
	// 178 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0x0f, 0x0a, 0x70,
	0x0e, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62,
	0x4e, 0x2c, 0xc8, 0x54, 0xe2, 0xe3, 0xe2, 0x71, 0xcc, 0x49, 0x2d, 0x2a, 0x09, 0x4a, 0x2d, 0x2c,
	0x4d, 0x2d, 0x2e, 0x51, 0x12, 0xe0, 0xe2, 0x0b, 0x4a, 0x4d, 0xce, 0x2f, 0x4b, 0x2d, 0x82, 0x89,
	0xd8, 0x73, 0x71, 0x87, 0x84, 0x04, 0x04, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x89,
	0x70, 0xb1, 0x26, 0x26, 0xe5, 0x17, 0x95, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x04, 0x41, 0x38,
	0x42, 0x52, 0x5c, 0x1c, 0xc9, 0xf9, 0x79, 0x25, 0x45, 0x89, 0xc9, 0x25, 0x12, 0x4c, 0x40, 0x09,
	0x9e, 0x20, 0x38, 0xdf, 0x28, 0x93, 0x8b, 0x19, 0x68, 0x80, 0x90, 0x1e, 0x17, 0x2b, 0xd8, 0x26,
	0x21, 0x41, 0x3d, 0xa0, 0xc5, 0x7a, 0xc8, 0xb6, 0x4a, 0x09, 0x80, 0x85, 0x90, 0xac, 0x51, 0x62,
	0x10, 0x32, 0xe2, 0x62, 0x87, 0xba, 0x44, 0x48, 0x18, 0x2c, 0x8d, 0xea, 0x2e, 0x6c, 0x7a, 0x92,
	0xd8, 0xc0, 0x3e, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x08, 0x99, 0x18, 0xef, 0x00,
	0x00, 0x00,
}