resolution.pb.go 5.88 KB
Newer Older
1
// Code generated by protoc-gen-go.
2
// source: dfss/dfsst/api/resolution.proto
3 4 5 6 7 8
// DO NOT EDIT!

/*
Package api is a generated protocol buffer package.

It is generated from these files:
9
	dfss/dfsst/api/resolution.proto
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

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

Loïck Bonniot's avatar
Loïck Bonniot committed
77 78 79 80
// 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

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
// 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{
166 167 168 169 170 171 172 173 174 175 176 177 178
	// 188 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x49, 0x2b, 0x2e,
	0xd6, 0x07, 0x11, 0x25, 0xfa, 0x89, 0x05, 0x99, 0xfa, 0x45, 0xa9, 0xc5, 0xf9, 0x39, 0xa5, 0x25,
	0x99, 0xf9, 0x79, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xcc, 0x40, 0x51, 0x25, 0x3e, 0x2e,
	0x1e, 0xc7, 0x9c, 0xd4, 0xa2, 0x92, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x25, 0x01, 0x2e,
	0xbe, 0xa0, 0xd4, 0xe4, 0xfc, 0xb2, 0xd4, 0x22, 0x98, 0x88, 0x3d, 0x17, 0x77, 0x48, 0x48, 0x40,
	0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x08, 0x17, 0x6b, 0x62, 0x52, 0x7e, 0x51,
	0x89, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x84, 0x23, 0x24, 0xc5, 0xc5, 0x91, 0x9c, 0x9f,
	0x57, 0x52, 0x94, 0x98, 0x5c, 0x22, 0xc1, 0x04, 0x94, 0xe0, 0x09, 0x82, 0xf3, 0x8d, 0x32, 0xb9,
	0x98, 0x81, 0x06, 0x08, 0xe9, 0x71, 0xb1, 0x82, 0x6d, 0x12, 0x12, 0xd4, 0x03, 0x5a, 0xac, 0x87,
	0x6c, 0xab, 0x94, 0x00, 0x58, 0x08, 0xc9, 0x1a, 0x25, 0x06, 0x21, 0x23, 0x2e, 0x76, 0xa8, 0x4b,
	0x84, 0x84, 0xc1, 0xd2, 0xa8, 0xee, 0xc2, 0xa6, 0x27, 0x89, 0x0d, 0xec, 0x33, 0x63, 0x40, 0x00,
	0x00, 0x00, 0xff, 0xff, 0xa7, 0x4b, 0x1a, 0xea, 0xfc, 0x00, 0x00, 0x00,
179
}