197 lines
7 KiB
Go
197 lines
7 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: spanAgent.proto
|
|
|
|
package haystack
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
grpc "google.golang.org/grpc"
|
|
math "math"
|
|
)
|
|
|
|
// 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.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type DispatchResult_ResultCode int32
|
|
|
|
const (
|
|
DispatchResult_SUCCESS DispatchResult_ResultCode = 0
|
|
DispatchResult_UNKNOWN_ERROR DispatchResult_ResultCode = 1
|
|
DispatchResult_RATE_LIMIT_ERROR DispatchResult_ResultCode = 2
|
|
)
|
|
|
|
var DispatchResult_ResultCode_name = map[int32]string{
|
|
0: "SUCCESS",
|
|
1: "UNKNOWN_ERROR",
|
|
2: "RATE_LIMIT_ERROR",
|
|
}
|
|
|
|
var DispatchResult_ResultCode_value = map[string]int32{
|
|
"SUCCESS": 0,
|
|
"UNKNOWN_ERROR": 1,
|
|
"RATE_LIMIT_ERROR": 2,
|
|
}
|
|
|
|
func (x DispatchResult_ResultCode) String() string {
|
|
return proto.EnumName(DispatchResult_ResultCode_name, int32(x))
|
|
}
|
|
|
|
func (DispatchResult_ResultCode) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_5a4cb81dd7dcc459, []int{0, 0}
|
|
}
|
|
|
|
type DispatchResult struct {
|
|
Code DispatchResult_ResultCode `protobuf:"varint,1,opt,name=code,proto3,enum=DispatchResult_ResultCode" json:"code,omitempty"`
|
|
ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DispatchResult) Reset() { *m = DispatchResult{} }
|
|
func (m *DispatchResult) String() string { return proto.CompactTextString(m) }
|
|
func (*DispatchResult) ProtoMessage() {}
|
|
func (*DispatchResult) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5a4cb81dd7dcc459, []int{0}
|
|
}
|
|
|
|
func (m *DispatchResult) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DispatchResult.Unmarshal(m, b)
|
|
}
|
|
func (m *DispatchResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DispatchResult.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *DispatchResult) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DispatchResult.Merge(m, src)
|
|
}
|
|
func (m *DispatchResult) XXX_Size() int {
|
|
return xxx_messageInfo_DispatchResult.Size(m)
|
|
}
|
|
func (m *DispatchResult) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DispatchResult.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DispatchResult proto.InternalMessageInfo
|
|
|
|
func (m *DispatchResult) GetCode() DispatchResult_ResultCode {
|
|
if m != nil {
|
|
return m.Code
|
|
}
|
|
return DispatchResult_SUCCESS
|
|
}
|
|
|
|
func (m *DispatchResult) GetErrorMessage() string {
|
|
if m != nil {
|
|
return m.ErrorMessage
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("DispatchResult_ResultCode", DispatchResult_ResultCode_name, DispatchResult_ResultCode_value)
|
|
proto.RegisterType((*DispatchResult)(nil), "DispatchResult")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("spanAgent.proto", fileDescriptor_5a4cb81dd7dcc459) }
|
|
|
|
var fileDescriptor_5a4cb81dd7dcc459 = []byte{
|
|
// 254 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xc1, 0x4a, 0xf3, 0x40,
|
|
0x10, 0xc7, 0xbf, 0x2d, 0x9f, 0xda, 0x8e, 0xb6, 0x8d, 0x8b, 0x87, 0x92, 0x53, 0x89, 0x97, 0x9e,
|
|
0x56, 0xa9, 0x4f, 0xd0, 0xc6, 0x1c, 0x8a, 0x36, 0x95, 0x4d, 0x8b, 0xe0, 0x25, 0x8c, 0x9b, 0x21,
|
|
0x0d, 0xda, 0xec, 0xb2, 0xbb, 0x82, 0x3e, 0x92, 0x6f, 0x29, 0x4d, 0x2a, 0xa2, 0xa7, 0x19, 0x7e,
|
|
0x33, 0x03, 0xff, 0xf9, 0xc1, 0xd0, 0x19, 0xac, 0x67, 0x25, 0xd5, 0x5e, 0x18, 0xab, 0xbd, 0x0e,
|
|
0x61, 0x0f, 0xda, 0x3e, 0xfa, 0x64, 0x30, 0xb8, 0xad, 0x9c, 0x41, 0xaf, 0xb6, 0x92, 0xdc, 0xdb,
|
|
0xab, 0xe7, 0x02, 0xfe, 0x2b, 0x5d, 0xd0, 0x88, 0x8d, 0xd9, 0x64, 0x30, 0x0d, 0xc5, 0xef, 0xb1,
|
|
0x68, 0x4b, 0xac, 0x0b, 0x92, 0xcd, 0x1e, 0xbf, 0x84, 0x3e, 0x59, 0xab, 0x6d, 0xbe, 0x23, 0xe7,
|
|
0xb0, 0xa4, 0x51, 0x67, 0xcc, 0x26, 0x3d, 0x79, 0xd6, 0xc0, 0x65, 0xcb, 0xa2, 0x39, 0xc0, 0xcf,
|
|
0x21, 0x3f, 0x85, 0x93, 0x6c, 0x13, 0xc7, 0x49, 0x96, 0x05, 0xff, 0xf8, 0x39, 0xf4, 0x37, 0xe9,
|
|
0x5d, 0xba, 0x7a, 0x4c, 0xf3, 0x44, 0xca, 0x95, 0x0c, 0x18, 0xbf, 0x80, 0x40, 0xce, 0xd6, 0x49,
|
|
0x7e, 0xbf, 0x58, 0x2e, 0xd6, 0x07, 0xda, 0x99, 0x5e, 0x41, 0x2f, 0xfb, 0x7e, 0x85, 0x47, 0xd0,
|
|
0x2d, 0x0e, 0xc1, 0xf8, 0x91, 0xd8, 0xf3, 0x70, 0xf8, 0x27, 0xea, 0xfc, 0x1a, 0x22, 0xa5, 0x77,
|
|
0x82, 0xde, 0x0d, 0x15, 0x15, 0x0a, 0x6d, 0xa8, 0x16, 0xde, 0xa2, 0xaa, 0xea, 0x52, 0x60, 0x23,
|
|
0x04, 0x4d, 0xf5, 0xc0, 0x9e, 0xba, 0x5b, 0xfc, 0x70, 0x1e, 0xd5, 0xcb, 0xf3, 0x71, 0x63, 0xe5,
|
|
0xe6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x30, 0xb9, 0x7d, 0x07, 0x34, 0x01, 0x00, 0x00,
|
|
}
|
|
|
|
// 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
|
|
|
|
// SpanAgentClient is the client API for SpanAgent service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type SpanAgentClient interface {
|
|
Dispatch(ctx context.Context, in *Span, opts ...grpc.CallOption) (*DispatchResult, error)
|
|
}
|
|
|
|
type spanAgentClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewSpanAgentClient(cc *grpc.ClientConn) SpanAgentClient {
|
|
return &spanAgentClient{cc}
|
|
}
|
|
|
|
func (c *spanAgentClient) Dispatch(ctx context.Context, in *Span, opts ...grpc.CallOption) (*DispatchResult, error) {
|
|
out := new(DispatchResult)
|
|
err := c.cc.Invoke(ctx, "/SpanAgent/dispatch", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SpanAgentServer is the server API for SpanAgent service.
|
|
type SpanAgentServer interface {
|
|
Dispatch(context.Context, *Span) (*DispatchResult, error)
|
|
}
|
|
|
|
func RegisterSpanAgentServer(s *grpc.Server, srv SpanAgentServer) {
|
|
s.RegisterService(&_SpanAgent_serviceDesc, srv)
|
|
}
|
|
|
|
func _SpanAgent_Dispatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Span)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SpanAgentServer).Dispatch(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/SpanAgent/Dispatch",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SpanAgentServer).Dispatch(ctx, req.(*Span))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _SpanAgent_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "SpanAgent",
|
|
HandlerType: (*SpanAgentServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "dispatch",
|
|
Handler: _SpanAgent_Dispatch_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "spanAgent.proto",
|
|
}
|