0dcbd3dc08
Change-Id: Id29f14b76a8c9cb2be31001b9a7a4356a4bda183
359 lines
12 KiB
Go
359 lines
12 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: vouchers.proto
|
|
|
|
package pb
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
_ "github.com/golang/protobuf/ptypes/timestamp"
|
|
grpc "google.golang.org/grpc"
|
|
math "math"
|
|
drpc "storj.io/drpc"
|
|
time "time"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
var _ = time.Kitchen
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type VoucherResponse_Status int32
|
|
|
|
const (
|
|
VoucherResponse_INVALID VoucherResponse_Status = 0
|
|
VoucherResponse_ACCEPTED VoucherResponse_Status = 1
|
|
VoucherResponse_REJECTED VoucherResponse_Status = 2
|
|
)
|
|
|
|
var VoucherResponse_Status_name = map[int32]string{
|
|
0: "INVALID",
|
|
1: "ACCEPTED",
|
|
2: "REJECTED",
|
|
}
|
|
|
|
var VoucherResponse_Status_value = map[string]int32{
|
|
"INVALID": 0,
|
|
"ACCEPTED": 1,
|
|
"REJECTED": 2,
|
|
}
|
|
|
|
func (x VoucherResponse_Status) String() string {
|
|
return proto.EnumName(VoucherResponse_Status_name, int32(x))
|
|
}
|
|
|
|
func (VoucherResponse_Status) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_3659b9a115b8060d, []int{2, 0}
|
|
}
|
|
|
|
// Voucher is a signed message verifying that a node has been vetted by a particular satellite
|
|
type Voucher struct {
|
|
SatelliteId NodeID `protobuf:"bytes,1,opt,name=satellite_id,json=satelliteId,proto3,customtype=NodeID" json:"satellite_id"`
|
|
StorageNodeId NodeID `protobuf:"bytes,2,opt,name=storage_node_id,json=storageNodeId,proto3,customtype=NodeID" json:"storage_node_id"`
|
|
Expiration time.Time `protobuf:"bytes,3,opt,name=expiration,proto3,stdtime" json:"expiration"`
|
|
SatelliteSignature []byte `protobuf:"bytes,4,opt,name=satellite_signature,json=satelliteSignature,proto3" json:"satellite_signature,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Voucher) Reset() { *m = Voucher{} }
|
|
func (m *Voucher) String() string { return proto.CompactTextString(m) }
|
|
func (*Voucher) ProtoMessage() {}
|
|
func (*Voucher) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_3659b9a115b8060d, []int{0}
|
|
}
|
|
func (m *Voucher) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Voucher.Unmarshal(m, b)
|
|
}
|
|
func (m *Voucher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Voucher.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Voucher) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Voucher.Merge(m, src)
|
|
}
|
|
func (m *Voucher) XXX_Size() int {
|
|
return xxx_messageInfo_Voucher.Size(m)
|
|
}
|
|
func (m *Voucher) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Voucher.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Voucher proto.InternalMessageInfo
|
|
|
|
func (m *Voucher) GetExpiration() time.Time {
|
|
if m != nil {
|
|
return m.Expiration
|
|
}
|
|
return time.Time{}
|
|
}
|
|
|
|
func (m *Voucher) GetSatelliteSignature() []byte {
|
|
if m != nil {
|
|
return m.SatelliteSignature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type VoucherRequest struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *VoucherRequest) Reset() { *m = VoucherRequest{} }
|
|
func (m *VoucherRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*VoucherRequest) ProtoMessage() {}
|
|
func (*VoucherRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_3659b9a115b8060d, []int{1}
|
|
}
|
|
func (m *VoucherRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_VoucherRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *VoucherRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_VoucherRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *VoucherRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_VoucherRequest.Merge(m, src)
|
|
}
|
|
func (m *VoucherRequest) XXX_Size() int {
|
|
return xxx_messageInfo_VoucherRequest.Size(m)
|
|
}
|
|
func (m *VoucherRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_VoucherRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_VoucherRequest proto.InternalMessageInfo
|
|
|
|
type VoucherResponse struct {
|
|
Voucher *Voucher `protobuf:"bytes,1,opt,name=voucher,proto3" json:"voucher,omitempty"`
|
|
Status VoucherResponse_Status `protobuf:"varint,2,opt,name=status,proto3,enum=vouchers.VoucherResponse_Status" json:"status,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *VoucherResponse) Reset() { *m = VoucherResponse{} }
|
|
func (m *VoucherResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*VoucherResponse) ProtoMessage() {}
|
|
func (*VoucherResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_3659b9a115b8060d, []int{2}
|
|
}
|
|
func (m *VoucherResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_VoucherResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *VoucherResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_VoucherResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *VoucherResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_VoucherResponse.Merge(m, src)
|
|
}
|
|
func (m *VoucherResponse) XXX_Size() int {
|
|
return xxx_messageInfo_VoucherResponse.Size(m)
|
|
}
|
|
func (m *VoucherResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_VoucherResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_VoucherResponse proto.InternalMessageInfo
|
|
|
|
func (m *VoucherResponse) GetVoucher() *Voucher {
|
|
if m != nil {
|
|
return m.Voucher
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *VoucherResponse) GetStatus() VoucherResponse_Status {
|
|
if m != nil {
|
|
return m.Status
|
|
}
|
|
return VoucherResponse_INVALID
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("vouchers.VoucherResponse_Status", VoucherResponse_Status_name, VoucherResponse_Status_value)
|
|
proto.RegisterType((*Voucher)(nil), "vouchers.Voucher")
|
|
proto.RegisterType((*VoucherRequest)(nil), "vouchers.VoucherRequest")
|
|
proto.RegisterType((*VoucherResponse)(nil), "vouchers.VoucherResponse")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("vouchers.proto", fileDescriptor_3659b9a115b8060d) }
|
|
|
|
var fileDescriptor_3659b9a115b8060d = []byte{
|
|
// 368 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcf, 0x4e, 0xab, 0x40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|
|
|
type DRPCVouchersClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
Request(ctx context.Context, in *VoucherRequest) (*VoucherResponse, error)
|
|
}
|
|
|
|
type drpcVouchersClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCVouchersClient(cc drpc.Conn) DRPCVouchersClient {
|
|
return &drpcVouchersClient{cc}
|
|
}
|
|
|
|
func (c *drpcVouchersClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcVouchersClient) Request(ctx context.Context, in *VoucherRequest) (*VoucherResponse, error) {
|
|
out := new(VoucherResponse)
|
|
err := c.cc.Invoke(ctx, "/vouchers.Vouchers/Request", in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
type DRPCVouchersServer interface {
|
|
Request(context.Context, *VoucherRequest) (*VoucherResponse, error)
|
|
}
|
|
|
|
type DRPCVouchersDescription struct{}
|
|
|
|
func (DRPCVouchersDescription) NumMethods() int { return 1 }
|
|
|
|
func (DRPCVouchersDescription) Method(n int) (string, drpc.Handler, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/vouchers.Vouchers/Request",
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCVouchersServer).
|
|
Request(
|
|
ctx,
|
|
in1.(*VoucherRequest),
|
|
)
|
|
}, DRPCVouchersServer.Request, true
|
|
default:
|
|
return "", nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterVouchers(srv drpc.Server, impl DRPCVouchersServer) {
|
|
srv.Register(impl, DRPCVouchersDescription{})
|
|
}
|
|
|
|
type DRPCVouchers_RequestStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*VoucherResponse) error
|
|
}
|
|
|
|
type drpcVouchersRequestStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcVouchersRequestStream) SendAndClose(m *VoucherResponse) error {
|
|
if err := x.MsgSend(m); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// 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.SupportPackageIsVersion4
|
|
|
|
// VouchersClient is the client API for Vouchers service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type VouchersClient interface {
|
|
Request(ctx context.Context, in *VoucherRequest, opts ...grpc.CallOption) (*VoucherResponse, error)
|
|
}
|
|
|
|
type vouchersClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewVouchersClient(cc *grpc.ClientConn) VouchersClient {
|
|
return &vouchersClient{cc}
|
|
}
|
|
|
|
func (c *vouchersClient) Request(ctx context.Context, in *VoucherRequest, opts ...grpc.CallOption) (*VoucherResponse, error) {
|
|
out := new(VoucherResponse)
|
|
err := c.cc.Invoke(ctx, "/vouchers.Vouchers/Request", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// VouchersServer is the server API for Vouchers service.
|
|
type VouchersServer interface {
|
|
Request(context.Context, *VoucherRequest) (*VoucherResponse, error)
|
|
}
|
|
|
|
func RegisterVouchersServer(s *grpc.Server, srv VouchersServer) {
|
|
s.RegisterService(&_Vouchers_serviceDesc, srv)
|
|
}
|
|
|
|
func _Vouchers_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(VoucherRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(VouchersServer).Request(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/vouchers.Vouchers/Request",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(VouchersServer).Request(ctx, req.(*VoucherRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Vouchers_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "vouchers.Vouchers",
|
|
HandlerType: (*VouchersServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Request",
|
|
Handler: _Vouchers_Request_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "vouchers.proto",
|
|
}
|