planetscale 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +9 -1
- data/.github/workflows/gem-push.yml +9 -2
- data/.licenses/go/github.com/matoous/go-nanoid/v2.dep.yml +34 -0
- data/.licenses/go/github.com/planetscale/planetscale-go/planetscale.dep.yml +1 -1
- data/.licenses/go/github.com/planetscale/sql-proxy/proxy.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap/buffer.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap/internal/bufferpool.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap/internal/color.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap/internal/exit.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap/zapcore.dep.yml +1 -1
- data/.licenses/go/go.uber.org/zap.dep.yml +1 -1
- data/README.md +2 -0
- data/controller.go +21 -36
- data/go.mod +4 -3
- data/go.sum +32 -18
- data/lib/planetscale/version.rb +1 -1
- data/lib/planetscale.rb +2 -3
- data/planetscale.gemspec +1 -1
- data/proxy/planetscale-darwin.h +1 -1
- data/proxy/planetscale-darwin.so +0 -0
- data/proxy/planetscale-linux.h +1 -1
- data/proxy/planetscale-linux.so +0 -0
- data/proxy.go +1 -5
- metadata +3 -345
- data/vendor/github.com/armon/circbuf/.gitignore +0 -22
- data/vendor/github.com/armon/circbuf/LICENSE +0 -20
- data/vendor/github.com/armon/circbuf/README.md +0 -28
- data/vendor/github.com/armon/circbuf/circbuf.go +0 -92
- data/vendor/github.com/armon/circbuf/go.mod +0 -1
- data/vendor/github.com/golang/protobuf/AUTHORS +0 -3
- data/vendor/github.com/golang/protobuf/CONTRIBUTORS +0 -3
- data/vendor/github.com/golang/protobuf/LICENSE +0 -28
- data/vendor/github.com/golang/protobuf/proto/buffer.go +0 -324
- data/vendor/github.com/golang/protobuf/proto/defaults.go +0 -63
- data/vendor/github.com/golang/protobuf/proto/deprecated.go +0 -113
- data/vendor/github.com/golang/protobuf/proto/discard.go +0 -58
- data/vendor/github.com/golang/protobuf/proto/extensions.go +0 -356
- data/vendor/github.com/golang/protobuf/proto/properties.go +0 -306
- data/vendor/github.com/golang/protobuf/proto/proto.go +0 -167
- data/vendor/github.com/golang/protobuf/proto/registry.go +0 -317
- data/vendor/github.com/golang/protobuf/proto/text_decode.go +0 -801
- data/vendor/github.com/golang/protobuf/proto/text_encode.go +0 -560
- data/vendor/github.com/golang/protobuf/proto/wire.go +0 -78
- data/vendor/github.com/golang/protobuf/proto/wrappers.go +0 -34
- data/vendor/github.com/gorilla/mux/AUTHORS +0 -8
- data/vendor/github.com/gorilla/mux/LICENSE +0 -27
- data/vendor/github.com/gorilla/mux/README.md +0 -805
- data/vendor/github.com/gorilla/mux/doc.go +0 -306
- data/vendor/github.com/gorilla/mux/go.mod +0 -3
- data/vendor/github.com/gorilla/mux/middleware.go +0 -74
- data/vendor/github.com/gorilla/mux/mux.go +0 -606
- data/vendor/github.com/gorilla/mux/regexp.go +0 -388
- data/vendor/github.com/gorilla/mux/route.go +0 -736
- data/vendor/github.com/gorilla/mux/test_helpers.go +0 -19
- data/vendor/github.com/hashicorp/go-cleanhttp/LICENSE +0 -363
- data/vendor/github.com/hashicorp/go-cleanhttp/README.md +0 -30
- data/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go +0 -58
- data/vendor/github.com/hashicorp/go-cleanhttp/doc.go +0 -20
- data/vendor/github.com/hashicorp/go-cleanhttp/go.mod +0 -3
- data/vendor/github.com/hashicorp/go-cleanhttp/handlers.go +0 -48
- data/vendor/github.com/mitchellh/go-homedir/LICENSE +0 -21
- data/vendor/github.com/mitchellh/go-homedir/README.md +0 -14
- data/vendor/github.com/mitchellh/go-homedir/go.mod +0 -1
- data/vendor/github.com/mitchellh/go-homedir/homedir.go +0 -167
- data/vendor/github.com/pkg/errors/.gitignore +0 -24
- data/vendor/github.com/pkg/errors/.travis.yml +0 -10
- data/vendor/github.com/pkg/errors/LICENSE +0 -23
- data/vendor/github.com/pkg/errors/Makefile +0 -44
- data/vendor/github.com/pkg/errors/README.md +0 -59
- data/vendor/github.com/pkg/errors/appveyor.yml +0 -32
- data/vendor/github.com/pkg/errors/errors.go +0 -288
- data/vendor/github.com/pkg/errors/go113.go +0 -38
- data/vendor/github.com/pkg/errors/stack.go +0 -177
- data/vendor/github.com/planetscale/planetscale-go/LICENSE +0 -202
- data/vendor/github.com/planetscale/planetscale-go/planetscale/audit_logs.go +0 -136
- data/vendor/github.com/planetscale/planetscale-go/planetscale/backups.go +0 -139
- data/vendor/github.com/planetscale/planetscale-go/planetscale/branches.go +0 -252
- data/vendor/github.com/planetscale/planetscale-go/planetscale/certs.go +0 -166
- data/vendor/github.com/planetscale/planetscale-go/planetscale/client.go +0 -312
- data/vendor/github.com/planetscale/planetscale-go/planetscale/databases.go +0 -133
- data/vendor/github.com/planetscale/planetscale-go/planetscale/deploy_requests.go +0 -368
- data/vendor/github.com/planetscale/planetscale-go/planetscale/organizations.go +0 -103
- data/vendor/github.com/planetscale/planetscale-go/planetscale/regions.go +0 -52
- data/vendor/github.com/planetscale/planetscale-go/planetscale/service_tokens.go +0 -163
- data/vendor/github.com/planetscale/sql-proxy/LICENSE +0 -202
- data/vendor/github.com/planetscale/sql-proxy/proxy/client.go +0 -476
- data/vendor/github.com/planetscale/sql-proxy/proxy/tls_cache.go +0 -73
- data/vendor/go.uber.org/atomic/.codecov.yml +0 -19
- data/vendor/go.uber.org/atomic/.gitignore +0 -12
- data/vendor/go.uber.org/atomic/.travis.yml +0 -27
- data/vendor/go.uber.org/atomic/CHANGELOG.md +0 -76
- data/vendor/go.uber.org/atomic/LICENSE.txt +0 -19
- data/vendor/go.uber.org/atomic/Makefile +0 -78
- data/vendor/go.uber.org/atomic/README.md +0 -63
- data/vendor/go.uber.org/atomic/bool.go +0 -81
- data/vendor/go.uber.org/atomic/bool_ext.go +0 -53
- data/vendor/go.uber.org/atomic/doc.go +0 -23
- data/vendor/go.uber.org/atomic/duration.go +0 -82
- data/vendor/go.uber.org/atomic/duration_ext.go +0 -40
- data/vendor/go.uber.org/atomic/error.go +0 -51
- data/vendor/go.uber.org/atomic/error_ext.go +0 -39
- data/vendor/go.uber.org/atomic/float64.go +0 -76
- data/vendor/go.uber.org/atomic/float64_ext.go +0 -47
- data/vendor/go.uber.org/atomic/gen.go +0 -26
- data/vendor/go.uber.org/atomic/go.mod +0 -8
- data/vendor/go.uber.org/atomic/go.sum +0 -9
- data/vendor/go.uber.org/atomic/int32.go +0 -102
- data/vendor/go.uber.org/atomic/int64.go +0 -102
- data/vendor/go.uber.org/atomic/nocmp.go +0 -35
- data/vendor/go.uber.org/atomic/string.go +0 -54
- data/vendor/go.uber.org/atomic/string_ext.go +0 -43
- data/vendor/go.uber.org/atomic/uint32.go +0 -102
- data/vendor/go.uber.org/atomic/uint64.go +0 -102
- data/vendor/go.uber.org/atomic/value.go +0 -31
- data/vendor/go.uber.org/multierr/.codecov.yml +0 -15
- data/vendor/go.uber.org/multierr/.gitignore +0 -4
- data/vendor/go.uber.org/multierr/.travis.yml +0 -23
- data/vendor/go.uber.org/multierr/CHANGELOG.md +0 -60
- data/vendor/go.uber.org/multierr/LICENSE.txt +0 -19
- data/vendor/go.uber.org/multierr/Makefile +0 -42
- data/vendor/go.uber.org/multierr/README.md +0 -23
- data/vendor/go.uber.org/multierr/error.go +0 -449
- data/vendor/go.uber.org/multierr/glide.yaml +0 -8
- data/vendor/go.uber.org/multierr/go.mod +0 -8
- data/vendor/go.uber.org/multierr/go.sum +0 -11
- data/vendor/go.uber.org/multierr/go113.go +0 -52
- data/vendor/go.uber.org/zap/.codecov.yml +0 -17
- data/vendor/go.uber.org/zap/.gitignore +0 -32
- data/vendor/go.uber.org/zap/.readme.tmpl +0 -109
- data/vendor/go.uber.org/zap/CHANGELOG.md +0 -492
- data/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md +0 -75
- data/vendor/go.uber.org/zap/CONTRIBUTING.md +0 -75
- data/vendor/go.uber.org/zap/FAQ.md +0 -164
- data/vendor/go.uber.org/zap/LICENSE.txt +0 -19
- data/vendor/go.uber.org/zap/Makefile +0 -73
- data/vendor/go.uber.org/zap/README.md +0 -134
- data/vendor/go.uber.org/zap/array.go +0 -320
- data/vendor/go.uber.org/zap/buffer/buffer.go +0 -141
- data/vendor/go.uber.org/zap/buffer/pool.go +0 -49
- data/vendor/go.uber.org/zap/checklicense.sh +0 -17
- data/vendor/go.uber.org/zap/config.go +0 -264
- data/vendor/go.uber.org/zap/doc.go +0 -113
- data/vendor/go.uber.org/zap/encoder.go +0 -79
- data/vendor/go.uber.org/zap/error.go +0 -80
- data/vendor/go.uber.org/zap/field.go +0 -549
- data/vendor/go.uber.org/zap/flag.go +0 -39
- data/vendor/go.uber.org/zap/glide.yaml +0 -34
- data/vendor/go.uber.org/zap/global.go +0 -168
- data/vendor/go.uber.org/zap/global_go112.go +0 -26
- data/vendor/go.uber.org/zap/global_prego112.go +0 -26
- data/vendor/go.uber.org/zap/go.mod +0 -14
- data/vendor/go.uber.org/zap/go.sum +0 -54
- data/vendor/go.uber.org/zap/http_handler.go +0 -132
- data/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go +0 -31
- data/vendor/go.uber.org/zap/internal/color/color.go +0 -44
- data/vendor/go.uber.org/zap/internal/exit/exit.go +0 -64
- data/vendor/go.uber.org/zap/level.go +0 -132
- data/vendor/go.uber.org/zap/logger.go +0 -348
- data/vendor/go.uber.org/zap/options.go +0 -148
- data/vendor/go.uber.org/zap/sink.go +0 -161
- data/vendor/go.uber.org/zap/stacktrace.go +0 -85
- data/vendor/go.uber.org/zap/sugar.go +0 -315
- data/vendor/go.uber.org/zap/time.go +0 -27
- data/vendor/go.uber.org/zap/writer.go +0 -99
- data/vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go +0 -188
- data/vendor/go.uber.org/zap/zapcore/clock.go +0 -50
- data/vendor/go.uber.org/zap/zapcore/console_encoder.go +0 -161
- data/vendor/go.uber.org/zap/zapcore/core.go +0 -113
- data/vendor/go.uber.org/zap/zapcore/doc.go +0 -24
- data/vendor/go.uber.org/zap/zapcore/encoder.go +0 -443
- data/vendor/go.uber.org/zap/zapcore/entry.go +0 -264
- data/vendor/go.uber.org/zap/zapcore/error.go +0 -132
- data/vendor/go.uber.org/zap/zapcore/field.go +0 -233
- data/vendor/go.uber.org/zap/zapcore/hook.go +0 -68
- data/vendor/go.uber.org/zap/zapcore/increase_level.go +0 -66
- data/vendor/go.uber.org/zap/zapcore/json_encoder.go +0 -534
- data/vendor/go.uber.org/zap/zapcore/level.go +0 -175
- data/vendor/go.uber.org/zap/zapcore/level_strings.go +0 -46
- data/vendor/go.uber.org/zap/zapcore/marshaler.go +0 -61
- data/vendor/go.uber.org/zap/zapcore/memory_encoder.go +0 -179
- data/vendor/go.uber.org/zap/zapcore/sampler.go +0 -208
- data/vendor/go.uber.org/zap/zapcore/tee.go +0 -81
- data/vendor/go.uber.org/zap/zapcore/write_syncer.go +0 -122
- data/vendor/golang.org/x/net/AUTHORS +0 -3
- data/vendor/golang.org/x/net/CONTRIBUTORS +0 -3
- data/vendor/golang.org/x/net/LICENSE +0 -27
- data/vendor/golang.org/x/net/PATENTS +0 -22
- data/vendor/golang.org/x/net/context/context.go +0 -56
- data/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +0 -71
- data/vendor/golang.org/x/net/context/go17.go +0 -73
- data/vendor/golang.org/x/net/context/go19.go +0 -21
- data/vendor/golang.org/x/net/context/pre_go17.go +0 -301
- data/vendor/golang.org/x/net/context/pre_go19.go +0 -110
- data/vendor/golang.org/x/oauth2/.travis.yml +0 -13
- data/vendor/golang.org/x/oauth2/AUTHORS +0 -3
- data/vendor/golang.org/x/oauth2/CONTRIBUTING.md +0 -26
- data/vendor/golang.org/x/oauth2/CONTRIBUTORS +0 -3
- data/vendor/golang.org/x/oauth2/LICENSE +0 -27
- data/vendor/golang.org/x/oauth2/README.md +0 -36
- data/vendor/golang.org/x/oauth2/go.mod +0 -9
- data/vendor/golang.org/x/oauth2/go.sum +0 -361
- data/vendor/golang.org/x/oauth2/internal/client_appengine.go +0 -14
- data/vendor/golang.org/x/oauth2/internal/doc.go +0 -6
- data/vendor/golang.org/x/oauth2/internal/oauth2.go +0 -37
- data/vendor/golang.org/x/oauth2/internal/token.go +0 -294
- data/vendor/golang.org/x/oauth2/internal/transport.go +0 -33
- data/vendor/golang.org/x/oauth2/oauth2.go +0 -381
- data/vendor/golang.org/x/oauth2/token.go +0 -178
- data/vendor/golang.org/x/oauth2/transport.go +0 -89
- data/vendor/google.golang.org/appengine/LICENSE +0 -202
- data/vendor/google.golang.org/appengine/internal/api.go +0 -678
- data/vendor/google.golang.org/appengine/internal/api_classic.go +0 -169
- data/vendor/google.golang.org/appengine/internal/api_common.go +0 -123
- data/vendor/google.golang.org/appengine/internal/app_id.go +0 -28
- data/vendor/google.golang.org/appengine/internal/base/api_base.pb.go +0 -308
- data/vendor/google.golang.org/appengine/internal/base/api_base.proto +0 -33
- data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go +0 -4367
- data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto +0 -551
- data/vendor/google.golang.org/appengine/internal/identity.go +0 -55
- data/vendor/google.golang.org/appengine/internal/identity_classic.go +0 -61
- data/vendor/google.golang.org/appengine/internal/identity_flex.go +0 -11
- data/vendor/google.golang.org/appengine/internal/identity_vm.go +0 -134
- data/vendor/google.golang.org/appengine/internal/internal.go +0 -110
- data/vendor/google.golang.org/appengine/internal/log/log_service.pb.go +0 -1313
- data/vendor/google.golang.org/appengine/internal/log/log_service.proto +0 -150
- data/vendor/google.golang.org/appengine/internal/main.go +0 -16
- data/vendor/google.golang.org/appengine/internal/main_common.go +0 -7
- data/vendor/google.golang.org/appengine/internal/main_vm.go +0 -69
- data/vendor/google.golang.org/appengine/internal/metadata.go +0 -60
- data/vendor/google.golang.org/appengine/internal/net.go +0 -56
- data/vendor/google.golang.org/appengine/internal/regen.sh +0 -40
- data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go +0 -361
- data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto +0 -44
- data/vendor/google.golang.org/appengine/internal/transaction.go +0 -115
- data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +0 -527
- data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +0 -64
- data/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +0 -210
- data/vendor/google.golang.org/protobuf/AUTHORS +0 -3
- data/vendor/google.golang.org/protobuf/CONTRIBUTORS +0 -3
- data/vendor/google.golang.org/protobuf/LICENSE +0 -27
- data/vendor/google.golang.org/protobuf/PATENTS +0 -22
- data/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +0 -773
- data/vendor/google.golang.org/protobuf/encoding/prototext/doc.go +0 -7
- data/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +0 -371
- data/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +0 -538
- data/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +0 -318
- data/vendor/google.golang.org/protobuf/internal/descopts/options.go +0 -29
- data/vendor/google.golang.org/protobuf/internal/detrand/rand.go +0 -69
- data/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +0 -213
- data/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go +0 -241
- data/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +0 -207
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +0 -665
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go +0 -190
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_string.go +0 -161
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_token.go +0 -373
- data/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go +0 -29
- data/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go +0 -265
- data/vendor/google.golang.org/protobuf/internal/errors/errors.go +0 -89
- data/vendor/google.golang.org/protobuf/internal/errors/is_go112.go +0 -39
- data/vendor/google.golang.org/protobuf/internal/errors/is_go113.go +0 -12
- data/vendor/google.golang.org/protobuf/internal/filedesc/build.go +0 -158
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +0 -631
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +0 -471
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +0 -704
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go +0 -450
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +0 -356
- data/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +0 -107
- data/vendor/google.golang.org/protobuf/internal/filetype/build.go +0 -297
- data/vendor/google.golang.org/protobuf/internal/flags/flags.go +0 -24
- data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go +0 -9
- data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go +0 -9
- data/vendor/google.golang.org/protobuf/internal/genid/any_gen.go +0 -34
- data/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +0 -106
- data/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +0 -829
- data/vendor/google.golang.org/protobuf/internal/genid/doc.go +0 -11
- data/vendor/google.golang.org/protobuf/internal/genid/duration_gen.go +0 -34
- data/vendor/google.golang.org/protobuf/internal/genid/empty_gen.go +0 -19
- data/vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go +0 -31
- data/vendor/google.golang.org/protobuf/internal/genid/goname.go +0 -25
- data/vendor/google.golang.org/protobuf/internal/genid/map_entry.go +0 -16
- data/vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go +0 -31
- data/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go +0 -116
- data/vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go +0 -34
- data/vendor/google.golang.org/protobuf/internal/genid/type_gen.go +0 -184
- data/vendor/google.golang.org/protobuf/internal/genid/wrappers.go +0 -13
- data/vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go +0 -175
- data/vendor/google.golang.org/protobuf/internal/impl/api_export.go +0 -177
- data/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +0 -141
- data/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +0 -223
- data/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +0 -830
- data/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +0 -5637
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +0 -388
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go +0 -37
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go +0 -11
- data/vendor/google.golang.org/protobuf/internal/impl/codec_message.go +0 -217
- data/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +0 -123
- data/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go +0 -209
- data/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go +0 -557
- data/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go +0 -17
- data/vendor/google.golang.org/protobuf/internal/impl/convert.go +0 -496
- data/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +0 -141
- data/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +0 -121
- data/vendor/google.golang.org/protobuf/internal/impl/decode.go +0 -276
- data/vendor/google.golang.org/protobuf/internal/impl/encode.go +0 -201
- data/vendor/google.golang.org/protobuf/internal/impl/enum.go +0 -21
- data/vendor/google.golang.org/protobuf/internal/impl/extension.go +0 -156
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +0 -219
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go +0 -92
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +0 -176
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +0 -81
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +0 -558
- data/vendor/google.golang.org/protobuf/internal/impl/merge.go +0 -176
- data/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go +0 -209
- data/vendor/google.golang.org/protobuf/internal/impl/message.go +0 -276
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +0 -465
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go +0 -543
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +0 -249
- data/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +0 -178
- data/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +0 -174
- data/vendor/google.golang.org/protobuf/internal/impl/validate.go +0 -576
- data/vendor/google.golang.org/protobuf/internal/impl/weak.go +0 -74
- data/vendor/google.golang.org/protobuf/internal/order/order.go +0 -89
- data/vendor/google.golang.org/protobuf/internal/order/range.go +0 -115
- data/vendor/google.golang.org/protobuf/internal/pragma/pragma.go +0 -29
- data/vendor/google.golang.org/protobuf/internal/set/ints.go +0 -58
- data/vendor/google.golang.org/protobuf/internal/strs/strings.go +0 -196
- data/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go +0 -27
- data/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +0 -94
- data/vendor/google.golang.org/protobuf/internal/version/version.go +0 -79
- data/vendor/google.golang.org/protobuf/proto/checkinit.go +0 -71
- data/vendor/google.golang.org/protobuf/proto/decode.go +0 -278
- data/vendor/google.golang.org/protobuf/proto/decode_gen.go +0 -603
- data/vendor/google.golang.org/protobuf/proto/doc.go +0 -94
- data/vendor/google.golang.org/protobuf/proto/encode.go +0 -319
- data/vendor/google.golang.org/protobuf/proto/encode_gen.go +0 -97
- data/vendor/google.golang.org/protobuf/proto/equal.go +0 -167
- data/vendor/google.golang.org/protobuf/proto/extension.go +0 -92
- data/vendor/google.golang.org/protobuf/proto/merge.go +0 -139
- data/vendor/google.golang.org/protobuf/proto/messageset.go +0 -93
- data/vendor/google.golang.org/protobuf/proto/proto.go +0 -43
- data/vendor/google.golang.org/protobuf/proto/proto_methods.go +0 -19
- data/vendor/google.golang.org/protobuf/proto/proto_reflect.go +0 -19
- data/vendor/google.golang.org/protobuf/proto/reset.go +0 -43
- data/vendor/google.golang.org/protobuf/proto/size.go +0 -97
- data/vendor/google.golang.org/protobuf/proto/size_gen.go +0 -55
- data/vendor/google.golang.org/protobuf/proto/wrappers.go +0 -29
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +0 -276
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +0 -248
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +0 -286
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +0 -374
- data/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +0 -252
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go +0 -77
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +0 -504
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go +0 -128
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +0 -461
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +0 -665
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +0 -285
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +0 -59
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +0 -411
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +0 -98
- data/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +0 -869
- data/vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go +0 -15
- data/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go +0 -167
- data/vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go +0 -44
- data/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go +0 -56
- data/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +0 -4039
- data/vendor/modules.txt +0 -79
@@ -1,19 +0,0 @@
|
|
1
|
-
// Copyright 2012 The Gorilla 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 mux
|
6
|
-
|
7
|
-
import "net/http"
|
8
|
-
|
9
|
-
// SetURLVars sets the URL variables for the given request, to be accessed via
|
10
|
-
// mux.Vars for testing route behaviour. Arguments are not modified, a shallow
|
11
|
-
// copy is returned.
|
12
|
-
//
|
13
|
-
// This API should only be used for testing purposes; it provides a way to
|
14
|
-
// inject variables into the request context. Alternatively, URL variables
|
15
|
-
// can be set by making a route that captures the required variables,
|
16
|
-
// starting a server and sending the request to that server.
|
17
|
-
func SetURLVars(r *http.Request, val map[string]string) *http.Request {
|
18
|
-
return requestWithVars(r, val)
|
19
|
-
}
|
@@ -1,363 +0,0 @@
|
|
1
|
-
Mozilla Public License, version 2.0
|
2
|
-
|
3
|
-
1. Definitions
|
4
|
-
|
5
|
-
1.1. "Contributor"
|
6
|
-
|
7
|
-
means each individual or legal entity that creates, contributes to the
|
8
|
-
creation of, or owns Covered Software.
|
9
|
-
|
10
|
-
1.2. "Contributor Version"
|
11
|
-
|
12
|
-
means the combination of the Contributions of others (if any) used by a
|
13
|
-
Contributor and that particular Contributor's Contribution.
|
14
|
-
|
15
|
-
1.3. "Contribution"
|
16
|
-
|
17
|
-
means Covered Software of a particular Contributor.
|
18
|
-
|
19
|
-
1.4. "Covered Software"
|
20
|
-
|
21
|
-
means Source Code Form to which the initial Contributor has attached the
|
22
|
-
notice in Exhibit A, the Executable Form of such Source Code Form, and
|
23
|
-
Modifications of such Source Code Form, in each case including portions
|
24
|
-
thereof.
|
25
|
-
|
26
|
-
1.5. "Incompatible With Secondary Licenses"
|
27
|
-
means
|
28
|
-
|
29
|
-
a. that the initial Contributor has attached the notice described in
|
30
|
-
Exhibit B to the Covered Software; or
|
31
|
-
|
32
|
-
b. that the Covered Software was made available under the terms of
|
33
|
-
version 1.1 or earlier of the License, but not also under the terms of
|
34
|
-
a Secondary License.
|
35
|
-
|
36
|
-
1.6. "Executable Form"
|
37
|
-
|
38
|
-
means any form of the work other than Source Code Form.
|
39
|
-
|
40
|
-
1.7. "Larger Work"
|
41
|
-
|
42
|
-
means a work that combines Covered Software with other material, in a
|
43
|
-
separate file or files, that is not Covered Software.
|
44
|
-
|
45
|
-
1.8. "License"
|
46
|
-
|
47
|
-
means this document.
|
48
|
-
|
49
|
-
1.9. "Licensable"
|
50
|
-
|
51
|
-
means having the right to grant, to the maximum extent possible, whether
|
52
|
-
at the time of the initial grant or subsequently, any and all of the
|
53
|
-
rights conveyed by this License.
|
54
|
-
|
55
|
-
1.10. "Modifications"
|
56
|
-
|
57
|
-
means any of the following:
|
58
|
-
|
59
|
-
a. any file in Source Code Form that results from an addition to,
|
60
|
-
deletion from, or modification of the contents of Covered Software; or
|
61
|
-
|
62
|
-
b. any new file in Source Code Form that contains any Covered Software.
|
63
|
-
|
64
|
-
1.11. "Patent Claims" of a Contributor
|
65
|
-
|
66
|
-
means any patent claim(s), including without limitation, method,
|
67
|
-
process, and apparatus claims, in any patent Licensable by such
|
68
|
-
Contributor that would be infringed, but for the grant of the License,
|
69
|
-
by the making, using, selling, offering for sale, having made, import,
|
70
|
-
or transfer of either its Contributions or its Contributor Version.
|
71
|
-
|
72
|
-
1.12. "Secondary License"
|
73
|
-
|
74
|
-
means either the GNU General Public License, Version 2.0, the GNU Lesser
|
75
|
-
General Public License, Version 2.1, the GNU Affero General Public
|
76
|
-
License, Version 3.0, or any later versions of those licenses.
|
77
|
-
|
78
|
-
1.13. "Source Code Form"
|
79
|
-
|
80
|
-
means the form of the work preferred for making modifications.
|
81
|
-
|
82
|
-
1.14. "You" (or "Your")
|
83
|
-
|
84
|
-
means an individual or a legal entity exercising rights under this
|
85
|
-
License. For legal entities, "You" includes any entity that controls, is
|
86
|
-
controlled by, or is under common control with You. For purposes of this
|
87
|
-
definition, "control" means (a) the power, direct or indirect, to cause
|
88
|
-
the direction or management of such entity, whether by contract or
|
89
|
-
otherwise, or (b) ownership of more than fifty percent (50%) of the
|
90
|
-
outstanding shares or beneficial ownership of such entity.
|
91
|
-
|
92
|
-
|
93
|
-
2. License Grants and Conditions
|
94
|
-
|
95
|
-
2.1. Grants
|
96
|
-
|
97
|
-
Each Contributor hereby grants You a world-wide, royalty-free,
|
98
|
-
non-exclusive license:
|
99
|
-
|
100
|
-
a. under intellectual property rights (other than patent or trademark)
|
101
|
-
Licensable by such Contributor to use, reproduce, make available,
|
102
|
-
modify, display, perform, distribute, and otherwise exploit its
|
103
|
-
Contributions, either on an unmodified basis, with Modifications, or
|
104
|
-
as part of a Larger Work; and
|
105
|
-
|
106
|
-
b. under Patent Claims of such Contributor to make, use, sell, offer for
|
107
|
-
sale, have made, import, and otherwise transfer either its
|
108
|
-
Contributions or its Contributor Version.
|
109
|
-
|
110
|
-
2.2. Effective Date
|
111
|
-
|
112
|
-
The licenses granted in Section 2.1 with respect to any Contribution
|
113
|
-
become effective for each Contribution on the date the Contributor first
|
114
|
-
distributes such Contribution.
|
115
|
-
|
116
|
-
2.3. Limitations on Grant Scope
|
117
|
-
|
118
|
-
The licenses granted in this Section 2 are the only rights granted under
|
119
|
-
this License. No additional rights or licenses will be implied from the
|
120
|
-
distribution or licensing of Covered Software under this License.
|
121
|
-
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
122
|
-
Contributor:
|
123
|
-
|
124
|
-
a. for any code that a Contributor has removed from Covered Software; or
|
125
|
-
|
126
|
-
b. for infringements caused by: (i) Your and any other third party's
|
127
|
-
modifications of Covered Software, or (ii) the combination of its
|
128
|
-
Contributions with other software (except as part of its Contributor
|
129
|
-
Version); or
|
130
|
-
|
131
|
-
c. under Patent Claims infringed by Covered Software in the absence of
|
132
|
-
its Contributions.
|
133
|
-
|
134
|
-
This License does not grant any rights in the trademarks, service marks,
|
135
|
-
or logos of any Contributor (except as may be necessary to comply with
|
136
|
-
the notice requirements in Section 3.4).
|
137
|
-
|
138
|
-
2.4. Subsequent Licenses
|
139
|
-
|
140
|
-
No Contributor makes additional grants as a result of Your choice to
|
141
|
-
distribute the Covered Software under a subsequent version of this
|
142
|
-
License (see Section 10.2) or under the terms of a Secondary License (if
|
143
|
-
permitted under the terms of Section 3.3).
|
144
|
-
|
145
|
-
2.5. Representation
|
146
|
-
|
147
|
-
Each Contributor represents that the Contributor believes its
|
148
|
-
Contributions are its original creation(s) or it has sufficient rights to
|
149
|
-
grant the rights to its Contributions conveyed by this License.
|
150
|
-
|
151
|
-
2.6. Fair Use
|
152
|
-
|
153
|
-
This License is not intended to limit any rights You have under
|
154
|
-
applicable copyright doctrines of fair use, fair dealing, or other
|
155
|
-
equivalents.
|
156
|
-
|
157
|
-
2.7. Conditions
|
158
|
-
|
159
|
-
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
|
160
|
-
Section 2.1.
|
161
|
-
|
162
|
-
|
163
|
-
3. Responsibilities
|
164
|
-
|
165
|
-
3.1. Distribution of Source Form
|
166
|
-
|
167
|
-
All distribution of Covered Software in Source Code Form, including any
|
168
|
-
Modifications that You create or to which You contribute, must be under
|
169
|
-
the terms of this License. You must inform recipients that the Source
|
170
|
-
Code Form of the Covered Software is governed by the terms of this
|
171
|
-
License, and how they can obtain a copy of this License. You may not
|
172
|
-
attempt to alter or restrict the recipients' rights in the Source Code
|
173
|
-
Form.
|
174
|
-
|
175
|
-
3.2. Distribution of Executable Form
|
176
|
-
|
177
|
-
If You distribute Covered Software in Executable Form then:
|
178
|
-
|
179
|
-
a. such Covered Software must also be made available in Source Code Form,
|
180
|
-
as described in Section 3.1, and You must inform recipients of the
|
181
|
-
Executable Form how they can obtain a copy of such Source Code Form by
|
182
|
-
reasonable means in a timely manner, at a charge no more than the cost
|
183
|
-
of distribution to the recipient; and
|
184
|
-
|
185
|
-
b. You may distribute such Executable Form under the terms of this
|
186
|
-
License, or sublicense it under different terms, provided that the
|
187
|
-
license for the Executable Form does not attempt to limit or alter the
|
188
|
-
recipients' rights in the Source Code Form under this License.
|
189
|
-
|
190
|
-
3.3. Distribution of a Larger Work
|
191
|
-
|
192
|
-
You may create and distribute a Larger Work under terms of Your choice,
|
193
|
-
provided that You also comply with the requirements of this License for
|
194
|
-
the Covered Software. If the Larger Work is a combination of Covered
|
195
|
-
Software with a work governed by one or more Secondary Licenses, and the
|
196
|
-
Covered Software is not Incompatible With Secondary Licenses, this
|
197
|
-
License permits You to additionally distribute such Covered Software
|
198
|
-
under the terms of such Secondary License(s), so that the recipient of
|
199
|
-
the Larger Work may, at their option, further distribute the Covered
|
200
|
-
Software under the terms of either this License or such Secondary
|
201
|
-
License(s).
|
202
|
-
|
203
|
-
3.4. Notices
|
204
|
-
|
205
|
-
You may not remove or alter the substance of any license notices
|
206
|
-
(including copyright notices, patent notices, disclaimers of warranty, or
|
207
|
-
limitations of liability) contained within the Source Code Form of the
|
208
|
-
Covered Software, except that You may alter any license notices to the
|
209
|
-
extent required to remedy known factual inaccuracies.
|
210
|
-
|
211
|
-
3.5. Application of Additional Terms
|
212
|
-
|
213
|
-
You may choose to offer, and to charge a fee for, warranty, support,
|
214
|
-
indemnity or liability obligations to one or more recipients of Covered
|
215
|
-
Software. However, You may do so only on Your own behalf, and not on
|
216
|
-
behalf of any Contributor. You must make it absolutely clear that any
|
217
|
-
such warranty, support, indemnity, or liability obligation is offered by
|
218
|
-
You alone, and You hereby agree to indemnify every Contributor for any
|
219
|
-
liability incurred by such Contributor as a result of warranty, support,
|
220
|
-
indemnity or liability terms You offer. You may include additional
|
221
|
-
disclaimers of warranty and limitations of liability specific to any
|
222
|
-
jurisdiction.
|
223
|
-
|
224
|
-
4. Inability to Comply Due to Statute or Regulation
|
225
|
-
|
226
|
-
If it is impossible for You to comply with any of the terms of this License
|
227
|
-
with respect to some or all of the Covered Software due to statute,
|
228
|
-
judicial order, or regulation then You must: (a) comply with the terms of
|
229
|
-
this License to the maximum extent possible; and (b) describe the
|
230
|
-
limitations and the code they affect. Such description must be placed in a
|
231
|
-
text file included with all distributions of the Covered Software under
|
232
|
-
this License. Except to the extent prohibited by statute or regulation,
|
233
|
-
such description must be sufficiently detailed for a recipient of ordinary
|
234
|
-
skill to be able to understand it.
|
235
|
-
|
236
|
-
5. Termination
|
237
|
-
|
238
|
-
5.1. The rights granted under this License will terminate automatically if You
|
239
|
-
fail to comply with any of its terms. However, if You become compliant,
|
240
|
-
then the rights granted under this License from a particular Contributor
|
241
|
-
are reinstated (a) provisionally, unless and until such Contributor
|
242
|
-
explicitly and finally terminates Your grants, and (b) on an ongoing
|
243
|
-
basis, if such Contributor fails to notify You of the non-compliance by
|
244
|
-
some reasonable means prior to 60 days after You have come back into
|
245
|
-
compliance. Moreover, Your grants from a particular Contributor are
|
246
|
-
reinstated on an ongoing basis if such Contributor notifies You of the
|
247
|
-
non-compliance by some reasonable means, this is the first time You have
|
248
|
-
received notice of non-compliance with this License from such
|
249
|
-
Contributor, and You become compliant prior to 30 days after Your receipt
|
250
|
-
of the notice.
|
251
|
-
|
252
|
-
5.2. If You initiate litigation against any entity by asserting a patent
|
253
|
-
infringement claim (excluding declaratory judgment actions,
|
254
|
-
counter-claims, and cross-claims) alleging that a Contributor Version
|
255
|
-
directly or indirectly infringes any patent, then the rights granted to
|
256
|
-
You by any and all Contributors for the Covered Software under Section
|
257
|
-
2.1 of this License shall terminate.
|
258
|
-
|
259
|
-
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
|
260
|
-
license agreements (excluding distributors and resellers) which have been
|
261
|
-
validly granted by You or Your distributors under this License prior to
|
262
|
-
termination shall survive termination.
|
263
|
-
|
264
|
-
6. Disclaimer of Warranty
|
265
|
-
|
266
|
-
Covered Software is provided under this License on an "as is" basis,
|
267
|
-
without warranty of any kind, either expressed, implied, or statutory,
|
268
|
-
including, without limitation, warranties that the Covered Software is free
|
269
|
-
of defects, merchantable, fit for a particular purpose or non-infringing.
|
270
|
-
The entire risk as to the quality and performance of the Covered Software
|
271
|
-
is with You. Should any Covered Software prove defective in any respect,
|
272
|
-
You (not any Contributor) assume the cost of any necessary servicing,
|
273
|
-
repair, or correction. This disclaimer of warranty constitutes an essential
|
274
|
-
part of this License. No use of any Covered Software is authorized under
|
275
|
-
this License except under this disclaimer.
|
276
|
-
|
277
|
-
7. Limitation of Liability
|
278
|
-
|
279
|
-
Under no circumstances and under no legal theory, whether tort (including
|
280
|
-
negligence), contract, or otherwise, shall any Contributor, or anyone who
|
281
|
-
distributes Covered Software as permitted above, be liable to You for any
|
282
|
-
direct, indirect, special, incidental, or consequential damages of any
|
283
|
-
character including, without limitation, damages for lost profits, loss of
|
284
|
-
goodwill, work stoppage, computer failure or malfunction, or any and all
|
285
|
-
other commercial damages or losses, even if such party shall have been
|
286
|
-
informed of the possibility of such damages. This limitation of liability
|
287
|
-
shall not apply to liability for death or personal injury resulting from
|
288
|
-
such party's negligence to the extent applicable law prohibits such
|
289
|
-
limitation. Some jurisdictions do not allow the exclusion or limitation of
|
290
|
-
incidental or consequential damages, so this exclusion and limitation may
|
291
|
-
not apply to You.
|
292
|
-
|
293
|
-
8. Litigation
|
294
|
-
|
295
|
-
Any litigation relating to this License may be brought only in the courts
|
296
|
-
of a jurisdiction where the defendant maintains its principal place of
|
297
|
-
business and such litigation shall be governed by laws of that
|
298
|
-
jurisdiction, without reference to its conflict-of-law provisions. Nothing
|
299
|
-
in this Section shall prevent a party's ability to bring cross-claims or
|
300
|
-
counter-claims.
|
301
|
-
|
302
|
-
9. Miscellaneous
|
303
|
-
|
304
|
-
This License represents the complete agreement concerning the subject
|
305
|
-
matter hereof. If any provision of this License is held to be
|
306
|
-
unenforceable, such provision shall be reformed only to the extent
|
307
|
-
necessary to make it enforceable. Any law or regulation which provides that
|
308
|
-
the language of a contract shall be construed against the drafter shall not
|
309
|
-
be used to construe this License against a Contributor.
|
310
|
-
|
311
|
-
|
312
|
-
10. Versions of the License
|
313
|
-
|
314
|
-
10.1. New Versions
|
315
|
-
|
316
|
-
Mozilla Foundation is the license steward. Except as provided in Section
|
317
|
-
10.3, no one other than the license steward has the right to modify or
|
318
|
-
publish new versions of this License. Each version will be given a
|
319
|
-
distinguishing version number.
|
320
|
-
|
321
|
-
10.2. Effect of New Versions
|
322
|
-
|
323
|
-
You may distribute the Covered Software under the terms of the version
|
324
|
-
of the License under which You originally received the Covered Software,
|
325
|
-
or under the terms of any subsequent version published by the license
|
326
|
-
steward.
|
327
|
-
|
328
|
-
10.3. Modified Versions
|
329
|
-
|
330
|
-
If you create software not governed by this License, and you want to
|
331
|
-
create a new license for such software, you may create and use a
|
332
|
-
modified version of this License if you rename the license and remove
|
333
|
-
any references to the name of the license steward (except to note that
|
334
|
-
such modified license differs from this License).
|
335
|
-
|
336
|
-
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
337
|
-
Licenses If You choose to distribute Source Code Form that is
|
338
|
-
Incompatible With Secondary Licenses under the terms of this version of
|
339
|
-
the License, the notice described in Exhibit B of this License must be
|
340
|
-
attached.
|
341
|
-
|
342
|
-
Exhibit A - Source Code Form License Notice
|
343
|
-
|
344
|
-
This Source Code Form is subject to the
|
345
|
-
terms of the Mozilla Public License, v.
|
346
|
-
2.0. If a copy of the MPL was not
|
347
|
-
distributed with this file, You can
|
348
|
-
obtain one at
|
349
|
-
http://mozilla.org/MPL/2.0/.
|
350
|
-
|
351
|
-
If it is not possible or desirable to put the notice in a particular file,
|
352
|
-
then You may include the notice in a location (such as a LICENSE file in a
|
353
|
-
relevant directory) where a recipient would be likely to look for such a
|
354
|
-
notice.
|
355
|
-
|
356
|
-
You may add additional accurate notices of copyright ownership.
|
357
|
-
|
358
|
-
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
359
|
-
|
360
|
-
This Source Code Form is "Incompatible
|
361
|
-
With Secondary Licenses", as defined by
|
362
|
-
the Mozilla Public License, v. 2.0.
|
363
|
-
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# cleanhttp
|
2
|
-
|
3
|
-
Functions for accessing "clean" Go http.Client values
|
4
|
-
|
5
|
-
-------------
|
6
|
-
|
7
|
-
The Go standard library contains a default `http.Client` called
|
8
|
-
`http.DefaultClient`. It is a common idiom in Go code to start with
|
9
|
-
`http.DefaultClient` and tweak it as necessary, and in fact, this is
|
10
|
-
encouraged; from the `http` package documentation:
|
11
|
-
|
12
|
-
> The Client's Transport typically has internal state (cached TCP connections),
|
13
|
-
so Clients should be reused instead of created as needed. Clients are safe for
|
14
|
-
concurrent use by multiple goroutines.
|
15
|
-
|
16
|
-
Unfortunately, this is a shared value, and it is not uncommon for libraries to
|
17
|
-
assume that they are free to modify it at will. With enough dependencies, it
|
18
|
-
can be very easy to encounter strange problems and race conditions due to
|
19
|
-
manipulation of this shared value across libraries and goroutines (clients are
|
20
|
-
safe for concurrent use, but writing values to the client struct itself is not
|
21
|
-
protected).
|
22
|
-
|
23
|
-
Making things worse is the fact that a bare `http.Client` will use a default
|
24
|
-
`http.Transport` called `http.DefaultTransport`, which is another global value
|
25
|
-
that behaves the same way. So it is not simply enough to replace
|
26
|
-
`http.DefaultClient` with `&http.Client{}`.
|
27
|
-
|
28
|
-
This repository provides some simple functions to get a "clean" `http.Client`
|
29
|
-
-- one that uses the same default values as the Go standard library, but
|
30
|
-
returns a client that does not share any state with other clients.
|
@@ -1,58 +0,0 @@
|
|
1
|
-
package cleanhttp
|
2
|
-
|
3
|
-
import (
|
4
|
-
"net"
|
5
|
-
"net/http"
|
6
|
-
"runtime"
|
7
|
-
"time"
|
8
|
-
)
|
9
|
-
|
10
|
-
// DefaultTransport returns a new http.Transport with similar default values to
|
11
|
-
// http.DefaultTransport, but with idle connections and keepalives disabled.
|
12
|
-
func DefaultTransport() *http.Transport {
|
13
|
-
transport := DefaultPooledTransport()
|
14
|
-
transport.DisableKeepAlives = true
|
15
|
-
transport.MaxIdleConnsPerHost = -1
|
16
|
-
return transport
|
17
|
-
}
|
18
|
-
|
19
|
-
// DefaultPooledTransport returns a new http.Transport with similar default
|
20
|
-
// values to http.DefaultTransport. Do not use this for transient transports as
|
21
|
-
// it can leak file descriptors over time. Only use this for transports that
|
22
|
-
// will be re-used for the same host(s).
|
23
|
-
func DefaultPooledTransport() *http.Transport {
|
24
|
-
transport := &http.Transport{
|
25
|
-
Proxy: http.ProxyFromEnvironment,
|
26
|
-
DialContext: (&net.Dialer{
|
27
|
-
Timeout: 30 * time.Second,
|
28
|
-
KeepAlive: 30 * time.Second,
|
29
|
-
DualStack: true,
|
30
|
-
}).DialContext,
|
31
|
-
MaxIdleConns: 100,
|
32
|
-
IdleConnTimeout: 90 * time.Second,
|
33
|
-
TLSHandshakeTimeout: 10 * time.Second,
|
34
|
-
ExpectContinueTimeout: 1 * time.Second,
|
35
|
-
ForceAttemptHTTP2: true,
|
36
|
-
MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1,
|
37
|
-
}
|
38
|
-
return transport
|
39
|
-
}
|
40
|
-
|
41
|
-
// DefaultClient returns a new http.Client with similar default values to
|
42
|
-
// http.Client, but with a non-shared Transport, idle connections disabled, and
|
43
|
-
// keepalives disabled.
|
44
|
-
func DefaultClient() *http.Client {
|
45
|
-
return &http.Client{
|
46
|
-
Transport: DefaultTransport(),
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
// DefaultPooledClient returns a new http.Client with similar default values to
|
51
|
-
// http.Client, but with a shared Transport. Do not use this function for
|
52
|
-
// transient clients as it can leak file descriptors over time. Only use this
|
53
|
-
// for clients that will be re-used for the same host(s).
|
54
|
-
func DefaultPooledClient() *http.Client {
|
55
|
-
return &http.Client{
|
56
|
-
Transport: DefaultPooledTransport(),
|
57
|
-
}
|
58
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
// Package cleanhttp offers convenience utilities for acquiring "clean"
|
2
|
-
// http.Transport and http.Client structs.
|
3
|
-
//
|
4
|
-
// Values set on http.DefaultClient and http.DefaultTransport affect all
|
5
|
-
// callers. This can have detrimental effects, esepcially in TLS contexts,
|
6
|
-
// where client or root certificates set to talk to multiple endpoints can end
|
7
|
-
// up displacing each other, leading to hard-to-debug issues. This package
|
8
|
-
// provides non-shared http.Client and http.Transport structs to ensure that
|
9
|
-
// the configuration will not be overwritten by other parts of the application
|
10
|
-
// or dependencies.
|
11
|
-
//
|
12
|
-
// The DefaultClient and DefaultTransport functions disable idle connections
|
13
|
-
// and keepalives. Without ensuring that idle connections are closed before
|
14
|
-
// garbage collection, short-term clients/transports can leak file descriptors,
|
15
|
-
// eventually leading to "too many open files" errors. If you will be
|
16
|
-
// connecting to the same hosts repeatedly from the same client, you can use
|
17
|
-
// DefaultPooledClient to receive a client that has connection pooling
|
18
|
-
// semantics similar to http.DefaultClient.
|
19
|
-
//
|
20
|
-
package cleanhttp
|
@@ -1,48 +0,0 @@
|
|
1
|
-
package cleanhttp
|
2
|
-
|
3
|
-
import (
|
4
|
-
"net/http"
|
5
|
-
"strings"
|
6
|
-
"unicode"
|
7
|
-
)
|
8
|
-
|
9
|
-
// HandlerInput provides input options to cleanhttp's handlers
|
10
|
-
type HandlerInput struct {
|
11
|
-
ErrStatus int
|
12
|
-
}
|
13
|
-
|
14
|
-
// PrintablePathCheckHandler is a middleware that ensures the request path
|
15
|
-
// contains only printable runes.
|
16
|
-
func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler {
|
17
|
-
// Nil-check on input to make it optional
|
18
|
-
if input == nil {
|
19
|
-
input = &HandlerInput{
|
20
|
-
ErrStatus: http.StatusBadRequest,
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
// Default to http.StatusBadRequest on error
|
25
|
-
if input.ErrStatus == 0 {
|
26
|
-
input.ErrStatus = http.StatusBadRequest
|
27
|
-
}
|
28
|
-
|
29
|
-
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
30
|
-
if r != nil {
|
31
|
-
// Check URL path for non-printable characters
|
32
|
-
idx := strings.IndexFunc(r.URL.Path, func(c rune) bool {
|
33
|
-
return !unicode.IsPrint(c)
|
34
|
-
})
|
35
|
-
|
36
|
-
if idx != -1 {
|
37
|
-
w.WriteHeader(input.ErrStatus)
|
38
|
-
return
|
39
|
-
}
|
40
|
-
|
41
|
-
if next != nil {
|
42
|
-
next.ServeHTTP(w, r)
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
return
|
47
|
-
})
|
48
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2013 Mitchell Hashimoto
|
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.
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# go-homedir
|
2
|
-
|
3
|
-
This is a Go library for detecting the user's home directory without
|
4
|
-
the use of cgo, so the library can be used in cross-compilation environments.
|
5
|
-
|
6
|
-
Usage is incredibly simple, just call `homedir.Dir()` to get the home directory
|
7
|
-
for a user, and `homedir.Expand()` to expand the `~` in a path to the home
|
8
|
-
directory.
|
9
|
-
|
10
|
-
**Why not just use `os/user`?** The built-in `os/user` package requires
|
11
|
-
cgo on Darwin systems. This means that any Go code that uses that package
|
12
|
-
cannot cross compile. But 99% of the time the use for `os/user` is just to
|
13
|
-
retrieve the home directory, which we can do for the current user without
|
14
|
-
cgo. This library does that, enabling cross-compilation.
|
@@ -1 +0,0 @@
|
|
1
|
-
module github.com/mitchellh/go-homedir
|