mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update vendor/ dir to latest w/o heroku, moby
had to lock a lot of things in place
This commit is contained in:
3
vendor/github.com/openzipkin/zipkin-go-opentracing/Makefile
generated
vendored
3
vendor/github.com/openzipkin/zipkin-go-opentracing/Makefile
generated
vendored
@@ -20,4 +20,7 @@ lint:
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
.PHONY: all
|
||||
all: vet lint test bench
|
||||
|
||||
.PHONY: example
|
||||
|
||||
10
vendor/github.com/openzipkin/zipkin-go-opentracing/circle.yml
generated
vendored
Normal file
10
vendor/github.com/openzipkin/zipkin-go-opentracing/circle.yml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
dependencies:
|
||||
override:
|
||||
- sudo rm -rf /home/ubuntu/.go_workspace/src/github.com/openzipkin
|
||||
- mkdir -p /home/ubuntu/.go_workspace/src/github.com/openzipkin
|
||||
- mv /home/ubuntu/zipkin-go-opentracing /home/ubuntu/.go_workspace/src/github.com/openzipkin
|
||||
- ln -s /home/ubuntu/.go_workspace/src/github.com/openzipkin/zipkin-go-opentracing /home/ubuntu/zipkin-go-opentracing
|
||||
- go get -u -t -v github.com/openzipkin/zipkin-go-opentracing/...
|
||||
test:
|
||||
override:
|
||||
- make test bench
|
||||
3
vendor/github.com/openzipkin/zipkin-go-opentracing/collector-scribe.go
generated
vendored
3
vendor/github.com/openzipkin/zipkin-go-opentracing/collector-scribe.go
generated
vendored
@@ -1,6 +1,7 @@
|
||||
package zipkintracer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net"
|
||||
@@ -198,7 +199,7 @@ func (c *ScribeCollector) send() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if rc, err := c.client.Log(sendBatch); err != nil {
|
||||
if rc, err := c.client.Log(context.Background(), sendBatch); err != nil {
|
||||
c.client = nil
|
||||
_ = c.logger.Log("err", fmt.Sprintf("during Log: %v", err))
|
||||
return err
|
||||
|
||||
3
vendor/github.com/openzipkin/zipkin-go-opentracing/collector-scribe_test.go
generated
vendored
3
vendor/github.com/openzipkin/zipkin-go-opentracing/collector-scribe_test.go
generated
vendored
@@ -1,6 +1,7 @@
|
||||
package zipkintracer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
@@ -143,7 +144,7 @@ func newScribeHandler(t *testing.T) *scribeHandler {
|
||||
return &scribeHandler{t: t}
|
||||
}
|
||||
|
||||
func (h *scribeHandler) Log(messages []*scribe.LogEntry) (scribe.ResultCode, error) {
|
||||
func (h *scribeHandler) Log(ctx context.Context, messages []*scribe.LogEntry) (scribe.ResultCode, error) {
|
||||
h.Lock()
|
||||
defer h.Unlock()
|
||||
for _, m := range messages {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
|
||||
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/examples/cli_with_2_services/svc1"
|
||||
@@ -41,7 +41,7 @@ func main() {
|
||||
// Create our HTTP collector.
|
||||
collector, err := zipkin.NewHTTPCollector(zipkinHTTPEndpoint)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func main() {
|
||||
zipkin.TraceID128Bit(traceID128Bit),
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
|
||||
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/examples/cli_with_2_services/svc1"
|
||||
@@ -42,7 +42,7 @@ func main() {
|
||||
// create collector.
|
||||
collector, err := zipkin.NewHTTPCollector(zipkinHTTPEndpoint)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ func main() {
|
||||
zipkin.TraceID128Bit(traceID128Bit),
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/opentracing/opentracing-go"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
|
||||
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/examples/cli_with_2_services/svc2"
|
||||
@@ -38,7 +38,7 @@ func main() {
|
||||
// create collector.
|
||||
collector, err := zipkin.NewHTTPCollector(zipkinHTTPEndpoint)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin HTTP collector: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ func main() {
|
||||
zipkin.TraceID128Bit(traceID128Bit),
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v", err)
|
||||
fmt.Printf("unable to create Zipkin tracer: %+v\n", err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
|
||||
3
vendor/github.com/openzipkin/zipkin-go-opentracing/examples/middleware/http.go
generated
vendored
3
vendor/github.com/openzipkin/zipkin-go-opentracing/examples/middleware/http.go
generated
vendored
@@ -55,7 +55,7 @@ func ToHTTPRequest(tracer opentracing.Tracer) RequestFunc {
|
||||
opentracing.TextMap,
|
||||
opentracing.HTTPHeadersCarrier(req.Header),
|
||||
); err != nil {
|
||||
fmt.Printf("error encountered while trying to inject span: %+v", err)
|
||||
fmt.Printf("error encountered while trying to inject span: %+v\n", err)
|
||||
}
|
||||
}
|
||||
return req
|
||||
@@ -86,7 +86,6 @@ func FromHTTPRequest(tracer opentracing.Tracer, operationName string,
|
||||
|
||||
// create span
|
||||
span := tracer.StartSpan(operationName, ext.RPCServerOption(wireContext))
|
||||
span.SetTag("serverSide", "here")
|
||||
defer span.Finish()
|
||||
|
||||
// store span in context
|
||||
|
||||
2
vendor/github.com/openzipkin/zipkin-go-opentracing/observer.go
generated
vendored
2
vendor/github.com/openzipkin/zipkin-go-opentracing/observer.go
generated
vendored
@@ -1,8 +1,8 @@
|
||||
package zipkintracer
|
||||
|
||||
import (
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
otobserver "github.com/opentracing-contrib/go-observer"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
)
|
||||
|
||||
// observer is a dispatcher to other observers
|
||||
|
||||
30
vendor/github.com/openzipkin/zipkin-go-opentracing/sample_test.go
generated
vendored
30
vendor/github.com/openzipkin/zipkin-go-opentracing/sample_test.go
generated
vendored
@@ -13,21 +13,21 @@ func TestBoundarySampler(t *testing.T) {
|
||||
rate float64
|
||||
}
|
||||
for input, want := range map[triple]bool{
|
||||
triple{123, 456, 1.0}: true,
|
||||
triple{123, 456, 999}: true,
|
||||
triple{123, 456, 0.0}: false,
|
||||
triple{123, 456, -42}: false,
|
||||
triple{1229998, 0, 0.01}: false,
|
||||
triple{1229999, 0, 0.01}: false,
|
||||
triple{1230000, 0, 0.01}: true,
|
||||
triple{1230001, 0, 0.01}: true,
|
||||
triple{1230098, 0, 0.01}: true,
|
||||
triple{1230099, 0, 0.01}: true,
|
||||
triple{1230100, 0, 0.01}: false,
|
||||
triple{1230101, 0, 0.01}: false,
|
||||
triple{1, 9999999, 0.01}: false,
|
||||
triple{999, 0, 0.99}: true,
|
||||
triple{9999, 0, 0.99}: false,
|
||||
{123, 456, 1.0}: true,
|
||||
{123, 456, 999}: true,
|
||||
{123, 456, 0.0}: false,
|
||||
{123, 456, -42}: false,
|
||||
{1229998, 0, 0.01}: false,
|
||||
{1229999, 0, 0.01}: false,
|
||||
{1230000, 0, 0.01}: true,
|
||||
{1230001, 0, 0.01}: true,
|
||||
{1230098, 0, 0.01}: true,
|
||||
{1230099, 0, 0.01}: true,
|
||||
{1230100, 0, 0.01}: false,
|
||||
{1230101, 0, 0.01}: false,
|
||||
{1, 9999999, 0.01}: false,
|
||||
{999, 0, 0.99}: true,
|
||||
{9999, 0, 0.99}: false,
|
||||
} {
|
||||
sampler := zipkin.NewBoundarySampler(input.rate, input.salt)
|
||||
if have := sampler(input.id); want != have {
|
||||
|
||||
2
vendor/github.com/openzipkin/zipkin-go-opentracing/span.go
generated
vendored
2
vendor/github.com/openzipkin/zipkin-go-opentracing/span.go
generated
vendored
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
"github.com/opentracing/opentracing-go/log"
|
||||
|
||||
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
|
||||
otobserver "github.com/opentracing-contrib/go-observer"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
|
||||
)
|
||||
|
||||
// Span provides access to the essential details of the span, for use
|
||||
|
||||
2
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/compile.sh
generated
vendored
2
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/compile.sh
generated
vendored
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
for f in *.thrift ; do
|
||||
thrift -r --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift $f
|
||||
thrift -r --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/ $f
|
||||
done
|
||||
|
||||
7
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/GoUnusedProtection__.go
generated
vendored
Normal file
7
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/GoUnusedProtection__.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package scribe
|
||||
|
||||
var GoUnusedProtection__ int;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
// Autogenerated by Thrift Compiler (0.9.3)
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package scribe
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
)
|
||||
@@ -12,7 +14,11 @@ import (
|
||||
// (needed to ensure safety because of naive import list construction.)
|
||||
var _ = thrift.ZERO
|
||||
var _ = fmt.Printf
|
||||
var _ = context.Background
|
||||
var _ = reflect.DeepEqual
|
||||
var _ = bytes.Equal
|
||||
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
@@ -1,152 +1,152 @@
|
||||
// Autogenerated by Thrift Compiler (0.9.3)
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
"math"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"scribe"
|
||||
"strconv"
|
||||
"strings"
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe"
|
||||
)
|
||||
|
||||
|
||||
func Usage() {
|
||||
fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:")
|
||||
flag.PrintDefaults()
|
||||
fmt.Fprintln(os.Stderr, "\nFunctions:")
|
||||
fmt.Fprintln(os.Stderr, " ResultCode Log( messages)")
|
||||
fmt.Fprintln(os.Stderr)
|
||||
os.Exit(0)
|
||||
fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:")
|
||||
flag.PrintDefaults()
|
||||
fmt.Fprintln(os.Stderr, "\nFunctions:")
|
||||
fmt.Fprintln(os.Stderr, " ResultCode Log( messages)")
|
||||
fmt.Fprintln(os.Stderr)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = Usage
|
||||
var host string
|
||||
var port int
|
||||
var protocol string
|
||||
var urlString string
|
||||
var framed bool
|
||||
var useHttp bool
|
||||
var parsedUrl url.URL
|
||||
var trans thrift.TTransport
|
||||
_ = strconv.Atoi
|
||||
_ = math.Abs
|
||||
flag.Usage = Usage
|
||||
flag.StringVar(&host, "h", "localhost", "Specify host and port")
|
||||
flag.IntVar(&port, "p", 9090, "Specify port")
|
||||
flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
|
||||
flag.StringVar(&urlString, "u", "", "Specify the url")
|
||||
flag.BoolVar(&framed, "framed", false, "Use framed transport")
|
||||
flag.BoolVar(&useHttp, "http", false, "Use http")
|
||||
flag.Parse()
|
||||
|
||||
if len(urlString) > 0 {
|
||||
parsedUrl, err := url.Parse(urlString)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
|
||||
flag.Usage()
|
||||
}
|
||||
host = parsedUrl.Host
|
||||
useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
|
||||
} else if useHttp {
|
||||
_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
|
||||
flag.Usage()
|
||||
}
|
||||
}
|
||||
|
||||
cmd := flag.Arg(0)
|
||||
var err error
|
||||
if useHttp {
|
||||
trans, err = thrift.NewTHttpClient(parsedUrl.String())
|
||||
} else {
|
||||
portStr := fmt.Sprint(port)
|
||||
if strings.Contains(host, ":") {
|
||||
host, portStr, err = net.SplitHostPort(host)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error with host:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error resolving address:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if framed {
|
||||
trans = thrift.NewTFramedTransport(trans)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error creating transport", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer trans.Close()
|
||||
var protocolFactory thrift.TProtocolFactory
|
||||
switch protocol {
|
||||
case "compact":
|
||||
protocolFactory = thrift.NewTCompactProtocolFactory()
|
||||
break
|
||||
case "simplejson":
|
||||
protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
|
||||
break
|
||||
case "json":
|
||||
protocolFactory = thrift.NewTJSONProtocolFactory()
|
||||
break
|
||||
case "binary", "":
|
||||
protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
|
||||
break
|
||||
default:
|
||||
fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
|
||||
Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
client := scribe.NewScribeClientFactory(trans, protocolFactory)
|
||||
if err := trans.Open(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
switch cmd {
|
||||
case "Log":
|
||||
if flag.NArg()-1 != 1 {
|
||||
fmt.Fprintln(os.Stderr, "Log requires 1 args")
|
||||
flag.Usage()
|
||||
}
|
||||
arg5 := flag.Arg(1)
|
||||
mbTrans6 := thrift.NewTMemoryBufferLen(len(arg5))
|
||||
defer mbTrans6.Close()
|
||||
_, err7 := mbTrans6.WriteString(arg5)
|
||||
if err7 != nil {
|
||||
Usage()
|
||||
return
|
||||
}
|
||||
factory8 := thrift.NewTSimpleJSONProtocolFactory()
|
||||
jsProt9 := factory8.GetProtocol(mbTrans6)
|
||||
containerStruct0 := scribe.NewScribeLogArgs()
|
||||
err10 := containerStruct0.ReadField1(jsProt9)
|
||||
if err10 != nil {
|
||||
Usage()
|
||||
return
|
||||
}
|
||||
argvalue0 := containerStruct0.Messages
|
||||
value0 := argvalue0
|
||||
fmt.Print(client.Log(value0))
|
||||
fmt.Print("\n")
|
||||
break
|
||||
case "":
|
||||
Usage()
|
||||
break
|
||||
default:
|
||||
fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
|
||||
}
|
||||
flag.Usage = Usage
|
||||
var host string
|
||||
var port int
|
||||
var protocol string
|
||||
var urlString string
|
||||
var framed bool
|
||||
var useHttp bool
|
||||
var parsedUrl url.URL
|
||||
var trans thrift.TTransport
|
||||
_ = strconv.Atoi
|
||||
_ = math.Abs
|
||||
flag.Usage = Usage
|
||||
flag.StringVar(&host, "h", "localhost", "Specify host and port")
|
||||
flag.IntVar(&port, "p", 9090, "Specify port")
|
||||
flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
|
||||
flag.StringVar(&urlString, "u", "", "Specify the url")
|
||||
flag.BoolVar(&framed, "framed", false, "Use framed transport")
|
||||
flag.BoolVar(&useHttp, "http", false, "Use http")
|
||||
flag.Parse()
|
||||
|
||||
if len(urlString) > 0 {
|
||||
parsedUrl, err := url.Parse(urlString)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
|
||||
flag.Usage()
|
||||
}
|
||||
host = parsedUrl.Host
|
||||
useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
|
||||
} else if useHttp {
|
||||
_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
|
||||
flag.Usage()
|
||||
}
|
||||
}
|
||||
|
||||
cmd := flag.Arg(0)
|
||||
var err error
|
||||
if useHttp {
|
||||
trans, err = thrift.NewTHttpClient(parsedUrl.String())
|
||||
} else {
|
||||
portStr := fmt.Sprint(port)
|
||||
if strings.Contains(host, ":") {
|
||||
host, portStr, err = net.SplitHostPort(host)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error with host:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "error resolving address:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if framed {
|
||||
trans = thrift.NewTFramedTransport(trans)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error creating transport", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer trans.Close()
|
||||
var protocolFactory thrift.TProtocolFactory
|
||||
switch protocol {
|
||||
case "compact":
|
||||
protocolFactory = thrift.NewTCompactProtocolFactory()
|
||||
break
|
||||
case "simplejson":
|
||||
protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
|
||||
break
|
||||
case "json":
|
||||
protocolFactory = thrift.NewTJSONProtocolFactory()
|
||||
break
|
||||
case "binary", "":
|
||||
protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
|
||||
break
|
||||
default:
|
||||
fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
|
||||
Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
client := scribe.NewScribeClientFactory(trans, protocolFactory)
|
||||
if err := trans.Open(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
switch cmd {
|
||||
case "Log":
|
||||
if flag.NArg() - 1 != 1 {
|
||||
fmt.Fprintln(os.Stderr, "Log requires 1 args")
|
||||
flag.Usage()
|
||||
}
|
||||
arg5 := flag.Arg(1)
|
||||
mbTrans6 := thrift.NewTMemoryBufferLen(len(arg5))
|
||||
defer mbTrans6.Close()
|
||||
_, err7 := mbTrans6.WriteString(arg5)
|
||||
if err7 != nil {
|
||||
Usage()
|
||||
return
|
||||
}
|
||||
factory8 := thrift.NewTSimpleJSONProtocolFactory()
|
||||
jsProt9 := factory8.GetProtocol(mbTrans6)
|
||||
containerStruct0 := scribe.NewScribeLogArgs()
|
||||
err10 := containerStruct0.ReadField1(jsProt9)
|
||||
if err10 != nil {
|
||||
Usage()
|
||||
return
|
||||
}
|
||||
argvalue0 := containerStruct0.Messages
|
||||
value0 := argvalue0
|
||||
fmt.Print(client.Log(context.Background(), value0))
|
||||
fmt.Print("\n")
|
||||
break
|
||||
case "":
|
||||
Usage()
|
||||
break
|
||||
default:
|
||||
fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
|
||||
}
|
||||
}
|
||||
|
||||
816
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/scribe.go
generated
vendored
816
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/scribe.go
generated
vendored
@@ -1,10 +1,14 @@
|
||||
// Autogenerated by Thrift Compiler (0.9.3)
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package scribe
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
)
|
||||
@@ -12,420 +16,602 @@ import (
|
||||
// (needed to ensure safety because of naive import list construction.)
|
||||
var _ = thrift.ZERO
|
||||
var _ = fmt.Printf
|
||||
var _ = context.Background
|
||||
var _ = reflect.DeepEqual
|
||||
var _ = bytes.Equal
|
||||
|
||||
type ResultCode int64
|
||||
const (
|
||||
ResultCode_OK ResultCode = 0
|
||||
ResultCode_TRY_LATER ResultCode = 1
|
||||
)
|
||||
|
||||
func (p ResultCode) String() string {
|
||||
switch p {
|
||||
case ResultCode_OK: return "OK"
|
||||
case ResultCode_TRY_LATER: return "TRY_LATER"
|
||||
}
|
||||
return "<UNSET>"
|
||||
}
|
||||
|
||||
func ResultCodeFromString(s string) (ResultCode, error) {
|
||||
switch s {
|
||||
case "OK": return ResultCode_OK, nil
|
||||
case "TRY_LATER": return ResultCode_TRY_LATER, nil
|
||||
}
|
||||
return ResultCode(0), fmt.Errorf("not a valid ResultCode string")
|
||||
}
|
||||
|
||||
|
||||
func ResultCodePtr(v ResultCode) *ResultCode { return &v }
|
||||
|
||||
func (p ResultCode) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ResultCode) UnmarshalText(text []byte) error {
|
||||
q, err := ResultCodeFromString(string(text))
|
||||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
*p = q
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ResultCode) Scan(value interface{}) error {
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
return errors.New("Scan value is not int64")
|
||||
}
|
||||
*p = ResultCode(v)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p * ResultCode) Value() (driver.Value, error) {
|
||||
if p == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return int64(*p), nil
|
||||
}
|
||||
// Attributes:
|
||||
// - Category
|
||||
// - Message
|
||||
type LogEntry struct {
|
||||
Category string `thrift:"category,1" db:"category" json:"category"`
|
||||
Message string `thrift:"message,2" db:"message" json:"message"`
|
||||
}
|
||||
|
||||
func NewLogEntry() *LogEntry {
|
||||
return &LogEntry{}
|
||||
}
|
||||
|
||||
|
||||
func (p *LogEntry) GetCategory() string {
|
||||
return p.Category
|
||||
}
|
||||
|
||||
func (p *LogEntry) GetMessage() string {
|
||||
return p.Message
|
||||
}
|
||||
func (p *LogEntry) Read(iprot thrift.TProtocol) error {
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP { break; }
|
||||
switch fieldId {
|
||||
case 1:
|
||||
if fieldTypeId == thrift.STRING {
|
||||
if err := p.ReadField1(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if fieldTypeId == thrift.STRING {
|
||||
if err := p.ReadField2(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) ReadField1(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadString(); err != nil {
|
||||
return thrift.PrependError("error reading field 1: ", err)
|
||||
} else {
|
||||
p.Category = v
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) ReadField2(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadString(); err != nil {
|
||||
return thrift.PrependError("error reading field 2: ", err)
|
||||
} else {
|
||||
p.Message = v
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) Write(oprot thrift.TProtocol) error {
|
||||
if err := oprot.WriteStructBegin("LogEntry"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
||||
if p != nil {
|
||||
if err := p.writeField1(oprot); err != nil { return err }
|
||||
if err := p.writeField2(oprot); err != nil { return err }
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err) }
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err) }
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) writeField1(oprot thrift.TProtocol) (err error) {
|
||||
if err := oprot.WriteFieldBegin("category", thrift.STRING, 1); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:category: ", p), err) }
|
||||
if err := oprot.WriteString(string(p.Category)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.category (1) field write error: ", p), err) }
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:category: ", p), err) }
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *LogEntry) writeField2(oprot thrift.TProtocol) (err error) {
|
||||
if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err) }
|
||||
if err := oprot.WriteString(string(p.Message)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err) }
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err) }
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *LogEntry) String() string {
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("LogEntry(%+v)", *p)
|
||||
}
|
||||
|
||||
type Scribe interface {
|
||||
// Parameters:
|
||||
// - Messages
|
||||
Log(messages []*LogEntry) (r ResultCode, err error)
|
||||
// Parameters:
|
||||
// - Messages
|
||||
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
|
||||
}
|
||||
|
||||
type ScribeClient struct {
|
||||
Transport thrift.TTransport
|
||||
ProtocolFactory thrift.TProtocolFactory
|
||||
InputProtocol thrift.TProtocol
|
||||
OutputProtocol thrift.TProtocol
|
||||
SeqId int32
|
||||
Transport thrift.TTransport
|
||||
ProtocolFactory thrift.TProtocolFactory
|
||||
InputProtocol thrift.TProtocol
|
||||
OutputProtocol thrift.TProtocol
|
||||
SeqId int32
|
||||
}
|
||||
|
||||
func NewScribeClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ScribeClient {
|
||||
return &ScribeClient{Transport: t,
|
||||
ProtocolFactory: f,
|
||||
InputProtocol: f.GetProtocol(t),
|
||||
OutputProtocol: f.GetProtocol(t),
|
||||
SeqId: 0,
|
||||
}
|
||||
return &ScribeClient{Transport: t,
|
||||
ProtocolFactory: f,
|
||||
InputProtocol: f.GetProtocol(t),
|
||||
OutputProtocol: f.GetProtocol(t),
|
||||
SeqId: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func NewScribeClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ScribeClient {
|
||||
return &ScribeClient{Transport: t,
|
||||
ProtocolFactory: nil,
|
||||
InputProtocol: iprot,
|
||||
OutputProtocol: oprot,
|
||||
SeqId: 0,
|
||||
}
|
||||
return &ScribeClient{Transport: t,
|
||||
ProtocolFactory: nil,
|
||||
InputProtocol: iprot,
|
||||
OutputProtocol: oprot,
|
||||
SeqId: 0,
|
||||
}
|
||||
}
|
||||
|
||||
// Parameters:
|
||||
// - Messages
|
||||
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
|
||||
if err = p.sendLog(messages); err != nil {
|
||||
return
|
||||
}
|
||||
return p.recvLog()
|
||||
func (p *ScribeClient) Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error) {
|
||||
if err = p.sendLog(messages); err != nil { return }
|
||||
return p.recvLog()
|
||||
}
|
||||
|
||||
func (p *ScribeClient) sendLog(messages []*LogEntry) (err error) {
|
||||
oprot := p.OutputProtocol
|
||||
if oprot == nil {
|
||||
oprot = p.ProtocolFactory.GetProtocol(p.Transport)
|
||||
p.OutputProtocol = oprot
|
||||
}
|
||||
p.SeqId++
|
||||
if err = oprot.WriteMessageBegin("Log", thrift.CALL, p.SeqId); err != nil {
|
||||
return
|
||||
}
|
||||
args := ScribeLogArgs{
|
||||
Messages: messages,
|
||||
}
|
||||
if err = args.Write(oprot); err != nil {
|
||||
return
|
||||
}
|
||||
if err = oprot.WriteMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
return oprot.Flush()
|
||||
func (p *ScribeClient) sendLog(messages []*LogEntry)(err error) {
|
||||
oprot := p.OutputProtocol
|
||||
if oprot == nil {
|
||||
oprot = p.ProtocolFactory.GetProtocol(p.Transport)
|
||||
p.OutputProtocol = oprot
|
||||
}
|
||||
p.SeqId++
|
||||
if err = oprot.WriteMessageBegin("Log", thrift.CALL, p.SeqId); err != nil {
|
||||
return
|
||||
}
|
||||
args := ScribeLogArgs{
|
||||
Messages : messages,
|
||||
}
|
||||
if err = args.Write(oprot); err != nil {
|
||||
return
|
||||
}
|
||||
if err = oprot.WriteMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
return oprot.Flush()
|
||||
}
|
||||
|
||||
|
||||
func (p *ScribeClient) recvLog() (value ResultCode, err error) {
|
||||
iprot := p.InputProtocol
|
||||
if iprot == nil {
|
||||
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
|
||||
p.InputProtocol = iprot
|
||||
}
|
||||
method, mTypeId, seqId, err := iprot.ReadMessageBegin()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if method != "Log" {
|
||||
err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "Log failed: wrong method name")
|
||||
return
|
||||
}
|
||||
if p.SeqId != seqId {
|
||||
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "Log failed: out of sequence response")
|
||||
return
|
||||
}
|
||||
if mTypeId == thrift.EXCEPTION {
|
||||
error0 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
|
||||
var error1 error
|
||||
error1, err = error0.Read(iprot)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if err = iprot.ReadMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
err = error1
|
||||
return
|
||||
}
|
||||
if mTypeId != thrift.REPLY {
|
||||
err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "Log failed: invalid message type")
|
||||
return
|
||||
}
|
||||
result := ScribeLogResult{}
|
||||
if err = result.Read(iprot); err != nil {
|
||||
return
|
||||
}
|
||||
if err = iprot.ReadMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
value = result.GetSuccess()
|
||||
return
|
||||
iprot := p.InputProtocol
|
||||
if iprot == nil {
|
||||
iprot = p.ProtocolFactory.GetProtocol(p.Transport)
|
||||
p.InputProtocol = iprot
|
||||
}
|
||||
method, mTypeId, seqId, err := iprot.ReadMessageBegin()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if method != "Log" {
|
||||
err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "Log failed: wrong method name")
|
||||
return
|
||||
}
|
||||
if p.SeqId != seqId {
|
||||
err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "Log failed: out of sequence response")
|
||||
return
|
||||
}
|
||||
if mTypeId == thrift.EXCEPTION {
|
||||
error0 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
|
||||
var error1 error
|
||||
error1, err = error0.Read(iprot)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if err = iprot.ReadMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
err = error1
|
||||
return
|
||||
}
|
||||
if mTypeId != thrift.REPLY {
|
||||
err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "Log failed: invalid message type")
|
||||
return
|
||||
}
|
||||
result := ScribeLogResult{}
|
||||
if err = result.Read(iprot); err != nil {
|
||||
return
|
||||
}
|
||||
if err = iprot.ReadMessageEnd(); err != nil {
|
||||
return
|
||||
}
|
||||
value = result.GetSuccess()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
type ScribeProcessor struct {
|
||||
processorMap map[string]thrift.TProcessorFunction
|
||||
handler Scribe
|
||||
processorMap map[string]thrift.TProcessorFunction
|
||||
handler Scribe
|
||||
}
|
||||
|
||||
func (p *ScribeProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
||||
p.processorMap[key] = processor
|
||||
p.processorMap[key] = processor
|
||||
}
|
||||
|
||||
func (p *ScribeProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
||||
processor, ok = p.processorMap[key]
|
||||
return processor, ok
|
||||
processor, ok = p.processorMap[key]
|
||||
return processor, ok
|
||||
}
|
||||
|
||||
func (p *ScribeProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
||||
return p.processorMap
|
||||
return p.processorMap
|
||||
}
|
||||
|
||||
func NewScribeProcessor(handler Scribe) *ScribeProcessor {
|
||||
|
||||
self2 := &ScribeProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
||||
self2.processorMap["Log"] = &scribeProcessorLog{handler: handler}
|
||||
return self2
|
||||
self2 := &ScribeProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
|
||||
self2.processorMap["Log"] = &scribeProcessorLog{handler:handler}
|
||||
return self2
|
||||
}
|
||||
|
||||
func (p *ScribeProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||
name, _, seqId, err := iprot.ReadMessageBegin()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if processor, ok := p.GetProcessorFunction(name); ok {
|
||||
return processor.Process(seqId, iprot, oprot)
|
||||
}
|
||||
iprot.Skip(thrift.STRUCT)
|
||||
iprot.ReadMessageEnd()
|
||||
x3 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
|
||||
oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
|
||||
x3.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return false, x3
|
||||
func (p *ScribeProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||
name, _, seqId, err := iprot.ReadMessageBegin()
|
||||
if err != nil { return false, err }
|
||||
if processor, ok := p.GetProcessorFunction(name); ok {
|
||||
return processor.Process(ctx, seqId, iprot, oprot)
|
||||
}
|
||||
iprot.Skip(thrift.STRUCT)
|
||||
iprot.ReadMessageEnd()
|
||||
x3 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
|
||||
oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
|
||||
x3.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return false, x3
|
||||
|
||||
}
|
||||
|
||||
type scribeProcessorLog struct {
|
||||
handler Scribe
|
||||
handler Scribe
|
||||
}
|
||||
|
||||
func (p *scribeProcessorLog) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||
args := ScribeLogArgs{}
|
||||
if err = args.Read(iprot); err != nil {
|
||||
iprot.ReadMessageEnd()
|
||||
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
||||
oprot.WriteMessageBegin("Log", thrift.EXCEPTION, seqId)
|
||||
x.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return false, err
|
||||
}
|
||||
func (p *scribeProcessorLog) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
||||
args := ScribeLogArgs{}
|
||||
if err = args.Read(iprot); err != nil {
|
||||
iprot.ReadMessageEnd()
|
||||
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
||||
oprot.WriteMessageBegin("Log", thrift.EXCEPTION, seqId)
|
||||
x.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return false, err
|
||||
}
|
||||
|
||||
iprot.ReadMessageEnd()
|
||||
result := ScribeLogResult{}
|
||||
var retval ResultCode
|
||||
var err2 error
|
||||
if retval, err2 = p.handler.Log(args.Messages); err2 != nil {
|
||||
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Log: "+err2.Error())
|
||||
oprot.WriteMessageBegin("Log", thrift.EXCEPTION, seqId)
|
||||
x.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return true, err2
|
||||
} else {
|
||||
result.Success = &retval
|
||||
}
|
||||
if err2 = oprot.WriteMessageBegin("Log", thrift.REPLY, seqId); err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = oprot.Flush(); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return true, err
|
||||
iprot.ReadMessageEnd()
|
||||
result := ScribeLogResult{}
|
||||
var retval ResultCode
|
||||
var err2 error
|
||||
if retval, err2 = p.handler.Log(ctx, args.Messages); err2 != nil {
|
||||
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Log: " + err2.Error())
|
||||
oprot.WriteMessageBegin("Log", thrift.EXCEPTION, seqId)
|
||||
x.Write(oprot)
|
||||
oprot.WriteMessageEnd()
|
||||
oprot.Flush()
|
||||
return true, err2
|
||||
} else {
|
||||
result.Success = &retval
|
||||
}
|
||||
if err2 = oprot.WriteMessageBegin("Log", thrift.REPLY, seqId); err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err2 = oprot.Flush(); err == nil && err2 != nil {
|
||||
err = err2
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return true, err
|
||||
}
|
||||
|
||||
|
||||
// HELPER FUNCTIONS AND STRUCTURES
|
||||
|
||||
// Attributes:
|
||||
// - Messages
|
||||
type ScribeLogArgs struct {
|
||||
Messages []*LogEntry `thrift:"messages,1" json:"messages"`
|
||||
Messages []*LogEntry `thrift:"messages,1" db:"messages" json:"messages"`
|
||||
}
|
||||
|
||||
func NewScribeLogArgs() *ScribeLogArgs {
|
||||
return &ScribeLogArgs{}
|
||||
return &ScribeLogArgs{}
|
||||
}
|
||||
|
||||
|
||||
func (p *ScribeLogArgs) GetMessages() []*LogEntry {
|
||||
return p.Messages
|
||||
return p.Messages
|
||||
}
|
||||
func (p *ScribeLogArgs) Read(iprot thrift.TProtocol) error {
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP {
|
||||
break
|
||||
}
|
||||
switch fieldId {
|
||||
case 1:
|
||||
if err := p.readField1(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP { break; }
|
||||
switch fieldId {
|
||||
case 1:
|
||||
if fieldTypeId == thrift.LIST {
|
||||
if err := p.ReadField1(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogArgs) readField1(iprot thrift.TProtocol) error {
|
||||
_, size, err := iprot.ReadListBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError("error reading list begin: ", err)
|
||||
}
|
||||
tSlice := make([]*LogEntry, 0, size)
|
||||
p.Messages = tSlice
|
||||
for i := 0; i < size; i++ {
|
||||
_elem4 := &LogEntry{}
|
||||
if err := _elem4.Read(iprot); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err)
|
||||
}
|
||||
p.Messages = append(p.Messages, _elem4)
|
||||
}
|
||||
if err := iprot.ReadListEnd(); err != nil {
|
||||
return thrift.PrependError("error reading list end: ", err)
|
||||
}
|
||||
return nil
|
||||
func (p *ScribeLogArgs) ReadField1(iprot thrift.TProtocol) error {
|
||||
_, size, err := iprot.ReadListBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError("error reading list begin: ", err)
|
||||
}
|
||||
tSlice := make([]*LogEntry, 0, size)
|
||||
p.Messages = tSlice
|
||||
for i := 0; i < size; i ++ {
|
||||
_elem4 := &LogEntry{}
|
||||
if err := _elem4.Read(iprot); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err)
|
||||
}
|
||||
p.Messages = append(p.Messages, _elem4)
|
||||
}
|
||||
if err := iprot.ReadListEnd(); err != nil {
|
||||
return thrift.PrependError("error reading list end: ", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogArgs) Write(oprot thrift.TProtocol) error {
|
||||
if err := oprot.WriteStructBegin("Log_args"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||
}
|
||||
if err := p.writeField1(oprot); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err)
|
||||
}
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err)
|
||||
}
|
||||
return nil
|
||||
if err := oprot.WriteStructBegin("Log_args"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
||||
if p != nil {
|
||||
if err := p.writeField1(oprot); err != nil { return err }
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err) }
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err) }
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
||||
if err := oprot.WriteFieldBegin("messages", thrift.LIST, 1); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:messages: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
|
||||
return thrift.PrependError("error writing list begin: ", err)
|
||||
}
|
||||
for _, v := range p.Messages {
|
||||
if err := v.Write(oprot); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
|
||||
}
|
||||
}
|
||||
if err := oprot.WriteListEnd(); err != nil {
|
||||
return thrift.PrependError("error writing list end: ", err)
|
||||
}
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:messages: ", p), err)
|
||||
}
|
||||
return err
|
||||
if err := oprot.WriteFieldBegin("messages", thrift.LIST, 1); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:messages: ", p), err) }
|
||||
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
|
||||
return thrift.PrependError("error writing list begin: ", err)
|
||||
}
|
||||
for _, v := range p.Messages {
|
||||
if err := v.Write(oprot); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
|
||||
}
|
||||
}
|
||||
if err := oprot.WriteListEnd(); err != nil {
|
||||
return thrift.PrependError("error writing list end: ", err)
|
||||
}
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:messages: ", p), err) }
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *ScribeLogArgs) String() string {
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("ScribeLogArgs(%+v)", *p)
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("ScribeLogArgs(%+v)", *p)
|
||||
}
|
||||
|
||||
// Attributes:
|
||||
// - Success
|
||||
type ScribeLogResult struct {
|
||||
Success *ResultCode `thrift:"success,0" json:"success,omitempty"`
|
||||
Success *ResultCode `thrift:"success,0" db:"success" json:"success,omitempty"`
|
||||
}
|
||||
|
||||
func NewScribeLogResult() *ScribeLogResult {
|
||||
return &ScribeLogResult{}
|
||||
return &ScribeLogResult{}
|
||||
}
|
||||
|
||||
var ScribeLogResult_Success_DEFAULT ResultCode
|
||||
|
||||
func (p *ScribeLogResult) GetSuccess() ResultCode {
|
||||
if !p.IsSetSuccess() {
|
||||
return ScribeLogResult_Success_DEFAULT
|
||||
}
|
||||
return *p.Success
|
||||
if !p.IsSetSuccess() {
|
||||
return ScribeLogResult_Success_DEFAULT
|
||||
}
|
||||
return *p.Success
|
||||
}
|
||||
func (p *ScribeLogResult) IsSetSuccess() bool {
|
||||
return p.Success != nil
|
||||
return p.Success != nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogResult) Read(iprot thrift.TProtocol) error {
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP {
|
||||
break
|
||||
}
|
||||
switch fieldId {
|
||||
case 0:
|
||||
if err := p.readField0(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP { break; }
|
||||
switch fieldId {
|
||||
case 0:
|
||||
if fieldTypeId == thrift.I32 {
|
||||
if err := p.ReadField0(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogResult) readField0(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadI32(); err != nil {
|
||||
return thrift.PrependError("error reading field 0: ", err)
|
||||
} else {
|
||||
temp := ResultCode(v)
|
||||
p.Success = &temp
|
||||
}
|
||||
return nil
|
||||
func (p *ScribeLogResult) ReadField0(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadI32(); err != nil {
|
||||
return thrift.PrependError("error reading field 0: ", err)
|
||||
} else {
|
||||
temp := ResultCode(v)
|
||||
p.Success = &temp
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogResult) Write(oprot thrift.TProtocol) error {
|
||||
if err := oprot.WriteStructBegin("Log_result"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||
}
|
||||
if err := p.writeField0(oprot); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err)
|
||||
}
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err)
|
||||
}
|
||||
return nil
|
||||
if err := oprot.WriteStructBegin("Log_result"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
||||
if p != nil {
|
||||
if err := p.writeField0(oprot); err != nil { return err }
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err) }
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err) }
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ScribeLogResult) writeField0(oprot thrift.TProtocol) (err error) {
|
||||
if p.IsSetSuccess() {
|
||||
if err := oprot.WriteFieldBegin("success", thrift.I32, 0); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteI32(int32(*p.Success)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
|
||||
}
|
||||
}
|
||||
return err
|
||||
if p.IsSetSuccess() {
|
||||
if err := oprot.WriteFieldBegin("success", thrift.I32, 0); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
|
||||
if err := oprot.WriteI32(int32(*p.Success)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *ScribeLogResult) String() string {
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("ScribeLogResult(%+v)", *p)
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("ScribeLogResult(%+v)", *p)
|
||||
}
|
||||
|
||||
|
||||
|
||||
185
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/ttypes.go
generated
vendored
185
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/ttypes.go
generated
vendored
@@ -1,185 +0,0 @@
|
||||
// Autogenerated by Thrift Compiler (0.9.3)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package scribe
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
)
|
||||
|
||||
// (needed to ensure safety because of naive import list construction.)
|
||||
var _ = thrift.ZERO
|
||||
var _ = fmt.Printf
|
||||
var _ = bytes.Equal
|
||||
|
||||
var GoUnusedProtection__ int
|
||||
|
||||
type ResultCode int64
|
||||
|
||||
const (
|
||||
ResultCode_OK ResultCode = 0
|
||||
ResultCode_TRY_LATER ResultCode = 1
|
||||
)
|
||||
|
||||
func (p ResultCode) String() string {
|
||||
switch p {
|
||||
case ResultCode_OK:
|
||||
return "OK"
|
||||
case ResultCode_TRY_LATER:
|
||||
return "TRY_LATER"
|
||||
}
|
||||
return "<UNSET>"
|
||||
}
|
||||
|
||||
func ResultCodeFromString(s string) (ResultCode, error) {
|
||||
switch s {
|
||||
case "OK":
|
||||
return ResultCode_OK, nil
|
||||
case "TRY_LATER":
|
||||
return ResultCode_TRY_LATER, nil
|
||||
}
|
||||
return ResultCode(0), fmt.Errorf("not a valid ResultCode string")
|
||||
}
|
||||
|
||||
func ResultCodePtr(v ResultCode) *ResultCode { return &v }
|
||||
|
||||
func (p ResultCode) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ResultCode) UnmarshalText(text []byte) error {
|
||||
q, err := ResultCodeFromString(string(text))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*p = q
|
||||
return nil
|
||||
}
|
||||
|
||||
// Attributes:
|
||||
// - Category
|
||||
// - Message
|
||||
type LogEntry struct {
|
||||
Category string `thrift:"category,1" json:"category"`
|
||||
Message string `thrift:"message,2" json:"message"`
|
||||
}
|
||||
|
||||
func NewLogEntry() *LogEntry {
|
||||
return &LogEntry{}
|
||||
}
|
||||
|
||||
func (p *LogEntry) GetCategory() string {
|
||||
return p.Category
|
||||
}
|
||||
|
||||
func (p *LogEntry) GetMessage() string {
|
||||
return p.Message
|
||||
}
|
||||
func (p *LogEntry) Read(iprot thrift.TProtocol) error {
|
||||
if _, err := iprot.ReadStructBegin(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
||||
}
|
||||
|
||||
for {
|
||||
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
||||
if err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
||||
}
|
||||
if fieldTypeId == thrift.STOP {
|
||||
break
|
||||
}
|
||||
switch fieldId {
|
||||
case 1:
|
||||
if err := p.readField1(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
case 2:
|
||||
if err := p.readField2(iprot); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
if err := iprot.Skip(fieldTypeId); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadFieldEnd(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := iprot.ReadStructEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) readField1(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadString(); err != nil {
|
||||
return thrift.PrependError("error reading field 1: ", err)
|
||||
} else {
|
||||
p.Category = v
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) readField2(iprot thrift.TProtocol) error {
|
||||
if v, err := iprot.ReadString(); err != nil {
|
||||
return thrift.PrependError("error reading field 2: ", err)
|
||||
} else {
|
||||
p.Message = v
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) Write(oprot thrift.TProtocol) error {
|
||||
if err := oprot.WriteStructBegin("LogEntry"); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
||||
}
|
||||
if err := p.writeField1(oprot); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := p.writeField2(oprot); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := oprot.WriteFieldStop(); err != nil {
|
||||
return thrift.PrependError("write field stop error: ", err)
|
||||
}
|
||||
if err := oprot.WriteStructEnd(); err != nil {
|
||||
return thrift.PrependError("write struct stop error: ", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *LogEntry) writeField1(oprot thrift.TProtocol) (err error) {
|
||||
if err := oprot.WriteFieldBegin("category", thrift.STRING, 1); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:category: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteString(string(p.Category)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.category (1) field write error: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:category: ", p), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *LogEntry) writeField2(oprot thrift.TProtocol) (err error) {
|
||||
if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteString(string(p.Message)); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err)
|
||||
}
|
||||
if err := oprot.WriteFieldEnd(); err != nil {
|
||||
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *LogEntry) String() string {
|
||||
if p == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("LogEntry(%+v)", *p)
|
||||
}
|
||||
7
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/GoUnusedProtection__.go
generated
vendored
Normal file
7
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/GoUnusedProtection__.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package zipkincore
|
||||
|
||||
var GoUnusedProtection__ int;
|
||||
|
||||
1272
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/ttypes.go
generated
vendored
1272
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/ttypes.go
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,12 @@
|
||||
// Autogenerated by Thrift Compiler (0.9.3)
|
||||
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
||||
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
|
||||
package zipkincore
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
)
|
||||
@@ -12,6 +14,8 @@ import (
|
||||
// (needed to ensure safety because of naive import list construction.)
|
||||
var _ = thrift.ZERO
|
||||
var _ = fmt.Printf
|
||||
var _ = context.Background
|
||||
var _ = reflect.DeepEqual
|
||||
var _ = bytes.Equal
|
||||
|
||||
const CLIENT_SEND = "cs"
|
||||
@@ -38,3 +42,4 @@ const SERVER_ADDR = "sa"
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
1285
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/zipkinCore.go
generated
vendored
Normal file
1285
vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/zipkinCore.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
vendor/github.com/openzipkin/zipkin-go-opentracing/tracer.go
generated
vendored
2
vendor/github.com/openzipkin/zipkin-go-opentracing/tracer.go
generated
vendored
@@ -7,8 +7,8 @@ import (
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
|
||||
"github.com/openzipkin/zipkin-go-opentracing/flag"
|
||||
otobserver "github.com/opentracing-contrib/go-observer"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/flag"
|
||||
)
|
||||
|
||||
// ErrInvalidEndpoint will be thrown if hostPort parameter is corrupted or host
|
||||
|
||||
2
vendor/github.com/openzipkin/zipkin-go-opentracing/zipkin-recorder.go
generated
vendored
2
vendor/github.com/openzipkin/zipkin-go-opentracing/zipkin-recorder.go
generated
vendored
@@ -11,8 +11,8 @@ import (
|
||||
otext "github.com/opentracing/opentracing-go/ext"
|
||||
"github.com/opentracing/opentracing-go/log"
|
||||
|
||||
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/flag"
|
||||
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user