76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/protos/server/server.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package server;
4 |
5 | import "google/api/annotations.proto";
6 | import "google/protobuf/empty.proto";
7 |
8 | // Correct import path
9 | option go_package = "github.com/johanbrandhorst/gopherjs-grpc-websocket/protos/server";
10 |
11 | service MyServer {
12 | rpc Simple(google.protobuf.Empty) returns (MyMessage) {
13 | option (google.api.http) = {
14 | get: "/api/v1/simple"
15 | };
16 | }
17 | rpc Unary(google.protobuf.Empty) returns (stream MyMessage) {
18 | option (google.api.http) = {
19 | get: "/api/v1/unary"
20 | };
21 | }
22 | rpc Bidi(stream MyMessage) returns (stream MyMessage) {
23 | option (google.api.http) = {
24 | get: "/api/v1/bidi"
25 | };
26 | }
27 | }
28 |
29 | message MyMessage {
30 | string msg = 1;
31 | uint32 num = 2;
32 | }
33 |
--------------------------------------------------------------------------------
/server/insecure/util.go:
--------------------------------------------------------------------------------
1 | package insecure
2 |
3 | import (
4 | "crypto/tls"
5 | "crypto/x509"
6 | )
7 |
8 | var (
9 | KeyPair *tls.Certificate
10 | CertPool *x509.CertPool
11 | )
12 |
13 | func init() {
14 | var err error
15 | pair, err := tls.X509KeyPair([]byte(cert), []byte(key))
16 | if err != nil {
17 | panic(err)
18 | }
19 | KeyPair = &pair
20 | CertPool = x509.NewCertPool()
21 | ok := CertPool.AppendCertsFromPEM([]byte(cert))
22 | if !ok {
23 | panic("bad certs")
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/server/server.go:
--------------------------------------------------------------------------------
1 | package server
2 |
3 | import (
4 | "io"
5 | "time"
6 |
7 | "github.com/golang/protobuf/ptypes/empty"
8 | "golang.org/x/net/context"
9 |
10 | "github.com/johanbrandhorst/gopherjs-grpc-websocket/protos/server"
11 | )
12 |
13 | type Server struct{}
14 |
15 | var _ server.MyServerServer = &Server{}
16 |
17 | func (s Server) Simple(ctx context.Context, _ *empty.Empty) (*server.MyMessage, error) {
18 | return &server.MyMessage{
19 | Msg: "A simple message",
20 | }, nil
21 | }
22 |
23 | func (s Server) Unary(_ *empty.Empty, srv server.MyServer_UnaryServer) error {
24 | // Send 4 messages
25 | for i := uint32(0); i < 4; i++ {
26 | msg := &server.MyMessage{
27 | Msg: "A unary message",
28 | Num: i,
29 | }
30 |
31 | if err := srv.Send(msg); err != nil {
32 | return err
33 | }
34 |
35 | // Sleep to simulate some work
36 | time.Sleep(time.Second)
37 | }
38 |
39 | return nil
40 | }
41 |
42 | func (s Server) Bidi(srv server.MyServer_BidiServer) error {
43 | for i := uint32(0); ; i++ {
44 | // Blocks until a message is received
45 | msg, err := srv.Recv()
46 | if err != nil {
47 | if err == io.EOF {
48 | // Client closed connection
49 | return nil
50 | }
51 |
52 | return err
53 | }
54 |
55 | // Just echo back the message sent,
56 | // incrementing the counter
57 | msg.Num = i
58 | if err := srv.Send(msg); err != nil {
59 | return err
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 0.11.5
2 |
3 | * feature: add writer and writerlevel to entry (#372)
4 |
5 | # 0.11.4
6 |
7 | * bug: fix undefined variable on solaris (#493)
8 |
9 | # 0.11.3
10 |
11 | * formatter: configure quoting of empty values (#484)
12 | * formatter: configure quoting character (default is `"`) (#484)
13 | * bug: fix not importing io correctly in non-linux environments (#481)
14 |
15 | # 0.11.2
16 |
17 | * bug: fix windows terminal detection (#476)
18 |
19 | # 0.11.1
20 |
21 | * bug: fix tty detection with custom out (#471)
22 |
23 | # 0.11.0
24 |
25 | * performance: Use bufferpool to allocate (#370)
26 | * terminal: terminal detection for app-engine (#343)
27 | * feature: exit handler (#375)
28 |
29 | # 0.10.0
30 |
31 | * feature: Add a test hook (#180)
32 | * feature: `ParseLevel` is now case-insensitive (#326)
33 | * feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308)
34 | * performance: avoid re-allocations on `WithFields` (#335)
35 |
36 | # 0.9.0
37 |
38 | * logrus/text_formatter: don't emit empty msg
39 | * logrus/hooks/airbrake: move out of main repository
40 | * logrus/hooks/sentry: move out of main repository
41 | * logrus/hooks/papertrail: move out of main repository
42 | * logrus/hooks/bugsnag: move out of main repository
43 | * logrus/core: run tests with `-race`
44 | * logrus/core: detect TTY based on `stderr`
45 | * logrus/core: support `WithError` on logger
46 | * logrus/core: Solaris support
47 |
48 | # 0.8.7
49 |
50 | * logrus/core: fix possible race (#216)
51 | * logrus/doc: small typo fixes and doc improvements
52 |
53 |
54 | # 0.8.6
55 |
56 | * hooks/raven: allow passing an initialized client
57 |
58 | # 0.8.5
59 |
60 | * logrus/core: revert #208
61 |
62 | # 0.8.4
63 |
64 | * formatter/text: fix data race (#218)
65 |
66 | # 0.8.3
67 |
68 | * logrus/core: fix entry log level (#208)
69 | * logrus/core: improve performance of text formatter by 40%
70 | * logrus/core: expose `LevelHooks` type
71 | * logrus/core: add support for DragonflyBSD and NetBSD
72 | * formatter/text: print structs more verbosely
73 |
74 | # 0.8.2
75 |
76 | * logrus: fix more Fatal family functions
77 |
78 | # 0.8.1
79 |
80 | * logrus: fix not exiting on `Fatalf` and `Fatalln`
81 |
82 | # 0.8.0
83 |
84 | * logrus: defaults to stderr instead of stdout
85 | * hooks/sentry: add special field for `*http.Request`
86 | * formatter/text: ignore Windows for colors
87 |
88 | # 0.7.3
89 |
90 | * formatter/\*: allow configuration of timestamp layout
91 |
92 | # 0.7.2
93 |
94 | * formatter/text: Add configuration option for time format (#158)
95 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Simon Eskildsen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/alt_exit.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | // The following code was sourced and modified from the
4 | // https://github.com/tebeka/atexit package governed by the following license:
5 | //
6 | // Copyright (c) 2012 Miki Tebeka .
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | // this software and associated documentation files (the "Software"), to deal in
10 | // the Software without restriction, including without limitation the rights to
11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | // the Software, and to permit persons to whom the Software is furnished to do so,
13 | // subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in all
16 | // copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | import (
26 | "fmt"
27 | "os"
28 | )
29 |
30 | var handlers = []func(){}
31 |
32 | func runHandler(handler func()) {
33 | defer func() {
34 | if err := recover(); err != nil {
35 | fmt.Fprintln(os.Stderr, "Error: Logrus exit handler error:", err)
36 | }
37 | }()
38 |
39 | handler()
40 | }
41 |
42 | func runHandlers() {
43 | for _, handler := range handlers {
44 | runHandler(handler)
45 | }
46 | }
47 |
48 | // Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code)
49 | func Exit(code int) {
50 | runHandlers()
51 | os.Exit(code)
52 | }
53 |
54 | // RegisterExitHandler adds a Logrus Exit handler, call logrus.Exit to invoke
55 | // all handlers. The handlers will also be invoked when any Fatal log entry is
56 | // made.
57 | //
58 | // This method is useful when a caller wishes to use logrus to log a fatal
59 | // message but also needs to gracefully shutdown. An example usecase could be
60 | // closing database connections, or sending a alert that the application is
61 | // closing.
62 | func RegisterExitHandler(handler func()) {
63 | handlers = append(handlers, handler)
64 | }
65 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
3 |
4 |
5 | The simplest way to use Logrus is simply the package-level exported logger:
6 |
7 | package main
8 |
9 | import (
10 | log "github.com/Sirupsen/logrus"
11 | )
12 |
13 | func main() {
14 | log.WithFields(log.Fields{
15 | "animal": "walrus",
16 | "number": 1,
17 | "size": 10,
18 | }).Info("A walrus appears")
19 | }
20 |
21 | Output:
22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
23 |
24 | For a full guide visit https://github.com/Sirupsen/logrus
25 | */
26 | package logrus
27 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/formatter.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import "time"
4 |
5 | const DefaultTimestampFormat = time.RFC3339
6 |
7 | // The Formatter interface is used to implement a custom Formatter. It takes an
8 | // `Entry`. It exposes all the fields, including the default ones:
9 | //
10 | // * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
11 | // * `entry.Data["time"]`. The timestamp.
12 | // * `entry.Data["level"]. The level the entry was logged at.
13 | //
14 | // Any additional fields added with `WithField` or `WithFields` are also in
15 | // `entry.Data`. Format is expected to return an array of bytes which are then
16 | // logged to `logger.Out`.
17 | type Formatter interface {
18 | Format(*Entry) ([]byte, error)
19 | }
20 |
21 | // This is to not silently overwrite `time`, `msg` and `level` fields when
22 | // dumping it. If this code wasn't there doing:
23 | //
24 | // logrus.WithField("level", 1).Info("hello")
25 | //
26 | // Would just silently drop the user provided level. Instead with this code
27 | // it'll logged as:
28 | //
29 | // {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
30 | //
31 | // It's not exported because it's still using Data in an opinionated way. It's to
32 | // avoid code duplication between the two default formatters.
33 | func prefixFieldClashes(data Fields) {
34 | if t, ok := data["time"]; ok {
35 | data["fields.time"] = t
36 | }
37 |
38 | if m, ok := data["msg"]; ok {
39 | data["fields.msg"] = m
40 | }
41 |
42 | if l, ok := data["level"]; ok {
43 | data["fields.level"] = l
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/hooks.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | // A hook to be fired when logging on the logging levels returned from
4 | // `Levels()` on your implementation of the interface. Note that this is not
5 | // fired in a goroutine or a channel with workers, you should handle such
6 | // functionality yourself if your call is non-blocking and you don't wish for
7 | // the logging calls for levels returned from `Levels()` to block.
8 | type Hook interface {
9 | Levels() []Level
10 | Fire(*Entry) error
11 | }
12 |
13 | // Internal type for storing the hooks on a logger instance.
14 | type LevelHooks map[Level][]Hook
15 |
16 | // Add a hook to an instance of logger. This is called with
17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
18 | func (hooks LevelHooks) Add(hook Hook) {
19 | for _, level := range hook.Levels() {
20 | hooks[level] = append(hooks[level], hook)
21 | }
22 | }
23 |
24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire
25 | // appropriate hooks for a log entry.
26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error {
27 | for _, hook := range hooks[level] {
28 | if err := hook.Fire(entry); err != nil {
29 | return err
30 | }
31 | }
32 |
33 | return nil
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/json_formatter.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | )
7 |
8 | type fieldKey string
9 | type FieldMap map[fieldKey]string
10 |
11 | const (
12 | FieldKeyMsg = "msg"
13 | FieldKeyLevel = "level"
14 | FieldKeyTime = "time"
15 | )
16 |
17 | func (f FieldMap) resolve(key fieldKey) string {
18 | if k, ok := f[key]; ok {
19 | return k
20 | }
21 |
22 | return string(key)
23 | }
24 |
25 | type JSONFormatter struct {
26 | // TimestampFormat sets the format used for marshaling timestamps.
27 | TimestampFormat string
28 |
29 | // DisableTimestamp allows disabling automatic timestamps in output
30 | DisableTimestamp bool
31 |
32 | // FieldMap allows users to customize the names of keys for various fields.
33 | // As an example:
34 | // formatter := &JSONFormatter{
35 | // FieldMap: FieldMap{
36 | // FieldKeyTime: "@timestamp",
37 | // FieldKeyLevel: "@level",
38 | // FieldKeyLevel: "@message",
39 | // },
40 | // }
41 | FieldMap FieldMap
42 | }
43 |
44 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {
45 | data := make(Fields, len(entry.Data)+3)
46 | for k, v := range entry.Data {
47 | switch v := v.(type) {
48 | case error:
49 | // Otherwise errors are ignored by `encoding/json`
50 | // https://github.com/Sirupsen/logrus/issues/137
51 | data[k] = v.Error()
52 | default:
53 | data[k] = v
54 | }
55 | }
56 | prefixFieldClashes(data)
57 |
58 | timestampFormat := f.TimestampFormat
59 | if timestampFormat == "" {
60 | timestampFormat = DefaultTimestampFormat
61 | }
62 |
63 | if !f.DisableTimestamp {
64 | data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat)
65 | }
66 | data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message
67 | data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String()
68 |
69 | serialized, err := json.Marshal(data)
70 | if err != nil {
71 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
72 | }
73 | return append(serialized, '\n'), nil
74 | }
75 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_bsd.go:
--------------------------------------------------------------------------------
1 | // +build darwin freebsd openbsd netbsd dragonfly
2 | // +build !appengine
3 |
4 | package logrus
5 |
6 | import "syscall"
7 |
8 | const ioctlReadTermios = syscall.TIOCGETA
9 |
10 | type Termios syscall.Termios
11 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_linux.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2013 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build !appengine
7 |
8 | package logrus
9 |
10 | import "syscall"
11 |
12 | const ioctlReadTermios = syscall.TCGETS
13 |
14 | type Termios syscall.Termios
15 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build linux darwin freebsd openbsd netbsd dragonfly
7 | // +build !appengine
8 |
9 | package logrus
10 |
11 | import (
12 | "io"
13 | "os"
14 | "syscall"
15 | "unsafe"
16 | )
17 |
18 | // IsTerminal returns true if stderr's file descriptor is a terminal.
19 | func IsTerminal(f io.Writer) bool {
20 | var termios Termios
21 | switch v := f.(type) {
22 | case *os.File:
23 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(v.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
24 | return err == 0
25 | default:
26 | return false
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/terminal_windows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build windows,!appengine
7 |
8 | package logrus
9 |
10 | import (
11 | "io"
12 | "os"
13 | "syscall"
14 | "unsafe"
15 | )
16 |
17 | var kernel32 = syscall.NewLazyDLL("kernel32.dll")
18 |
19 | var (
20 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
21 | )
22 |
23 | // IsTerminal returns true if stderr's file descriptor is a terminal.
24 | func IsTerminal(f io.Writer) bool {
25 | switch v := f.(type) {
26 | case *os.File:
27 | var st uint32
28 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(v.Fd()), uintptr(unsafe.Pointer(&st)), 0)
29 | return r != 0 && e == 0
30 | default:
31 | return false
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/Sirupsen/logrus/writer.go:
--------------------------------------------------------------------------------
1 | package logrus
2 |
3 | import (
4 | "bufio"
5 | "io"
6 | "runtime"
7 | )
8 |
9 | func (logger *Logger) Writer() *io.PipeWriter {
10 | return logger.WriterLevel(InfoLevel)
11 | }
12 |
13 | func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
14 | return NewEntry(logger).WriterLevel(level)
15 | }
16 |
17 | func (entry *Entry) Writer() *io.PipeWriter {
18 | return entry.WriterLevel(InfoLevel)
19 | }
20 |
21 | func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
22 | reader, writer := io.Pipe()
23 |
24 | var printFunc func(args ...interface{})
25 |
26 | switch level {
27 | case DebugLevel:
28 | printFunc = entry.Debug
29 | case InfoLevel:
30 | printFunc = entry.Info
31 | case WarnLevel:
32 | printFunc = entry.Warn
33 | case ErrorLevel:
34 | printFunc = entry.Error
35 | case FatalLevel:
36 | printFunc = entry.Fatal
37 | case PanicLevel:
38 | printFunc = entry.Panic
39 | default:
40 | printFunc = entry.Print
41 | }
42 |
43 | go entry.writerScanner(reader, printFunc)
44 | runtime.SetFinalizer(writer, writerFinalizer)
45 |
46 | return writer
47 | }
48 |
49 | func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
50 | scanner := bufio.NewScanner(reader)
51 | for scanner.Scan() {
52 | printFunc(scanner.Text())
53 | }
54 | if err := scanner.Err(); err != nil {
55 | entry.Errorf("Error while reading from Writer: %s", err)
56 | }
57 | reader.Close()
58 | }
59 |
60 | func writerFinalizer(writer *io.PipeWriter) {
61 | writer.Close()
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/github.com/elazarl/go-bindata-assetfs/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014, Elazar Leibovich
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 |
--------------------------------------------------------------------------------
/vendor/github.com/elazarl/go-bindata-assetfs/README.md:
--------------------------------------------------------------------------------
1 | # go-bindata-assetfs
2 |
3 | Serve embedded files from [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) with `net/http`.
4 |
5 | [GoDoc](http://godoc.org/github.com/elazarl/go-bindata-assetfs)
6 |
7 | ### Installation
8 |
9 | Install with
10 |
11 | $ go get github.com/jteeuwen/go-bindata/...
12 | $ go get github.com/elazarl/go-bindata-assetfs/...
13 |
14 | ### Creating embedded data
15 |
16 | Usage is identical to [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) usage,
17 | instead of running `go-bindata` run `go-bindata-assetfs`.
18 |
19 | The tool will create a `bindata_assetfs.go` file, which contains the embedded data.
20 |
21 | A typical use case is
22 |
23 | $ go-bindata-assetfs data/...
24 |
25 | ### Using assetFS in your code
26 |
27 | The generated file provides an `assetFS()` function that returns a `http.Filesystem`
28 | wrapping the embedded files. What you usually want to do is:
29 |
30 | http.Handle("/", http.FileServer(assetFS()))
31 |
32 | This would run an HTTP server serving the embedded files.
33 |
34 | ## Without running binary tool
35 |
36 | You can always just run the `go-bindata` tool, and then
37 |
38 | use
39 |
40 | import "github.com/elazarl/go-bindata-assetfs"
41 | ...
42 | http.Handle("/",
43 | http.FileServer(
44 | &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: "data"}))
45 |
46 | to serve files embedded from the `data` directory.
47 |
--------------------------------------------------------------------------------
/vendor/github.com/elazarl/go-bindata-assetfs/doc.go:
--------------------------------------------------------------------------------
1 | // assetfs allows packages to serve static content embedded
2 | // with the go-bindata tool with the standard net/http package.
3 | //
4 | // See https://github.com/jteeuwen/go-bindata for more information
5 | // about embedding binary data with go-bindata.
6 | //
7 | // Usage example, after running
8 | // $ go-bindata data/...
9 | // use:
10 | // http.Handle("/",
11 | // http.FileServer(
12 | // &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "data"}))
13 | package assetfs
14 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/glog/README:
--------------------------------------------------------------------------------
1 | glog
2 | ====
3 |
4 | Leveled execution logs for Go.
5 |
6 | This is an efficient pure Go implementation of leveled logs in the
7 | manner of the open source C++ package
8 | https://github.com/google/glog
9 |
10 | By binding methods to booleans it is possible to use the log package
11 | without paying the expense of evaluating the arguments to the log.
12 | Through the -vmodule flag, the package also provides fine-grained
13 | control over logging at the file level.
14 |
15 | The comment from glog.go introduces the ideas:
16 |
17 | Package glog implements logging analogous to the Google-internal
18 | C++ INFO/ERROR/V setup. It provides functions Info, Warning,
19 | Error, Fatal, plus formatting variants such as Infof. It
20 | also provides V-style logging controlled by the -v and
21 | -vmodule=file=2 flags.
22 |
23 | Basic examples:
24 |
25 | glog.Info("Prepare to repel boarders")
26 |
27 | glog.Fatalf("Initialization failed: %s", err)
28 |
29 | See the documentation for the V function for an explanation
30 | of these examples:
31 |
32 | if glog.V(2) {
33 | glog.Info("Starting transaction...")
34 | }
35 |
36 | glog.V(2).Infoln("Processed", nItems, "elements")
37 |
38 |
39 | The repository contains an open source version of the log package
40 | used inside Google. The master copy of the source lives inside
41 | Google, not here. The code in this repo is for export only and is not itself
42 | under development. Feature requests will be ignored.
43 |
44 | Send bug reports to golang-nuts@googlegroups.com.
45 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/LICENSE:
--------------------------------------------------------------------------------
1 | Go support for Protocol Buffers - Google's data interchange format
2 |
3 | Copyright 2010 The Go Authors. All rights reserved.
4 | https://github.com/golang/protobuf
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are
8 | met:
9 |
10 | * Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 | * Redistributions in binary form must reproduce the above
13 | copyright notice, this list of conditions and the following disclaimer
14 | in the documentation and/or other materials provided with the
15 | distribution.
16 | * Neither the name of Google Inc. nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/proto/Makefile:
--------------------------------------------------------------------------------
1 | # Go support for Protocol Buffers - Google's data interchange format
2 | #
3 | # Copyright 2010 The Go Authors. All rights reserved.
4 | # https://github.com/golang/protobuf
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are
8 | # met:
9 | #
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above
13 | # copyright notice, this list of conditions and the following disclaimer
14 | # in the documentation and/or other materials provided with the
15 | # distribution.
16 | # * Neither the name of Google Inc. nor the names of its
17 | # contributors may be used to endorse or promote products derived from
18 | # this software without specific prior written permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | install:
33 | go install
34 |
35 | test: install generate-test-pbs
36 | go test
37 |
38 |
39 | generate-test-pbs:
40 | make install
41 | make -C testdata
42 | protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto
43 | make
44 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/Makefile:
--------------------------------------------------------------------------------
1 | # Go support for Protocol Buffers - Google's data interchange format
2 | #
3 | # Copyright 2010 The Go Authors. All rights reserved.
4 | # https://github.com/golang/protobuf
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are
8 | # met:
9 | #
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above
13 | # copyright notice, this list of conditions and the following disclaimer
14 | # in the documentation and/or other materials provided with the
15 | # distribution.
16 | # * Neither the name of Google Inc. nor the names of its
17 | # contributors may be used to endorse or promote products derived from
18 | # this software without specific prior written permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | test:
33 | cd testdata && make test
34 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile:
--------------------------------------------------------------------------------
1 | # Go support for Protocol Buffers - Google's data interchange format
2 | #
3 | # Copyright 2010 The Go Authors. All rights reserved.
4 | # https://github.com/golang/protobuf
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are
8 | # met:
9 | #
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above
13 | # copyright notice, this list of conditions and the following disclaimer
14 | # in the documentation and/or other materials provided with the
15 | # distribution.
16 | # * Neither the name of Google Inc. nor the names of its
17 | # contributors may be used to endorse or promote products derived from
18 | # this software without specific prior written permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | # Not stored here, but descriptor.proto is in https://github.com/google/protobuf/
33 | # at src/google/protobuf/descriptor.proto
34 | regenerate:
35 | echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION
36 | protoc --go_out=. -I$(HOME)/src/protobuf/src $(HOME)/src/protobuf/src/google/protobuf/descriptor.proto && \
37 | sed 's,^package google_protobuf,package descriptor,' google/protobuf/descriptor.pb.go > \
38 | $(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go && \
39 | rm -f google/protobuf/descriptor.pb.go
40 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go:
--------------------------------------------------------------------------------
1 | // Go support for Protocol Buffers - Google's data interchange format
2 | //
3 | // Copyright 2010 The Go Authors. All rights reserved.
4 | // https://github.com/golang/protobuf
5 | //
6 | // Redistribution and use in source and binary forms, with or without
7 | // modification, are permitted provided that the following conditions are
8 | // met:
9 | //
10 | // * Redistributions of source code must retain the above copyright
11 | // notice, this list of conditions and the following disclaimer.
12 | // * Redistributions in binary form must reproduce the above
13 | // copyright notice, this list of conditions and the following disclaimer
14 | // in the documentation and/or other materials provided with the
15 | // distribution.
16 | // * Neither the name of Google Inc. nor the names of its
17 | // contributors may be used to endorse or promote products derived from
18 | // this software without specific prior written permission.
19 | //
20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | /*
33 | A plugin for the Google protocol buffer compiler to generate Go code.
34 | Run it by building this program and putting it in your path with the name
35 | protoc-gen-go
36 | That word 'go' at the end becomes part of the option string set for the
37 | protocol compiler, so once the protocol compiler (protoc) is installed
38 | you can run
39 | protoc --go_out=output_directory input_directory/file.proto
40 | to generate Go bindings for the protocol defined by file.proto.
41 | With that input, the output will be written to
42 | output_directory/file.pb.go
43 |
44 | The generated code is documented in the package comment for
45 | the library.
46 |
47 | See the README and documentation for protocol buffers to learn more:
48 | https://developers.google.com/protocol-buffers/
49 |
50 | */
51 | package documentation
52 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/generator/Makefile:
--------------------------------------------------------------------------------
1 | # Go support for Protocol Buffers - Google's data interchange format
2 | #
3 | # Copyright 2010 The Go Authors. All rights reserved.
4 | # https://github.com/golang/protobuf
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are
8 | # met:
9 | #
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above
13 | # copyright notice, this list of conditions and the following disclaimer
14 | # in the documentation and/or other materials provided with the
15 | # distribution.
16 | # * Neither the name of Google Inc. nor the names of its
17 | # contributors may be used to endorse or promote products derived from
18 | # this software without specific prior written permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | include $(GOROOT)/src/Make.inc
33 |
34 | TARG=github.com/golang/protobuf/compiler/generator
35 | GOFILES=\
36 | generator.go\
37 |
38 | DEPS=../descriptor ../plugin ../../proto
39 |
40 | include $(GOROOT)/src/Make.pkg
41 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go:
--------------------------------------------------------------------------------
1 | // Go support for Protocol Buffers - Google's data interchange format
2 | //
3 | // Copyright 2015 The Go Authors. All rights reserved.
4 | // https://github.com/golang/protobuf
5 | //
6 | // Redistribution and use in source and binary forms, with or without
7 | // modification, are permitted provided that the following conditions are
8 | // met:
9 | //
10 | // * Redistributions of source code must retain the above copyright
11 | // notice, this list of conditions and the following disclaimer.
12 | // * Redistributions in binary form must reproduce the above
13 | // copyright notice, this list of conditions and the following disclaimer
14 | // in the documentation and/or other materials provided with the
15 | // distribution.
16 | // * Neither the name of Google Inc. nor the names of its
17 | // contributors may be used to endorse or promote products derived from
18 | // this software without specific prior written permission.
19 | //
20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | package main
33 |
34 | import _ "github.com/golang/protobuf/protoc-gen-go/grpc"
35 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile:
--------------------------------------------------------------------------------
1 | # Go support for Protocol Buffers - Google's data interchange format
2 | #
3 | # Copyright 2010 The Go Authors. All rights reserved.
4 | # https://github.com/golang/protobuf
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are
8 | # met:
9 | #
10 | # * Redistributions of source code must retain the above copyright
11 | # notice, this list of conditions and the following disclaimer.
12 | # * Redistributions in binary form must reproduce the above
13 | # copyright notice, this list of conditions and the following disclaimer
14 | # in the documentation and/or other materials provided with the
15 | # distribution.
16 | # * Neither the name of Google Inc. nor the names of its
17 | # contributors may be used to endorse or promote products derived from
18 | # this software without specific prior written permission.
19 | #
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | # Not stored here, but plugin.proto is in https://github.com/google/protobuf/
33 | # at src/google/protobuf/compiler/plugin.proto
34 | # Also we need to fix an import.
35 | regenerate:
36 | echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION
37 | protoc --go_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor:. \
38 | -I$(HOME)/src/protobuf/src $(HOME)/src/protobuf/src/google/protobuf/compiler/plugin.proto && \
39 | mv google/protobuf/compiler/plugin.pb.go $(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/plugin
40 |
41 | restore:
42 | cp plugin.pb.golden plugin.pb.go
43 |
44 | preserve:
45 | cp plugin.pb.go plugin.pb.golden
46 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go.
2 | // source: github.com/golang/protobuf/ptypes/empty/empty.proto
3 | // DO NOT EDIT!
4 |
5 | /*
6 | Package empty is a generated protocol buffer package.
7 |
8 | It is generated from these files:
9 | github.com/golang/protobuf/ptypes/empty/empty.proto
10 |
11 | It has these top-level messages:
12 | Empty
13 | */
14 | package empty
15 |
16 | import proto "github.com/golang/protobuf/proto"
17 | import fmt "fmt"
18 | import math "math"
19 |
20 | // Reference imports to suppress errors if they are not otherwise used.
21 | var _ = proto.Marshal
22 | var _ = fmt.Errorf
23 | var _ = math.Inf
24 |
25 | // This is a compile-time assertion to ensure that this generated file
26 | // is compatible with the proto package it is being compiled against.
27 | // A compilation error at this line likely means your copy of the
28 | // proto package needs to be updated.
29 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
30 |
31 | // A generic empty message that you can re-use to avoid defining duplicated
32 | // empty messages in your APIs. A typical example is to use it as the request
33 | // or the response type of an API method. For instance:
34 | //
35 | // service Foo {
36 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
37 | // }
38 | //
39 | // The JSON representation for `Empty` is empty JSON object `{}`.
40 | type Empty struct {
41 | }
42 |
43 | func (m *Empty) Reset() { *m = Empty{} }
44 | func (m *Empty) String() string { return proto.CompactTextString(m) }
45 | func (*Empty) ProtoMessage() {}
46 | func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
47 | func (*Empty) XXX_WellKnownType() string { return "Empty" }
48 |
49 | func init() {
50 | proto.RegisterType((*Empty)(nil), "google.protobuf.Empty")
51 | }
52 |
53 | func init() {
54 | proto.RegisterFile("github.com/golang/protobuf/ptypes/empty/empty.proto", fileDescriptor0)
55 | }
56 |
57 | var fileDescriptor0 = []byte{
58 | // 150 bytes of a gzipped FileDescriptorProto
59 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0x4e, 0xcf, 0x2c, 0xc9,
60 | 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28,
61 | 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xcd,
62 | 0x2d, 0x28, 0xa9, 0x84, 0x90, 0x7a, 0x60, 0x39, 0x21, 0xfe, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54,
63 | 0x3d, 0x98, 0x4a, 0x25, 0x76, 0x2e, 0x56, 0x57, 0x90, 0xbc, 0x53, 0x25, 0x97, 0x70, 0x72, 0x7e,
64 | 0xae, 0x1e, 0x9a, 0xbc, 0x13, 0x17, 0x58, 0x36, 0x00, 0xc4, 0x0d, 0x60, 0x8c, 0x52, 0x27, 0xd2,
65 | 0xce, 0x05, 0x8c, 0x8c, 0x3f, 0x18, 0x19, 0x17, 0x31, 0x31, 0xbb, 0x07, 0x38, 0xad, 0x62, 0x92,
66 | 0x73, 0x87, 0x18, 0x1a, 0x00, 0x55, 0xaa, 0x17, 0x9e, 0x9a, 0x93, 0xe3, 0x9d, 0x97, 0x5f, 0x9e,
67 | 0x17, 0x02, 0xd2, 0x92, 0xc4, 0x06, 0x36, 0xc3, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xbb,
68 | 0xf4, 0x0e, 0xd2, 0x00, 0x00, 0x00,
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto:
--------------------------------------------------------------------------------
1 | // Protocol Buffers - Google's data interchange format
2 | // Copyright 2008 Google Inc. All rights reserved.
3 | // https://developers.google.com/protocol-buffers/
4 | //
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are
7 | // met:
8 | //
9 | // * Redistributions of source code must retain the above copyright
10 | // notice, this list of conditions and the following disclaimer.
11 | // * Redistributions in binary form must reproduce the above
12 | // copyright notice, this list of conditions and the following disclaimer
13 | // in the documentation and/or other materials provided with the
14 | // distribution.
15 | // * Neither the name of Google Inc. nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 | //
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | syntax = "proto3";
32 |
33 | package google.protobuf;
34 |
35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes";
36 | option go_package = "github.com/golang/protobuf/ptypes/empty";
37 | option java_package = "com.google.protobuf";
38 | option java_outer_classname = "EmptyProto";
39 | option java_multiple_files = true;
40 | option java_generate_equals_and_hash = true;
41 | option objc_class_prefix = "GPB";
42 | option cc_enable_arenas = true;
43 |
44 | // A generic empty message that you can re-use to avoid defining duplicated
45 | // empty messages in your APIs. A typical example is to use it as the request
46 | // or the response type of an API method. For instance:
47 | //
48 | // service Foo {
49 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
50 | // }
51 | //
52 | // The JSON representation for `Empty` is empty JSON object `{}`.
53 | message Empty {}
54 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/README.md:
--------------------------------------------------------------------------------
1 | This folder contains the schema of the configuration model for the API services
2 | platform.
3 |
4 | **Note**: Protos under this directory are in Alpha status, and therefore are
5 | subject to breaking changes.
6 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/annotations.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | import "google/api/http.proto";
20 | import "google/protobuf/descriptor.proto";
21 |
22 | option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
23 | option java_multiple_files = true;
24 | option java_outer_classname = "AnnotationsProto";
25 | option java_package = "com.google.api";
26 | option objc_class_prefix = "GAPI";
27 |
28 | extend google.protobuf.MethodOptions {
29 | // See `HttpRule`.
30 | HttpRule http = 72295728;
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/backend.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20 | option java_multiple_files = true;
21 | option java_outer_classname = "BackendProto";
22 | option java_package = "com.google.api";
23 | option objc_class_prefix = "GAPI";
24 |
25 |
26 | // `Backend` defines the backend configuration for a service.
27 | message Backend {
28 | // A list of API backend rules that apply to individual API methods.
29 | //
30 | // **NOTE:** All service configuration rules follow "last one wins" order.
31 | repeated BackendRule rules = 1;
32 | }
33 |
34 | // A backend rule provides configuration for an individual API element.
35 | message BackendRule {
36 | // Selects the methods to which this rule applies.
37 | //
38 | // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
39 | string selector = 1;
40 |
41 | // The address of the API backend.
42 | string address = 2;
43 |
44 | // The number of seconds to wait for a response from a request. The
45 | // default depends on the deployment context.
46 | double deadline = 3;
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/consumer.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20 | option java_multiple_files = true;
21 | option java_outer_classname = "ConsumerProto";
22 | option java_package = "com.google.api";
23 |
24 |
25 | // A descriptor for defining project properties for a service. One service may
26 | // have many consumer projects, and the service may want to behave differently
27 | // depending on some properties on the project. For example, a project may be
28 | // associated with a school, or a business, or a government agency, a business
29 | // type property on the project may affect how a service responds to the client.
30 | // This descriptor defines which properties are allowed to be set on a project.
31 | //
32 | // Example:
33 | //
34 | // project_properties:
35 | // properties:
36 | // - name: NO_WATERMARK
37 | // type: BOOL
38 | // description: Allows usage of the API without watermarks.
39 | // - name: EXTENDED_TILE_CACHE_PERIOD
40 | // type: INT64
41 | message ProjectProperties {
42 | // List of per consumer project-specific properties.
43 | repeated Property properties = 1;
44 | }
45 |
46 | // Defines project properties.
47 | //
48 | // API services can define properties that can be assigned to consumer projects
49 | // so that backends can perform response customization without having to make
50 | // additional calls or maintain additional storage. For example, Maps API
51 | // defines properties that controls map tile cache period, or whether to embed a
52 | // watermark in a result.
53 | //
54 | // These values can be set via API producer console. Only API providers can
55 | // define and set these properties.
56 | message Property {
57 | // Supported data type of the property values
58 | enum PropertyType {
59 | // The type is unspecified, and will result in an error.
60 | UNSPECIFIED = 0;
61 |
62 | // The type is `int64`.
63 | INT64 = 1;
64 |
65 | // The type is `bool`.
66 | BOOL = 2;
67 |
68 | // The type is `string`.
69 | STRING = 3;
70 |
71 | // The type is 'double'.
72 | DOUBLE = 4;
73 | }
74 |
75 | // The name of the property (a.k.a key).
76 | string name = 1;
77 |
78 | // The type of this property.
79 | PropertyType type = 2;
80 |
81 | // The description of the property
82 | string description = 3;
83 | }
84 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/context.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20 | option java_multiple_files = true;
21 | option java_outer_classname = "ContextProto";
22 | option java_package = "com.google.api";
23 | option objc_class_prefix = "GAPI";
24 |
25 |
26 | // `Context` defines which contexts an API requests.
27 | //
28 | // Example:
29 | //
30 | // context:
31 | // rules:
32 | // - selector: "*"
33 | // requested:
34 | // - google.rpc.context.ProjectContext
35 | // - google.rpc.context.OriginContext
36 | //
37 | // The above specifies that all methods in the API request
38 | // `google.rpc.context.ProjectContext` and
39 | // `google.rpc.context.OriginContext`.
40 | //
41 | // Available context types are defined in package
42 | // `google.rpc.context`.
43 | message Context {
44 | // A list of RPC context rules that apply to individual API methods.
45 | //
46 | // **NOTE:** All service configuration rules follow "last one wins" order.
47 | repeated ContextRule rules = 1;
48 | }
49 |
50 | // A context rule provides information about the context for an individual API
51 | // element.
52 | message ContextRule {
53 | // Selects the methods to which this rule applies.
54 | //
55 | // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
56 | string selector = 1;
57 |
58 | // A list of full type names of requested contexts.
59 | repeated string requested = 2;
60 |
61 | // A list of full type names of provided contexts.
62 | repeated string provided = 3;
63 | }
64 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/control.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20 | option java_multiple_files = true;
21 | option java_outer_classname = "ControlProto";
22 | option java_package = "com.google.api";
23 | option objc_class_prefix = "GAPI";
24 |
25 |
26 | // Selects and configures the service controller used by the service. The
27 | // service controller handles features like abuse, quota, billing, logging,
28 | // monitoring, etc.
29 | message Control {
30 | // The service control environment to use. If empty, no control plane
31 | // feature (like quota and billing) will be enabled.
32 | string environment = 1;
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/httpbody.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
20 | option java_multiple_files = true;
21 | option java_outer_classname = "HttpBodyProto";
22 | option java_package = "com.google.api";
23 | option objc_class_prefix = "GAPI";
24 |
25 |
26 | // Message that represents an arbitrary HTTP body. It should only be used for
27 | // payload formats that can't be represented as JSON, such as raw binary or
28 | // an HTML page.
29 | //
30 | //
31 | // This message can be used both in streaming and non-streaming API methods in
32 | // the request as well as the response.
33 | //
34 | // It can be used as a top-level request field, which is convenient if one
35 | // wants to extract parameters from either the URL or HTTP template into the
36 | // request fields and also want access to the raw HTTP body.
37 | //
38 | // Example:
39 | //
40 | // message GetResourceRequest {
41 | // // A unique request id.
42 | // string request_id = 1;
43 | //
44 | // // The raw HTTP body is bound to this field.
45 | // google.api.HttpBody http_body = 2;
46 | // }
47 | //
48 | // service ResourceService {
49 | // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
50 | // rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);
51 | // }
52 | //
53 | // Example with streaming methods:
54 | //
55 | // service CaldavService {
56 | // rpc GetCalendar(stream google.api.HttpBody)
57 | // returns (stream google.api.HttpBody);
58 | // rpc UpdateCalendar(stream google.api.HttpBody)
59 | // returns (stream google.api.HttpBody);
60 | // }
61 | //
62 | // Use of this type only changes how the request and response bodies are
63 | // handled, all other features will continue to work unchanged.
64 | message HttpBody {
65 | // The HTTP Content-Type string representing the content type of the body.
66 | string content_type = 1;
67 |
68 | // HTTP body binary data.
69 | bytes data = 2;
70 | }
71 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/label.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option cc_enable_arenas = true;
20 | option go_package = "google.golang.org/genproto/googleapis/api/label;label";
21 | option java_multiple_files = true;
22 | option java_outer_classname = "LabelProto";
23 | option java_package = "com.google.api";
24 | option objc_class_prefix = "GAPI";
25 |
26 |
27 | // A description of a label.
28 | message LabelDescriptor {
29 | // Value types that can be used as label values.
30 | enum ValueType {
31 | // A variable-length string. This is the default.
32 | STRING = 0;
33 |
34 | // Boolean; true or false.
35 | BOOL = 1;
36 |
37 | // A 64-bit signed integer.
38 | INT64 = 2;
39 | }
40 |
41 | // The label key.
42 | string key = 1;
43 |
44 | // The type of data that can be assigned to the label.
45 | ValueType value_type = 2;
46 |
47 | // A human-readable description for the label.
48 | string description = 3;
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/log.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | import "google/api/label.proto";
20 |
21 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
22 | option java_multiple_files = true;
23 | option java_outer_classname = "LogProto";
24 | option java_package = "com.google.api";
25 | option objc_class_prefix = "GAPI";
26 |
27 |
28 | // A description of a log type. Example in YAML format:
29 | //
30 | // - name: library.googleapis.com/activity_history
31 | // description: The history of borrowing and returning library items.
32 | // display_name: Activity
33 | // labels:
34 | // - key: /customer_id
35 | // description: Identifier of a library customer
36 | message LogDescriptor {
37 | // The name of the log. It must be less than 512 characters long and can
38 | // include the following characters: upper- and lower-case alphanumeric
39 | // characters [A-Za-z0-9], and punctuation characters including
40 | // slash, underscore, hyphen, period [/_-.].
41 | string name = 1;
42 |
43 | // The set of labels that are available to describe a specific log entry.
44 | // Runtime requests that contain labels not specified here are
45 | // considered invalid.
46 | repeated LabelDescriptor labels = 2;
47 |
48 | // A human-readable description of this log. This information appears in
49 | // the documentation and can contain details.
50 | string description = 3;
51 |
52 | // The human-readable name for this log. This information appears on
53 | // the user interface and should be concise.
54 | string display_name = 4;
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/github.com/googleapis/googleapis/google/api/source_info.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | import "google/protobuf/any.proto";
20 |
21 | option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
22 | option java_multiple_files = true;
23 | option java_outer_classname = "SourceInfoProto";
24 | option java_package = "com.google.api";
25 | option objc_class_prefix = "GAPI";
26 |
27 |
28 | // Source information used to create a Service Config
29 | message SourceInfo {
30 | // All files used during config generation.
31 | repeated google.protobuf.Any source_files = 1;
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/github.com/gopherjs/websocket/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014-2015, GopherJS Team
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 |
8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 |
10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11 |
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 |
--------------------------------------------------------------------------------
/vendor/github.com/gopherjs/websocket/README.md:
--------------------------------------------------------------------------------
1 | websocket
2 | =========
3 |
4 | [](https://godoc.org/github.com/gopherjs/websocket)
5 |
6 | Packages [websocket](https://godoc.org/github.com/gopherjs/websocket) and [websocketjs](https://godoc.org/github.com/gopherjs/websocket/websocketjs) provide high- and low-level bindings for the browser's WebSocket API (respectively).
7 |
8 | The high-level bindings offer a Dial function that returns a regular net.Conn.
9 | It can be used similarly to net package.
10 |
11 | ```Go
12 | conn, err := websocket.Dial("ws://localhost/socket") // Blocks until connection is established.
13 | if err != nil {
14 | // handle error
15 | }
16 |
17 | buf := make([]byte, 1024)
18 | n, err = conn.Read(buf) // Blocks until a WebSocket frame is received.
19 | doSomethingWithData(buf[:n])
20 | if err != nil {
21 | // handle error
22 | }
23 |
24 | _, err = conn.Write([]byte("Hello!"))
25 | // ...
26 |
27 | err = conn.Close()
28 | // ...
29 | ```
30 |
31 | The low-level bindings work with typical JavaScript idioms, such as adding event listeners with callbacks.
32 |
33 | ```Go
34 | ws, err := websocketjs.New("ws://localhost/socket") // Does not block.
35 | if err != nil {
36 | // handle error
37 | }
38 |
39 | onOpen := func(ev *js.Object) {
40 | err := ws.Send([]byte("Hello!")) // Send a binary frame.
41 | // ...
42 | err := ws.Send("Hello!") // Send a text frame.
43 | // ...
44 | }
45 |
46 | ws.AddEventListener("open", false, onOpen)
47 | ws.AddEventListener("message", false, onMessage)
48 | ws.AddEventListener("close", false, onClose)
49 | ws.AddEventListener("error", false, onError)
50 |
51 | err = ws.Close()
52 | // ...
53 | ```
54 |
--------------------------------------------------------------------------------
/vendor/github.com/gopherjs/websocket/addr.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014-2015 GopherJS Team. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be found
3 | // in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import "net/url"
8 |
9 | // addr represents the address of a WebSocket connection.
10 | type addr struct {
11 | *url.URL
12 | }
13 |
14 | // Network returns the network type for a WebSocket, "websocket".
15 | func (addr *addr) Network() string { return "websocket" }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gopherjs/websocket/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014-2015 GopherJS Team. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be found
3 | // in the LICENSE file.
4 |
5 | /*
6 | Package websocket provides high-level bindings for the browser's WebSocket API.
7 |
8 | These bindings offer a Dial function that returns a regular net.Conn.
9 | It can be used similarly to net package.
10 |
11 | conn, err := websocket.Dial("ws://localhost/socket") // Blocks until connection is established.
12 | if err != nil {
13 | // handle error
14 | }
15 |
16 | buf := make([]byte, 1024)
17 | n, err = conn.Read(buf) // Blocks until a WebSocket frame is received.
18 | doSomethingWithData(buf[:n])
19 | if err != nil {
20 | // handle error
21 | }
22 |
23 | _, err = conn.Write([]byte("Hello!"))
24 | // ...
25 |
26 | err = conn.Close()
27 | // ...
28 | */
29 | package websocket
30 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Gorilla WebSocket authors for copyright
2 | # purposes.
3 | #
4 | # Please keep the list sorted.
5 |
6 | Gary Burd
7 | Joachim Bauch
8 |
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 |
6 | Redistributions of source code must retain the above copyright notice, this
7 | list of conditions and the following disclaimer.
8 |
9 | Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/client_clone.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.8
6 |
7 | package websocket
8 |
9 | import "crypto/tls"
10 |
11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config {
12 | if cfg == nil {
13 | return &tls.Config{}
14 | }
15 | return cfg.Clone()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/client_clone_legacy.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.8
6 |
7 | package websocket
8 |
9 | import "crypto/tls"
10 |
11 | // cloneTLSConfig clones all public fields except the fields
12 | // SessionTicketsDisabled and SessionTicketKey. This avoids copying the
13 | // sync.Mutex in the sync.Once and makes it safe to call cloneTLSConfig on a
14 | // config in active use.
15 | func cloneTLSConfig(cfg *tls.Config) *tls.Config {
16 | if cfg == nil {
17 | return &tls.Config{}
18 | }
19 | return &tls.Config{
20 | Rand: cfg.Rand,
21 | Time: cfg.Time,
22 | Certificates: cfg.Certificates,
23 | NameToCertificate: cfg.NameToCertificate,
24 | GetCertificate: cfg.GetCertificate,
25 | RootCAs: cfg.RootCAs,
26 | NextProtos: cfg.NextProtos,
27 | ServerName: cfg.ServerName,
28 | ClientAuth: cfg.ClientAuth,
29 | ClientCAs: cfg.ClientCAs,
30 | InsecureSkipVerify: cfg.InsecureSkipVerify,
31 | CipherSuites: cfg.CipherSuites,
32 | PreferServerCipherSuites: cfg.PreferServerCipherSuites,
33 | ClientSessionCache: cfg.ClientSessionCache,
34 | MinVersion: cfg.MinVersion,
35 | MaxVersion: cfg.MaxVersion,
36 | CurvePreferences: cfg.CurvePreferences,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/conn_read.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.5
6 |
7 | package websocket
8 |
9 | import "io"
10 |
11 | func (c *Conn) read(n int) ([]byte, error) {
12 | p, err := c.br.Peek(n)
13 | if err == io.EOF {
14 | err = errUnexpectedEOF
15 | }
16 | c.br.Discard(len(p))
17 | return p, err
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/conn_read_legacy.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.5
6 |
7 | package websocket
8 |
9 | import "io"
10 |
11 | func (c *Conn) read(n int) ([]byte, error) {
12 | p, err := c.br.Peek(n)
13 | if err == io.EOF {
14 | err = errUnexpectedEOF
15 | }
16 | if len(p) > 0 {
17 | // advance over the bytes just read
18 | io.ReadFull(c.br, p)
19 | }
20 | return p, err
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/json.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "encoding/json"
9 | "io"
10 | )
11 |
12 | // WriteJSON is deprecated, use c.WriteJSON instead.
13 | func WriteJSON(c *Conn, v interface{}) error {
14 | return c.WriteJSON(v)
15 | }
16 |
17 | // WriteJSON writes the JSON encoding of v to the connection.
18 | //
19 | // See the documentation for encoding/json Marshal for details about the
20 | // conversion of Go values to JSON.
21 | func (c *Conn) WriteJSON(v interface{}) error {
22 | w, err := c.NextWriter(TextMessage)
23 | if err != nil {
24 | return err
25 | }
26 | err1 := json.NewEncoder(w).Encode(v)
27 | err2 := w.Close()
28 | if err1 != nil {
29 | return err1
30 | }
31 | return err2
32 | }
33 |
34 | // ReadJSON is deprecated, use c.ReadJSON instead.
35 | func ReadJSON(c *Conn, v interface{}) error {
36 | return c.ReadJSON(v)
37 | }
38 |
39 | // ReadJSON reads the next JSON-encoded message from the connection and stores
40 | // it in the value pointed to by v.
41 | //
42 | // See the documentation for the encoding/json Unmarshal function for details
43 | // about the conversion of JSON to a Go value.
44 | func (c *Conn) ReadJSON(v interface{}) error {
45 | _, r, err := c.NextReader()
46 | if err != nil {
47 | return err
48 | }
49 | err = json.NewDecoder(r).Decode(v)
50 | if err == io.EOF {
51 | // One value is expected in the message.
52 | err = io.ErrUnexpectedEOF
53 | }
54 | return err
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/mask.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
2 | // this source code is governed by a BSD-style license that can be found in the
3 | // LICENSE file.
4 |
5 | // +build !appengine
6 |
7 | package websocket
8 |
9 | import "unsafe"
10 |
11 | const wordSize = int(unsafe.Sizeof(uintptr(0)))
12 |
13 | func maskBytes(key [4]byte, pos int, b []byte) int {
14 |
15 | // Mask one byte at a time for small buffers.
16 | if len(b) < 2*wordSize {
17 | for i := range b {
18 | b[i] ^= key[pos&3]
19 | pos++
20 | }
21 | return pos & 3
22 | }
23 |
24 | // Mask one byte at a time to word boundary.
25 | if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 {
26 | n = wordSize - n
27 | for i := range b[:n] {
28 | b[i] ^= key[pos&3]
29 | pos++
30 | }
31 | b = b[n:]
32 | }
33 |
34 | // Create aligned word size key.
35 | var k [wordSize]byte
36 | for i := range k {
37 | k[i] = key[(pos+i)&3]
38 | }
39 | kw := *(*uintptr)(unsafe.Pointer(&k))
40 |
41 | // Mask one word at a time.
42 | n := (len(b) / wordSize) * wordSize
43 | for i := 0; i < n; i += wordSize {
44 | *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw
45 | }
46 |
47 | // Mask one byte at a time for remaining bytes.
48 | b = b[n:]
49 | for i := range b {
50 | b[i] ^= key[pos&3]
51 | pos++
52 | }
53 |
54 | return pos & 3
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Gengo, Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification,
5 | are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of Gengo, Inc. nor the names of its
15 | contributors may be used to endorse or promote products derived from this
16 | software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/generator/generator.go:
--------------------------------------------------------------------------------
1 | // Package generator provides an abstract interface to code generators.
2 | package generator
3 |
4 | import (
5 | plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
6 | "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor"
7 | )
8 |
9 | // Generator is an abstraction of code generators.
10 | type Generator interface {
11 | // Generate generates output files from input .proto files.
12 | Generate(targets []*descriptor.File) ([]*plugin.CodeGeneratorResponse_File, error)
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/gengateway/doc.go:
--------------------------------------------------------------------------------
1 | // Package gengateway provides a code generator for grpc gateway files.
2 | package gengateway
3 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/httprule/compile.go:
--------------------------------------------------------------------------------
1 | package httprule
2 |
3 | import (
4 | "github.com/grpc-ecosystem/grpc-gateway/utilities"
5 | )
6 |
7 | const (
8 | opcodeVersion = 1
9 | )
10 |
11 | // Template is a compiled representation of path templates.
12 | type Template struct {
13 | // Version is the version number of the format.
14 | Version int
15 | // OpCodes is a sequence of operations.
16 | OpCodes []int
17 | // Pool is a constant pool
18 | Pool []string
19 | // Verb is a VERB part in the template.
20 | Verb string
21 | // Fields is a list of field paths bound in this template.
22 | Fields []string
23 | // Original template (example: /v1/a_bit_of_everything)
24 | Template string
25 | }
26 |
27 | // Compiler compiles utilities representation of path templates into marshallable operations.
28 | // They can be unmarshalled by runtime.NewPattern.
29 | type Compiler interface {
30 | Compile() Template
31 | }
32 |
33 | type op struct {
34 | // code is the opcode of the operation
35 | code utilities.OpCode
36 |
37 | // str is a string operand of the code.
38 | // num is ignored if str is not empty.
39 | str string
40 |
41 | // num is a numeric operand of the code.
42 | num int
43 | }
44 |
45 | func (w wildcard) compile() []op {
46 | return []op{
47 | {code: utilities.OpPush},
48 | }
49 | }
50 |
51 | func (w deepWildcard) compile() []op {
52 | return []op{
53 | {code: utilities.OpPushM},
54 | }
55 | }
56 |
57 | func (l literal) compile() []op {
58 | return []op{
59 | {
60 | code: utilities.OpLitPush,
61 | str: string(l),
62 | },
63 | }
64 | }
65 |
66 | func (v variable) compile() []op {
67 | var ops []op
68 | for _, s := range v.segments {
69 | ops = append(ops, s.compile()...)
70 | }
71 | ops = append(ops, op{
72 | code: utilities.OpConcatN,
73 | num: len(v.segments),
74 | }, op{
75 | code: utilities.OpCapture,
76 | str: v.path,
77 | })
78 |
79 | return ops
80 | }
81 |
82 | func (t template) Compile() Template {
83 | var rawOps []op
84 | for _, s := range t.segments {
85 | rawOps = append(rawOps, s.compile()...)
86 | }
87 |
88 | var (
89 | ops []int
90 | pool []string
91 | fields []string
92 | )
93 | consts := make(map[string]int)
94 | for _, op := range rawOps {
95 | ops = append(ops, int(op.code))
96 | if op.str == "" {
97 | ops = append(ops, op.num)
98 | } else {
99 | if _, ok := consts[op.str]; !ok {
100 | consts[op.str] = len(pool)
101 | pool = append(pool, op.str)
102 | }
103 | ops = append(ops, consts[op.str])
104 | }
105 | if op.code == utilities.OpCapture {
106 | fields = append(fields, op.str)
107 | }
108 | }
109 | return Template{
110 | Version: opcodeVersion,
111 | OpCodes: ops,
112 | Pool: pool,
113 | Verb: t.verb,
114 | Fields: fields,
115 | Template: t.template,
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/httprule/types.go:
--------------------------------------------------------------------------------
1 | package httprule
2 |
3 | import (
4 | "fmt"
5 | "strings"
6 | )
7 |
8 | type template struct {
9 | segments []segment
10 | verb string
11 | template string
12 | }
13 |
14 | type segment interface {
15 | fmt.Stringer
16 | compile() (ops []op)
17 | }
18 |
19 | type wildcard struct{}
20 |
21 | type deepWildcard struct{}
22 |
23 | type literal string
24 |
25 | type variable struct {
26 | path string
27 | segments []segment
28 | }
29 |
30 | func (wildcard) String() string {
31 | return "*"
32 | }
33 |
34 | func (deepWildcard) String() string {
35 | return "**"
36 | }
37 |
38 | func (l literal) String() string {
39 | return string(l)
40 | }
41 |
42 | func (v variable) String() string {
43 | var segs []string
44 | for _, s := range v.segments {
45 | segs = append(segs, s.String())
46 | }
47 | return fmt.Sprintf("{%s=%s}", v.path, strings.Join(segs, "/"))
48 | }
49 |
50 | func (t template) String() string {
51 | var segs []string
52 | for _, s := range t.segments {
53 | segs = append(segs, s.String())
54 | }
55 | str := strings.Join(segs, "/")
56 | if t.verb != "" {
57 | str = fmt.Sprintf("%s:%s", str, t.verb)
58 | }
59 | return "/" + str
60 | }
61 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go:
--------------------------------------------------------------------------------
1 | package runtime
2 |
3 | import (
4 | "strconv"
5 | )
6 |
7 | // String just returns the given string.
8 | // It is just for compatibility to other types.
9 | func String(val string) (string, error) {
10 | return val, nil
11 | }
12 |
13 | // Bool converts the given string representation of a boolean value into bool.
14 | func Bool(val string) (bool, error) {
15 | return strconv.ParseBool(val)
16 | }
17 |
18 | // Float64 converts the given string representation into representation of a floating point number into float64.
19 | func Float64(val string) (float64, error) {
20 | return strconv.ParseFloat(val, 64)
21 | }
22 |
23 | // Float32 converts the given string representation of a floating point number into float32.
24 | func Float32(val string) (float32, error) {
25 | f, err := strconv.ParseFloat(val, 32)
26 | if err != nil {
27 | return 0, err
28 | }
29 | return float32(f), nil
30 | }
31 |
32 | // Int64 converts the given string representation of an integer into int64.
33 | func Int64(val string) (int64, error) {
34 | return strconv.ParseInt(val, 0, 64)
35 | }
36 |
37 | // Int32 converts the given string representation of an integer into int32.
38 | func Int32(val string) (int32, error) {
39 | i, err := strconv.ParseInt(val, 0, 32)
40 | if err != nil {
41 | return 0, err
42 | }
43 | return int32(i), nil
44 | }
45 |
46 | // Uint64 converts the given string representation of an integer into uint64.
47 | func Uint64(val string) (uint64, error) {
48 | return strconv.ParseUint(val, 0, 64)
49 | }
50 |
51 | // Uint32 converts the given string representation of an integer into uint32.
52 | func Uint32(val string) (uint32, error) {
53 | i, err := strconv.ParseUint(val, 0, 32)
54 | if err != nil {
55 | return 0, err
56 | }
57 | return uint32(i), nil
58 | }
59 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package runtime contains runtime helper functions used by
3 | servers which protoc-gen-grpc-gateway generates.
4 | */
5 | package runtime
6 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/internal/stream_chunk.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 | package grpc.gateway.runtime;
3 | option go_package = "internal";
4 |
5 | // StreamError is a response type which is returned when
6 | // streaming rpc returns an error.
7 | message StreamError {
8 | int32 grpc_code = 1;
9 | int32 http_code = 2;
10 | string message = 3;
11 | string http_status = 4;
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go:
--------------------------------------------------------------------------------
1 | package runtime
2 |
3 | import (
4 | "encoding/json"
5 | "io"
6 | )
7 |
8 | // JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON
9 | // with the standard "encoding/json" package of Golang.
10 | // Although it is generally faster for simple proto messages than JSONPb,
11 | // it does not support advanced features of protobuf, e.g. map, oneof, ....
12 | type JSONBuiltin struct{}
13 |
14 | // ContentType always Returns "application/json".
15 | func (*JSONBuiltin) ContentType() string {
16 | return "application/json"
17 | }
18 |
19 | // Marshal marshals "v" into JSON
20 | func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) {
21 | return json.Marshal(v)
22 | }
23 |
24 | // Unmarshal unmarshals JSON data into "v".
25 | func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error {
26 | return json.Unmarshal(data, v)
27 | }
28 |
29 | // NewDecoder returns a Decoder which reads JSON stream from "r".
30 | func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder {
31 | return json.NewDecoder(r)
32 | }
33 |
34 | // NewEncoder returns an Encoder which writes JSON stream into "w".
35 | func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder {
36 | return json.NewEncoder(w)
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go:
--------------------------------------------------------------------------------
1 | package runtime
2 |
3 | import (
4 | "io"
5 | )
6 |
7 | // Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
8 | type Marshaler interface {
9 | // Marshal marshals "v" into byte sequence.
10 | Marshal(v interface{}) ([]byte, error)
11 | // Unmarshal unmarshals "data" into "v".
12 | // "v" must be a pointer value.
13 | Unmarshal(data []byte, v interface{}) error
14 | // NewDecoder returns a Decoder which reads byte sequence from "r".
15 | NewDecoder(r io.Reader) Decoder
16 | // NewEncoder returns an Encoder which writes bytes sequence into "w".
17 | NewEncoder(w io.Writer) Encoder
18 | // ContentType returns the Content-Type which this marshaler is responsible for.
19 | ContentType() string
20 | }
21 |
22 | // Decoder decodes a byte sequence
23 | type Decoder interface {
24 | Decode(v interface{}) error
25 | }
26 |
27 | // Encoder encodes gRPC payloads / fields into byte sequence.
28 | type Encoder interface {
29 | Encode(v interface{}) error
30 | }
31 |
32 | // DecoderFunc adapts an decoder function into Decoder.
33 | type DecoderFunc func(v interface{}) error
34 |
35 | // Decode delegates invocations to the underlying function itself.
36 | func (f DecoderFunc) Decode(v interface{}) error { return f(v) }
37 |
38 | // EncoderFunc adapts an encoder function into Encoder
39 | type EncoderFunc func(v interface{}) error
40 |
41 | // Encode delegates invocations to the underlying function itself.
42 | func (f EncoderFunc) Encode(v interface{}) error { return f(v) }
43 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go:
--------------------------------------------------------------------------------
1 | package runtime
2 |
3 | import (
4 | "errors"
5 | "net/http"
6 | )
7 |
8 | // MIMEWildcard is the fallback MIME type used for requests which do not match
9 | // a registered MIME type.
10 | const MIMEWildcard = "*"
11 |
12 | var (
13 | acceptHeader = http.CanonicalHeaderKey("Accept")
14 | contentTypeHeader = http.CanonicalHeaderKey("Content-Type")
15 |
16 | defaultMarshaler = &JSONPb{OrigName: true}
17 | )
18 |
19 | // MarshalerForRequest returns the inbound/outbound marshalers for this request.
20 | // It checks the registry on the ServeMux for the MIME type set by the Content-Type header.
21 | // If it isn't set (or the request Content-Type is empty), checks for "*".
22 | // If there are multiple Content-Type headers set, choose the first one that it can
23 | // exactly match in the registry.
24 | // Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler.
25 | func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) {
26 | for _, acceptVal := range r.Header[acceptHeader] {
27 | if m, ok := mux.marshalers.mimeMap[acceptVal]; ok {
28 | outbound = m
29 | break
30 | }
31 | }
32 |
33 | for _, contentTypeVal := range r.Header[contentTypeHeader] {
34 | if m, ok := mux.marshalers.mimeMap[contentTypeVal]; ok {
35 | inbound = m
36 | break
37 | }
38 | }
39 |
40 | if inbound == nil {
41 | inbound = mux.marshalers.mimeMap[MIMEWildcard]
42 | }
43 | if outbound == nil {
44 | outbound = inbound
45 | }
46 |
47 | return inbound, outbound
48 | }
49 |
50 | // marshalerRegistry is a mapping from MIME types to Marshalers.
51 | type marshalerRegistry struct {
52 | mimeMap map[string]Marshaler
53 | }
54 |
55 | // add adds a marshaler for a case-sensitive MIME type string ("*" to match any
56 | // MIME type).
57 | func (m marshalerRegistry) add(mime string, marshaler Marshaler) error {
58 | if len(mime) == 0 {
59 | return errors.New("empty MIME type")
60 | }
61 |
62 | m.mimeMap[mime] = marshaler
63 |
64 | return nil
65 | }
66 |
67 | // makeMarshalerMIMERegistry returns a new registry of marshalers.
68 | // It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces.
69 | //
70 | // For example, you could allow the client to specify the use of the runtime.JSONPb marshaler
71 | // with a "applicaton/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler
72 | // with a "application/json" Content-Type.
73 | // "*" can be used to match any Content-Type.
74 | // This can be attached to a ServerMux with the marshaler option.
75 | func makeMarshalerMIMERegistry() marshalerRegistry {
76 | return marshalerRegistry{
77 | mimeMap: map[string]Marshaler{
78 | MIMEWildcard: defaultMarshaler,
79 | },
80 | }
81 | }
82 |
83 | // WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound
84 | // Marshalers to a MIME type in mux.
85 | func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption {
86 | return func(mux *ServeMux) {
87 | if err := mux.marshalers.add(mime, marshaler); err != nil {
88 | panic(err)
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go:
--------------------------------------------------------------------------------
1 | package runtime
2 |
3 | import (
4 | "github.com/golang/protobuf/proto"
5 | )
6 |
7 | // StringP returns a pointer to a string whose pointee is same as the given string value.
8 | func StringP(val string) (*string, error) {
9 | return proto.String(val), nil
10 | }
11 |
12 | // BoolP parses the given string representation of a boolean value,
13 | // and returns a pointer to a bool whose value is same as the parsed value.
14 | func BoolP(val string) (*bool, error) {
15 | b, err := Bool(val)
16 | if err != nil {
17 | return nil, err
18 | }
19 | return proto.Bool(b), nil
20 | }
21 |
22 | // Float64P parses the given string representation of a floating point number,
23 | // and returns a pointer to a float64 whose value is same as the parsed number.
24 | func Float64P(val string) (*float64, error) {
25 | f, err := Float64(val)
26 | if err != nil {
27 | return nil, err
28 | }
29 | return proto.Float64(f), nil
30 | }
31 |
32 | // Float32P parses the given string representation of a floating point number,
33 | // and returns a pointer to a float32 whose value is same as the parsed number.
34 | func Float32P(val string) (*float32, error) {
35 | f, err := Float32(val)
36 | if err != nil {
37 | return nil, err
38 | }
39 | return proto.Float32(f), nil
40 | }
41 |
42 | // Int64P parses the given string representation of an integer
43 | // and returns a pointer to a int64 whose value is same as the parsed integer.
44 | func Int64P(val string) (*int64, error) {
45 | i, err := Int64(val)
46 | if err != nil {
47 | return nil, err
48 | }
49 | return proto.Int64(i), nil
50 | }
51 |
52 | // Int32P parses the given string representation of an integer
53 | // and returns a pointer to a int32 whose value is same as the parsed integer.
54 | func Int32P(val string) (*int32, error) {
55 | i, err := Int32(val)
56 | if err != nil {
57 | return nil, err
58 | }
59 | return proto.Int32(i), err
60 | }
61 |
62 | // Uint64P parses the given string representation of an integer
63 | // and returns a pointer to a uint64 whose value is same as the parsed integer.
64 | func Uint64P(val string) (*uint64, error) {
65 | i, err := Uint64(val)
66 | if err != nil {
67 | return nil, err
68 | }
69 | return proto.Uint64(i), err
70 | }
71 |
72 | // Uint32P parses the given string representation of an integer
73 | // and returns a pointer to a uint32 whose value is same as the parsed integer.
74 | func Uint32P(val string) (*uint32, error) {
75 | i, err := Uint32(val)
76 | if err != nil {
77 | return nil, err
78 | }
79 | return proto.Uint32(i), err
80 | }
81 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api/annotations.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | import "google/api/http.proto";
20 | import "google/protobuf/descriptor.proto";
21 |
22 | option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
23 | option java_multiple_files = true;
24 | option java_outer_classname = "AnnotationsProto";
25 | option java_package = "com.google.api";
26 | option objc_class_prefix = "GAPI";
27 |
28 | extend google.protobuf.MethodOptions {
29 | // See `HttpRule`.
30 | HttpRule http = 72295728;
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go:
--------------------------------------------------------------------------------
1 | // Package utilities provides members for internal use in grpc-gateway.
2 | package utilities
3 |
--------------------------------------------------------------------------------
/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go:
--------------------------------------------------------------------------------
1 | package utilities
2 |
3 | // An OpCode is a opcode of compiled path patterns.
4 | type OpCode int
5 |
6 | // These constants are the valid values of OpCode.
7 | const (
8 | // OpNop does nothing
9 | OpNop = OpCode(iota)
10 | // OpPush pushes a component to stack
11 | OpPush
12 | // OpLitPush pushes a component to stack if it matches to the literal
13 | OpLitPush
14 | // OpPushM concatenates the remaining components and pushes it to stack
15 | OpPushM
16 | // OpConcatN pops N items from stack, concatenates them and pushes it back to stack
17 | OpConcatN
18 | // OpCapture pops an item and binds it to the variable
19 | OpCapture
20 | // OpEnd is the least postive invalid opcode.
21 | OpEnd
22 | )
23 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/gopherjs-json/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Johan Brandhorst
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/gopherjs-json/README.md:
--------------------------------------------------------------------------------
1 | # gopherjs-json
2 | Convenience functions for interacting with JSON in GopherJS
3 |
4 | Inspired by https://github.com/gopherjs/gopherjs/wiki/JavaScript-Tips-and-Gotchas
5 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/gopherjs-json/json.go:
--------------------------------------------------------------------------------
1 | package json
2 |
3 | import "github.com/gopherjs/gopherjs/js"
4 |
5 | // Marshal uses the browser builtin JSON.stringify function
6 | // and wraps it such that any exceptions thrown are returned
7 | // as errors.
8 | func Marshal(o *js.Object) (res string, err error) {
9 | defer func() {
10 | e := recover()
11 |
12 | if e == nil {
13 | return
14 | }
15 |
16 | if e, ok := e.(*js.Error); ok {
17 | err = e
18 | } else {
19 | panic(e)
20 | }
21 | }()
22 |
23 | res = js.Global.Get("JSON").Call("stringify", o).String()
24 |
25 | return res, err
26 | }
27 |
28 | // Unmarshal uses the browser builtin JSON.parse function
29 | // and wraps it such that any exceptions thrown are returned
30 | // as errors.
31 | func Unmarshal(s string) (res *js.Object, err error) {
32 | defer func() {
33 | e := recover()
34 |
35 | if e == nil {
36 | return
37 | }
38 |
39 | if e, ok := e.(*js.Error); ok {
40 | err = e
41 | } else {
42 | panic(e)
43 | }
44 | }()
45 |
46 | res = js.Global.Get("JSON").Call("parse", s)
47 |
48 | return res, err
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/protoc-gen-gopherjs/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Johan Brandhorst
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/protoc-gen-gopherjs/README.md:
--------------------------------------------------------------------------------
1 | # protoc-gen-gopherjs-structs
2 | Generate gopherjs compatible structs from your proto files!
3 |
4 | ## Why?
5 | This is useful to avoid importing packages imported by the files generated by the
6 | standard proto go plugin, so as to minimize generated JS filesize.
7 |
8 | It also automatically embeds the `*js.Object` into the structs so that they can
9 | be used properly in GopherJS files.
10 |
11 | ## WARNING
12 |
13 | This `protoc` plugin is very much alpha state and does not support
14 | all types of valid proto files and messages.
15 | Use are your own risk, and contributions are very much welcome!
16 |
--------------------------------------------------------------------------------
/vendor/github.com/johanbrandhorst/protoc-gen-gopherjs/main.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Johan Brandhorst. All Rights Reserved.
2 | // See LICENSE for licensing terms.
3 |
4 | package main
5 |
6 | import (
7 | "bytes"
8 | "io/ioutil"
9 | "log"
10 | "os"
11 | "strings"
12 |
13 | "github.com/golang/protobuf/proto"
14 | "github.com/golang/protobuf/protoc-gen-go/descriptor"
15 | plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
16 |
17 | "github.com/johanbrandhorst/protoc-gen-gopherjs/filegenerator"
18 | )
19 |
20 | func main() {
21 | data, err := ioutil.ReadAll(os.Stdin)
22 | if err != nil {
23 | log.Fatalln("Could not read request from STDIN: ", err)
24 | }
25 |
26 | req := &plugin.CodeGeneratorRequest{}
27 |
28 | err = proto.Unmarshal(data, req)
29 | if err != nil {
30 | log.Fatalln("Could not unmarshal request: ", err)
31 | }
32 |
33 | resp := &plugin.CodeGeneratorResponse{}
34 |
35 | for _, inFile := range req.GetProtoFile() {
36 | for _, reqFile := range req.GetFileToGenerate() {
37 | if inFile.GetName() == reqFile {
38 | outFile, err := processFile(inFile)
39 | if err != nil {
40 | log.Fatalln("Could not process file: ", err)
41 | }
42 | resp.File = append(resp.File, outFile)
43 | }
44 | }
45 | }
46 |
47 | data, err = proto.Marshal(resp)
48 | if err != nil {
49 | log.Fatalf("Could not marshal response: %v [%v]\n", err, resp)
50 | }
51 |
52 | _, err = os.Stdout.Write(data)
53 | if err != nil {
54 | log.Fatalln("Could not write response to STDOUT: ", err)
55 | }
56 | }
57 |
58 | func processFile(inFile *descriptor.FileDescriptorProto) (*plugin.CodeGeneratorResponse_File, error) {
59 | outFile := &plugin.CodeGeneratorResponse_File{}
60 | outFile.Name = proto.String(strings.TrimSuffix(inFile.GetName(), ".proto") + ".pb.gopherjs.go")
61 |
62 | b := &bytes.Buffer{}
63 | fg := filegenerator.New(b)
64 |
65 | fg.Generate(inFile)
66 |
67 | outFile.Content = proto.String(b.String())
68 |
69 | return outFile, nil
70 | }
71 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/LICENSE:
--------------------------------------------------------------------------------
1 | This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | license. Its contents can be found at:
3 | http://creativecommons.org/publicdomain/zero/1.0
4 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/Makefile:
--------------------------------------------------------------------------------
1 | all:
2 | make -C testdata
3 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/asset.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package bindata
6 |
7 | // Asset holds information about a single asset to be processed.
8 | type Asset struct {
9 | Path string // Full file path.
10 | Name string // Key used in TOC -- name by which asset is referenced.
11 | Func string // Function name for the procedure returning the asset contents.
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/bytewriter.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package bindata
6 |
7 | import (
8 | "fmt"
9 | "io"
10 | )
11 |
12 | var (
13 | newline = []byte{'\n'}
14 | dataindent = []byte{'\t', '\t'}
15 | space = []byte{' '}
16 | )
17 |
18 | type ByteWriter struct {
19 | io.Writer
20 | c int
21 | }
22 |
23 | func (w *ByteWriter) Write(p []byte) (n int, err error) {
24 | if len(p) == 0 {
25 | return
26 | }
27 |
28 | for n = range p {
29 | if w.c%12 == 0 {
30 | w.Writer.Write(newline)
31 | w.Writer.Write(dataindent)
32 | w.c = 0
33 | } else {
34 | w.Writer.Write(space)
35 | }
36 |
37 | fmt.Fprintf(w.Writer, "0x%02x,", p[n])
38 | w.c++
39 | }
40 |
41 | n++
42 |
43 | return
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/debug.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package bindata
6 |
7 | import (
8 | "fmt"
9 | "io"
10 | )
11 |
12 | // writeDebug writes the debug code file.
13 | func writeDebug(w io.Writer, c *Config, toc []Asset) error {
14 | err := writeDebugHeader(w)
15 | if err != nil {
16 | return err
17 | }
18 |
19 | for i := range toc {
20 | err = writeDebugAsset(w, c, &toc[i])
21 | if err != nil {
22 | return err
23 | }
24 | }
25 |
26 | return nil
27 | }
28 |
29 | // writeDebugHeader writes output file headers.
30 | // This targets debug builds.
31 | func writeDebugHeader(w io.Writer) error {
32 | _, err := fmt.Fprintf(w, `import (
33 | "fmt"
34 | "io/ioutil"
35 | "os"
36 | "path/filepath"
37 | "strings"
38 | )
39 |
40 | // bindataRead reads the given file from disk. It returns an error on failure.
41 | func bindataRead(path, name string) ([]byte, error) {
42 | buf, err := ioutil.ReadFile(path)
43 | if err != nil {
44 | err = fmt.Errorf("Error reading asset %%s at %%s: %%v", name, path, err)
45 | }
46 | return buf, err
47 | }
48 |
49 | type asset struct {
50 | bytes []byte
51 | info os.FileInfo
52 | }
53 |
54 | `)
55 | return err
56 | }
57 |
58 | // writeDebugAsset write a debug entry for the given asset.
59 | // A debug entry is simply a function which reads the asset from
60 | // the original file (e.g.: from disk).
61 | func writeDebugAsset(w io.Writer, c *Config, asset *Asset) error {
62 | pathExpr := fmt.Sprintf("%q", asset.Path)
63 | if c.Dev {
64 | pathExpr = fmt.Sprintf("filepath.Join(rootDir, %q)", asset.Name)
65 | }
66 |
67 | _, err := fmt.Fprintf(w, `// %s reads file data from disk. It returns an error on failure.
68 | func %s() (*asset, error) {
69 | path := %s
70 | name := %q
71 | bytes, err := bindataRead(path, name)
72 | if err != nil {
73 | return nil, err
74 | }
75 |
76 | fi, err := os.Stat(path)
77 | if err != nil {
78 | err = fmt.Errorf("Error reading asset info %%s at %%s: %%v", name, path, err)
79 | }
80 |
81 | a := &asset{bytes: bytes, info: fi}
82 | return a, err
83 | }
84 |
85 | `, asset.Func, asset.Func, pathExpr, asset.Name)
86 | return err
87 | }
88 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/go-bindata/AppendSliceValue.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "strings"
4 |
5 | // borrowed from https://github.com/hashicorp/serf/blob/master/command/agent/flag_slice_value.go
6 |
7 | // AppendSliceValue implements the flag.Value interface and allows multiple
8 | // calls to the same variable to append a list.
9 | type AppendSliceValue []string
10 |
11 | func (s *AppendSliceValue) String() string {
12 | return strings.Join(*s, ",")
13 | }
14 |
15 | func (s *AppendSliceValue) Set(value string) error {
16 | if *s == nil {
17 | *s = make([]string, 0, 1)
18 | }
19 |
20 | *s = append(*s, value)
21 | return nil
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/go-bindata/version.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package main
6 |
7 | import (
8 | "fmt"
9 | "runtime"
10 | )
11 |
12 | const (
13 | AppName = "go-bindata"
14 | AppVersionMajor = 3
15 | AppVersionMinor = 1
16 | )
17 |
18 | // revision part of the program version.
19 | // This will be set automatically at build time like so:
20 | //
21 | // go build -ldflags "-X main.AppVersionRev `date -u +%s`"
22 | var AppVersionRev string
23 |
24 | func Version() string {
25 | if len(AppVersionRev) == 0 {
26 | AppVersionRev = "0"
27 | }
28 |
29 | return fmt.Sprintf("%s %d.%d.%s (Go runtime %s).\nCopyright (c) 2010-2013, Jim Teeuwen.",
30 | AppName, AppVersionMajor, AppVersionMinor, AppVersionRev, runtime.Version())
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/restore.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package bindata
6 |
7 | import (
8 | "fmt"
9 | "io"
10 | )
11 |
12 | func writeRestore(w io.Writer) error {
13 | _, err := fmt.Fprintf(w, `
14 | // RestoreAsset restores an asset under the given directory
15 | func RestoreAsset(dir, name string) error {
16 | data, err := Asset(name)
17 | if err != nil {
18 | return err
19 | }
20 | info, err := AssetInfo(name)
21 | if err != nil {
22 | return err
23 | }
24 | err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
25 | if err != nil {
26 | return err
27 | }
28 | err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
29 | if err != nil {
30 | return err
31 | }
32 | err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
33 | if err != nil {
34 | return err
35 | }
36 | return nil
37 | }
38 |
39 | // RestoreAssets restores an asset under the given directory recursively
40 | func RestoreAssets(dir, name string) error {
41 | children, err := AssetDir(name)
42 | // File
43 | if err != nil {
44 | return RestoreAsset(dir, name)
45 | }
46 | // Dir
47 | for _, child := range children {
48 | err = RestoreAssets(dir, filepath.Join(name, child))
49 | if err != nil {
50 | return err
51 | }
52 | }
53 | return nil
54 | }
55 |
56 | func _filePath(dir, name string) string {
57 | cannonicalName := strings.Replace(name, "\\", "/", -1)
58 | return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
59 | }
60 |
61 | `)
62 | return err
63 | }
64 |
--------------------------------------------------------------------------------
/vendor/github.com/jteeuwen/go-bindata/stringwriter.go:
--------------------------------------------------------------------------------
1 | // This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2 | // license. Its contents can be found at:
3 | // http://creativecommons.org/publicdomain/zero/1.0/
4 |
5 | package bindata
6 |
7 | import (
8 | "io"
9 | )
10 |
11 | const lowerHex = "0123456789abcdef"
12 |
13 | type StringWriter struct {
14 | io.Writer
15 | c int
16 | }
17 |
18 | func (w *StringWriter) Write(p []byte) (n int, err error) {
19 | if len(p) == 0 {
20 | return
21 | }
22 |
23 | buf := []byte(`\x00`)
24 | var b byte
25 |
26 | for n, b = range p {
27 | buf[2] = lowerHex[b/16]
28 | buf[3] = lowerHex[b%16]
29 | w.Writer.Write(buf)
30 | w.c++
31 | }
32 |
33 | n++
34 |
35 | return
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-dom/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 oskca
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-dom/README.md:
--------------------------------------------------------------------------------
1 | Gopherjs Dom Library
2 | -----------------------
3 |
4 | This Library implements convenience functions for manipulating DOM
5 | in a Gopherjs application.
6 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-json/JSON.go:
--------------------------------------------------------------------------------
1 | // package JSON wraps the javascritp JSON api for GOPHERJS.
2 | package json
3 |
4 | import (
5 | "github.com/gopherjs/gopherjs/js"
6 | )
7 |
8 | var (
9 | json = js.Global.Get("JSON")
10 | )
11 |
12 | func Stringify(obj interface{}) string {
13 | return json.Call("stringify", obj).String()
14 | }
15 |
16 | func Parse(jsonStr string) *js.Object {
17 | return json.Call("parse", jsonStr)
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-json/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 oskca
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-json/README.md:
--------------------------------------------------------------------------------
1 | Gopherjs JSON Library
2 | -----------------------
3 |
4 | This Library implements convenience functions for manipulating JSON
5 | in a Gopherjs application.
6 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 oskca
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/component.go:
--------------------------------------------------------------------------------
1 | package vue
2 |
3 | import (
4 | "github.com/gopherjs/gopherjs/js"
5 | )
6 |
7 | var (
8 | creatorPool = make([]*pool, 0)
9 | )
10 |
11 | type pool struct {
12 | creator func() (structPtr interface{})
13 | structPtr interface{}
14 | counter int
15 | }
16 |
17 | // Component is actually an Extended Vue SubClass,
18 | // which acts as a Component constructor in VueJS world
19 | // thus you can use Component.New to create a
20 | // preConfigured VueJS instance(*ViewModel).
21 | type Component struct {
22 | *ViewModel
23 | }
24 |
25 | // New create the component instance
26 | func (c *Component) New() *ViewModel {
27 | return newViewModel(c.Object.New())
28 | }
29 |
30 | func newComponent(o *js.Object) *Component {
31 | return &Component{
32 | ViewModel: newViewModel(o),
33 | }
34 | }
35 |
36 | // Register register Component:c in the global namespace
37 | func (c *Component) Register(name string) *Component {
38 | vue.Call("component", name, c)
39 | return c
40 | }
41 |
42 | func GetComponent(name string) *Component {
43 | return newComponent(vue.Call("component", name))
44 | }
45 |
46 | // NewComponent creates and registers a named global Component
47 | //
48 | // vmCreator should return a gopherjs struct pointer. see New for more details
49 | func NewComponent(
50 | vmCreator func() (structPtr interface{}),
51 | templateStr string,
52 | replaceMountPoint ...bool,
53 | ) *Component {
54 | // args
55 | idx := len(creatorPool)
56 | creatorPool = append(creatorPool, new(pool))
57 | creatorPool[idx].creator = vmCreator
58 | vmfn := func() interface{} {
59 | p := creatorPool[idx]
60 | if p.counter%3 == 0 {
61 | p.structPtr = p.creator()
62 | }
63 | p.counter += 1
64 | return p.structPtr
65 | }
66 | // opts
67 | opt := NewOption()
68 | opt.Data = vmfn
69 | opt.Template = templateStr
70 | opt.OnLifeCycleEvent(EvtBeforeCreate, func(vm *ViewModel) {
71 | vm.Options.Set("methods", js.MakeWrapper(vmfn()))
72 | vMap[vmfn()] = vm
73 | })
74 | return opt.NewComponent()
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/filter.go:
--------------------------------------------------------------------------------
1 | package vue
2 |
3 | import (
4 | "github.com/gopherjs/gopherjs/js"
5 | )
6 |
7 | // Filter return interface{} to utilize GopherJS type convertion automatically
8 | type Filter func(oldValue *js.Object) (newValue interface{})
9 |
10 | // using interface{} type here to utilize GopherJS type convertion automatically
11 | func NewFilter(fn func(oldValue *js.Object) (newValue interface{})) Filter {
12 | return Filter(fn)
13 | }
14 |
15 | func (f Filter) Register(name string) {
16 | vue.Call("filter", name, f)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/inc_debug.go:
--------------------------------------------------------------------------------
1 | //+build debug
2 |
3 | package vue
4 |
5 | import _ "github.com/oskca/gopherjs-vue/jscode/debug"
6 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/inc_minified.go:
--------------------------------------------------------------------------------
1 | //+build !debug
2 |
3 | package vue
4 |
5 | import _ "github.com/oskca/gopherjs-vue/jscode/minified"
6 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/jscode/debug/inc.go:
--------------------------------------------------------------------------------
1 | package debug
2 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/jscode/minified/inc.go:
--------------------------------------------------------------------------------
1 | package minifiled
2 |
--------------------------------------------------------------------------------
/vendor/github.com/oskca/gopherjs-vue/mapping.go:
--------------------------------------------------------------------------------
1 | package vue
2 |
3 | import (
4 | "strings"
5 |
6 | "github.com/gopherjs/gopherjs/js"
7 | "github.com/oskca/gopherjs-json"
8 | )
9 |
10 | // FromJS set the corresponding VueJS data model field from obj
11 | // new data model field will be created when not exist
12 | func (v *ViewModel) FromJS(obj *js.Object) *ViewModel {
13 | for _, key := range js.Keys(obj) {
14 | // skip internal or unexported field
15 | if strings.HasPrefix(key, "$") || strings.HasPrefix(key, "_") {
16 | continue
17 | }
18 | v.Object.Set(key, obj.Get(key))
19 | }
20 | return v
21 | }
22 |
23 | func (v *ViewModel) FromJSON(jsonStr string) *ViewModel {
24 | return v.FromJS(json.Parse(jsonStr))
25 | }
26 |
27 | func (v *ViewModel) ToJS() *js.Object {
28 | obj := js.Global.Get("Object").New()
29 | for _, key := range js.Keys(v.Object) {
30 | // skip internal/unexported field
31 | if strings.HasPrefix(key, "$") || strings.HasPrefix(key, "_") {
32 | continue
33 | }
34 | obj.Set(key, v.Get(key))
35 | }
36 | return obj
37 | }
38 |
39 | func (v *ViewModel) ToJSON() string {
40 | return json.Stringify(v.ToJSON())
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/tmc/grpc-websocket-proxy/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2016 Travis Cline
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/vendor/github.com/tmc/grpc-websocket-proxy/wsproxy/doc.go:
--------------------------------------------------------------------------------
1 | // Package wsproxy implements a websocket proxy for grpc-gateway backed services
2 | package wsproxy
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/go17.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.7
6 |
7 | package context
8 |
9 | import (
10 | "context" // standard library's context, as of Go 1.7
11 | "time"
12 | )
13 |
14 | var (
15 | todo = context.TODO()
16 | background = context.Background()
17 | )
18 |
19 | // Canceled is the error returned by Context.Err when the context is canceled.
20 | var Canceled = context.Canceled
21 |
22 | // DeadlineExceeded is the error returned by Context.Err when the context's
23 | // deadline passes.
24 | var DeadlineExceeded = context.DeadlineExceeded
25 |
26 | // WithCancel returns a copy of parent with a new Done channel. The returned
27 | // context's Done channel is closed when the returned cancel function is called
28 | // or when the parent context's Done channel is closed, whichever happens first.
29 | //
30 | // Canceling this context releases resources associated with it, so code should
31 | // call cancel as soon as the operations running in this Context complete.
32 | func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
33 | ctx, f := context.WithCancel(parent)
34 | return ctx, CancelFunc(f)
35 | }
36 |
37 | // WithDeadline returns a copy of the parent context with the deadline adjusted
38 | // to be no later than d. If the parent's deadline is already earlier than d,
39 | // WithDeadline(parent, d) is semantically equivalent to parent. The returned
40 | // context's Done channel is closed when the deadline expires, when the returned
41 | // cancel function is called, or when the parent context's Done channel is
42 | // closed, whichever happens first.
43 | //
44 | // Canceling this context releases resources associated with it, so code should
45 | // call cancel as soon as the operations running in this Context complete.
46 | func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
47 | ctx, f := context.WithDeadline(parent, deadline)
48 | return ctx, CancelFunc(f)
49 | }
50 |
51 | // WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
52 | //
53 | // Canceling this context releases resources associated with it, so code should
54 | // call cancel as soon as the operations running in this Context complete:
55 | //
56 | // func slowOperationWithTimeout(ctx context.Context) (Result, error) {
57 | // ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
58 | // defer cancel() // releases resources if slowOperation completes before timeout elapses
59 | // return slowOperation(ctx)
60 | // }
61 | func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
62 | return WithDeadline(parent, time.Now().Add(timeout))
63 | }
64 |
65 | // WithValue returns a copy of parent in which the value associated with key is
66 | // val.
67 | //
68 | // Use context Values only for request-scoped data that transits processes and
69 | // APIs, not for passing optional parameters to functions.
70 | func WithValue(parent Context, key interface{}, val interface{}) Context {
71 | return context.WithValue(parent, key, val)
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/Dockerfile:
--------------------------------------------------------------------------------
1 | #
2 | # This Dockerfile builds a recent curl with HTTP/2 client support, using
3 | # a recent nghttp2 build.
4 | #
5 | # See the Makefile for how to tag it. If Docker and that image is found, the
6 | # Go tests use this curl binary for integration tests.
7 | #
8 |
9 | FROM ubuntu:trusty
10 |
11 | RUN apt-get update && \
12 | apt-get upgrade -y && \
13 | apt-get install -y git-core build-essential wget
14 |
15 | RUN apt-get install -y --no-install-recommends \
16 | autotools-dev libtool pkg-config zlib1g-dev \
17 | libcunit1-dev libssl-dev libxml2-dev libevent-dev \
18 | automake autoconf
19 |
20 | # The list of packages nghttp2 recommends for h2load:
21 | RUN apt-get install -y --no-install-recommends make binutils \
22 | autoconf automake autotools-dev \
23 | libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \
24 | libev-dev libevent-dev libjansson-dev libjemalloc-dev \
25 | cython python3.4-dev python-setuptools
26 |
27 | # Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached:
28 | ENV NGHTTP2_VER 895da9a
29 | RUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git
30 |
31 | WORKDIR /root/nghttp2
32 | RUN git reset --hard $NGHTTP2_VER
33 | RUN autoreconf -i
34 | RUN automake
35 | RUN autoconf
36 | RUN ./configure
37 | RUN make
38 | RUN make install
39 |
40 | WORKDIR /root
41 | RUN wget http://curl.haxx.se/download/curl-7.45.0.tar.gz
42 | RUN tar -zxvf curl-7.45.0.tar.gz
43 | WORKDIR /root/curl-7.45.0
44 | RUN ./configure --with-ssl --with-nghttp2=/usr/local
45 | RUN make
46 | RUN make install
47 | RUN ldconfig
48 |
49 | CMD ["-h"]
50 | ENTRYPOINT ["/usr/local/bin/curl"]
51 |
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/Makefile:
--------------------------------------------------------------------------------
1 | curlimage:
2 | docker build -t gohttp2/curl .
3 |
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/README:
--------------------------------------------------------------------------------
1 | This is a work-in-progress HTTP/2 implementation for Go.
2 |
3 | It will eventually live in the Go standard library and won't require
4 | any changes to your code to use. It will just be automatic.
5 |
6 | Status:
7 |
8 | * The server support is pretty good. A few things are missing
9 | but are being worked on.
10 | * The client work has just started but shares a lot of code
11 | is coming along much quicker.
12 |
13 | Docs are at https://godoc.org/golang.org/x/net/http2
14 |
15 | Demo test server at https://http2.golang.org/
16 |
17 | Help & bug reports welcome!
18 |
19 | Contributing: https://golang.org/doc/contribute.html
20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/configure_transport.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.6
6 |
7 | package http2
8 |
9 | import (
10 | "crypto/tls"
11 | "fmt"
12 | "net/http"
13 | )
14 |
15 | func configureTransport(t1 *http.Transport) (*Transport, error) {
16 | connPool := new(clientConnPool)
17 | t2 := &Transport{
18 | ConnPool: noDialClientConnPool{connPool},
19 | t1: t1,
20 | }
21 | connPool.t = t2
22 | if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil {
23 | return nil, err
24 | }
25 | if t1.TLSClientConfig == nil {
26 | t1.TLSClientConfig = new(tls.Config)
27 | }
28 | if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") {
29 | t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...)
30 | }
31 | if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") {
32 | t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1")
33 | }
34 | upgradeFn := func(authority string, c *tls.Conn) http.RoundTripper {
35 | addr := authorityAddr("https", authority)
36 | if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil {
37 | go c.Close()
38 | return erringRoundTripper{err}
39 | } else if !used {
40 | // Turns out we don't need this c.
41 | // For example, two goroutines made requests to the same host
42 | // at the same time, both kicking off TCP dials. (since protocol
43 | // was unknown)
44 | go c.Close()
45 | }
46 | return t2
47 | }
48 | if m := t1.TLSNextProto; len(m) == 0 {
49 | t1.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{
50 | "h2": upgradeFn,
51 | }
52 | } else {
53 | m["h2"] = upgradeFn
54 | }
55 | return t2, nil
56 | }
57 |
58 | // registerHTTPSProtocol calls Transport.RegisterProtocol but
59 | // convering panics into errors.
60 | func registerHTTPSProtocol(t *http.Transport, rt http.RoundTripper) (err error) {
61 | defer func() {
62 | if e := recover(); e != nil {
63 | err = fmt.Errorf("%v", e)
64 | }
65 | }()
66 | t.RegisterProtocol("https", rt)
67 | return nil
68 | }
69 |
70 | // noDialH2RoundTripper is a RoundTripper which only tries to complete the request
71 | // if there's already has a cached connection to the host.
72 | type noDialH2RoundTripper struct{ t *Transport }
73 |
74 | func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
75 | res, err := rt.t.RoundTrip(req)
76 | if err == ErrNoCachedConn {
77 | return nil, http.ErrSkipAltProtocol
78 | }
79 | return res, err
80 | }
81 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/flow.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Flow control
6 |
7 | package http2
8 |
9 | // flow is the flow control window's size.
10 | type flow struct {
11 | // n is the number of DATA bytes we're allowed to send.
12 | // A flow is kept both on a conn and a per-stream.
13 | n int32
14 |
15 | // conn points to the shared connection-level flow that is
16 | // shared by all streams on that conn. It is nil for the flow
17 | // that's on the conn directly.
18 | conn *flow
19 | }
20 |
21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf }
22 |
23 | func (f *flow) available() int32 {
24 | n := f.n
25 | if f.conn != nil && f.conn.n < n {
26 | n = f.conn.n
27 | }
28 | return n
29 | }
30 |
31 | func (f *flow) take(n int32) {
32 | if n > f.available() {
33 | panic("internal error: took too much")
34 | }
35 | f.n -= n
36 | if f.conn != nil {
37 | f.conn.n -= n
38 | }
39 | }
40 |
41 | // add adds n bytes (positive or negative) to the flow control window.
42 | // It returns false if the sum would exceed 2^31-1.
43 | func (f *flow) add(n int32) bool {
44 | remain := (1<<31 - 1) - f.n
45 | if n > remain {
46 | return false
47 | }
48 | f.n += n
49 | return true
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/go16.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.6
6 |
7 | package http2
8 |
9 | import (
10 | "crypto/tls"
11 | "net/http"
12 | "time"
13 | )
14 |
15 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
16 | return t1.ExpectContinueTimeout
17 | }
18 |
19 | // isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.
20 | func isBadCipher(cipher uint16) bool {
21 | switch cipher {
22 | case tls.TLS_RSA_WITH_RC4_128_SHA,
23 | tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
24 | tls.TLS_RSA_WITH_AES_128_CBC_SHA,
25 | tls.TLS_RSA_WITH_AES_256_CBC_SHA,
26 | tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
27 | tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
28 | tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
29 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
30 | tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
31 | tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
32 | tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
33 | tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
34 | tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
35 | // Reject cipher suites from Appendix A.
36 | // "This list includes those cipher suites that do not
37 | // offer an ephemeral key exchange and those that are
38 | // based on the TLS null, stream or block cipher type"
39 | return true
40 | default:
41 | return false
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/go17_not18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.7,!go1.8
6 |
7 | package http2
8 |
9 | import "crypto/tls"
10 |
11 | // temporary copy of Go 1.7's private tls.Config.clone:
12 | func cloneTLSConfig(c *tls.Config) *tls.Config {
13 | return &tls.Config{
14 | Rand: c.Rand,
15 | Time: c.Time,
16 | Certificates: c.Certificates,
17 | NameToCertificate: c.NameToCertificate,
18 | GetCertificate: c.GetCertificate,
19 | RootCAs: c.RootCAs,
20 | NextProtos: c.NextProtos,
21 | ServerName: c.ServerName,
22 | ClientAuth: c.ClientAuth,
23 | ClientCAs: c.ClientCAs,
24 | InsecureSkipVerify: c.InsecureSkipVerify,
25 | CipherSuites: c.CipherSuites,
26 | PreferServerCipherSuites: c.PreferServerCipherSuites,
27 | SessionTicketsDisabled: c.SessionTicketsDisabled,
28 | SessionTicketKey: c.SessionTicketKey,
29 | ClientSessionCache: c.ClientSessionCache,
30 | MinVersion: c.MinVersion,
31 | MaxVersion: c.MaxVersion,
32 | CurvePreferences: c.CurvePreferences,
33 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
34 | Renegotiation: c.Renegotiation,
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/go18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.8
6 |
7 | package http2
8 |
9 | import (
10 | "crypto/tls"
11 | "io"
12 | "net/http"
13 | )
14 |
15 | func cloneTLSConfig(c *tls.Config) *tls.Config {
16 | c2 := c.Clone()
17 | c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264
18 | return c2
19 | }
20 |
21 | var _ http.Pusher = (*responseWriter)(nil)
22 |
23 | // Push implements http.Pusher.
24 | func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
25 | internalOpts := pushOptions{}
26 | if opts != nil {
27 | internalOpts.Method = opts.Method
28 | internalOpts.Header = opts.Header
29 | }
30 | return w.push(target, internalOpts)
31 | }
32 |
33 | func configureServer18(h1 *http.Server, h2 *Server) error {
34 | if h2.IdleTimeout == 0 {
35 | if h1.IdleTimeout != 0 {
36 | h2.IdleTimeout = h1.IdleTimeout
37 | } else {
38 | h2.IdleTimeout = h1.ReadTimeout
39 | }
40 | }
41 | return nil
42 | }
43 |
44 | func shouldLogPanic(panicValue interface{}) bool {
45 | return panicValue != nil && panicValue != http.ErrAbortHandler
46 | }
47 |
48 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
49 | return req.GetBody
50 | }
51 |
52 | func reqBodyIsNoBody(body io.ReadCloser) bool {
53 | return body == http.NoBody
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/headermap.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package http2
6 |
7 | import (
8 | "net/http"
9 | "strings"
10 | )
11 |
12 | var (
13 | commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case
14 | commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case
15 | )
16 |
17 | func init() {
18 | for _, v := range []string{
19 | "accept",
20 | "accept-charset",
21 | "accept-encoding",
22 | "accept-language",
23 | "accept-ranges",
24 | "age",
25 | "access-control-allow-origin",
26 | "allow",
27 | "authorization",
28 | "cache-control",
29 | "content-disposition",
30 | "content-encoding",
31 | "content-language",
32 | "content-length",
33 | "content-location",
34 | "content-range",
35 | "content-type",
36 | "cookie",
37 | "date",
38 | "etag",
39 | "expect",
40 | "expires",
41 | "from",
42 | "host",
43 | "if-match",
44 | "if-modified-since",
45 | "if-none-match",
46 | "if-unmodified-since",
47 | "last-modified",
48 | "link",
49 | "location",
50 | "max-forwards",
51 | "proxy-authenticate",
52 | "proxy-authorization",
53 | "range",
54 | "referer",
55 | "refresh",
56 | "retry-after",
57 | "server",
58 | "set-cookie",
59 | "strict-transport-security",
60 | "trailer",
61 | "transfer-encoding",
62 | "user-agent",
63 | "vary",
64 | "via",
65 | "www-authenticate",
66 | } {
67 | chk := http.CanonicalHeaderKey(v)
68 | commonLowerHeader[chk] = v
69 | commonCanonHeader[v] = chk
70 | }
71 | }
72 |
73 | func lowerHeader(v string) string {
74 | if s, ok := commonLowerHeader[v]; ok {
75 | return s
76 | }
77 | return strings.ToLower(v)
78 | }
79 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/not_go16.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.6
6 |
7 | package http2
8 |
9 | import (
10 | "crypto/tls"
11 | "net/http"
12 | "time"
13 | )
14 |
15 | func configureTransport(t1 *http.Transport) (*Transport, error) {
16 | return nil, errTransportVersion
17 | }
18 |
19 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
20 | return 0
21 |
22 | }
23 |
24 | // isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.
25 | func isBadCipher(cipher uint16) bool {
26 | switch cipher {
27 | case tls.TLS_RSA_WITH_RC4_128_SHA,
28 | tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
29 | tls.TLS_RSA_WITH_AES_128_CBC_SHA,
30 | tls.TLS_RSA_WITH_AES_256_CBC_SHA,
31 | tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
32 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
33 | tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
34 | tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
35 | tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
36 | tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
37 | tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
38 | // Reject cipher suites from Appendix A.
39 | // "This list includes those cipher suites that do not
40 | // offer an ephemeral key exchange and those that are
41 | // based on the TLS null, stream or block cipher type"
42 | return true
43 | default:
44 | return false
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/not_go17.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.7
6 |
7 | package http2
8 |
9 | import (
10 | "crypto/tls"
11 | "net"
12 | "net/http"
13 | "time"
14 | )
15 |
16 | type contextContext interface {
17 | Done() <-chan struct{}
18 | Err() error
19 | }
20 |
21 | type fakeContext struct{}
22 |
23 | func (fakeContext) Done() <-chan struct{} { return nil }
24 | func (fakeContext) Err() error { panic("should not be called") }
25 |
26 | func reqContext(r *http.Request) fakeContext {
27 | return fakeContext{}
28 | }
29 |
30 | func setResponseUncompressed(res *http.Response) {
31 | // Nothing.
32 | }
33 |
34 | type clientTrace struct{}
35 |
36 | func requestTrace(*http.Request) *clientTrace { return nil }
37 | func traceGotConn(*http.Request, *ClientConn) {}
38 | func traceFirstResponseByte(*clientTrace) {}
39 | func traceWroteHeaders(*clientTrace) {}
40 | func traceWroteRequest(*clientTrace, error) {}
41 | func traceGot100Continue(trace *clientTrace) {}
42 | func traceWait100Continue(trace *clientTrace) {}
43 |
44 | func nop() {}
45 |
46 | func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx contextContext, cancel func()) {
47 | return nil, nop
48 | }
49 |
50 | func contextWithCancel(ctx contextContext) (_ contextContext, cancel func()) {
51 | return ctx, nop
52 | }
53 |
54 | func requestWithContext(req *http.Request, ctx contextContext) *http.Request {
55 | return req
56 | }
57 |
58 | // temporary copy of Go 1.6's private tls.Config.clone:
59 | func cloneTLSConfig(c *tls.Config) *tls.Config {
60 | return &tls.Config{
61 | Rand: c.Rand,
62 | Time: c.Time,
63 | Certificates: c.Certificates,
64 | NameToCertificate: c.NameToCertificate,
65 | GetCertificate: c.GetCertificate,
66 | RootCAs: c.RootCAs,
67 | NextProtos: c.NextProtos,
68 | ServerName: c.ServerName,
69 | ClientAuth: c.ClientAuth,
70 | ClientCAs: c.ClientCAs,
71 | InsecureSkipVerify: c.InsecureSkipVerify,
72 | CipherSuites: c.CipherSuites,
73 | PreferServerCipherSuites: c.PreferServerCipherSuites,
74 | SessionTicketsDisabled: c.SessionTicketsDisabled,
75 | SessionTicketKey: c.SessionTicketKey,
76 | ClientSessionCache: c.ClientSessionCache,
77 | MinVersion: c.MinVersion,
78 | MaxVersion: c.MaxVersion,
79 | CurvePreferences: c.CurvePreferences,
80 | }
81 | }
82 |
83 | func (cc *ClientConn) Ping(ctx contextContext) error {
84 | return cc.ping(ctx)
85 | }
86 |
87 | func (t *Transport) idleConnTimeout() time.Duration { return 0 }
88 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/not_go18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.8
6 |
7 | package http2
8 |
9 | import (
10 | "io"
11 | "net/http"
12 | )
13 |
14 | func configureServer18(h1 *http.Server, h2 *Server) error {
15 | // No IdleTimeout to sync prior to Go 1.8.
16 | return nil
17 | }
18 |
19 | func shouldLogPanic(panicValue interface{}) bool {
20 | return panicValue != nil
21 | }
22 |
23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
24 | return nil
25 | }
26 |
27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/http2/writesched_random.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package http2
6 |
7 | import "math"
8 |
9 | // NewRandomWriteScheduler constructs a WriteScheduler that ignores HTTP/2
10 | // priorities. Control frames like SETTINGS and PING are written before DATA
11 | // frames, but if no control frames are queued and multiple streams have queued
12 | // HEADERS or DATA frames, Pop selects a ready stream arbitrarily.
13 | func NewRandomWriteScheduler() WriteScheduler {
14 | return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)}
15 | }
16 |
17 | type randomWriteScheduler struct {
18 | // zero are frames not associated with a specific stream.
19 | zero writeQueue
20 |
21 | // sq contains the stream-specific queues, keyed by stream ID.
22 | // When a stream is idle or closed, it's deleted from the map.
23 | sq map[uint32]*writeQueue
24 |
25 | // pool of empty queues for reuse.
26 | queuePool writeQueuePool
27 | }
28 |
29 | func (ws *randomWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) {
30 | // no-op: idle streams are not tracked
31 | }
32 |
33 | func (ws *randomWriteScheduler) CloseStream(streamID uint32) {
34 | q, ok := ws.sq[streamID]
35 | if !ok {
36 | return
37 | }
38 | delete(ws.sq, streamID)
39 | ws.queuePool.put(q)
40 | }
41 |
42 | func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {
43 | // no-op: priorities are ignored
44 | }
45 |
46 | func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) {
47 | id := wr.StreamID()
48 | if id == 0 {
49 | ws.zero.push(wr)
50 | return
51 | }
52 | q, ok := ws.sq[id]
53 | if !ok {
54 | q = ws.queuePool.get()
55 | ws.sq[id] = q
56 | }
57 | q.push(wr)
58 | }
59 |
60 | func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) {
61 | // Control frames first.
62 | if !ws.zero.empty() {
63 | return ws.zero.shift(), true
64 | }
65 | // Iterate over all non-idle streams until finding one that can be consumed.
66 | for _, q := range ws.sq {
67 | if wr, ok := q.consume(math.MaxInt32); ok {
68 | return wr, true
69 | }
70 | }
71 | return FrameWriteRequest{}, false
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/idna/trie.go:
--------------------------------------------------------------------------------
1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2 |
3 | // Copyright 2016 The Go Authors. All rights reserved.
4 | // Use of this source code is governed by a BSD-style
5 | // license that can be found in the LICENSE file.
6 |
7 | package idna
8 |
9 | // appendMapping appends the mapping for the respective rune. isMapped must be
10 | // true. A mapping is a categorization of a rune as defined in UTS #46.
11 | func (c info) appendMapping(b []byte, s string) []byte {
12 | index := int(c >> indexShift)
13 | if c&xorBit == 0 {
14 | s := mappings[index:]
15 | return append(b, s[1:s[0]+1]...)
16 | }
17 | b = append(b, s...)
18 | if c&inlineXOR == inlineXOR {
19 | // TODO: support and handle two-byte inline masks
20 | b[len(b)-1] ^= byte(index)
21 | } else {
22 | for p := len(b) - int(xorData[index]); p < len(b); p++ {
23 | index++
24 | b[p] ^= xorData[index]
25 | }
26 | }
27 | return b
28 | }
29 |
30 | // Sparse block handling code.
31 |
32 | type valueRange struct {
33 | value uint16 // header: value:stride
34 | lo, hi byte // header: lo:n
35 | }
36 |
37 | type sparseBlocks struct {
38 | values []valueRange
39 | offset []uint16
40 | }
41 |
42 | var idnaSparse = sparseBlocks{
43 | values: idnaSparseValues[:],
44 | offset: idnaSparseOffset[:],
45 | }
46 |
47 | // Don't use newIdnaTrie to avoid unconditional linking in of the table.
48 | var trie = &idnaTrie{}
49 |
50 | // lookup determines the type of block n and looks up the value for b.
51 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block
52 | // is a list of ranges with an accompanying value. Given a matching range r,
53 | // the value for b is by r.value + (b - r.lo) * stride.
54 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 {
55 | offset := t.offset[n]
56 | header := t.values[offset]
57 | lo := offset + 1
58 | hi := lo + uint16(header.lo)
59 | for lo < hi {
60 | m := lo + (hi-lo)/2
61 | r := t.values[m]
62 | if r.lo <= b && b <= r.hi {
63 | return r.value + uint16(b-r.lo)*header.value
64 | }
65 | if b < r.lo {
66 | hi = m
67 | } else {
68 | lo = m + 1
69 | }
70 | }
71 | return 0
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/internal/triegen/compact.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package triegen
6 |
7 | // This file defines Compacter and its implementations.
8 |
9 | import "io"
10 |
11 | // A Compacter generates an alternative, more space-efficient way to store a
12 | // trie value block. A trie value block holds all possible values for the last
13 | // byte of a UTF-8 encoded rune. Excluding ASCII characters, a trie value block
14 | // always has 64 values, as a UTF-8 encoding ends with a byte in [0x80, 0xC0).
15 | type Compacter interface {
16 | // Size returns whether the Compacter could encode the given block as well
17 | // as its size in case it can. len(v) is always 64.
18 | Size(v []uint64) (sz int, ok bool)
19 |
20 | // Store stores the block using the Compacter's compression method.
21 | // It returns a handle with which the block can be retrieved.
22 | // len(v) is always 64.
23 | Store(v []uint64) uint32
24 |
25 | // Print writes the data structures associated to the given store to w.
26 | Print(w io.Writer) error
27 |
28 | // Handler returns the name of a function that gets called during trie
29 | // lookup for blocks generated by the Compacter. The function should be of
30 | // the form func (n uint32, b byte) uint64, where n is the index returned by
31 | // the Compacter's Store method and b is the last byte of the UTF-8
32 | // encoding, where 0x80 <= b < 0xC0, for which to do the lookup in the
33 | // block.
34 | Handler() string
35 | }
36 |
37 | // simpleCompacter is the default Compacter used by builder. It implements a
38 | // normal trie block.
39 | type simpleCompacter builder
40 |
41 | func (b *simpleCompacter) Size([]uint64) (sz int, ok bool) {
42 | return blockSize * b.ValueSize, true
43 | }
44 |
45 | func (b *simpleCompacter) Store(v []uint64) uint32 {
46 | h := uint32(len(b.ValueBlocks) - blockOffset)
47 | b.ValueBlocks = append(b.ValueBlocks, v)
48 | return h
49 | }
50 |
51 | func (b *simpleCompacter) Print(io.Writer) error {
52 | // Structures are printed in print.go.
53 | return nil
54 | }
55 |
56 | func (b *simpleCompacter) Handler() string {
57 | panic("Handler should be special-cased for this Compacter")
58 | }
59 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build ignore
6 |
7 | package main
8 |
9 | import (
10 | "unicode"
11 |
12 | "golang.org/x/text/internal/gen"
13 | "golang.org/x/text/internal/ucd"
14 | "golang.org/x/text/unicode/rangetable"
15 | )
16 |
17 | // These tables are hand-extracted from:
18 | // http://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt
19 | func visitDefaults(fn func(r rune, c Class)) {
20 | // first write default values for ranges listed above.
21 | visitRunes(fn, AL, []rune{
22 | 0x0600, 0x07BF, // Arabic
23 | 0x08A0, 0x08FF, // Arabic Extended-A
24 | 0xFB50, 0xFDCF, // Arabic Presentation Forms
25 | 0xFDF0, 0xFDFF,
26 | 0xFE70, 0xFEFF,
27 | 0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols
28 | })
29 | visitRunes(fn, R, []rune{
30 | 0x0590, 0x05FF, // Hebrew
31 | 0x07C0, 0x089F, // Nko et al.
32 | 0xFB1D, 0xFB4F,
33 | 0x00010800, 0x00010FFF, // Cypriot Syllabary et. al.
34 | 0x0001E800, 0x0001EDFF,
35 | 0x0001EF00, 0x0001EFFF,
36 | })
37 | visitRunes(fn, ET, []rune{ // European Terminator
38 | 0x20A0, 0x20Cf, // Currency symbols
39 | })
40 | rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) {
41 | fn(r, BN) // Boundary Neutral
42 | })
43 | ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) {
44 | if p.String(1) == "Default_Ignorable_Code_Point" {
45 | fn(p.Rune(0), BN) // Boundary Neutral
46 | }
47 | })
48 | }
49 |
50 | func visitRunes(fn func(r rune, c Class), c Class, runes []rune) {
51 | for i := 0; i < len(runes); i += 2 {
52 | lo, hi := runes[i], runes[i+1]
53 | for j := lo; j <= hi; j++ {
54 | fn(j, c)
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build ignore
6 |
7 | package main
8 |
9 | // Class is the Unicode BiDi class. Each rune has a single class.
10 | type Class uint
11 |
12 | const (
13 | L Class = iota // LeftToRight
14 | R // RightToLeft
15 | EN // EuropeanNumber
16 | ES // EuropeanSeparator
17 | ET // EuropeanTerminator
18 | AN // ArabicNumber
19 | CS // CommonSeparator
20 | B // ParagraphSeparator
21 | S // SegmentSeparator
22 | WS // WhiteSpace
23 | ON // OtherNeutral
24 | BN // BoundaryNeutral
25 | NSM // NonspacingMark
26 | AL // ArabicLetter
27 | Control // Control LRO - PDI
28 |
29 | numClass
30 |
31 | LRO // LeftToRightOverride
32 | RLO // RightToLeftOverride
33 | LRE // LeftToRightEmbedding
34 | RLE // RightToLeftEmbedding
35 | PDF // PopDirectionalFormat
36 | LRI // LeftToRightIsolate
37 | RLI // RightToLeftIsolate
38 | FSI // FirstStrongIsolate
39 | PDI // PopDirectionalIsolate
40 |
41 | unknownClass = ^Class(0)
42 | )
43 |
44 | var controlToClass = map[rune]Class{
45 | 0x202D: LRO, // LeftToRightOverride,
46 | 0x202E: RLO, // RightToLeftOverride,
47 | 0x202A: LRE, // LeftToRightEmbedding,
48 | 0x202B: RLE, // RightToLeftEmbedding,
49 | 0x202C: PDF, // PopDirectionalFormat,
50 | 0x2066: LRI, // LeftToRightIsolate,
51 | 0x2067: RLI, // RightToLeftIsolate,
52 | 0x2068: FSI, // FirstStrongIsolate,
53 | 0x2069: PDI, // PopDirectionalIsolate,
54 | }
55 |
56 | // A trie entry has the following bits:
57 | // 7..5 XOR mask for brackets
58 | // 4 1: Bracket open, 0: Bracket close
59 | // 3..0 Class type
60 |
61 | const (
62 | openMask = 0x10
63 | xorMaskShift = 5
64 | )
65 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/bidi/trieval.go:
--------------------------------------------------------------------------------
1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2 |
3 | package bidi
4 |
5 | // Class is the Unicode BiDi class. Each rune has a single class.
6 | type Class uint
7 |
8 | const (
9 | L Class = iota // LeftToRight
10 | R // RightToLeft
11 | EN // EuropeanNumber
12 | ES // EuropeanSeparator
13 | ET // EuropeanTerminator
14 | AN // ArabicNumber
15 | CS // CommonSeparator
16 | B // ParagraphSeparator
17 | S // SegmentSeparator
18 | WS // WhiteSpace
19 | ON // OtherNeutral
20 | BN // BoundaryNeutral
21 | NSM // NonspacingMark
22 | AL // ArabicLetter
23 | Control // Control LRO - PDI
24 |
25 | numClass
26 |
27 | LRO // LeftToRightOverride
28 | RLO // RightToLeftOverride
29 | LRE // LeftToRightEmbedding
30 | RLE // RightToLeftEmbedding
31 | PDF // PopDirectionalFormat
32 | LRI // LeftToRightIsolate
33 | RLI // RightToLeftIsolate
34 | FSI // FirstStrongIsolate
35 | PDI // PopDirectionalIsolate
36 |
37 | unknownClass = ^Class(0)
38 | )
39 |
40 | var controlToClass = map[rune]Class{
41 | 0x202D: LRO, // LeftToRightOverride,
42 | 0x202E: RLO, // RightToLeftOverride,
43 | 0x202A: LRE, // LeftToRightEmbedding,
44 | 0x202B: RLE, // RightToLeftEmbedding,
45 | 0x202C: PDF, // PopDirectionalFormat,
46 | 0x2066: LRI, // LeftToRightIsolate,
47 | 0x2067: RLI, // RightToLeftIsolate,
48 | 0x2068: FSI, // FirstStrongIsolate,
49 | 0x2069: PDI, // PopDirectionalIsolate,
50 | }
51 |
52 | // A trie entry has the following bits:
53 | // 7..5 XOR mask for brackets
54 | // 4 1: Bracket open, 0: Bracket close
55 | // 3..0 Class type
56 |
57 | const (
58 | openMask = 0x10
59 | xorMaskShift = 5
60 | )
61 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/cldr/base.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package cldr
6 |
7 | import (
8 | "encoding/xml"
9 | "regexp"
10 | "strconv"
11 | )
12 |
13 | // Elem is implemented by every XML element.
14 | type Elem interface {
15 | setEnclosing(Elem)
16 | setName(string)
17 | enclosing() Elem
18 |
19 | GetCommon() *Common
20 | }
21 |
22 | type hidden struct {
23 | CharData string `xml:",chardata"`
24 | Alias *struct {
25 | Common
26 | Source string `xml:"source,attr"`
27 | Path string `xml:"path,attr"`
28 | } `xml:"alias"`
29 | Def *struct {
30 | Common
31 | Choice string `xml:"choice,attr,omitempty"`
32 | Type string `xml:"type,attr,omitempty"`
33 | } `xml:"default"`
34 | }
35 |
36 | // Common holds several of the most common attributes and sub elements
37 | // of an XML element.
38 | type Common struct {
39 | XMLName xml.Name
40 | name string
41 | enclElem Elem
42 | Type string `xml:"type,attr,omitempty"`
43 | Reference string `xml:"reference,attr,omitempty"`
44 | Alt string `xml:"alt,attr,omitempty"`
45 | ValidSubLocales string `xml:"validSubLocales,attr,omitempty"`
46 | Draft string `xml:"draft,attr,omitempty"`
47 | hidden
48 | }
49 |
50 | // Default returns the default type to select from the enclosed list
51 | // or "" if no default value is specified.
52 | func (e *Common) Default() string {
53 | if e.Def == nil {
54 | return ""
55 | }
56 | if e.Def.Choice != "" {
57 | return e.Def.Choice
58 | } else if e.Def.Type != "" {
59 | // Type is still used by the default element in collation.
60 | return e.Def.Type
61 | }
62 | return ""
63 | }
64 |
65 | // GetCommon returns e. It is provided such that Common implements Elem.
66 | func (e *Common) GetCommon() *Common {
67 | return e
68 | }
69 |
70 | // Data returns the character data accumulated for this element.
71 | func (e *Common) Data() string {
72 | e.CharData = charRe.ReplaceAllStringFunc(e.CharData, replaceUnicode)
73 | return e.CharData
74 | }
75 |
76 | func (e *Common) setName(s string) {
77 | e.name = s
78 | }
79 |
80 | func (e *Common) enclosing() Elem {
81 | return e.enclElem
82 | }
83 |
84 | func (e *Common) setEnclosing(en Elem) {
85 | e.enclElem = en
86 | }
87 |
88 | // Escape characters that can be escaped without further escaping the string.
89 | var charRe = regexp.MustCompile(`[0-9a-fA-F]*;|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|\\x[0-9a-fA-F]{2}|\\[0-7]{3}|\\[abtnvfr]`)
90 |
91 | // replaceUnicode converts hexadecimal Unicode codepoint notations to a one-rune string.
92 | // It assumes the input string is correctly formatted.
93 | func replaceUnicode(s string) string {
94 | if s[1] == '#' {
95 | r, _ := strconv.ParseInt(s[3:len(s)-1], 16, 32)
96 | return string(r)
97 | }
98 | r, _, _, _ := strconv.UnquoteChar(s, 0)
99 | return string(r)
100 | }
101 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/norm/input.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package norm
6 |
7 | import "unicode/utf8"
8 |
9 | type input struct {
10 | str string
11 | bytes []byte
12 | }
13 |
14 | func inputBytes(str []byte) input {
15 | return input{bytes: str}
16 | }
17 |
18 | func inputString(str string) input {
19 | return input{str: str}
20 | }
21 |
22 | func (in *input) setBytes(str []byte) {
23 | in.str = ""
24 | in.bytes = str
25 | }
26 |
27 | func (in *input) setString(str string) {
28 | in.str = str
29 | in.bytes = nil
30 | }
31 |
32 | func (in *input) _byte(p int) byte {
33 | if in.bytes == nil {
34 | return in.str[p]
35 | }
36 | return in.bytes[p]
37 | }
38 |
39 | func (in *input) skipASCII(p, max int) int {
40 | if in.bytes == nil {
41 | for ; p < max && in.str[p] < utf8.RuneSelf; p++ {
42 | }
43 | } else {
44 | for ; p < max && in.bytes[p] < utf8.RuneSelf; p++ {
45 | }
46 | }
47 | return p
48 | }
49 |
50 | func (in *input) skipContinuationBytes(p int) int {
51 | if in.bytes == nil {
52 | for ; p < len(in.str) && !utf8.RuneStart(in.str[p]); p++ {
53 | }
54 | } else {
55 | for ; p < len(in.bytes) && !utf8.RuneStart(in.bytes[p]); p++ {
56 | }
57 | }
58 | return p
59 | }
60 |
61 | func (in *input) appendSlice(buf []byte, b, e int) []byte {
62 | if in.bytes != nil {
63 | return append(buf, in.bytes[b:e]...)
64 | }
65 | for i := b; i < e; i++ {
66 | buf = append(buf, in.str[i])
67 | }
68 | return buf
69 | }
70 |
71 | func (in *input) copySlice(buf []byte, b, e int) int {
72 | if in.bytes == nil {
73 | return copy(buf, in.str[b:e])
74 | }
75 | return copy(buf, in.bytes[b:e])
76 | }
77 |
78 | func (in *input) charinfoNFC(p int) (uint16, int) {
79 | if in.bytes == nil {
80 | return nfcData.lookupString(in.str[p:])
81 | }
82 | return nfcData.lookup(in.bytes[p:])
83 | }
84 |
85 | func (in *input) charinfoNFKC(p int) (uint16, int) {
86 | if in.bytes == nil {
87 | return nfkcData.lookupString(in.str[p:])
88 | }
89 | return nfkcData.lookup(in.bytes[p:])
90 | }
91 |
92 | func (in *input) hangul(p int) (r rune) {
93 | if in.bytes == nil {
94 | if !isHangulString(in.str[p:]) {
95 | return 0
96 | }
97 | r, _ = utf8.DecodeRuneInString(in.str[p:])
98 | } else {
99 | if !isHangul(in.bytes[p:]) {
100 | return 0
101 | }
102 | r, _ = utf8.DecodeRune(in.bytes[p:])
103 | }
104 | return r
105 | }
106 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/norm/transform.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package norm
6 |
7 | import (
8 | "unicode/utf8"
9 |
10 | "golang.org/x/text/transform"
11 | )
12 |
13 | // Reset implements the Reset method of the transform.Transformer interface.
14 | func (Form) Reset() {}
15 |
16 | // Transform implements the Transform method of the transform.Transformer
17 | // interface. It may need to write segments of up to MaxSegmentSize at once.
18 | // Users should either catch ErrShortDst and allow dst to grow or have dst be at
19 | // least of size MaxTransformChunkSize to be guaranteed of progress.
20 | func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
21 | n := 0
22 | // Cap the maximum number of src bytes to check.
23 | b := src
24 | eof := atEOF
25 | if ns := len(dst); ns < len(b) {
26 | err = transform.ErrShortDst
27 | eof = false
28 | b = b[:ns]
29 | }
30 | i, ok := formTable[f].quickSpan(inputBytes(b), n, len(b), eof)
31 | n += copy(dst[n:], b[n:i])
32 | if !ok {
33 | nDst, nSrc, err = f.transform(dst[n:], src[n:], atEOF)
34 | return nDst + n, nSrc + n, err
35 | }
36 | if n < len(src) && !atEOF {
37 | err = transform.ErrShortSrc
38 | }
39 | return n, n, err
40 | }
41 |
42 | func flushTransform(rb *reorderBuffer) bool {
43 | // Write out (must fully fit in dst, or else it is a ErrShortDst).
44 | if len(rb.out) < rb.nrune*utf8.UTFMax {
45 | return false
46 | }
47 | rb.out = rb.out[rb.flushCopy(rb.out):]
48 | return true
49 | }
50 |
51 | var errs = []error{nil, transform.ErrShortDst, transform.ErrShortSrc}
52 |
53 | // transform implements the transform.Transformer interface. It is only called
54 | // when quickSpan does not pass for a given string.
55 | func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
56 | // TODO: get rid of reorderBuffer. See CL 23460044.
57 | rb := reorderBuffer{}
58 | rb.init(f, src)
59 | for {
60 | // Load segment into reorder buffer.
61 | rb.setFlusher(dst[nDst:], flushTransform)
62 | end := decomposeSegment(&rb, nSrc, atEOF)
63 | if end < 0 {
64 | return nDst, nSrc, errs[-end]
65 | }
66 | nDst = len(dst) - len(rb.out)
67 | nSrc = end
68 |
69 | // Next quickSpan.
70 | end = rb.nsrc
71 | eof := atEOF
72 | if n := nSrc + len(dst) - nDst; n < end {
73 | err = transform.ErrShortDst
74 | end = n
75 | eof = false
76 | }
77 | end, ok := rb.f.quickSpan(rb.src, nSrc, end, eof)
78 | n := copy(dst[nDst:], rb.src.bytes[nSrc:end])
79 | nSrc += n
80 | nDst += n
81 | if ok {
82 | if n < rb.nsrc && !atEOF {
83 | err = transform.ErrShortSrc
84 | }
85 | return nDst, nSrc, err
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/norm/trie.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package norm
6 |
7 | type valueRange struct {
8 | value uint16 // header: value:stride
9 | lo, hi byte // header: lo:n
10 | }
11 |
12 | type sparseBlocks struct {
13 | values []valueRange
14 | offset []uint16
15 | }
16 |
17 | var nfcSparse = sparseBlocks{
18 | values: nfcSparseValues[:],
19 | offset: nfcSparseOffset[:],
20 | }
21 |
22 | var nfkcSparse = sparseBlocks{
23 | values: nfkcSparseValues[:],
24 | offset: nfkcSparseOffset[:],
25 | }
26 |
27 | var (
28 | nfcData = newNfcTrie(0)
29 | nfkcData = newNfkcTrie(0)
30 | )
31 |
32 | // lookupValue determines the type of block n and looks up the value for b.
33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block
34 | // is a list of ranges with an accompanying value. Given a matching range r,
35 | // the value for b is by r.value + (b - r.lo) * stride.
36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 {
37 | offset := t.offset[n]
38 | header := t.values[offset]
39 | lo := offset + 1
40 | hi := lo + uint16(header.lo)
41 | for lo < hi {
42 | m := lo + (hi-lo)/2
43 | r := t.values[m]
44 | if r.lo <= b && b <= r.hi {
45 | return r.value + uint16(b-r.lo)*header.value
46 | }
47 | if b < r.lo {
48 | hi = m
49 | } else {
50 | lo = m + 1
51 | }
52 | }
53 | return 0
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/text/unicode/rangetable/rangetable.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package rangetable provides utilities for creating and inspecting
6 | // unicode.RangeTables.
7 | package rangetable
8 |
9 | import (
10 | "sort"
11 | "unicode"
12 | )
13 |
14 | // New creates a RangeTable from the given runes, which may contain duplicates.
15 | func New(r ...rune) *unicode.RangeTable {
16 | if len(r) == 0 {
17 | return &unicode.RangeTable{}
18 | }
19 |
20 | sort.Sort(byRune(r))
21 |
22 | // Remove duplicates.
23 | k := 1
24 | for i := 1; i < len(r); i++ {
25 | if r[k-1] != r[i] {
26 | r[k] = r[i]
27 | k++
28 | }
29 | }
30 |
31 | var rt unicode.RangeTable
32 | for _, r := range r[:k] {
33 | if r <= 0xFFFF {
34 | rt.R16 = append(rt.R16, unicode.Range16{Lo: uint16(r), Hi: uint16(r), Stride: 1})
35 | } else {
36 | rt.R32 = append(rt.R32, unicode.Range32{Lo: uint32(r), Hi: uint32(r), Stride: 1})
37 | }
38 | }
39 |
40 | // Optimize RangeTable.
41 | return Merge(&rt)
42 | }
43 |
44 | type byRune []rune
45 |
46 | func (r byRune) Len() int { return len(r) }
47 | func (r byRune) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
48 | func (r byRune) Less(i, j int) bool { return r[i] < r[j] }
49 |
50 | // Visit visits all runes in the given RangeTable in order, calling fn for each.
51 | func Visit(rt *unicode.RangeTable, fn func(rune)) {
52 | for _, r16 := range rt.R16 {
53 | for r := rune(r16.Lo); r <= rune(r16.Hi); r += rune(r16.Stride) {
54 | fn(r)
55 | }
56 | }
57 | for _, r32 := range rt.R32 {
58 | for r := rune(r32.Lo); r <= rune(r32.Hi); r += rune(r32.Stride) {
59 | fn(r)
60 | }
61 | }
62 | }
63 |
64 | // Assigned returns a RangeTable with all assigned code points for a given
65 | // Unicode version. This includes graphic, format, control, and private-use
66 | // characters. It returns nil if the data for the given version is not
67 | // available.
68 | func Assigned(version string) *unicode.RangeTable {
69 | return assigned[version]
70 | }
71 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go.
2 | // source: google/api/annotations.proto
3 | // DO NOT EDIT!
4 |
5 | /*
6 | Package annotations is a generated protocol buffer package.
7 |
8 | It is generated from these files:
9 | google/api/annotations.proto
10 | google/api/http.proto
11 |
12 | It has these top-level messages:
13 | Http
14 | HttpRule
15 | CustomHttpPattern
16 | */
17 | package annotations
18 |
19 | import proto "github.com/golang/protobuf/proto"
20 | import fmt "fmt"
21 | import math "math"
22 | import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
23 |
24 | // Reference imports to suppress errors if they are not otherwise used.
25 | var _ = proto.Marshal
26 | var _ = fmt.Errorf
27 | var _ = math.Inf
28 |
29 | // This is a compile-time assertion to ensure that this generated file
30 | // is compatible with the proto package it is being compiled against.
31 | // A compilation error at this line likely means your copy of the
32 | // proto package needs to be updated.
33 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
34 |
35 | var E_Http = &proto.ExtensionDesc{
36 | ExtendedType: (*google_protobuf.MethodOptions)(nil),
37 | ExtensionType: (*HttpRule)(nil),
38 | Field: 72295728,
39 | Name: "google.api.http",
40 | Tag: "bytes,72295728,opt,name=http",
41 | Filename: "google/api/annotations.proto",
42 | }
43 |
44 | func init() {
45 | proto.RegisterExtension(E_Http)
46 | }
47 |
48 | func init() { proto.RegisterFile("google/api/annotations.proto", fileDescriptor0) }
49 |
50 | var fileDescriptor0 = []byte{
51 | // 208 bytes of a gzipped FileDescriptorProto
52 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f,
53 | 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc,
54 | 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xea, 0x25, 0x16, 0x64,
55 | 0x4a, 0x89, 0x22, 0xa9, 0xcc, 0x28, 0x29, 0x29, 0x80, 0x28, 0x91, 0x52, 0x80, 0x0a, 0x83, 0x79,
56 | 0x49, 0xa5, 0x69, 0xfa, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0xf9, 0x45, 0x10, 0x15,
57 | 0x56, 0xde, 0x5c, 0x2c, 0x20, 0xf5, 0x42, 0x72, 0x7a, 0x50, 0xd3, 0x60, 0x4a, 0xf5, 0x7c, 0x53,
58 | 0x4b, 0x32, 0xf2, 0x53, 0xfc, 0x0b, 0xc0, 0x56, 0x4a, 0x6c, 0x38, 0xb5, 0x47, 0x49, 0x81, 0x51,
59 | 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x61, 0xad, 0x9e, 0x47, 0x49, 0x49, 0x41, 0x50, 0x69, 0x4e, 0x6a,
60 | 0x10, 0xd8, 0x10, 0xa7, 0x3c, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x24, 0x05, 0x4e, 0x02, 0x8e, 0x08,
61 | 0x67, 0x07, 0x80, 0x4c, 0x0e, 0x60, 0x8c, 0x72, 0x84, 0xca, 0xa7, 0xe7, 0xe7, 0x24, 0xe6, 0xa5,
62 | 0xeb, 0xe5, 0x17, 0xa5, 0xeb, 0xa7, 0xa7, 0xe6, 0x81, 0xed, 0xd5, 0x87, 0x48, 0x25, 0x16, 0x64,
63 | 0x16, 0xa3, 0x7b, 0xda, 0x1a, 0x89, 0xbd, 0x88, 0x89, 0xc5, 0xdd, 0x31, 0xc0, 0x33, 0x89, 0x0d,
64 | 0xac, 0xc9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x29, 0x19, 0x62, 0x28, 0x01, 0x00, 0x00,
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to contribute
2 |
3 | We definitely welcome patches and contribution to grpc! Here are some guidelines
4 | and information about how to do so.
5 |
6 | ## Sending patches
7 |
8 | ### Getting started
9 |
10 | 1. Check out the code:
11 |
12 | $ go get google.golang.org/grpc
13 | $ cd $GOPATH/src/google.golang.org/grpc
14 |
15 | 1. Create a fork of the grpc-go repository.
16 | 1. Add your fork as a remote:
17 |
18 | $ git remote add fork git@github.com:$YOURGITHUBUSERNAME/grpc-go.git
19 |
20 | 1. Make changes, commit them.
21 | 1. Run the test suite:
22 |
23 | $ make test
24 |
25 | 1. Push your changes to your fork:
26 |
27 | $ git push fork ...
28 |
29 | 1. Open a pull request.
30 |
31 | ## Legal requirements
32 |
33 | In order to protect both you and ourselves, you will need to sign the
34 | [Contributor License Agreement](https://cla.developers.google.com/clas).
35 |
36 | ## Filing Issues
37 | When filing an issue, make sure to answer these five questions:
38 |
39 | 1. What version of Go are you using (`go version`)?
40 | 2. What operating system and processor architecture are you using?
41 | 3. What did you do?
42 | 4. What did you expect to see?
43 | 5. What did you see instead?
44 |
45 | ### Contributing code
46 | Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
47 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2014, Google Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above
11 | copyright notice, this list of conditions and the following disclaimer
12 | in the documentation and/or other materials provided with the
13 | distribution.
14 | * Neither the name of Google Inc. nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/Makefile:
--------------------------------------------------------------------------------
1 | all: test testrace
2 |
3 | deps:
4 | go get -d -v google.golang.org/grpc/...
5 |
6 | updatedeps:
7 | go get -d -v -u -f google.golang.org/grpc/...
8 |
9 | testdeps:
10 | go get -d -v -t google.golang.org/grpc/...
11 |
12 | updatetestdeps:
13 | go get -d -v -t -u -f google.golang.org/grpc/...
14 |
15 | build: deps
16 | go build google.golang.org/grpc/...
17 |
18 | proto:
19 | @ if ! which protoc > /dev/null; then \
20 | echo "error: protoc not installed" >&2; \
21 | exit 1; \
22 | fi
23 | go get -u -v github.com/golang/protobuf/protoc-gen-go
24 | # use $$dir as the root for all proto files in the same directory
25 | for dir in $$(git ls-files '*.proto' | xargs -n1 dirname | uniq); do \
26 | protoc -I $$dir --go_out=plugins=grpc:$$dir $$dir/*.proto; \
27 | done
28 |
29 | test: testdeps
30 | go test -v -cpu 1,4 google.golang.org/grpc/...
31 |
32 | testrace: testdeps
33 | go test -v -race -cpu 1,4 google.golang.org/grpc/...
34 |
35 | clean:
36 | go clean -i google.golang.org/grpc/...
37 |
38 | coverage: testdeps
39 | ./coverage.sh --coveralls
40 |
41 | .PHONY: \
42 | all \
43 | deps \
44 | updatedeps \
45 | testdeps \
46 | updatetestdeps \
47 | build \
48 | proto \
49 | test \
50 | testrace \
51 | clean \
52 | coverage
53 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the gRPC project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of gRPC, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of gRPC. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of gRPC or any code incorporated within this
19 | implementation of gRPC constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of gRPC
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/README.md:
--------------------------------------------------------------------------------
1 | # gRPC-Go
2 |
3 | [](https://travis-ci.org/grpc/grpc-go) [](https://godoc.org/google.golang.org/grpc)
4 |
5 | The Go implementation of [gRPC](http://www.grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [gRPC Quick Start](http://www.grpc.io/docs/) guide.
6 |
7 | Installation
8 | ------------
9 |
10 | To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run:
11 |
12 | ```
13 | $ go get google.golang.org/grpc
14 | ```
15 |
16 | Prerequisites
17 | -------------
18 |
19 | This requires Go 1.6 or later.
20 |
21 | Constraints
22 | -----------
23 | The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](http://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants.
24 |
25 | Documentation
26 | -------------
27 | See [API documentation](https://godoc.org/google.golang.org/grpc) for package and API descriptions and find examples in the [examples directory](examples/).
28 |
29 | Status
30 | ------
31 | GA
32 |
33 | FAQ
34 | ---
35 |
36 | #### Compiling error, undefined: grpc.SupportPackageIsVersion
37 |
38 | Please update proto package, gRPC package and rebuild the proto files:
39 | - `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}`
40 | - `go get -u google.golang.org/grpc`
41 | - `protoc --go_out=plugins=grpc:. *.proto`
42 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/backoff.go:
--------------------------------------------------------------------------------
1 | package grpc
2 |
3 | import (
4 | "math/rand"
5 | "time"
6 | )
7 |
8 | // DefaultBackoffConfig uses values specified for backoff in
9 | // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
10 | var (
11 | DefaultBackoffConfig = BackoffConfig{
12 | MaxDelay: 120 * time.Second,
13 | baseDelay: 1.0 * time.Second,
14 | factor: 1.6,
15 | jitter: 0.2,
16 | }
17 | )
18 |
19 | // backoffStrategy defines the methodology for backing off after a grpc
20 | // connection failure.
21 | //
22 | // This is unexported until the gRPC project decides whether or not to allow
23 | // alternative backoff strategies. Once a decision is made, this type and its
24 | // method may be exported.
25 | type backoffStrategy interface {
26 | // backoff returns the amount of time to wait before the next retry given
27 | // the number of consecutive failures.
28 | backoff(retries int) time.Duration
29 | }
30 |
31 | // BackoffConfig defines the parameters for the default gRPC backoff strategy.
32 | type BackoffConfig struct {
33 | // MaxDelay is the upper bound of backoff delay.
34 | MaxDelay time.Duration
35 |
36 | // TODO(stevvooe): The following fields are not exported, as allowing
37 | // changes would violate the current gRPC specification for backoff. If
38 | // gRPC decides to allow more interesting backoff strategies, these fields
39 | // may be opened up in the future.
40 |
41 | // baseDelay is the amount of time to wait before retrying after the first
42 | // failure.
43 | baseDelay time.Duration
44 |
45 | // factor is applied to the backoff after each retry.
46 | factor float64
47 |
48 | // jitter provides a range to randomize backoff delays.
49 | jitter float64
50 | }
51 |
52 | func setDefaults(bc *BackoffConfig) {
53 | md := bc.MaxDelay
54 | *bc = DefaultBackoffConfig
55 |
56 | if md > 0 {
57 | bc.MaxDelay = md
58 | }
59 | }
60 |
61 | func (bc BackoffConfig) backoff(retries int) time.Duration {
62 | if retries == 0 {
63 | return bc.baseDelay
64 | }
65 | backoff, max := float64(bc.baseDelay), float64(bc.MaxDelay)
66 | for backoff < max && retries > 0 {
67 | backoff *= bc.factor
68 | retries--
69 | }
70 | if backoff > max {
71 | backoff = max
72 | }
73 | // Randomize backoff delays so that if a cluster of requests start at
74 | // the same time, they won't operate in lockstep.
75 | backoff *= 1 + bc.jitter*(rand.Float64()*2-1)
76 | if backoff < 0 {
77 | return 0
78 | }
79 | return time.Duration(backoff)
80 | }
81 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/codegen.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # This script serves as an example to demonstrate how to generate the gRPC-Go
4 | # interface and the related messages from .proto file.
5 | #
6 | # It assumes the installation of i) Google proto buffer compiler at
7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen
8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have
9 | # not, please install them first.
10 | #
11 | # We recommend running this script at $GOPATH/src.
12 | #
13 | # If this is not what you need, feel free to make your own scripts. Again, this
14 | # script is for demonstration purpose.
15 | #
16 | proto=$1
17 | protoc --go_out=plugins=grpc:. $proto
18 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/codes/code_string.go:
--------------------------------------------------------------------------------
1 | // generated by stringer -type=Code; DO NOT EDIT
2 |
3 | package codes
4 |
5 | import "fmt"
6 |
7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated"
8 |
9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192}
10 |
11 | func (i Code) String() string {
12 | if i+1 >= Code(len(_Code_index)) {
13 | return fmt.Sprintf("Code(%d)", i)
14 | }
15 | return _Code_name[_Code_index[i]:_Code_index[i+1]]
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/coverage.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | set -e
5 |
6 | workdir=.cover
7 | profile="$workdir/cover.out"
8 | mode=set
9 | end2endtest="google.golang.org/grpc/test"
10 |
11 | generate_cover_data() {
12 | rm -rf "$workdir"
13 | mkdir "$workdir"
14 |
15 | for pkg in "$@"; do
16 | if [ $pkg == "google.golang.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ]
17 | then
18 | f="$workdir/$(echo $pkg | tr / -)"
19 | go test -covermode="$mode" -coverprofile="$f.cover" "$pkg"
20 | go test -covermode="$mode" -coverpkg "$pkg" -coverprofile="$f.e2e.cover" "$end2endtest"
21 | fi
22 | done
23 |
24 | echo "mode: $mode" >"$profile"
25 | grep -h -v "^mode:" "$workdir"/*.cover >>"$profile"
26 | }
27 |
28 | show_cover_report() {
29 | go tool cover -${1}="$profile"
30 | }
31 |
32 | push_to_coveralls() {
33 | goveralls -coverprofile="$profile"
34 | }
35 |
36 | generate_cover_data $(go list ./...)
37 | show_cover_report func
38 | case "$1" in
39 | "")
40 | ;;
41 | --html)
42 | show_cover_report html ;;
43 | --coveralls)
44 | push_to_coveralls ;;
45 | *)
46 | echo >&2 "error: invalid option: $1" ;;
47 | esac
48 | rm -rf "$workdir"
49 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/credentials/credentials_util_go18.go:
--------------------------------------------------------------------------------
1 | // +build go1.8
2 |
3 | /*
4 | *
5 | * Copyright 2017, Google Inc.
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions are
10 | * met:
11 | *
12 | * * Redistributions of source code must retain the above copyright
13 | * notice, this list of conditions and the following disclaimer.
14 | * * Redistributions in binary form must reproduce the above
15 | * copyright notice, this list of conditions and the following disclaimer
16 | * in the documentation and/or other materials provided with the
17 | * distribution.
18 | * * Neither the name of Google Inc. nor the names of its
19 | * contributors may be used to endorse or promote products derived from
20 | * this software without specific prior written permission.
21 | *
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | *
34 | */
35 |
36 | package credentials
37 |
38 | import (
39 | "crypto/tls"
40 | )
41 |
42 | // cloneTLSConfig returns a shallow clone of the exported
43 | // fields of cfg, ignoring the unexported sync.Once, which
44 | // contains a mutex and must not be copied.
45 | //
46 | // If cfg is nil, a new zero tls.Config is returned.
47 | func cloneTLSConfig(cfg *tls.Config) *tls.Config {
48 | if cfg == nil {
49 | return &tls.Config{}
50 | }
51 |
52 | return cfg.Clone()
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package grpc implements an RPC system called gRPC.
3 |
4 | See www.grpc.io for more information about gRPC.
5 | */
6 | package grpc // import "google.golang.org/grpc"
7 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/internal/internal.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016, Google Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are
7 | * met:
8 | *
9 | * * Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * * Redistributions in binary form must reproduce the above
12 | * copyright notice, this list of conditions and the following disclaimer
13 | * in the documentation and/or other materials provided with the
14 | * distribution.
15 | * * Neither the name of Google Inc. nor the names of its
16 | * contributors may be used to endorse or promote products derived from
17 | * this software without specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | *
31 | */
32 |
33 | // Package internal contains gRPC-internal code for testing, to avoid polluting
34 | // the godoc of the top-level grpc package.
35 | package internal
36 |
37 | // TestingCloseConns closes all existing transports but keeps
38 | // grpcServer.lis accepting new connections.
39 | //
40 | // The provided grpcServer must be of type *grpc.Server. It is untyped
41 | // for circular dependency reasons.
42 | var TestingCloseConns func(grpcServer interface{})
43 |
44 | // TestingUseHandlerImpl enables the http.Handler-based server implementation.
45 | // It must be called before Serve and requires TLS credentials.
46 | //
47 | // The provided grpcServer must be of type *grpc.Server. It is untyped
48 | // for circular dependency reasons.
49 | var TestingUseHandlerImpl func(grpcServer interface{})
50 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/peer/peer.go:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2014, Google Inc.
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are
8 | * met:
9 | *
10 | * * Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above
13 | * copyright notice, this list of conditions and the following disclaimer
14 | * in the documentation and/or other materials provided with the
15 | * distribution.
16 | * * Neither the name of Google Inc. nor the names of its
17 | * contributors may be used to endorse or promote products derived from
18 | * this software without specific prior written permission.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | *
32 | */
33 |
34 | // Package peer defines various peer information associated with RPCs and
35 | // corresponding utils.
36 | package peer
37 |
38 | import (
39 | "net"
40 |
41 | "golang.org/x/net/context"
42 | "google.golang.org/grpc/credentials"
43 | )
44 |
45 | // Peer contains the information of the peer for an RPC.
46 | type Peer struct {
47 | // Addr is the peer address.
48 | Addr net.Addr
49 | // AuthInfo is the authentication information of the transport.
50 | // It is nil if there is no transport security being used.
51 | AuthInfo credentials.AuthInfo
52 | }
53 |
54 | type peerKey struct{}
55 |
56 | // NewContext creates a new context with peer information attached.
57 | func NewContext(ctx context.Context, p *Peer) context.Context {
58 | return context.WithValue(ctx, peerKey{}, p)
59 | }
60 |
61 | // FromContext returns the peer information in ctx if it exists.
62 | func FromContext(ctx context.Context) (p *Peer, ok bool) {
63 | p, ok = ctx.Value(peerKey{}).(*Peer)
64 | return
65 | }
66 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/tap/tap.go:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2016, Google Inc.
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are
8 | * met:
9 | *
10 | * * Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above
13 | * copyright notice, this list of conditions and the following disclaimer
14 | * in the documentation and/or other materials provided with the
15 | * distribution.
16 | * * Neither the name of Google Inc. nor the names of its
17 | * contributors may be used to endorse or promote products derived from
18 | * this software without specific prior written permission.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | *
32 | */
33 |
34 | // Package tap defines the function handles which are executed on the transport
35 | // layer of gRPC-Go and related information. Everything here is EXPERIMENTAL.
36 | package tap
37 |
38 | import (
39 | "golang.org/x/net/context"
40 | )
41 |
42 | // Info defines the relevant information needed by the handles.
43 | type Info struct {
44 | // FullMethodName is the string of grpc method (in the format of
45 | // /package.service/method).
46 | FullMethodName string
47 | // TODO: More to be added.
48 | }
49 |
50 | // ServerInHandle defines the function which runs when a new stream is created
51 | // on the server side. Note that it is executed in the per-connection I/O goroutine(s) instead
52 | // of per-RPC goroutine. Therefore, users should NOT have any blocking/time-consuming
53 | // work in this handle. Otherwise all the RPCs would slow down.
54 | type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error)
55 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/transport/go16.go:
--------------------------------------------------------------------------------
1 | // +build go1.6,!go1.7
2 |
3 | /*
4 | * Copyright 2016, Google Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are
9 | * met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following disclaimer
15 | * in the documentation and/or other materials provided with the
16 | * distribution.
17 | * * Neither the name of Google Inc. nor the names of its
18 | * contributors may be used to endorse or promote products derived from
19 | * this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | *
33 | */
34 |
35 | package transport
36 |
37 | import (
38 | "net"
39 |
40 | "golang.org/x/net/context"
41 | )
42 |
43 | // dialContext connects to the address on the named network.
44 | func dialContext(ctx context.Context, network, address string) (net.Conn, error) {
45 | return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address)
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/google.golang.org/grpc/transport/go17.go:
--------------------------------------------------------------------------------
1 | // +build go1.7
2 |
3 | /*
4 | * Copyright 2016, Google Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions are
9 | * met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following disclaimer
15 | * in the documentation and/or other materials provided with the
16 | * distribution.
17 | * * Neither the name of Google Inc. nor the names of its
18 | * contributors may be used to endorse or promote products derived from
19 | * this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | *
33 | */
34 |
35 | package transport
36 |
37 | import (
38 | "net"
39 |
40 | "golang.org/x/net/context"
41 | )
42 |
43 | // dialContext connects to the address on the named network.
44 | func dialContext(ctx context.Context, network, address string) (net.Conn, error) {
45 | return (&net.Dialer{}).DialContext(ctx, network, address)
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/honnef.co/go/js/util/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Dominik Honnef
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/vendor/honnef.co/go/js/util/README.md:
--------------------------------------------------------------------------------
1 | # js/util
2 |
3 | Package util provides some helpers for working with GopherJS.
4 |
5 | ## Install
6 |
7 | go get honnef.co/go/js/util
8 |
--------------------------------------------------------------------------------
/vendor/honnef.co/go/js/util/util.go:
--------------------------------------------------------------------------------
1 | // Package util provides some helpers for working with GopherJS.
2 | package util // import "honnef.co/go/js/util"
3 |
4 | import "github.com/gopherjs/gopherjs/js"
5 |
6 | func Float64Slice(o *js.Object) []float64 {
7 | if o == nil {
8 | return nil
9 | }
10 | d := o.Interface().([]interface{})
11 | ret := make([]float64, len(d))
12 | for i, e := range d {
13 | ret[i] = e.(float64)
14 | }
15 | return ret
16 | }
17 |
18 | func IntSlice(o *js.Object) []int {
19 | if o == nil {
20 | return nil
21 | }
22 | d := o.Interface().([]interface{})
23 | ret := make([]int, len(d))
24 | for i, e := range d {
25 | ret[i] = int(e.(float64))
26 | }
27 | return ret
28 | }
29 |
30 | func StringSlice(o *js.Object) []string {
31 | if o == nil {
32 | return nil
33 | }
34 | d := o.Interface().([]interface{})
35 | ret := make([]string, len(d))
36 | for i, e := range d {
37 | ret[i] = e.(string)
38 | }
39 | return ret
40 | }
41 |
42 | type Err struct {
43 | *js.Object
44 | Message string `js:"message"`
45 | Name string `js:"name"`
46 | File string `js:"fileName"` // Mozilla extension
47 | Line int `js:"lineNumber"` // Mozilla extension
48 | Stack string `js:"stack"` // Chrome/Microsoft extension
49 | }
50 |
51 | func (err Err) Error() string {
52 | return err.Message
53 | }
54 |
55 | func Error(o *js.Object) error {
56 | if o == nil {
57 | return nil
58 | }
59 | return Err{Object: o}
60 | }
61 |
62 | type EventTarget struct {
63 | *js.Object
64 | }
65 |
66 | func (t EventTarget) AddEventListener(typ string, useCapture bool, listener func(*js.Object)) {
67 | t.Call("addEventListener", typ, listener, useCapture)
68 | }
69 |
70 | func (t EventTarget) RemoveEventListener(typ string, useCapture bool, listener func(*js.Object)) {
71 | t.Call("removeEventListener", typ, listener, useCapture)
72 | }
73 |
--------------------------------------------------------------------------------
/vendor/honnef.co/go/js/xhr/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Dominik Honnef
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/vendor/honnef.co/go/js/xhr/README.md:
--------------------------------------------------------------------------------
1 | # js/xhr
2 |
3 | Package xhr provides GopherJS bindings for the XMLHttpRequest API.
4 |
5 | ## Install
6 |
7 | go get honnef.co/go/js/xhr
8 |
9 | ## Documentation
10 |
11 | For documentation, see http://godoc.org/honnef.co/go/js/xhr
12 |
--------------------------------------------------------------------------------