From 3f3383dc0a0de9d6a0444bba71603e5c5d248f0b Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 21 May 2018 14:34:20 +0200 Subject: [PATCH 01/13] Migrate to dep (#3972) * Update makefile to use dep * Migrate to dep * Fix some deps * Try to find a better version for golang.org/x/net * Try to find a better version for golang.org/x/oauth2 --- Gopkg.lock | 875 +++ Gopkg.toml | 106 + Makefile | 24 +- vendor/code.gitea.io/git/CONTRIBUTING.md | 86 - vendor/code.gitea.io/git/DCO | 36 - vendor/code.gitea.io/git/MAINTAINERS | 21 - vendor/code.gitea.io/git/Makefile | 44 - vendor/code.gitea.io/git/README.md | 25 - vendor/code.gitea.io/git/repo_blame.go | 16 +- .../github.com/PuerkitoBio/goquery/README.md | 126 - .../github.com/RoaringBitmap/roaring/Makefile | 121 - .../RoaringBitmap/roaring/README.md | 246 - vendor/github.com/Smerity/govarint/README.md | 67 - vendor/github.com/Unknwon/cae/README.md | 37 - vendor/github.com/Unknwon/cae/README_ZH.md | 29 - .../Unknwon/cae/tz/testdata/test.lnk | 1 + .../Unknwon/cae/tz/testdata/testdir.lnk | 1 + .../Unknwon/cae/zip/testdata/test.lnk | 1 + .../Unknwon/cae/zip/testdata/testdir.lnk | 1 + vendor/github.com/Unknwon/com/README.md | 20 - vendor/github.com/Unknwon/i18n/Makefile | 12 - vendor/github.com/Unknwon/i18n/README.md | 136 - vendor/github.com/Unknwon/paginater/README.md | 65 - .../github.com/andybalholm/cascadia/README.md | 7 - .../blevesearch/bleve/CONTRIBUTING.md | 16 - vendor/github.com/blevesearch/bleve/README.md | 67 - .../blevesearch/bleve/analysis/test_words.txt | 7 - .../blevesearch/bleve/geo/README.md | 9 - .../blevesearch/bleve/index/scorch/README.md | 367 -- .../bleve/index/scorch/segment/zap/README.md | 167 - .../bleve/index/upsidedown/benchmark_all.sh | 8 - .../bleve/index/upsidedown/upsidedown.proto | 14 - .../bleve/search/facet/benchmark_data.txt | 2909 ---------- .../bleve/search/query/query_string.y | 328 -- .../blevesearch/go-porterstemmer/README.md | 118 - .../github.com/blevesearch/segment/README.md | 92 - .../blevesearch/segment/segment_words.rl | 285 - vendor/github.com/boltdb/bolt/Makefile | 18 - vendor/github.com/boltdb/bolt/README.md | 915 ---- vendor/github.com/boltdb/bolt/appveyor.yml | 18 - vendor/github.com/boombuler/barcode/README.md | 18 - .../chaseadamsio/goorgeous/README.org | 66 - .../chaseadamsio/goorgeous/gopher.gif | Bin 15232 -> 0 bytes .../chaseadamsio/goorgeous/gopher_small.gif | Bin 3270 -> 0 bytes .../couchbase/vellum/CONTRIBUTING.md | 16 - vendor/github.com/couchbase/vellum/README.md | 168 - .../denisenkom/go-mssqldb/README.md | 95 - .../dgrijalva/jwt-go/MIGRATION_GUIDE.md | 97 - vendor/github.com/dgrijalva/jwt-go/README.md | 85 - .../dgrijalva/jwt-go/VERSION_HISTORY.md | 105 - vendor/github.com/edsrzf/mmap-go/README.md | 12 - .../elazarl/go-bindata-assetfs/README.md | 46 - .../ethantkoenig/rupture/Gopkg.lock | 173 - .../ethantkoenig/rupture/Gopkg.toml | 34 - .../github.com/ethantkoenig/rupture/README.md | 13 - vendor/github.com/facebookgo/clock/README.md | 104 - .../github.com/facebookgo/httpdown/readme.md | 41 - vendor/github.com/facebookgo/stats/readme.md | 4 - .../glycerine/go-unsnap-stream/README.md | 20 - .../glycerine/go-unsnap-stream/binary.dat | Bin 5592 -> 0 bytes .../go-unsnap-stream/binary.dat.snappy | Bin 5610 -> 0 bytes .../glycerine/go-unsnap-stream/unenc.txt | 1 - .../go-unsnap-stream/unenc.txt.snappy | Bin 31 -> 0 bytes .../github.com/go-macaron/bindata/README.md | 16 - .../github.com/go-macaron/binding/README.md | 20 - vendor/github.com/go-macaron/cache/README.md | 20 - .../cache/memcache/memcache.goconvey | 1 - .../go-macaron/cache/redis/redis.goconvey | 1 - .../github.com/go-macaron/captcha/README.md | 16 - vendor/github.com/go-macaron/csrf/README.md | 18 - vendor/github.com/go-macaron/gzip/README.md | 20 - vendor/github.com/go-macaron/i18n/README.md | 16 - vendor/github.com/go-macaron/inject/README.md | 11 - .../github.com/go-macaron/session/README.md | 20 - .../go-macaron/session/redis/redis.goconvey | 1 - .../github.com/go-macaron/toolbox/README.md | 110 - .../go-sql-driver/mysql/CHANGELOG.md | 114 - .../go-sql-driver/mysql/CONTRIBUTING.md | 23 - .../go-sql-driver/mysql/ISSUE_TEMPLATE.md | 21 - .../mysql/PULL_REQUEST_TEMPLATE.md | 9 - .../github.com/go-sql-driver/mysql/README.md | 439 -- vendor/github.com/go-xorm/builder/README.md | 175 - vendor/github.com/go-xorm/builder/circle.yml | 12 - vendor/github.com/go-xorm/core/README.md | 116 - vendor/github.com/go-xorm/core/benchmark.sh | 1 - vendor/github.com/go-xorm/core/circle.yml | 15 - vendor/github.com/go-xorm/tidb/README.md | 24 - .../github.com/go-xorm/xorm/CONTRIBUTING.md | 46 - vendor/github.com/go-xorm/xorm/README.md | 430 -- vendor/github.com/go-xorm/xorm/README_CN.md | 435 -- vendor/github.com/go-xorm/xorm/circle.yml | 38 - .../github.com/go-xorm/xorm/gen_reserved.sh | 6 - .../github.com/go-xorm/xorm/pg_reserved.txt | 746 --- vendor/github.com/go-xorm/xorm/test_mssql.sh | 1 - .../go-xorm/xorm/test_mssql_cache.sh | 1 - .../github.com/go-xorm/xorm/test_mymysql.sh | 1 - .../go-xorm/xorm/test_mymysql_cache.sh | 1 - vendor/github.com/go-xorm/xorm/test_mysql.sh | 1 - .../go-xorm/xorm/test_mysql_cache.sh | 1 - .../github.com/go-xorm/xorm/test_postgres.sh | 1 - .../go-xorm/xorm/test_postgres_cache.sh | 1 - vendor/github.com/go-xorm/xorm/test_sqlite.sh | 1 - .../go-xorm/xorm/test_sqlite_cache.sh | 1 - vendor/github.com/gogits/chardet/README.md | 12 - .../gogits/chardet/icu-license.html | 51 - vendor/github.com/gogits/cron/README.md | 2 - vendor/github.com/golang/protobuf/AUTHORS | 3 + .../github.com/golang/protobuf/CONTRIBUTORS | 3 + .../github.com/golang/protobuf/proto/Makefile | 43 - vendor/github.com/golang/snappy/README | 7 - vendor/github.com/gorilla/context/README.md | 10 - vendor/github.com/gorilla/mux/README.md | 299 -- .../github.com/gorilla/securecookie/README.md | 78 - vendor/github.com/gorilla/sessions/README.md | 81 - vendor/github.com/issue9/identicon/README.md | 40 - .../github.com/jaytaylor/html2text/README.md | 112 - vendor/github.com/juju/errors/Makefile | 11 - vendor/github.com/juju/errors/README.md | 536 -- .../github.com/kballard/go-shellquote/README | 36 - vendor/github.com/keybase/go-crypto/AUTHORS | 3 + .../github.com/keybase/go-crypto/CONTRIBUTORS | 3 + .../keybase/go-crypto/openpgp/patch.sh | 7 - .../keybase/go-crypto/openpgp/sig-v3.patch | 135 - .../klauspost/compress/snappy/AUTHORS | 15 + .../klauspost/compress/snappy/CONTRIBUTORS | 37 + .../compress/snappy/LICENSE} | 55 +- vendor/github.com/klauspost/cpuid/README.md | 145 - vendor/github.com/klauspost/crc32/README.md | 87 - .../github.com/lafriks/xormstore/Gopkg.lock | 75 - .../github.com/lafriks/xormstore/Gopkg.toml | 50 - vendor/github.com/lafriks/xormstore/README.md | 48 - vendor/github.com/lafriks/xormstore/test | 70 - vendor/github.com/lib/pq/CONTRIBUTING.md | 29 - vendor/github.com/lib/pq/README.md | 105 - vendor/github.com/lib/pq/oid/gen.go | 93 + .../lunny/dingtalk_webhook/README.md | 18 - vendor/github.com/markbates/goth/README.md | 141 - vendor/github.com/mattn/go-sqlite3/README.md | 97 - .../github.com/mcuadros/go-version/README.md | 80 - .../microcosm-cc/bluemonday/CONTRIBUTING.md | 47 - .../microcosm-cc/bluemonday/CREDITS.md | 6 - .../microcosm-cc/bluemonday/Makefile | 42 - .../microcosm-cc/bluemonday/README.md | 346 -- .../github.com/mrjones/oauth/MIT-LICENSE.txt | 7 - vendor/github.com/mrjones/oauth/README.md | 51 - vendor/github.com/mrjones/oauth/pre-commit.sh | 21 - vendor/github.com/mschoch/smat/README.md | 166 - vendor/github.com/msteinert/pam/README.md | 30 - vendor/github.com/nfnt/resize/README.md | 149 - vendor/github.com/ngaut/log/README.md | 2 - vendor/github.com/ngaut/zkhelper/README.md | 4 - vendor/github.com/petar/GoLLRB/AUTHORS | 4 + vendor/github.com/philhofer/fwd/README.md | 315 -- .../philhofer/fwd/writer_appengine.go | 5 + vendor/github.com/pingcap/go-hbase/README.md | 14 - vendor/github.com/pingcap/go-themis/README.md | 30 - .../github.com/pingcap/tidb/CONTRIBUTING.md | 65 - vendor/github.com/pingcap/tidb/Dockerfile | 15 - .../src/github.com/boltdb/bolt/LICENSE | 20 + .../github.com/go-sql-driver/mysql/AUTHORS | 44 + .../github.com/go-sql-driver/mysql/LICENSE | 373 ++ .../src/github.com/golang/snappy/AUTHORS | 14 + .../src/github.com/golang/snappy/CONTRIBUTORS | 36 + .../src/github.com/golang/snappy/LICENSE} | 9 +- .../src/github.com/juju/errors/LICENSE | 191 + .../src/github.com/ngaut/log/LICENSE | 165 + .../src/github.com/peterh/liner/COPYING | 21 + .../github.com/rcrowley/go-metrics/LICENSE | 29 + .../src/github.com/twinj/uuid/LICENSE | 20 + .../github.com/pingcap/tidb/LICENSES/LICENSE | 201 + vendor/github.com/pingcap/tidb/Makefile | 138 - vendor/github.com/pingcap/tidb/README.md | 62 - vendor/github.com/pingcap/tidb/gitcookie.sh | 9 - vendor/github.com/pingcap/tidb/make.cmd | 32 - .../github.com/pingcap/tidb/parser/parser.y | 4688 ----------------- .../github.com/pingcap/tidb/parser/scanner.l | 1259 ----- vendor/github.com/pquerna/otp/README.md | 60 - .../github.com/russross/blackfriday/README.md | 363 -- vendor/github.com/satori/go.uuid/README.md | 65 - .../go-diff/diffmatchpatch/speedtest1.txt | 230 - .../go-diff/diffmatchpatch/speedtest2.txt | 188 - .../shurcooL/sanitized_anchor_name/README.md | 34 - vendor/github.com/steveyen/gtreap/README.md | 90 - .../github.com/stretchr/testify/LICENCE.txt | 22 + .../testify/assert/assertion_format.go.tmpl | 4 - .../testify/assert/assertion_forward.go.tmpl | 4 - vendor/github.com/tstranex/u2f/README.md | 97 - vendor/github.com/twinj/uuid/README.md | 86 - vendor/github.com/ugorji/go/codec/README.md | 148 - .../ugorji/go/codec/fast-path.go.tmpl | 540 -- .../ugorji/go/codec/gen-dec-array.go.tmpl | 104 - .../ugorji/go/codec/gen-dec-map.go.tmpl | 58 - .../ugorji/go/codec/gen-helper.go.tmpl | 364 -- vendor/github.com/ugorji/go/codec/prebuild.sh | 199 - .../ugorji/go/codec/test-cbor-goldens.json | 639 --- vendor/github.com/ugorji/go/codec/test.py | 126 - vendor/github.com/ugorji/go/codec/tests.sh | 80 - vendor/github.com/urfave/cli/CHANGELOG.md | 336 -- vendor/github.com/urfave/cli/README.md | 1364 ----- vendor/github.com/urfave/cli/appveyor.yml | 24 - vendor/github.com/urfave/cli/flag-types.json | 93 - .../github.com/urfave/cli/generate-flag-types | 248 - vendor/github.com/urfave/cli/runtests | 122 - vendor/github.com/willf/bitset/Makefile | 197 - vendor/github.com/willf/bitset/README.md | 96 - vendor/github.com/willf/bitset/VERSION | 1 - vendor/github.com/yohcop/openid-go/README.md | 38 - .../yohcop/openid-go/html_discovery.go | 2 - vendor/golang.org/x/crypto/AUTHORS | 3 + vendor/golang.org/x/crypto/CONTRIBUTORS | 3 + vendor/golang.org/x/net/AUTHORS | 3 + vendor/golang.org/x/net/CONTRIBUTORS | 3 + vendor/golang.org/x/oauth2/CONTRIBUTING.md | 31 - vendor/golang.org/x/oauth2/README.md | 65 - vendor/golang.org/x/oauth2/internal/token.go | 2 - vendor/golang.org/x/sync/AUTHORS | 3 + vendor/golang.org/x/sync/CONTRIBUTORS | 3 + vendor/golang.org/x/sys/AUTHORS | 3 + vendor/golang.org/x/sys/CONTRIBUTORS | 3 + vendor/golang.org/x/sys/unix/mkall.sh | 285 - vendor/golang.org/x/sys/unix/mkerrors.sh | 476 -- vendor/golang.org/x/sys/unix/mksyscall.pl | 323 -- .../x/sys/unix/mksyscall_solaris.pl | 294 -- .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 264 - .../golang.org/x/sys/unix/mksysnum_darwin.pl | 39 - .../x/sys/unix/mksysnum_dragonfly.pl | 50 - .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 63 - .../golang.org/x/sys/unix/mksysnum_linux.pl | 58 - .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 - .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 - vendor/golang.org/x/text/AUTHORS | 3 + vendor/golang.org/x/text/CONTRIBUTORS | 3 + .../x/text/encoding/charmap/maketables.go | 556 ++ .../x/text/encoding/htmlindex/gen.go | 170 + .../text/encoding/internal/identifier/gen.go | 137 + .../x/text/encoding/japanese/maketables.go | 161 + .../x/text/encoding/korean/maketables.go | 143 + .../encoding/simplifiedchinese/maketables.go | 161 + .../encoding/traditionalchinese/maketables.go | 140 + vendor/golang.org/x/text/internal/gen/code.go | 351 ++ vendor/golang.org/x/text/internal/gen/gen.go | 281 + .../x/text/internal/triegen/compact.go | 58 + .../x/text/internal/triegen/print.go | 251 + .../x/text/internal/triegen/triegen.go | 494 ++ vendor/golang.org/x/text/internal/ucd/ucd.go | 376 ++ vendor/golang.org/x/text/language/Makefile | 16 - .../golang.org/x/text/language/gen_common.go | 20 + .../golang.org/x/text/language/gen_index.go | 162 + .../golang.org/x/text/language/maketables.go | 1699 ++++++ vendor/golang.org/x/text/unicode/cldr/base.go | 100 + vendor/golang.org/x/text/unicode/cldr/cldr.go | 130 + .../golang.org/x/text/unicode/cldr/collate.go | 359 ++ .../golang.org/x/text/unicode/cldr/decode.go | 171 + .../golang.org/x/text/unicode/cldr/makexml.go | 400 ++ .../golang.org/x/text/unicode/cldr/resolve.go | 602 +++ .../golang.org/x/text/unicode/cldr/slice.go | 144 + vendor/golang.org/x/text/unicode/cldr/xml.go | 1487 ++++++ .../x/text/unicode/norm/maketables.go | 976 ++++ .../golang.org/x/text/unicode/norm/triegen.go | 117 + .../alexcesaro/quotedprintable.v3/README.md | 16 - vendor/gopkg.in/asn1-ber.v1/README.md | 24 - vendor/gopkg.in/bufio.v1/Makefile | 2 - vendor/gopkg.in/bufio.v1/README.md | 4 - .../editorconfig-core-go.v1/README.md | 121 - vendor/gopkg.in/gomail.v2/CHANGELOG.md | 20 - vendor/gopkg.in/gomail.v2/CONTRIBUTING.md | 20 - vendor/gopkg.in/gomail.v2/README.md | 92 - vendor/gopkg.in/ini.v1/Makefile | 15 - vendor/gopkg.in/ini.v1/README.md | 763 --- vendor/gopkg.in/ini.v1/README_ZH.md | 750 --- vendor/gopkg.in/ldap.v2/Makefile | 42 - vendor/gopkg.in/ldap.v2/README.md | 53 - vendor/gopkg.in/macaron.v1/README.md | 93 - vendor/gopkg.in/macaron.v1/fixtures/symlink | 1 + vendor/gopkg.in/macaron.v1/macaronlogo.png | Bin 88924 -> 0 bytes vendor/gopkg.in/redis.v2/Makefile | 3 - vendor/gopkg.in/redis.v2/README.md | 46 - vendor/gopkg.in/testfixtures.v2/README.md | 323 -- vendor/gopkg.in/yaml.v2/README.md | 131 - .../projects/go/libravatar/README.md | 25 - vendor/vendor.json | 1668 ------ 281 files changed, 12024 insertions(+), 32676 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml delete mode 100644 vendor/code.gitea.io/git/CONTRIBUTING.md delete mode 100644 vendor/code.gitea.io/git/DCO delete mode 100644 vendor/code.gitea.io/git/MAINTAINERS delete mode 100644 vendor/code.gitea.io/git/Makefile delete mode 100644 vendor/code.gitea.io/git/README.md delete mode 100644 vendor/github.com/PuerkitoBio/goquery/README.md delete mode 100644 vendor/github.com/RoaringBitmap/roaring/Makefile delete mode 100644 vendor/github.com/RoaringBitmap/roaring/README.md delete mode 100644 vendor/github.com/Smerity/govarint/README.md delete mode 100644 vendor/github.com/Unknwon/cae/README.md delete mode 100644 vendor/github.com/Unknwon/cae/README_ZH.md create mode 120000 vendor/github.com/Unknwon/cae/tz/testdata/test.lnk create mode 120000 vendor/github.com/Unknwon/cae/tz/testdata/testdir.lnk create mode 120000 vendor/github.com/Unknwon/cae/zip/testdata/test.lnk create mode 120000 vendor/github.com/Unknwon/cae/zip/testdata/testdir.lnk delete mode 100644 vendor/github.com/Unknwon/com/README.md delete mode 100644 vendor/github.com/Unknwon/i18n/Makefile delete mode 100644 vendor/github.com/Unknwon/i18n/README.md delete mode 100644 vendor/github.com/Unknwon/paginater/README.md delete mode 100644 vendor/github.com/andybalholm/cascadia/README.md delete mode 100644 vendor/github.com/blevesearch/bleve/CONTRIBUTING.md delete mode 100644 vendor/github.com/blevesearch/bleve/README.md delete mode 100644 vendor/github.com/blevesearch/bleve/analysis/test_words.txt delete mode 100644 vendor/github.com/blevesearch/bleve/geo/README.md delete mode 100644 vendor/github.com/blevesearch/bleve/index/scorch/README.md delete mode 100644 vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/README.md delete mode 100755 vendor/github.com/blevesearch/bleve/index/upsidedown/benchmark_all.sh delete mode 100644 vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.proto delete mode 100644 vendor/github.com/blevesearch/bleve/search/facet/benchmark_data.txt delete mode 100644 vendor/github.com/blevesearch/bleve/search/query/query_string.y delete mode 100644 vendor/github.com/blevesearch/go-porterstemmer/README.md delete mode 100644 vendor/github.com/blevesearch/segment/README.md delete mode 100644 vendor/github.com/blevesearch/segment/segment_words.rl delete mode 100644 vendor/github.com/boltdb/bolt/Makefile delete mode 100644 vendor/github.com/boltdb/bolt/README.md delete mode 100644 vendor/github.com/boltdb/bolt/appveyor.yml delete mode 100644 vendor/github.com/boombuler/barcode/README.md delete mode 100644 vendor/github.com/chaseadamsio/goorgeous/README.org delete mode 100644 vendor/github.com/chaseadamsio/goorgeous/gopher.gif delete mode 100644 vendor/github.com/chaseadamsio/goorgeous/gopher_small.gif delete mode 100644 vendor/github.com/couchbase/vellum/CONTRIBUTING.md delete mode 100644 vendor/github.com/couchbase/vellum/README.md delete mode 100644 vendor/github.com/denisenkom/go-mssqldb/README.md delete mode 100644 vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md delete mode 100644 vendor/github.com/dgrijalva/jwt-go/README.md delete mode 100644 vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md delete mode 100644 vendor/github.com/edsrzf/mmap-go/README.md delete mode 100644 vendor/github.com/elazarl/go-bindata-assetfs/README.md delete mode 100644 vendor/github.com/ethantkoenig/rupture/Gopkg.lock delete mode 100644 vendor/github.com/ethantkoenig/rupture/Gopkg.toml delete mode 100644 vendor/github.com/ethantkoenig/rupture/README.md delete mode 100644 vendor/github.com/facebookgo/clock/README.md delete mode 100644 vendor/github.com/facebookgo/httpdown/readme.md delete mode 100644 vendor/github.com/facebookgo/stats/readme.md delete mode 100644 vendor/github.com/glycerine/go-unsnap-stream/README.md delete mode 100644 vendor/github.com/glycerine/go-unsnap-stream/binary.dat delete mode 100644 vendor/github.com/glycerine/go-unsnap-stream/binary.dat.snappy delete mode 100644 vendor/github.com/glycerine/go-unsnap-stream/unenc.txt delete mode 100644 vendor/github.com/glycerine/go-unsnap-stream/unenc.txt.snappy delete mode 100644 vendor/github.com/go-macaron/bindata/README.md delete mode 100644 vendor/github.com/go-macaron/binding/README.md delete mode 100644 vendor/github.com/go-macaron/cache/README.md delete mode 100644 vendor/github.com/go-macaron/cache/memcache/memcache.goconvey delete mode 100644 vendor/github.com/go-macaron/cache/redis/redis.goconvey delete mode 100644 vendor/github.com/go-macaron/captcha/README.md delete mode 100644 vendor/github.com/go-macaron/csrf/README.md delete mode 100644 vendor/github.com/go-macaron/gzip/README.md delete mode 100644 vendor/github.com/go-macaron/i18n/README.md delete mode 100644 vendor/github.com/go-macaron/inject/README.md delete mode 100644 vendor/github.com/go-macaron/session/README.md delete mode 100644 vendor/github.com/go-macaron/session/redis/redis.goconvey delete mode 100644 vendor/github.com/go-macaron/toolbox/README.md delete mode 100644 vendor/github.com/go-sql-driver/mysql/CHANGELOG.md delete mode 100644 vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-sql-driver/mysql/ISSUE_TEMPLATE.md delete mode 100644 vendor/github.com/go-sql-driver/mysql/PULL_REQUEST_TEMPLATE.md delete mode 100644 vendor/github.com/go-sql-driver/mysql/README.md delete mode 100644 vendor/github.com/go-xorm/builder/README.md delete mode 100644 vendor/github.com/go-xorm/builder/circle.yml delete mode 100644 vendor/github.com/go-xorm/core/README.md delete mode 100755 vendor/github.com/go-xorm/core/benchmark.sh delete mode 100644 vendor/github.com/go-xorm/core/circle.yml delete mode 100644 vendor/github.com/go-xorm/tidb/README.md delete mode 100644 vendor/github.com/go-xorm/xorm/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-xorm/xorm/README.md delete mode 100644 vendor/github.com/go-xorm/xorm/README_CN.md delete mode 100644 vendor/github.com/go-xorm/xorm/circle.yml delete mode 100755 vendor/github.com/go-xorm/xorm/gen_reserved.sh delete mode 100644 vendor/github.com/go-xorm/xorm/pg_reserved.txt delete mode 100755 vendor/github.com/go-xorm/xorm/test_mssql.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_mssql_cache.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_mymysql.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_mymysql_cache.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_mysql.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_mysql_cache.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_postgres.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_postgres_cache.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_sqlite.sh delete mode 100755 vendor/github.com/go-xorm/xorm/test_sqlite_cache.sh delete mode 100644 vendor/github.com/gogits/chardet/README.md delete mode 100644 vendor/github.com/gogits/chardet/icu-license.html delete mode 100644 vendor/github.com/gogits/cron/README.md create mode 100644 vendor/github.com/golang/protobuf/AUTHORS create mode 100644 vendor/github.com/golang/protobuf/CONTRIBUTORS delete mode 100644 vendor/github.com/golang/protobuf/proto/Makefile delete mode 100644 vendor/github.com/golang/snappy/README delete mode 100644 vendor/github.com/gorilla/context/README.md delete mode 100644 vendor/github.com/gorilla/mux/README.md delete mode 100644 vendor/github.com/gorilla/securecookie/README.md delete mode 100644 vendor/github.com/gorilla/sessions/README.md delete mode 100644 vendor/github.com/issue9/identicon/README.md delete mode 100644 vendor/github.com/jaytaylor/html2text/README.md delete mode 100644 vendor/github.com/juju/errors/Makefile delete mode 100644 vendor/github.com/juju/errors/README.md delete mode 100644 vendor/github.com/kballard/go-shellquote/README create mode 100644 vendor/github.com/keybase/go-crypto/AUTHORS create mode 100644 vendor/github.com/keybase/go-crypto/CONTRIBUTORS delete mode 100644 vendor/github.com/keybase/go-crypto/openpgp/patch.sh delete mode 100644 vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch create mode 100644 vendor/github.com/klauspost/compress/snappy/AUTHORS create mode 100644 vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS rename vendor/github.com/{ngaut/sync2/vitess_license => klauspost/compress/snappy/LICENSE} (81%) delete mode 100644 vendor/github.com/klauspost/cpuid/README.md delete mode 100644 vendor/github.com/klauspost/crc32/README.md delete mode 100644 vendor/github.com/lafriks/xormstore/Gopkg.lock delete mode 100644 vendor/github.com/lafriks/xormstore/Gopkg.toml delete mode 100644 vendor/github.com/lafriks/xormstore/README.md delete mode 100755 vendor/github.com/lafriks/xormstore/test delete mode 100644 vendor/github.com/lib/pq/CONTRIBUTING.md delete mode 100644 vendor/github.com/lib/pq/README.md create mode 100644 vendor/github.com/lib/pq/oid/gen.go delete mode 100644 vendor/github.com/lunny/dingtalk_webhook/README.md delete mode 100644 vendor/github.com/markbates/goth/README.md delete mode 100644 vendor/github.com/mattn/go-sqlite3/README.md delete mode 100644 vendor/github.com/mcuadros/go-version/README.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/CREDITS.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/Makefile delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/README.md delete mode 100644 vendor/github.com/mrjones/oauth/MIT-LICENSE.txt delete mode 100644 vendor/github.com/mrjones/oauth/README.md delete mode 100755 vendor/github.com/mrjones/oauth/pre-commit.sh delete mode 100644 vendor/github.com/mschoch/smat/README.md delete mode 100644 vendor/github.com/msteinert/pam/README.md delete mode 100644 vendor/github.com/nfnt/resize/README.md delete mode 100644 vendor/github.com/ngaut/log/README.md delete mode 100644 vendor/github.com/ngaut/zkhelper/README.md create mode 100644 vendor/github.com/petar/GoLLRB/AUTHORS delete mode 100644 vendor/github.com/philhofer/fwd/README.md create mode 100644 vendor/github.com/philhofer/fwd/writer_appengine.go delete mode 100644 vendor/github.com/pingcap/go-hbase/README.md delete mode 100644 vendor/github.com/pingcap/go-themis/README.md delete mode 100644 vendor/github.com/pingcap/tidb/CONTRIBUTING.md delete mode 100644 vendor/github.com/pingcap/tidb/Dockerfile create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/go-sql-driver/mysql/AUTHORS create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/go-sql-driver/mysql/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/golang/snappy/AUTHORS create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/golang/snappy/CONTRIBUTORS rename vendor/github.com/{ngaut/pools/vitess_license => pingcap/tidb/Godeps/_workspace/src/github.com/golang/snappy/LICENSE} (83%) create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/juju/errors/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/ngaut/log/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/peterh/liner/COPYING create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/rcrowley/go-metrics/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/Godeps/_workspace/src/github.com/twinj/uuid/LICENSE create mode 100644 vendor/github.com/pingcap/tidb/LICENSES/LICENSE delete mode 100644 vendor/github.com/pingcap/tidb/Makefile delete mode 100644 vendor/github.com/pingcap/tidb/README.md delete mode 100644 vendor/github.com/pingcap/tidb/gitcookie.sh delete mode 100644 vendor/github.com/pingcap/tidb/make.cmd delete mode 100644 vendor/github.com/pingcap/tidb/parser/parser.y delete mode 100644 vendor/github.com/pingcap/tidb/parser/scanner.l delete mode 100644 vendor/github.com/pquerna/otp/README.md delete mode 100644 vendor/github.com/russross/blackfriday/README.md delete mode 100644 vendor/github.com/satori/go.uuid/README.md delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/speedtest1.txt delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/speedtest2.txt delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/README.md delete mode 100644 vendor/github.com/steveyen/gtreap/README.md create mode 100644 vendor/github.com/stretchr/testify/LICENCE.txt delete mode 100644 vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl delete mode 100644 vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl delete mode 100644 vendor/github.com/tstranex/u2f/README.md delete mode 100644 vendor/github.com/twinj/uuid/README.md delete mode 100644 vendor/github.com/ugorji/go/codec/README.md delete mode 100644 vendor/github.com/ugorji/go/codec/fast-path.go.tmpl delete mode 100644 vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl delete mode 100644 vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl delete mode 100644 vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl delete mode 100755 vendor/github.com/ugorji/go/codec/prebuild.sh delete mode 100644 vendor/github.com/ugorji/go/codec/test-cbor-goldens.json delete mode 100755 vendor/github.com/ugorji/go/codec/test.py delete mode 100755 vendor/github.com/ugorji/go/codec/tests.sh delete mode 100644 vendor/github.com/urfave/cli/CHANGELOG.md delete mode 100644 vendor/github.com/urfave/cli/README.md delete mode 100644 vendor/github.com/urfave/cli/appveyor.yml delete mode 100644 vendor/github.com/urfave/cli/flag-types.json delete mode 100755 vendor/github.com/urfave/cli/generate-flag-types delete mode 100755 vendor/github.com/urfave/cli/runtests delete mode 100644 vendor/github.com/willf/bitset/Makefile delete mode 100644 vendor/github.com/willf/bitset/README.md delete mode 100644 vendor/github.com/willf/bitset/VERSION delete mode 100644 vendor/github.com/yohcop/openid-go/README.md create mode 100644 vendor/golang.org/x/crypto/AUTHORS create mode 100644 vendor/golang.org/x/crypto/CONTRIBUTORS create mode 100644 vendor/golang.org/x/net/AUTHORS create mode 100644 vendor/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/oauth2/CONTRIBUTING.md delete mode 100644 vendor/golang.org/x/oauth2/README.md create mode 100644 vendor/golang.org/x/sync/AUTHORS create mode 100644 vendor/golang.org/x/sync/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/AUTHORS create mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS delete mode 100755 vendor/golang.org/x/sys/unix/mkall.sh delete mode 100755 vendor/golang.org/x/sys/unix/mkerrors.sh delete mode 100755 vendor/golang.org/x/sys/unix/mksyscall.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksyscall_solaris.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_darwin.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_linux.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl delete mode 100755 vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl create mode 100644 vendor/golang.org/x/text/AUTHORS create mode 100644 vendor/golang.org/x/text/CONTRIBUTORS create mode 100644 vendor/golang.org/x/text/encoding/charmap/maketables.go create mode 100644 vendor/golang.org/x/text/encoding/htmlindex/gen.go create mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/gen.go create mode 100644 vendor/golang.org/x/text/encoding/japanese/maketables.go create mode 100644 vendor/golang.org/x/text/encoding/korean/maketables.go create mode 100644 vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go create mode 100644 vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go create mode 100644 vendor/golang.org/x/text/internal/gen/code.go create mode 100644 vendor/golang.org/x/text/internal/gen/gen.go create mode 100644 vendor/golang.org/x/text/internal/triegen/compact.go create mode 100644 vendor/golang.org/x/text/internal/triegen/print.go create mode 100644 vendor/golang.org/x/text/internal/triegen/triegen.go create mode 100644 vendor/golang.org/x/text/internal/ucd/ucd.go delete mode 100644 vendor/golang.org/x/text/language/Makefile create mode 100644 vendor/golang.org/x/text/language/gen_common.go create mode 100644 vendor/golang.org/x/text/language/gen_index.go create mode 100644 vendor/golang.org/x/text/language/maketables.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/base.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/cldr.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/collate.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/decode.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/makexml.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/resolve.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/slice.go create mode 100644 vendor/golang.org/x/text/unicode/cldr/xml.go create mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go create mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go delete mode 100644 vendor/gopkg.in/alexcesaro/quotedprintable.v3/README.md delete mode 100644 vendor/gopkg.in/asn1-ber.v1/README.md delete mode 100644 vendor/gopkg.in/bufio.v1/Makefile delete mode 100644 vendor/gopkg.in/bufio.v1/README.md delete mode 100644 vendor/gopkg.in/editorconfig/editorconfig-core-go.v1/README.md delete mode 100644 vendor/gopkg.in/gomail.v2/CHANGELOG.md delete mode 100644 vendor/gopkg.in/gomail.v2/CONTRIBUTING.md delete mode 100644 vendor/gopkg.in/gomail.v2/README.md delete mode 100644 vendor/gopkg.in/ini.v1/Makefile delete mode 100644 vendor/gopkg.in/ini.v1/README.md delete mode 100644 vendor/gopkg.in/ini.v1/README_ZH.md delete mode 100644 vendor/gopkg.in/ldap.v2/Makefile delete mode 100644 vendor/gopkg.in/ldap.v2/README.md delete mode 100644 vendor/gopkg.in/macaron.v1/README.md create mode 120000 vendor/gopkg.in/macaron.v1/fixtures/symlink delete mode 100644 vendor/gopkg.in/macaron.v1/macaronlogo.png delete mode 100644 vendor/gopkg.in/redis.v2/Makefile delete mode 100644 vendor/gopkg.in/redis.v2/README.md delete mode 100644 vendor/gopkg.in/testfixtures.v2/README.md delete mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/strk.kbt.io/projects/go/libravatar/README.md delete mode 100644 vendor/vendor.json diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000000..147b63fdda --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,875 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "code.gitea.io/git" + packages = ["."] + revision = "0077debc17a58c821f4e62e815a54c1ab52da157" + +[[projects]] + branch = "master" + name = "code.gitea.io/sdk" + packages = ["gitea"] + revision = "b2308e3f700875a3642a78bd3f6e5db8ef6f974d" + +[[projects]] + name = "github.com/PuerkitoBio/goquery" + packages = ["."] + revision = "ed7d758e9a34ba1f55e8084e0d731448b46921a8" + +[[projects]] + name = "github.com/RoaringBitmap/roaring" + packages = ["."] + revision = "1a28a7fa985680f9f4e1644c0a857ec359a444b0" + version = "v0.4.7" + +[[projects]] + branch = "master" + name = "github.com/Smerity/govarint" + packages = ["."] + revision = "7265e41f48f15fd61751e16da866af3c704bb3ab" + +[[projects]] + branch = "master" + name = "github.com/Unknwon/cae" + packages = [ + ".", + "zip" + ] + revision = "c6aac99ea2cae2ebaf23f26f76b04fe3fcfc9f8c" + +[[projects]] + branch = "master" + name = "github.com/Unknwon/com" + packages = ["."] + revision = "7677a1d7c1137cd3dd5ba7a076d0c898a1ef4520" + +[[projects]] + branch = "master" + name = "github.com/Unknwon/i18n" + packages = ["."] + revision = "b64d336589669d317928070e70ba0ae558f16633" + +[[projects]] + name = "github.com/Unknwon/paginater" + packages = ["."] + revision = "7748a72e01415173a27d79866b984328e7b0c12b" + +[[projects]] + name = "github.com/andybalholm/cascadia" + packages = ["."] + revision = "349dd0209470eabd9514242c688c403c0926d266" + +[[projects]] + name = "github.com/blevesearch/bleve" + packages = [ + ".", + "analysis", + "analysis/analyzer/custom", + "analysis/analyzer/standard", + "analysis/datetime/flexible", + "analysis/datetime/optional", + "analysis/lang/en", + "analysis/token/camelcase", + "analysis/token/lowercase", + "analysis/token/porter", + "analysis/token/stop", + "analysis/token/unicodenorm", + "analysis/token/unique", + "analysis/tokenizer/unicode", + "document", + "geo", + "index", + "index/scorch", + "index/scorch/mergeplan", + "index/scorch/segment", + "index/scorch/segment/mem", + "index/scorch/segment/zap", + "index/store", + "index/store/boltdb", + "index/store/gtreap", + "index/upsidedown", + "mapping", + "numeric", + "registry", + "search", + "search/collector", + "search/facet", + "search/highlight", + "search/highlight/format/html", + "search/highlight/fragmenter/simple", + "search/highlight/highlighter/html", + "search/highlight/highlighter/simple", + "search/query", + "search/scorer", + "search/searcher" + ] + revision = "ff210fbc6d348ad67aa5754eaea11a463fcddafd" + +[[projects]] + branch = "master" + name = "github.com/blevesearch/go-porterstemmer" + packages = ["."] + revision = "23a2c8e5cf1f380f27722c6d2ae8896431dc7d0e" + +[[projects]] + name = "github.com/blevesearch/segment" + packages = ["."] + revision = "db70c57796cc8c310613541dfade3dce627d09c7" + +[[projects]] + name = "github.com/boltdb/bolt" + packages = ["."] + revision = "ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7" + source = "github.com/go-gitea/bolt" + +[[projects]] + name = "github.com/boombuler/barcode" + packages = [ + ".", + "qr", + "utils" + ] + revision = "fe0f26ff6d26693948ee8189aa064ee8c54141fa" + +[[projects]] + name = "github.com/bradfitz/gomemcache" + packages = ["memcache"] + revision = "fb1f79c6b65acda83063cbc69f6bba1522558bfc" + +[[projects]] + name = "github.com/chaseadamsio/goorgeous" + packages = ["."] + revision = "098da33fde5f9220736531b3cb26a2dec86a8367" + +[[projects]] + name = "github.com/coreos/etcd" + packages = ["error"] + revision = "01c303113d0a3d5a8075864321c3aedb72035bdd" + +[[projects]] + branch = "master" + name = "github.com/coreos/go-etcd" + packages = ["etcd"] + revision = "003851be7bb0694fe3cc457a49529a19388ee7cf" + +[[projects]] + branch = "master" + name = "github.com/couchbase/vellum" + packages = [ + ".", + "regexp", + "utf8" + ] + revision = "eb6ae3743b3f300f2136f83ca78c08cc071edbd4" + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "ecdeabc65495df2dec95d7c4a4c3e021903035e5" + +[[projects]] + name = "github.com/denisenkom/go-mssqldb" + packages = ["."] + revision = "e32ca5036449b7ea12c62ed761ea1ad7fc88a4e2" + +[[projects]] + name = "github.com/dgrijalva/jwt-go" + packages = ["."] + revision = "9ed569b5d1ac936e6494082958d63a6aa4fff99a" + +[[projects]] + branch = "master" + name = "github.com/edsrzf/mmap-go" + packages = ["."] + revision = "0bce6a6887123b67a60366d2c9fe2dfb74289d2e" + +[[projects]] + name = "github.com/elazarl/go-bindata-assetfs" + packages = ["."] + revision = "57eb5e1fc594ad4b0b1dbea7b286d299e0cb43c2" + +[[projects]] + name = "github.com/ethantkoenig/rupture" + packages = ["."] + revision = "0a76f03a811abcca2e6357329b673e9bb8ef9643" + +[[projects]] + branch = "master" + name = "github.com/facebookgo/clock" + packages = ["."] + revision = "600d898af40aa09a7a93ecb9265d87b0504b6f03" + +[[projects]] + name = "github.com/facebookgo/grace" + packages = [ + "gracehttp", + "gracenet" + ] + revision = "5729e484473f52048578af1b80d0008c7024089b" + +[[projects]] + branch = "master" + name = "github.com/facebookgo/httpdown" + packages = ["."] + revision = "a3b1354551a26449fbe05f5d855937f6e7acbd71" + +[[projects]] + branch = "master" + name = "github.com/facebookgo/stats" + packages = ["."] + revision = "1b76add642e42c6ffba7211ad7b3939ce654526e" + +[[projects]] + branch = "master" + name = "github.com/glycerine/go-unsnap-stream" + packages = ["."] + revision = "9f0cb55181dd3a0a4c168d3dbc72d4aca4853126" + +[[projects]] + branch = "master" + name = "github.com/go-macaron/bindata" + packages = ["."] + revision = "85786f57eee3e5544a9cc24fa2afe425b97a8652" + +[[projects]] + name = "github.com/go-macaron/binding" + packages = ["."] + revision = "9440f336b443056c90d7d448a0a55ad8c7599880" + +[[projects]] + branch = "master" + name = "github.com/go-macaron/cache" + packages = [ + ".", + "memcache", + "redis" + ] + revision = "56173531277692bc2925924d51fda1cd0a6b8178" + +[[projects]] + name = "github.com/go-macaron/captcha" + packages = ["."] + revision = "8aa5919789ab301e865595eb4b1114d6b9847deb" + +[[projects]] + name = "github.com/go-macaron/csrf" + packages = ["."] + revision = "6a9a7df172cc1fcd81e4585f44b09200b6087cc0" + +[[projects]] + branch = "master" + name = "github.com/go-macaron/gzip" + packages = ["."] + revision = "cad1c6580a07c56f5f6bc52d66002a05985c5854" + +[[projects]] + branch = "master" + name = "github.com/go-macaron/i18n" + packages = ["."] + revision = "ef57533c3b0fc2d8581deda14937e52f11a203ab" + +[[projects]] + branch = "master" + name = "github.com/go-macaron/inject" + packages = ["."] + revision = "d8a0b8677191f4380287cfebd08e462217bac7ad" + +[[projects]] + name = "github.com/go-macaron/session" + packages = [ + ".", + "redis" + ] + revision = "66031fcb37a0fff002a1f028eb0b3a815c78306b" + +[[projects]] + name = "github.com/go-macaron/toolbox" + packages = ["."] + revision = "99a42f20e9e88daec5c0d7beb4e7eac134680ab0" + +[[projects]] + name = "github.com/go-sql-driver/mysql" + packages = ["."] + revision = "ce924a41eea897745442daaa1739089b0f3f561d" + +[[projects]] + name = "github.com/go-xorm/builder" + packages = ["."] + revision = "488224409dd8aa2ce7a5baf8d10d55764a913738" + +[[projects]] + name = "github.com/go-xorm/core" + packages = ["."] + revision = "cb1d0ca71f42d3ee1bf4aba7daa16099bc31a7e9" + +[[projects]] + name = "github.com/go-xorm/tidb" + packages = ["."] + revision = "21e49190ce47a766fa741cf7edc831a30c12c6ac" + +[[projects]] + name = "github.com/go-xorm/xorm" + packages = ["."] + revision = "d4149d1eee0c2c488a74a5863fd9caf13d60fd03" + +[[projects]] + branch = "master" + name = "github.com/gogits/chardet" + packages = ["."] + revision = "2404f777256163ea3eadb273dada5dcb037993c0" + +[[projects]] + name = "github.com/gogits/cron" + packages = ["."] + revision = "7f3990acf1833faa5ebd0e86f0a4c72a4b5eba3c" + +[[projects]] + name = "github.com/golang/protobuf" + packages = ["proto"] + revision = "99511271042a09d1e01baea8781caa5210fec66e" + +[[projects]] + name = "github.com/golang/snappy" + packages = ["."] + revision = "5f1c01d9f64b941dd9582c638279d046eda6ca31" + +[[projects]] + name = "github.com/gorilla/context" + packages = ["."] + revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" + version = "v1.1.1" + +[[projects]] + name = "github.com/gorilla/mux" + packages = ["."] + revision = "757bef944d0f21880861c2dd9c871ca543023cba" + +[[projects]] + name = "github.com/gorilla/securecookie" + packages = ["."] + revision = "e59506cc896acb7f7bf732d4fdf5e25f7ccd8983" + version = "v1.1.1" + +[[projects]] + name = "github.com/gorilla/sessions" + packages = ["."] + revision = "ca9ada44574153444b00d3fd9c8559e4cc95f896" + version = "v1.1" + +[[projects]] + name = "github.com/issue9/identicon" + packages = ["."] + revision = "d36b54562f4cf70c83653e13dc95c220c79ef521" + +[[projects]] + name = "github.com/jaytaylor/html2text" + packages = ["."] + revision = "8fb95d837f7d6db1913fecfd7bcc5333e6499596" + +[[projects]] + name = "github.com/juju/errors" + packages = ["."] + revision = "b2c7a7da5b2995941048f60146e67702a292e468" + +[[projects]] + name = "github.com/kballard/go-shellquote" + packages = ["."] + revision = "cd60e84ee657ff3dc51de0b4f55dd299a3e136f2" + +[[projects]] + name = "github.com/keybase/go-crypto" + packages = [ + "brainpool", + "cast5", + "curve25519", + "ed25519", + "ed25519/internal/edwards25519", + "openpgp", + "openpgp/armor", + "openpgp/ecdh", + "openpgp/elgamal", + "openpgp/errors", + "openpgp/packet", + "openpgp/s2k", + "rsa" + ] + revision = "00ac4db533f63ef97576cbc7b07939ff7daf7329" + +[[projects]] + name = "github.com/klauspost/compress" + packages = [ + "flate", + "gzip" + ] + revision = "8df558b6cb6f9b445f9586446cfe7223e7d8bd6b" + version = "v1.1" + +[[projects]] + name = "github.com/klauspost/cpuid" + packages = ["."] + revision = "09cded8978dc9e80714c4d85b0322337b0a1e5e0" + version = "v1.0" + +[[projects]] + name = "github.com/klauspost/crc32" + packages = ["."] + revision = "cb6bfca970f6908083f26f39a79009d608efd5cd" + version = "v1.1" + +[[projects]] + name = "github.com/lafriks/xormstore" + packages = [ + ".", + "util" + ] + revision = "9cab149ea91875cf056211bd6ef82379fce9cb67" + version = "v1.0.0" + +[[projects]] + name = "github.com/lib/pq" + packages = [ + ".", + "oid" + ] + revision = "456514e2defec52e0cd37f90ccf17ec8b28295e2" + +[[projects]] + branch = "master" + name = "github.com/lunny/dingtalk_webhook" + packages = ["."] + revision = "e3534c89ef969912856dfa39e56b09e58c5f5daf" + +[[projects]] + name = "github.com/markbates/goth" + packages = [ + ".", + "gothic", + "providers/bitbucket", + "providers/dropbox", + "providers/facebook", + "providers/github", + "providers/gitlab", + "providers/gplus", + "providers/openidConnect", + "providers/twitter" + ] + revision = "4933f155d89c3c52ab4ca545c6602cf4a1e87913" + version = "1.45.5" + +[[projects]] + name = "github.com/mattn/go-sqlite3" + packages = ["."] + revision = "acfa60124032040b9f5a9406f5a772ee16fe845e" + +[[projects]] + branch = "master" + name = "github.com/mcuadros/go-version" + packages = ["."] + revision = "88e56e02bea1c203c99222c365fa52a69996ccac" + +[[projects]] + name = "github.com/microcosm-cc/bluemonday" + packages = ["."] + revision = "f77f16ffc87a6a58814e64ae72d55f9c41374e6d" + +[[projects]] + name = "github.com/mrjones/oauth" + packages = ["."] + revision = "3f67d9c274355678b2f9844b08d643e2f9213340" + +[[projects]] + branch = "master" + name = "github.com/mschoch/smat" + packages = ["."] + revision = "90eadee771aeab36e8bf796039b8c261bebebe4f" + +[[projects]] + name = "github.com/msteinert/pam" + packages = ["."] + revision = "02ccfbfaf0cc627aa3aec8ef7ed5cfeec5b43f63" + +[[projects]] + name = "github.com/nfnt/resize" + packages = ["."] + revision = "891127d8d1b52734debe1b3c3d7e747502b6c366" + +[[projects]] + name = "github.com/ngaut/deadline" + packages = ["."] + revision = "fae8f9dfd7048de16575b9d4c255278e38c28a4f" + +[[projects]] + branch = "master" + name = "github.com/ngaut/go-zookeeper" + packages = ["zk"] + revision = "9c3719e318c7cfd072e41eb48cb71fcaa49d5e05" + +[[projects]] + name = "github.com/ngaut/log" + packages = ["."] + revision = "d2af3a61f64d093457fb23b25d20f4ce3cd551ce" + +[[projects]] + branch = "master" + name = "github.com/ngaut/pools" + packages = ["."] + revision = "b7bc8c42aac787667ba45adea78233f53f548443" + +[[projects]] + branch = "master" + name = "github.com/ngaut/sync2" + packages = ["."] + revision = "7a24ed77b2efb460c1468b7dc917821c66e80e55" + +[[projects]] + branch = "master" + name = "github.com/ngaut/tso" + packages = [ + "client", + "proto", + "util" + ] + revision = "118f6c141d58f1e72577ff61f43f649bf39355ee" + +[[projects]] + branch = "master" + name = "github.com/ngaut/zkhelper" + packages = ["."] + revision = "6738bdc138d469112c6687fbfcfe049ccabd6a0a" + +[[projects]] + branch = "master" + name = "github.com/petar/GoLLRB" + packages = ["llrb"] + revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" + +[[projects]] + name = "github.com/philhofer/fwd" + packages = ["."] + revision = "bb6d471dc95d4fe11e432687f8b70ff496cf3136" + version = "v1.0.0" + +[[projects]] + name = "github.com/pingcap/go-hbase" + packages = [ + ".", + "iohelper", + "proto" + ] + revision = "7a98d1fe4e9e115de8c77ae0e158c0d08732c550" + +[[projects]] + branch = "master" + name = "github.com/pingcap/go-themis" + packages = [ + ".", + "oracle", + "oracle/oracles" + ] + revision = "dbb996606c1d1fe8571fd9ac6da2254c76d2c5c9" + +[[projects]] + name = "github.com/pingcap/tidb" + packages = [ + ".", + "ast", + "column", + "context", + "ddl", + "domain", + "evaluator", + "executor", + "infoschema", + "inspectkv", + "kv", + "kv/memkv", + "meta", + "meta/autoid", + "model", + "mysql", + "optimizer", + "optimizer/plan", + "parser", + "parser/opcode", + "perfschema", + "privilege", + "privilege/privileges", + "sessionctx", + "sessionctx/autocommit", + "sessionctx/db", + "sessionctx/forupdate", + "sessionctx/variable", + "store/hbase", + "store/localstore", + "store/localstore/boltdb", + "store/localstore/engine", + "store/localstore/goleveldb", + "structure", + "table", + "table/tables", + "terror", + "util", + "util/bytes", + "util/charset", + "util/codec", + "util/distinct", + "util/hack", + "util/segmentmap", + "util/sqlexec", + "util/stringutil", + "util/types" + ] + revision = "33197485abe227dcb254644cf5081c9a3c281669" + +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + name = "github.com/pquerna/otp" + packages = [ + ".", + "hotp", + "totp" + ] + revision = "54653902c20e47f3417541d35435cb6d6162e28a" + +[[projects]] + branch = "master" + name = "github.com/russross/blackfriday" + packages = ["."] + revision = "11635eb403ff09dbc3a6b5a007ab5ab09151c229" + +[[projects]] + name = "github.com/satori/go.uuid" + packages = ["."] + revision = "b061729afc07e77a8aa4fad0a2fd840958f1942a" + +[[projects]] + name = "github.com/sergi/go-diff" + packages = ["diffmatchpatch"] + revision = "552b4e9bbdca9e5adafd95ee98c822fdd11b330b" + +[[projects]] + name = "github.com/shurcooL/sanitized_anchor_name" + packages = ["."] + revision = "1dba4b3954bc059efc3991ec364f9f9a35f597d2" + +[[projects]] + branch = "master" + name = "github.com/steveyen/gtreap" + packages = ["."] + revision = "0abe01ef9be25c4aedc174758ec2d917314d6d70" + +[[projects]] + name = "github.com/stretchr/testify" + packages = ["assert"] + revision = "2aa2c176b9dab406a6970f6a55f513e8a8c8b18f" + +[[projects]] + name = "github.com/syndtr/goleveldb" + packages = [ + "leveldb", + "leveldb/cache", + "leveldb/comparer", + "leveldb/errors", + "leveldb/filter", + "leveldb/iterator", + "leveldb/journal", + "leveldb/memdb", + "leveldb/opt", + "leveldb/storage", + "leveldb/table", + "leveldb/util" + ] + revision = "917f41c560270110ceb73c5b38be2a9127387071" + +[[projects]] + branch = "master" + name = "github.com/tinylib/msgp" + packages = ["msgp"] + revision = "c8cf64dff2009d53fa8f8a16df54d1cdfc64c4a7" + +[[projects]] + branch = "master" + name = "github.com/tstranex/u2f" + packages = ["."] + revision = "d21a03e0b1d9fc1df59ff54e7a513655c1748b0c" + +[[projects]] + name = "github.com/twinj/uuid" + packages = ["."] + revision = "89173bcdda19db0eb88aef1e1cb1cb2505561d31" + version = "0.10.0" + +[[projects]] + name = "github.com/ugorji/go" + packages = ["codec"] + revision = "c062049c1793b01a3cc3fe786108edabbaf7756b" + +[[projects]] + name = "github.com/urfave/cli" + packages = ["."] + revision = "d86a009f5e13f83df65d0d6cee9a2e3f1445f0da" + +[[projects]] + branch = "master" + name = "github.com/willf/bitset" + packages = ["."] + revision = "8ce1146b8621c95164efd9c8b1124cfa9b8afb4e" + +[[projects]] + name = "github.com/yohcop/openid-go" + packages = ["."] + revision = "2c050d2dae5345c417db301f11fda6fbf5ad0f0a" + +[[projects]] + name = "golang.org/x/crypto" + packages = [ + "curve25519", + "ed25519", + "ed25519/internal/edwards25519", + "md4", + "pbkdf2", + "ssh" + ] + revision = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94" + +[[projects]] + name = "golang.org/x/net" + packages = [ + "context", + "html", + "html/atom", + "html/charset" + ] + revision = "f2499483f923065a842d38eb4c7f1927e6fc6e6d" + +[[projects]] + name = "golang.org/x/oauth2" + packages = [ + ".", + "internal" + ] + revision = "c10ba270aa0bf8b8c1c986e103859c67a9103061" + +[[projects]] + name = "golang.org/x/sync" + packages = ["syncmap"] + revision = "5a06fca2c336a4b2b2fcb45702e8c47621b2aa2c" + +[[projects]] + name = "golang.org/x/sys" + packages = [ + "unix", + "windows", + "windows/svc" + ] + revision = "a646d33e2ee3172a661fc09bca23bb4889a41bc8" + +[[projects]] + name = "golang.org/x/text" + packages = [ + "encoding", + "encoding/charmap", + "encoding/htmlindex", + "encoding/internal", + "encoding/internal/identifier", + "encoding/japanese", + "encoding/korean", + "encoding/simplifiedchinese", + "encoding/traditionalchinese", + "encoding/unicode", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "internal/utf8internal", + "language", + "runes", + "transform", + "unicode/cldr", + "unicode/norm" + ] + revision = "2bf8f2a19ec09c670e931282edfe6567f6be21c9" + +[[projects]] + branch = "v3" + name = "gopkg.in/alexcesaro/quotedprintable.v3" + packages = ["."] + revision = "2caba252f4dc53eaf6b553000885530023f54623" + +[[projects]] + name = "gopkg.in/asn1-ber.v1" + packages = ["."] + revision = "4e86f4367175e39f69d9358a5f17b4dda270378d" + version = "v1.1" + +[[projects]] + name = "gopkg.in/bufio.v1" + packages = ["."] + revision = "567b2bfa514e796916c4747494d6ff5132a1dfce" + version = "v1" + +[[projects]] + name = "gopkg.in/editorconfig/editorconfig-core-go.v1" + packages = ["."] + revision = "a872f05c2e34b37b567401384d202aff11ba06d4" + version = "v1.2.0" + +[[projects]] + branch = "v2" + name = "gopkg.in/gomail.v2" + packages = ["."] + revision = "81ebce5c23dfd25c6c67194b37d3dd3f338c98b1" + +[[projects]] + name = "gopkg.in/ini.v1" + packages = ["."] + revision = "7e7da451323b6766da368f8a1e8ec9a88a16b4a0" + version = "v1.31.1" + +[[projects]] + name = "gopkg.in/ldap.v2" + packages = ["."] + revision = "d0a5ced67b4dc310b9158d63a2c6f9c5ec13f105" + version = "v2.4.1" + +[[projects]] + name = "gopkg.in/macaron.v1" + packages = ["."] + revision = "75f2e9b42e99652f0d82b28ccb73648f44615faa" + version = "v1.2.4" + +[[projects]] + name = "gopkg.in/redis.v2" + packages = ["."] + revision = "e6179049628164864e6e84e973cfb56335748dea" + version = "v2.3.2" + +[[projects]] + name = "gopkg.in/testfixtures.v2" + packages = ["."] + revision = "b9ef14dc461bf934d8df2dfc6f1f456be5664cca" + version = "v2.0.0" + +[[projects]] + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "a5b47d31c556af34a302ce5d659e6fea44d90de0" + +[[projects]] + name = "strk.kbt.io/projects/go/libravatar" + packages = ["."] + revision = "5eed7bff870ae19ef51c5773dbc8f3e9fcbd0982" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "036b8c882671cf8d2c5e2fdbe53b1bdfbd39f7ebd7765bd50276c7c4ecf16687" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000000..1019888c01 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,106 @@ + +ignored = ["google.golang.org/appengine*"] + +[prune] + go-tests = true + unused-packages = true + non-go = true + +[[constraint]] + branch = "master" + name = "code.gitea.io/git" + +[[constraint]] + branch = "master" + name = "code.gitea.io/sdk" + +[[constraint]] + revision = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94" + name = "golang.org/x/crypto" + +[[constraint]] + revision = "a646d33e2ee3172a661fc09bca23bb4889a41bc8" + name = "golang.org/x/sys" + +[[constraint]] + revision = "2bf8f2a19ec09c670e931282edfe6567f6be21c9" + name = "golang.org/x/text" + +[[constraint]] + revision = "f2499483f923065a842d38eb4c7f1927e6fc6e6d" + name = "golang.org/x/net" + +[[constraint]] + #version = "v1.0.0" + revision = "33197485abe227dcb254644cf5081c9a3c281669" + name = "github.com/pingcap/tidb" + +[[override]] + name = "github.com/go-xorm/xorm" + #version = "0.6.5" + revision = "d4149d1eee0c2c488a74a5863fd9caf13d60fd03" + +[[override]] + name = "github.com/gorilla/mux" + revision = "757bef944d0f21880861c2dd9c871ca543023cba" + +[[constraint]] + name = "github.com/gorilla/context" + version = "1.1.1" + +[[constraint]] + name = "github.com/lafriks/xormstore" + version = "1.0.0" + +[[constraint]] + branch = "master" + name = "github.com/lunny/dingtalk_webhook" + +[[constraint]] + name = "github.com/markbates/goth" + version = "1.45.5" + +[[constraint]] + branch = "master" + name = "github.com/mcuadros/go-version" + +[[constraint]] + branch = "master" + name = "github.com/russross/blackfriday" + +[[constraint]] + branch = "master" + name = "github.com/tstranex/u2f" + +[[constraint]] + name = "gopkg.in/editorconfig/editorconfig-core-go.v1" + version = "1.2.0" + +[[constraint]] + branch = "v2" + name = "gopkg.in/gomail.v2" + +[[constraint]] + name = "gopkg.in/ini.v1" + version = "1.31.1" + +[[constraint]] + name = "gopkg.in/ldap.v2" + version = "2.4.1" + +[[constraint]] + name = "gopkg.in/macaron.v1" + version = "1.2.4" + +[[constraint]] + name = "gopkg.in/testfixtures.v2" + version = "2.0.0" + +[[override]] + name = "github.com/boltdb/bolt" + revision = "ccd680d8c1a0179ac3d68f692b01e1a1589cbfc7" + source = "github.com/go-gitea/bolt" + +[[override]] + revision = "c10ba270aa0bf8b8c1c986e103859c67a9103061" + name = "golang.org/x/oauth2" diff --git a/Makefile b/Makefile index 9adba6a98a..85be7eee81 100644 --- a/Makefile +++ b/Makefile @@ -153,18 +153,22 @@ coverage: unit-test-coverage: for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; -.PHONY: test-vendor -test-vendor: - @hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) get -u github.com/kardianos/govendor; \ +.PHONY: vendor +vendor: + @hash dep > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ + $(GO) get -u github.com/golang/dep/cmd/dep; \ fi - govendor list +unused | tee "$(TMPDIR)/wc-gitea-unused" - [ $$(cat "$(TMPDIR)/wc-gitea-unused" | wc -l) -eq 0 ] || echo "Warning: /!\\ Some vendor are not used /!\\" + dep ensure -vendor-only - govendor list +outside | tee "$(TMPDIR)/wc-gitea-outside" - [ $$(cat "$(TMPDIR)/wc-gitea-outside" | wc -l) -eq 0 ] || exit 1 - - govendor status || exit 1 +.PHONY: test-vendor +test-vendor: vendor + @diff=$$(git diff vendor/); \ + if [ -n "$$diff" ]; then \ + echo "Please run 'make vendor' and commit the result:"; \ + echo "$${diff}"; \ + exit 1; \ + fi; +#TODO add dep status -missing when implemented .PHONY: test-sqlite test-sqlite: integrations.sqlite.test diff --git a/vendor/code.gitea.io/git/CONTRIBUTING.md b/vendor/code.gitea.io/git/CONTRIBUTING.md deleted file mode 100644 index 3ce81e0adc..0000000000 --- a/vendor/code.gitea.io/git/CONTRIBUTING.md +++ /dev/null @@ -1,86 +0,0 @@ -# Contribution Guidelines - -## Introduction - -This document explains how to contribute changes to the Gitea project. It assumes you have followed the [installation instructions](https://github.com/go-gitea/docs/tree/master/en-US/installation). Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io). - -## Bug reports - -Please search the issues on the issue tracker with a variety of keywords to ensure your bug is not already reported. - -If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new) and answer the questions so we can understand and reproduce the problematic behavior. - -To show us that the issue you are having is in Gitea itself, please write clear, concise instructions so we can reproduce the behavior (even if it seems obvious). The more detailed and specific you are, the faster we can fix the issue. Check out [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html). - -Please be kind, remember that Gitea comes at no cost to you, and you're getting free help. - -## Discuss your design - -The project welcomes submissions but please let everyone know what you're working on if you want to change or add something to the Gitea repositories. - -Before starting to write something new for the Gitea project, please [file an issue](https://github.com/go-gitea/gitea/issues/new). Significant changes must go through the [change proposal process](https://github.com/go-gitea/proposals) before they can be accepted. - -This process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside the goals for the project and tools. It also checks that the design is sound before code is written; the code review tool is not the place for high-level discussions. - -## Testing redux - -Before sending code out for review, run all the tests for the whole tree to make sure the changes don't break other usage and keep the compatibility on upgrade. To make sure you are running the test suite exactly like we do, you should install the CLI for [Drone CI](https://github.com/drone/drone), as we are using the server for continous testing, following [these instructions](http://readme.drone.io/0.5/install/cli/). After that you can simply call `drone exec` within your working directory and it will try to run the test suite locally. - -## Code review - -Changes to Gitea must be reviewed before they are accepted, no matter who makes the change even if it is an owner or a maintainer. We use GitHub's pull request workflow to do that and we also use [LGTM](http://lgtm.co) to ensure every PR is reviewed by at least 2 maintainers. - -Please try to make your pull request easy to review for us. Please read the "[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md)" guide, it has lots of useful tips for any project you may want to contribute. Some of the key points: - -* Make small pull requests. The smaller, the faster to review and the more likely it will be merged soon. -* Don't make changes unrelated to your PR. Maybe there are typos on some comments, maybe refactoring would be welcome on a function... but if that is not related to your PR, please make *another* PR for that. -* Split big pull requests into multiple small ones. An incremental change will be faster to review than a huge PR. - -## Sign your work - -The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: If you can certify [DCO](DCO), then you just add a line to every git commit message: - -``` -Signed-off-by: Joe Smith -``` - -Please use your real name, we really dislike pseudonyms or anonymous contributions. We are in the open-source world without secrets. If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. - -## Maintainers - -To make sure every PR is checked, we have [team maintainers](https://github.com/orgs/go-gitea/teams/maintainers). Every PR **MUST** be reviewed by at least two maintainers (or owners) before it can get merged. A maintainer should be a contributor of Gitea (or Gogs) and contributed at least 4 accepted PRs. A contributor should apply as a maintainer in the [Discord #develop channel](https://discord.gg/NsatcWJ). The owners or the team maintainers may invite the contributor. A maintainer should spend some time on code reviews. If a maintainer has no time to do that, they should apply to leave the maintainers team and we will give them the honor of being a member of the [advisors team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if an advisor has time to code review, we will gladly welcome them back to the maintainers team. If a maintainer is inactive for more than 3 months and forgets to leave the maintainers team, the owners may move him or her from the maintainers team to the advisors team. - -## Owners - -Since Gitea is a pure community organization without any company support, to keep the development healthy we will elect three owners every year. All contributors may vote to elect up to three candidates, one of which will be the main owner, and the other two the assistant owners. When the new owners have been elected, the old owners will give up ownership to the newly elected owners. If an owner is unable to do so, the other owners will assist in ceding ownership to the newly elected owners. - -After the election, the new owners should proactively agree with our [CONTRIBUTING](CONTRIBUTING.md) requirements on the [Discord #general channel](https://discord.gg/NsatcWJ). Below are the words to speak: - -``` -I'm honored to having been elected an owner of Gitea, I agree with [CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea and lead the development of Gitea. -``` - -To honor the past owners, here's the history of the owners and the time they served: - -* 2016-11-04 ~ 2017-12-31 - * [Lunny Xiao](https://github.com/lunny) - * [Thomas Boerger](https://github.com/tboerger) - * [Kim Carlbäcker](https://github.com/bkcsoft) - -## Versions - -Gitea has the `master` branch as a tip branch and has version branches such as `v0.9`. `v0.9` is a release branch and we will tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept pull requests on the `v0.9` branch and publish a `v0.9.1` tag, after bringing the bug fix also to the master branch. - -Since the `master` branch is a tip version, if you wish to use Gitea in production, please download the latest release tag version. All the branches will be protected via GitHub, all the PRs to every branch must be reviewed by two maintainers and must pass the automatic tests. - -## Copyright - -Code that you contribute should use the standard copyright header: - -``` -// Copyright 2017 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. -``` - -Files in the repository contain copyright from the year they are added to the year they are last changed. If the copyright author is changed, just paste the header below the old one. diff --git a/vendor/code.gitea.io/git/DCO b/vendor/code.gitea.io/git/DCO deleted file mode 100644 index 716561d5d2..0000000000 --- a/vendor/code.gitea.io/git/DCO +++ /dev/null @@ -1,36 +0,0 @@ -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/vendor/code.gitea.io/git/MAINTAINERS b/vendor/code.gitea.io/git/MAINTAINERS deleted file mode 100644 index 8c8a4947dd..0000000000 --- a/vendor/code.gitea.io/git/MAINTAINERS +++ /dev/null @@ -1,21 +0,0 @@ -Alexey Makhov (@makhov) -Andrey Nering (@andreynering) -Bo-Yi Wu (@appleboy) -Ethan Koenig (@ethantkoenig) -Kees de Vries (@Bwko) -Kim Carlbäcker (@bkcsoft) -LefsFlare (@LefsFlarey) -Lunny Xiao (@lunny) -Matthias Loibl (@metalmatze) -Morgan Bazalgette (@thehowl) -Rachid Zarouali (@xinity) -Rémy Boulanouar (@DblK) -Sandro Santilli (@strk) -Thibault Meyer (@0xbaadf00d) -Thomas Boerger (@tboerger) -Lauris Bukšis-Haberkorns (@lafriks) -Antoine Girard (@sapk) -Jonas Östanbäck (@cez81) -David Schneiderbauer (@daviian) -Peter Žeby (@morlinest) -Jonas Franz (@JonasFranzDEV) diff --git a/vendor/code.gitea.io/git/Makefile b/vendor/code.gitea.io/git/Makefile deleted file mode 100644 index 9aa6ebdcf5..0000000000 --- a/vendor/code.gitea.io/git/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -IMPORT := code.gitea.io/git - -PACKAGES ?= $(shell go list -e ./... | grep -v /vendor/ | grep -v /benchmark/) -GENERATE ?= code.gitea.io/git - -.PHONY: all -all: clean test build - -.PHONY: clean -clean: - go clean -i ./... - -generate: - @which mockery > /dev/null; if [ $$? -ne 0 ]; then \ - go get -u github.com/vektra/mockery/...; \ - fi - go generate $(GENERATE) - -.PHONY: fmt -fmt: - find . -name "*.go" -type f ! -path "./vendor/*" ! -path "./benchmark/*" | xargs gofmt -s -w - -.PHONY: vet -vet: - go vet $(PACKAGES) - -.PHONY: lint -lint: - @which golint > /dev/null; if [ $$? -ne 0 ]; then \ - go get -u github.com/golang/lint/golint; \ - fi - for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done; - -.PHONY: test -test: - for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; - -.PHONY: bench -bench: - go test -run=XXXXXX -benchtime=10s -bench=. || exit 1 - -.PHONY: build -build: - go build . diff --git a/vendor/code.gitea.io/git/README.md b/vendor/code.gitea.io/git/README.md deleted file mode 100644 index e27603b0f2..0000000000 --- a/vendor/code.gitea.io/git/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Git Shell - -[![Build Status](http://drone.gitea.io/api/badges/go-gitea/git/status.svg)](http://drone.gitea.io/go-gitea/git) -[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ) -[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com") -[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/git/coverage.svg)](https://coverage.gitea.io/go-gitea/git) -[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/git)](https://goreportcard.com/report/code.gitea.io/git) -[![GoDoc](https://godoc.org/code.gitea.io/git?status.svg)](https://godoc.org/code.gitea.io/git) - -This project is a Go module to access Git through shell commands. For further -informations take a look at the current [documentation](https://godoc.org/code.gitea.io/git). - -## Contributing - -Fork -> Patch -> Push -> Pull Request - -## Authors - -* [Maintainers](https://github.com/orgs/go-gitea/people) -* [Contributors](https://github.com/go-gitea/git/graphs/contributors) - -## License - -This project is under the MIT License. See the [LICENSE](LICENSE) file for the -full license text. diff --git a/vendor/code.gitea.io/git/repo_blame.go b/vendor/code.gitea.io/git/repo_blame.go index b48cbeea6c..80ec50e472 100644 --- a/vendor/code.gitea.io/git/repo_blame.go +++ b/vendor/code.gitea.io/git/repo_blame.go @@ -4,7 +4,21 @@ package git +import "fmt" + // FileBlame return the Blame object of file func (repo *Repository) FileBlame(revision, path, file string) ([]byte, error) { - return NewCommand("blame", "--root", file).RunInDirBytes(path) + return NewCommand("blame", "--root", "--", file).RunInDirBytes(path) +} + +// LineBlame returns the latest commit at the given line +func (repo *Repository) LineBlame(revision, path, file string, line uint) (*Commit, error) { + res, err := NewCommand("blame", fmt.Sprintf("-L %d,%d", line, line), "-p", revision, "--", file).RunInDir(path) + if err != nil { + return nil, err + } + if len(res) < 40 { + return nil, fmt.Errorf("invalid result of blame: %s", res) + } + return repo.GetCommit(string(res[:40])) } diff --git a/vendor/github.com/PuerkitoBio/goquery/README.md b/vendor/github.com/PuerkitoBio/goquery/README.md deleted file mode 100644 index 7b01a27178..0000000000 --- a/vendor/github.com/PuerkitoBio/goquery/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# goquery - a little like that j-thing, only in Go -[![build status](https://secure.travis-ci.org/PuerkitoBio/goquery.png)](http://travis-ci.org/PuerkitoBio/goquery) [![GoDoc](https://godoc.org/github.com/PuerkitoBio/goquery?status.png)](http://godoc.org/github.com/PuerkitoBio/goquery) [![Sourcegraph Badge](https://sourcegraph.com/github.com/PuerkitoBio/goquery/-/badge.svg)](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge) - - -goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...). - -## Installation - -Please note that because of the net/html dependency, goquery requires Go1.1+. - - $ go get github.com/PuerkitoBio/goquery - -(optional) To run unit tests: - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test - -(optional) To run benchmarks (warning: it runs for a few minutes): - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test -bench=".*" - -## Changelog - -**Note that goquery's API is now stable, and will not break.** - -* **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv). -* **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb). -* **2016-08-28 (v1.0.1)** : Optimize performance for large documents. -* **2016-07-27 (v1.0.0)** : Tag version 1.0.0. -* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object. -* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see godoc for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`). -* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr]. -* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used. -* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s. -* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader. -* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response. -* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility. -* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out). -* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method. -* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases). -* **v0.1.0** : Initial release. - -## API - -goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate. - -jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention: - -* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`) -* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`) -* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`) -* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`) -* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`) -* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`) - -Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour). - -The complete [godoc reference documentation can be found here][doc]. - -Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string): - -* `Find("~")` returns an empty selection because the selector string doesn't match anything. -* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything). -* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything. -* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element. - -## Examples - -See some tips and tricks in the [wiki][]. - -Adapted from example_test.go: - -```Go -package main - -import ( - "fmt" - "log" - - "github.com/PuerkitoBio/goquery" -) - -func ExampleScrape() { - doc, err := goquery.NewDocument("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { - // For each item found, get the band and title - band := s.Find("a").Text() - title := s.Find("i").Text() - fmt.Printf("Review %d: %s - %s\n", i, band, title) - }) -} - -func main() { - ExampleScrape() -} -``` - -## License - -The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic]. - -[jquery]: http://jquery.com/ -[go]: http://golang.org/ -[cascadia]: https://github.com/andybalholm/cascadia -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[golic]: http://golang.org/LICENSE -[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE -[doc]: http://godoc.org/github.com/PuerkitoBio/goquery -[index]: http://api.jquery.com/index/ -[gonet]: https://github.com/golang/net/ -[html]: http://godoc.org/golang.org/x/net/html -[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks -[thatguystone]: https://github.com/thatguystone -[piotr]: https://github.com/piotrkowalczuk diff --git a/vendor/github.com/RoaringBitmap/roaring/Makefile b/vendor/github.com/RoaringBitmap/roaring/Makefile deleted file mode 100644 index d5259b4c9e..0000000000 --- a/vendor/github.com/RoaringBitmap/roaring/Makefile +++ /dev/null @@ -1,121 +0,0 @@ -.PHONY: help all test format fmtcheck vet lint qa deps clean nuke rle backrle ser fetch-real-roaring-datasets - - - - - - - - -# Display general help about this command -help: - @echo "" - @echo "The following commands are available:" - @echo "" - @echo " make qa : Run all the tests" - @echo " make test : Run the unit tests" - @echo "" - @echo " make format : Format the source code" - @echo " make fmtcheck : Check if the source code has been formatted" - @echo " make vet : Check for suspicious constructs" - @echo " make lint : Check for style errors" - @echo "" - @echo " make deps : Get the dependencies" - @echo " make clean : Remove any build artifact" - @echo " make nuke : Deletes any intermediate file" - @echo "" - @echo " make fuzz-smat : Fuzzy testing with smat" - @echo " make fuzz-stream : Fuzzy testing with stream deserialization" - @echo " make fuzz-buffer : Fuzzy testing with buffer deserialization" - @echo "" - -# Alias for help target -all: help -test: - go test - go test -race -run TestConcurrent* -# Format the source code -format: - @find ./ -type f -name "*.go" -exec gofmt -w {} \; - -# Check if the source code has been formatted -fmtcheck: - @mkdir -p target - @find ./ -type f -name "*.go" -exec gofmt -d {} \; | tee target/format.diff - @test ! -s target/format.diff || { echo "ERROR: the source code has not been formatted - please use 'make format' or 'gofmt'"; exit 1; } - -# Check for syntax errors -vet: - GOPATH=$(GOPATH) go vet ./... - -# Check for style errors -lint: - GOPATH=$(GOPATH) PATH=$(GOPATH)/bin:$(PATH) golint ./... - - - - - -# Alias to run all quality-assurance checks -qa: fmtcheck test vet lint - -# --- INSTALL --- - -# Get the dependencies -deps: - GOPATH=$(GOPATH) go get github.com/smartystreets/goconvey/convey - GOPATH=$(GOPATH) go get github.com/willf/bitset - GOPATH=$(GOPATH) go get github.com/golang/lint/golint - GOPATH=$(GOPATH) go get github.com/mschoch/smat - GOPATH=$(GOPATH) go get github.com/dvyukov/go-fuzz/go-fuzz - GOPATH=$(GOPATH) go get github.com/dvyukov/go-fuzz/go-fuzz-build - GOPATH=$(GOPATH) go get github.com/glycerine/go-unsnap-stream - GOPATH=$(GOPATH) go get github.com/philhofer/fwd - GOPATH=$(GOPATH) go get github.com/jtolds/gls - -fuzz-smat: - go test -tags=gofuzz -run=TestGenerateSmatCorpus - go-fuzz-build -func FuzzSmat github.com/RoaringBitmap/roaring - go-fuzz -bin=./roaring-fuzz.zip -workdir=workdir/ -timeout=200 - - -fuzz-stream: - go-fuzz-build -func FuzzSerializationStream github.com/RoaringBitmap/roaring - go-fuzz -bin=./roaring-fuzz.zip -workdir=workdir/ -timeout=200 - - -fuzz-buffer: - go-fuzz-build -func FuzzSerializationBuffer github.com/RoaringBitmap/roaring - go-fuzz -bin=./roaring-fuzz.zip -workdir=workdir/ -timeout=200 - -# Remove any build artifact -clean: - GOPATH=$(GOPATH) go clean ./... - -# Deletes any intermediate file -nuke: - rm -rf ./target - GOPATH=$(GOPATH) go clean -i ./... - -rle: - cp rle.go rle16.go - perl -pi -e 's/32/16/g' rle16.go - cp rle_test.go rle16_test.go - perl -pi -e 's/32/16/g' rle16_test.go - -backrle: - cp rle16.go rle.go - perl -pi -e 's/16/32/g' rle.go - perl -pi -e 's/2032/2016/g' rle.go - -ser: rle - go generate - -cover: - go test -coverprofile=coverage.out - go tool cover -html=coverage.out - -fetch-real-roaring-datasets: - # pull github.com/RoaringBitmap/real-roaring-datasets -> testdata/real-roaring-datasets - git submodule init - git submodule update diff --git a/vendor/github.com/RoaringBitmap/roaring/README.md b/vendor/github.com/RoaringBitmap/roaring/README.md deleted file mode 100644 index 2c096ce8e6..0000000000 --- a/vendor/github.com/RoaringBitmap/roaring/README.md +++ /dev/null @@ -1,246 +0,0 @@ -roaring [![Build Status](https://travis-ci.org/RoaringBitmap/roaring.png)](https://travis-ci.org/RoaringBitmap/roaring) [![Coverage Status](https://coveralls.io/repos/github/RoaringBitmap/roaring/badge.svg?branch=master)](https://coveralls.io/github/RoaringBitmap/roaring?branch=master) [![GoDoc](https://godoc.org/github.com/RoaringBitmap/roaring?status.svg)](https://godoc.org/github.com/RoaringBitmap/roaring) [![Go Report Card](https://goreportcard.com/badge/RoaringBitmap/roaring)](https://goreportcard.com/report/github.com/RoaringBitmap/roaring) -============= - -This is a go version of the Roaring bitmap data structure. - - - -Roaring bitmaps are used by several major systems such as [Apache Lucene][lucene] and derivative systems such as [Solr][solr] and -[Elasticsearch][elasticsearch], [Metamarkets' Druid][druid], [LinkedIn Pinot][pinot], [Netflix Atlas][atlas], [Apache Spark][spark], [OpenSearchServer][opensearchserver], [Cloud Torrent][cloudtorrent], [Whoosh][whoosh], [Pilosa][pilosa], [Microsoft Visual Studio Team Services (VSTS)][vsts], and eBay's [Apache Kylin][kylin]. - -[lucene]: https://lucene.apache.org/ -[solr]: https://lucene.apache.org/solr/ -[elasticsearch]: https://www.elastic.co/products/elasticsearch -[druid]: http://druid.io/ -[spark]: https://spark.apache.org/ -[opensearchserver]: http://www.opensearchserver.com -[cloudtorrent]: https://github.com/jpillora/cloud-torrent -[whoosh]: https://bitbucket.org/mchaput/whoosh/wiki/Home -[pilosa]: https://www.pilosa.com/ -[kylin]: http://kylin.apache.org/ -[pinot]: http://github.com/linkedin/pinot/wiki -[vsts]: https://www.visualstudio.com/team-services/ -[atlas]: https://github.com/Netflix/atlas - -Roaring bitmaps are found to work well in many important applications: - -> Use Roaring for bitmap compression whenever possible. Do not use other bitmap compression methods ([Wang et al., SIGMOD 2017](http://db.ucsd.edu/wp-content/uploads/2017/03/sidm338-wangA.pdf)) - - -The ``roaring`` Go library is used by -* [Cloud Torrent](https://github.com/jpillora/cloud-torrent): a self-hosted remote torrent client -* [runv](https://github.com/hyperhq/runv): an Hypervisor-based runtime for the Open Containers Initiative -* [InfluxDB](https://www.influxdata.com) -* [Pilosa](https://www.pilosa.com/) -* [Bleve](http://www.blevesearch.com) - -This library is used in production in several systems, it is part of the [Awesome Go collection](https://awesome-go.com). - - -There are also [Java](https://github.com/RoaringBitmap/RoaringBitmap) and [C/C++](https://github.com/RoaringBitmap/CRoaring) versions. The Java, C, C++ and Go version are binary compatible: e.g, you can save bitmaps -from a Java program and load them back in Go, and vice versa. We have a [format specification](https://github.com/RoaringBitmap/RoaringFormatSpec). - - -This code is licensed under Apache License, Version 2.0 (ASL2.0). - -Copyright 2016-... by the authors. - - -### References - -- Daniel Lemire, Owen Kaser, Nathan Kurz, Luca Deri, Chris O'Hara, François Saint-Jacques, Gregory Ssi-Yan-Kai, Roaring Bitmaps: Implementation of an Optimized Software Library, Software: Practice and Experience 48 (4), 2018 [arXiv:1709.07821](https://arxiv.org/abs/1709.07821) -- Samy Chambi, Daniel Lemire, Owen Kaser, Robert Godin, -Better bitmap performance with Roaring bitmaps, -Software: Practice and Experience 46 (5), 2016. -http://arxiv.org/abs/1402.6407 This paper used data from http://lemire.me/data/realroaring2014.html -- Daniel Lemire, Gregory Ssi-Yan-Kai, Owen Kaser, Consistently faster and smaller compressed bitmaps with Roaring, Software: Practice and Experience 46 (11), 2016. http://arxiv.org/abs/1603.06549 - - -### Dependencies - -Dependencies are fetched automatically by giving the `-t` flag to `go get`. - -they include - - github.com/smartystreets/goconvey/convey - - github.com/willf/bitset - - github.com/mschoch/smat - - github.com/glycerine/go-unsnap-stream - - github.com/philhofer/fwd - - github.com/jtolds/gls - -Note that the smat library requires Go 1.6 or better. - -#### Installation - - - go get -t github.com/RoaringBitmap/roaring - - -### Example - -Here is a simplified but complete example: - -```go -package main - -import ( - "fmt" - "github.com/RoaringBitmap/roaring" - "bytes" -) - - -func main() { - // example inspired by https://github.com/fzandona/goroar - fmt.Println("==roaring==") - rb1 := roaring.BitmapOf(1, 2, 3, 4, 5, 100, 1000) - fmt.Println(rb1.String()) - - rb2 := roaring.BitmapOf(3, 4, 1000) - fmt.Println(rb2.String()) - - rb3 := roaring.New() - fmt.Println(rb3.String()) - - fmt.Println("Cardinality: ", rb1.GetCardinality()) - - fmt.Println("Contains 3? ", rb1.Contains(3)) - - rb1.And(rb2) - - rb3.Add(1) - rb3.Add(5) - - rb3.Or(rb1) - - // computes union of the three bitmaps in parallel using 4 workers - roaring.ParOr(4, rb1, rb2, rb3) - // computes intersection of the three bitmaps in parallel using 4 workers - roaring.ParAnd(4, rb1, rb2, rb3) - - - // prints 1, 3, 4, 5, 1000 - i := rb3.Iterator() - for i.HasNext() { - fmt.Println(i.Next()) - } - fmt.Println() - - // next we include an example of serialization - buf := new(bytes.Buffer) - rb1.WriteTo(buf) // we omit error handling - newrb:= roaring.New() - newrb.ReadFrom(buf) - if rb1.Equals(newrb) { - fmt.Println("I wrote the content to a byte stream and read it back.") - } -} -``` - -If you wish to use serialization and handle errors, you might want to -consider the following sample of code: - -```go - rb := BitmapOf(1, 2, 3, 4, 5, 100, 1000) - buf := new(bytes.Buffer) - size,err:=rb.WriteTo(buf) - if err != nil { - t.Errorf("Failed writing") - } - newrb:= New() - size,err=newrb.ReadFrom(buf) - if err != nil { - t.Errorf("Failed reading") - } - if ! rb.Equals(newrb) { - t.Errorf("Cannot retrieve serialized version") - } -``` - -Given N integers in [0,x), then the serialized size in bytes of -a Roaring bitmap should never exceed this bound: - -`` 8 + 9 * ((long)x+65535)/65536 + 2 * N `` - -That is, given a fixed overhead for the universe size (x), Roaring -bitmaps never use more than 2 bytes per integer. You can call -``BoundSerializedSizeInBytes`` for a more precise estimate. - - -### Documentation - -Current documentation is available at http://godoc.org/github.com/RoaringBitmap/roaring - -### Goroutine safety - -In general, it should not generally be considered safe to access -the same bitmaps using different goroutines--they are left -unsynchronized for performance. Should you want to access -a Bitmap from more than one goroutine, you should -provide synchronization. Typically this is done by using channels to pass -the *Bitmap around (in Go style; so there is only ever one owner), -or by using `sync.Mutex` to serialize operations on Bitmaps. - -### Coverage - -We test our software. For a report on our test coverage, see - -https://coveralls.io/github/RoaringBitmap/roaring?branch=master - -### Benchmark - -Type - - go test -bench Benchmark -run - - -To run benchmarks on [Real Roaring Datasets](https://github.com/RoaringBitmap/real-roaring-datasets) -run the following: - -```sh -go get github.com/RoaringBitmap/real-roaring-datasets -BENCH_REAL_DATA=1 go test -bench BenchmarkRealData -run - -``` - -### Iterative use - -You can use roaring with gore: - -- go get -u github.com/motemen/gore -- Make sure that ``$GOPATH/bin`` is in your ``$PATH``. -- go get github/RoaringBitmap/roaring - -```go -$ gore -gore version 0.2.6 :help for help -gore> :import github.com/RoaringBitmap/roaring -gore> x:=roaring.New() -gore> x.Add(1) -gore> x.String() -"{1}" -``` - - -### Fuzzy testing - -You can help us test further the library with fuzzy testing: - - go get github.com/dvyukov/go-fuzz/go-fuzz - go get github.com/dvyukov/go-fuzz/go-fuzz-build - go test -tags=gofuzz -run=TestGenerateSmatCorpus - go-fuzz-build github.com/RoaringBitmap/roaring - go-fuzz -bin=./roaring-fuzz.zip -workdir=workdir/ -timeout=200 - -Let it run, and if the # of crashers is > 0, check out the reports in -the workdir where you should be able to find the panic goroutine stack -traces. - -### Alternative in Go - -There is a Go version wrapping the C/C++ implementation https://github.com/RoaringBitmap/gocroaring - -For an alternative implementation in Go, see https://github.com/fzandona/goroar -The two versions were written independently. - - -### Mailing list/discussion group - -https://groups.google.com/forum/#!forum/roaring-bitmaps diff --git a/vendor/github.com/Smerity/govarint/README.md b/vendor/github.com/Smerity/govarint/README.md deleted file mode 100644 index 5b82dccb2f..0000000000 --- a/vendor/github.com/Smerity/govarint/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Govarint - -This project aims to provide a simple API for the performant encoding and decoding of 32 and 64 bit integers using a variety of algorithms. - -[![](http://i.imgur.com/mpgC23U.jpg)](https://www.flickr.com/photos/tsevis/8648521649/) - -## Usage - -Each integer encoding algorithm conforms to an encoding and decoding interface. -The interfaces also specify the size of the unsigned integer, either 32 or 64 bits, and will be referred to as XX below. -To create an encoder: - - NewU32Base128Encoder(w io.Writer) - NewU64Base128Encoder(w io.Writer) - NewU32GroupVarintEncoder(w io.Writer) - -For encoders, the only two commands are `PutUXX` and `Close`. -`Close` must be called as some integer encoding algorithms write in multiples. - - var buf bytes.Buffer - enc := NewU32Base128Encoder(&buf) - enc.PutU32(117) - enc.PutU32(343) - enc.Close() - -To create a decoder: - - NewU32Base128Decoder(r io.ByteReader) - NewU64Base128Decoder(r io.ByteReader) - NewU32GroupVarintDecoder(r io.ByteReader) - -For decoders, the only command is `GetUXX`. -`GetUXX` returns the value and any potential errors. -When reading is complete, `GetUXX` will return an `EOF` (End Of File). - - dec := NewU32Base128Decoder(&buf) - x, err := dec.GetU32() - -## Use Cases - -Using fixed width integers, such as uint32 and uint64, usually waste large amounts of space, especially when encoding small values. -Optimally, smaller numbers should take less space to represent. - -Using integer encoding algorithms is especially common in specific applications, such as storing edge lists or indexes for search engines. -In these situations, you have a sorted list of numbers that you want to keep as compactly as possible in memory. -Additionally, by storing only the difference between the given number and the previous (delta encoding), the numbers are quite small, and thus compress well. - -For an explicit example, the Web Data Commons Hyperlink Graph contains 128 billion edges linking page A to page B, where each page is represented by a 32 bit integer. -By converting all these edges to 64 bit integers (32 | 32), sorting them, and then using delta encoding, memory usage can be reduced from 64 bits per edge down to only 9 bits per edge using the Base128 integer encoding algorithm. -This figure improves even further if compressed using conventional compression algorithms (3 bits per edge). - -## Encodings supported - -`govarint` supports: - -+ Base128 [32, 64] - each byte uses 7 bits for encoding the integer and 1 bit for indicating if the integer requires another byte -+ Group Varint [32] - integers are encoded in blocks of four - one byte encodes the size of the following four integers, then the values of the four integers follows - -Group Varint consistently beats Base128 in decompression speed but Base128 may offer improved compression ratios depending on the distribution of the supplied integers. - -## Tests - - go test -v -bench=. - -## License - -MIT License, as per `LICENSE` diff --git a/vendor/github.com/Unknwon/cae/README.md b/vendor/github.com/Unknwon/cae/README.md deleted file mode 100644 index e72de97205..0000000000 --- a/vendor/github.com/Unknwon/cae/README.md +++ /dev/null @@ -1,37 +0,0 @@ -Compression and Archive Extensions -================================== - -[![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/cae) - -[中文文档](README_ZH.md) - -Package cae implements PHP-like Compression and Archive Extensions. - -But this package has some modifications depends on Go-style. - -Reference: [PHP:Compression and Archive Extensions](http://www.php.net/manual/en/refs.compression.php). - -Code Convention: based on [Go Code Convention](https://github.com/Unknwon/go-code-convention). - -### Implementations - -Package `zip`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/zip)) and `tz`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/tz)) both enable you to transparently read or write ZIP/TAR.GZ compressed archives and the files inside them. - -- Features: - - Add file or directory from everywhere to archive, no one-to-one limitation. - - Extract part of entries, not all at once. - - Stream data directly into `io.Writer` without any file system storage. - -### Test cases and Coverage - -All subpackages use [GoConvey](http://goconvey.co/) to write test cases, and coverage is more than 80 percent. - -### Use cases - -- [Gogs](https://github.com/gogits/gogs): self hosted Git service in the Go Programming Language. -- [GoBlog](https://github.com/fuxiaohei/GoBlog): personal blogging application. -- [GoBuild](https://github.com/shxsun/gobuild/): online Go cross-platform compilation and download service. - -## License - -This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. \ No newline at end of file diff --git a/vendor/github.com/Unknwon/cae/README_ZH.md b/vendor/github.com/Unknwon/cae/README_ZH.md deleted file mode 100644 index e2f8747ee4..0000000000 --- a/vendor/github.com/Unknwon/cae/README_ZH.md +++ /dev/null @@ -1,29 +0,0 @@ -压缩与打包扩展 -============= - -[![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/cae) - -包 cae 实现了 PHP 风格的压缩与打包扩展。 - -但本包依据 Go 语言的风格进行了一些修改。 - -引用:[PHP:Compression and Archive Extensions](http://www.php.net/manual/en/refs.compression.php) - -编码规范:基于 [Go 编码规范](https://github.com/Unknwon/go-code-convention) - -### 实现 - -包 `zip`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/zip)) 和 `tz`([Go Walker](http://gowalker.org/github.com/Unknwon/cae/tz)) 都允许你轻易的读取或写入 ZIP/TAR.GZ 压缩档案和其内部文件。 - -- 特性: - - 将任意位置的文件或目录加入档案,没有一对一的操作限制。 - - 只解压部分文件,而非一次性解压全部。 - - 将数据以流的形式直接写入 `io.Writer` 而不需经过文件系统的存储。 - -### 测试用例与覆盖率 - -所有子包均采用 [GoConvey](http://goconvey.co/) 来书写测试用例,覆盖率均超过 80%。 - -## 授权许可 - -本项目采用 Apache v2 开源授权许可证,完整的授权说明已放置在 [LICENSE](LICENSE) 文件中。 \ No newline at end of file diff --git a/vendor/github.com/Unknwon/cae/tz/testdata/test.lnk b/vendor/github.com/Unknwon/cae/tz/testdata/test.lnk new file mode 120000 index 0000000000..b317dc9d26 --- /dev/null +++ b/vendor/github.com/Unknwon/cae/tz/testdata/test.lnk @@ -0,0 +1 @@ +test.zip \ No newline at end of file diff --git a/vendor/github.com/Unknwon/cae/tz/testdata/testdir.lnk b/vendor/github.com/Unknwon/cae/tz/testdata/testdir.lnk new file mode 120000 index 0000000000..9f6260d6f5 --- /dev/null +++ b/vendor/github.com/Unknwon/cae/tz/testdata/testdir.lnk @@ -0,0 +1 @@ +testdir \ No newline at end of file diff --git a/vendor/github.com/Unknwon/cae/zip/testdata/test.lnk b/vendor/github.com/Unknwon/cae/zip/testdata/test.lnk new file mode 120000 index 0000000000..b317dc9d26 --- /dev/null +++ b/vendor/github.com/Unknwon/cae/zip/testdata/test.lnk @@ -0,0 +1 @@ +test.zip \ No newline at end of file diff --git a/vendor/github.com/Unknwon/cae/zip/testdata/testdir.lnk b/vendor/github.com/Unknwon/cae/zip/testdata/testdir.lnk new file mode 120000 index 0000000000..9f6260d6f5 --- /dev/null +++ b/vendor/github.com/Unknwon/cae/zip/testdata/testdir.lnk @@ -0,0 +1 @@ +testdir \ No newline at end of file diff --git a/vendor/github.com/Unknwon/com/README.md b/vendor/github.com/Unknwon/com/README.md deleted file mode 100644 index 8d821abd65..0000000000 --- a/vendor/github.com/Unknwon/com/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Common Functions -================ - -[![Build Status](https://travis-ci.org/Unknwon/com.svg)](https://travis-ci.org/Unknwon/com) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/com) - -This is an open source project for commonly used functions for the Go programming language. - -This package need >= **go 1.2** - -Code Convention: based on [Go Code Convention](https://github.com/Unknwon/go-code-convention). - -## Contribute - -Your contribute is welcome, but you have to check following steps after you added some functions and commit them: - -1. Make sure you wrote user-friendly comments for **all functions** . -2. Make sure you wrote test cases with any possible condition for **all functions** in file `*_test.go`. -3. Make sure you wrote benchmarks for **all functions** in file `*_test.go`. -4. Make sure you wrote useful examples for **all functions** in file `example_test.go`. -5. Make sure you ran `go test` and got **PASS** . diff --git a/vendor/github.com/Unknwon/i18n/Makefile b/vendor/github.com/Unknwon/i18n/Makefile deleted file mode 100644 index 8ff1ac4399..0000000000 --- a/vendor/github.com/Unknwon/i18n/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -.PHONY: build test bench vet - -build: vet bench - -test: - go test -v -cover - -bench: - go test -v -cover -test.bench=. -test.benchmem - -vet: - go vet \ No newline at end of file diff --git a/vendor/github.com/Unknwon/i18n/README.md b/vendor/github.com/Unknwon/i18n/README.md deleted file mode 100644 index 7503e41f28..0000000000 --- a/vendor/github.com/Unknwon/i18n/README.md +++ /dev/null @@ -1,136 +0,0 @@ -i18n [![GoDoc](https://godoc.org/github.com/Unknwon/i18n?status.svg)](https://godoc.org/github.com/Unknwon/i18n) [![Sourcegraph](https://sourcegraph.com/github.com/Unknwon/i18n/-/badge.svg)](https://sourcegraph.com/github.com/Unknwon/i18n?badge) -==== - -Package i18n is for app Internationalization and Localization. - -## Introduction - -This package provides multiple-language options to improve user experience. Sites like [Go Walker](http://gowalker.org) and [gogs.io](http://gogs.io) are using this module to implement Chinese and English user interfaces. - -You can use following command to install this module: - - go get github.com/Unknwon/i18n - -## Usage - -First of all, you have to import this package: - -```go -import "github.com/Unknwon/i18n" -``` - -The format of locale files is very like INI format configuration file, which is basically key-value pairs. But this module has some improvements. Every language corresponding to a locale file, for example, under `conf/locale` folder of [gogsweb](https://github.com/gogits/gogsweb/tree/master/conf/locale), there are two files called `locale_en-US.ini` and `locale_zh-CN.ini`. - -The name and extensions of locale files can be anything, but we strongly recommend you to follow the style of gogsweb. - -## Minimal example - -Here are two simplest locale file examples: - -File `locale_en-US.ini`: - -```ini -hi = hello, %s -bye = goodbye -``` - -File `locale_zh-CN.ini`: - -```ini -hi = 您好,%s -bye = 再见 -``` - -### Do Translation - -There are two ways to do translation depends on which way is the best fit for your application or framework. - -Directly use package function to translate: - -```go -i18n.Tr("en-US", "hi", "Unknwon") -i18n.Tr("en-US", "bye") -``` - -Or create a struct and embed it: - -```go -type MyController struct{ - // ...other fields - i18n.Locale -} - -//... - -func ... { - c := &MyController{ - Locale: i18n.Locale{"en-US"}, - } - _ = c.Tr("hi", "Unknwon") - _ = c.Tr("bye") -} -``` - -Code above will produce correspondingly: - -- English `en-US`:`hello, Unknwon`, `goodbye` -- Chinese `zh-CN`:`您好,Unknwon`, `再见` - -## Section - -For different pages, one key may map to different values. Therefore, i18n module also uses the section feature of INI format configuration to achieve section. - -For example, the key name is `about`, and we want to show `About` in the home page and `About Us` in about page. Then you can do following: - -Content in locale file: - -```ini -about = About - -[about] -about = About Us -``` - -Get `about` in home page: - -```go -i18n.Tr("en-US", "about") -``` - -Get `about` in about page: - -```go -i18n.Tr("en-US", "about.about") -``` - -### Ambiguity - -Because dot `.` is sign of section in both [INI parser](https://github.com/go-ini/ini) and locale files, so when your key name contains `.` will cause ambiguity. At this point, you just need to add one more `.` in front of the key. - -For example, the key name is `about.`, then we can use: - -```go -i18n.Tr("en-US", ".about.") -``` - -to get expect result. - -## Helper tool - -Module i18n provides a command line helper tool beei18n for simplify steps of your development. You can install it as follows: - - go get github.com/Unknwon/i18n/ui18n - -### Sync locale files - -Command `sync` allows you use a exist local file as the template to create or sync other locale files: - - ui18n sync srouce_file.ini other1.ini other2.ini - -This command can operate 1 or more files in one command. - -## More information - -- The first locale you load to the module is considered as **default locale**. -- When matching non-default locale and didn't find the string, i18n will have a second try on default locale. -- If i18n still cannot find string in the default locale, raw string will be returned. For instance, when the string is `hi` and it does not exist in locale file, simply return `hi` as output. diff --git a/vendor/github.com/Unknwon/paginater/README.md b/vendor/github.com/Unknwon/paginater/README.md deleted file mode 100644 index 8e608ed3ea..0000000000 --- a/vendor/github.com/Unknwon/paginater/README.md +++ /dev/null @@ -1,65 +0,0 @@ -Paginater [![Build Status](https://drone.io/github.com/Unknwon/paginater/status.png)](https://drone.io/github.com/Unknwon/paginater/latest) [![](http://gocover.io/_badge/github.com/Unknwon/paginater)](http://gocover.io/github.com/Unknwon/paginater) -========= - -Package paginater is a helper module for custom pagination calculation. - -## Installation - - go get github.com/Unknwon/paginater - -## Getting Started - -The following code shows an example of how to use paginater: - -```go -package main - -import "github.com/Unknwon/paginater" - -func main() { - // Arguments: - // - Total number of rows - // - Number of rows in one page - // - Current page number - // - Number of page links - p := paginater.New(45, 10, 3, 3) - - // Then use p as a template object named "Page" in "demo.html" - // ... -} -``` - -`demo.html` - -```html -{{if not .Page.IsFirst}}[First](1){{end}} -{{if .Page.HasPrevious}}[Previous]({{.Page.Previous}}){{end}} - -{{range .Page.Pages}} - {{if eq .Num -1}} - ... - {{else}} - {{.Num}}{{if .IsCurrent}}(current){{end}} - {{end}} -{{end}} - -{{if .Page.HasNext}}[Next]({{.Page.Next}}){{end}} -{{if not .Page.IsLast}}[Last]({{.Page.TotalPages}}){{end}} -``` - -Possible output: - -``` -[First](1) [Previous](2) ... 2 3(current) 4 ... [Next](4) [Last](5) -``` - -As you may guess, if the `Page` value is `-1`, you should print `...` in the HTML as common practice. - -## Getting Help - -- [API Documentation](https://gowalker.org/github.com/Unknwon/paginater) -- [File An Issue](https://github.com/Unknwon/paginater/issues/new) - -## License - -This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. \ No newline at end of file diff --git a/vendor/github.com/andybalholm/cascadia/README.md b/vendor/github.com/andybalholm/cascadia/README.md deleted file mode 100644 index 9021cb92aa..0000000000 --- a/vendor/github.com/andybalholm/cascadia/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# cascadia - -[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) - -The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. - -To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. diff --git a/vendor/github.com/blevesearch/bleve/CONTRIBUTING.md b/vendor/github.com/blevesearch/bleve/CONTRIBUTING.md deleted file mode 100644 index 5ebf3d65bc..0000000000 --- a/vendor/github.com/blevesearch/bleve/CONTRIBUTING.md +++ /dev/null @@ -1,16 +0,0 @@ -# Contributing to Bleve - -We look forward to your contributions, but ask that you first review these guidelines. - -### Sign the CLA - -As Bleve is a Couchbase project we require contributors accept the [Couchbase Contributor License Agreement](http://review.couchbase.org/static/individual_agreement.html). To sign this agreement log into the Couchbase [code review tool](http://review.couchbase.org/). The Bleve project does not use this code review tool but it is still used to track acceptance of the contributor license agreements. - -### Submitting a Pull Request - -All types of contributions are welcome, but please keep the following in mind: - -- If you're planning a large change, you should really discuss it in a github issue or on the google group first. This helps avoid duplicate effort and spending time on something that may not be merged. -- Existing tests should continue to pass, new tests for the contribution are nice to have. -- All code should have gone through `go fmt` -- All code should pass `go vet` diff --git a/vendor/github.com/blevesearch/bleve/README.md b/vendor/github.com/blevesearch/bleve/README.md deleted file mode 100644 index 7c1a7c7c46..0000000000 --- a/vendor/github.com/blevesearch/bleve/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# ![bleve](docs/bleve.png) bleve - -[![Build Status](https://travis-ci.org/blevesearch/bleve.svg?branch=master)](https://travis-ci.org/blevesearch/bleve) [![Coverage Status](https://coveralls.io/repos/github/blevesearch/bleve/badge.svg?branch=master)](https://coveralls.io/github/blevesearch/bleve?branch=master) [![GoDoc](https://godoc.org/github.com/blevesearch/bleve?status.svg)](https://godoc.org/github.com/blevesearch/bleve) -[![Join the chat at https://gitter.im/blevesearch/bleve](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/blevesearch/bleve?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![codebeat](https://codebeat.co/badges/38a7cbc9-9cf5-41c0-a315-0746178230f4)](https://codebeat.co/projects/github-com-blevesearch-bleve) -[![Go Report Card](https://goreportcard.com/badge/blevesearch/bleve)](https://goreportcard.com/report/blevesearch/bleve) -[![Sourcegraph](https://sourcegraph.com/github.com/blevesearch/bleve/-/badge.svg)](https://sourcegraph.com/github.com/blevesearch/bleve?badge) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - -modern text indexing in go - [blevesearch.com](http://www.blevesearch.com/) - -Try out bleve live by [searching the bleve website](http://www.blevesearch.com/search/?q=bleve). - -## Features - -* Index any go data structure (including JSON) -* Intelligent defaults backed up by powerful configuration -* Supported field types: - * Text, Numeric, Date -* Supported query types: - * Term, Phrase, Match, Match Phrase, Prefix - * Conjunction, Disjunction, Boolean - * Numeric Range, Date Range - * Simple query [syntax](http://www.blevesearch.com/docs/Query-String-Query/) for human entry -* tf-idf Scoring -* Search result match highlighting -* Supports Aggregating Facets: - * Terms Facet - * Numeric Range Facet - * Date Range Facet - -## Discussion - -Discuss usage and development of bleve in the [google group](https://groups.google.com/forum/#!forum/bleve). - -## Indexing - -```go -message := struct{ - Id string - From string - Body string -}{ - Id: "example", - From: "marty.schoch@gmail.com", - Body: "bleve indexing is easy", -} - -mapping := bleve.NewIndexMapping() -index, err := bleve.New("example.bleve", mapping) -if err != nil { - panic(err) -} -index.Index(message.Id, message) -``` - -## Querying - -```go -index, _ := bleve.Open("example.bleve") -query := bleve.NewQueryStringQuery("bleve") -searchRequest := bleve.NewSearchRequest(query) -searchResult, _ := index.Search(searchRequest) -``` - -## License - -Apache License Version 2.0 diff --git a/vendor/github.com/blevesearch/bleve/analysis/test_words.txt b/vendor/github.com/blevesearch/bleve/analysis/test_words.txt deleted file mode 100644 index b86e254bb9..0000000000 --- a/vendor/github.com/blevesearch/bleve/analysis/test_words.txt +++ /dev/null @@ -1,7 +0,0 @@ -# full line comment -marty -steve # trailing comment -| different format of comment -dustin -siri | different style trailing comment -multiple words with different whitespace \ No newline at end of file diff --git a/vendor/github.com/blevesearch/bleve/geo/README.md b/vendor/github.com/blevesearch/bleve/geo/README.md deleted file mode 100644 index 43bcd98fed..0000000000 --- a/vendor/github.com/blevesearch/bleve/geo/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# geo support in bleve - -First, all of this geo code is a Go adaptation of the [Lucene 5.3.2 sandbox geo support](https://lucene.apache.org/core/5_3_2/sandbox/org/apache/lucene/util/package-summary.html). - -## Notes - -- All of the APIs will use float64 for lon/lat values. -- When describing a point in function arguments or return values, we always use the order lon, lat. -- High level APIs will use TopLeft and BottomRight to describe bounding boxes. This may not map cleanly to min/max lon/lat when crossing the dateline. The lower level APIs will use min/max lon/lat and require the higher-level code to split boxes accordingly. diff --git a/vendor/github.com/blevesearch/bleve/index/scorch/README.md b/vendor/github.com/blevesearch/bleve/index/scorch/README.md deleted file mode 100644 index 861335a1bf..0000000000 --- a/vendor/github.com/blevesearch/bleve/index/scorch/README.md +++ /dev/null @@ -1,367 +0,0 @@ -# scorch - -## Definitions - -Batch -- A collection of Documents to mutate in the index. - -Document -- Has a unique identifier (arbitrary bytes). -- Is comprised of a list of fields. - -Field -- Has a name (string). -- Has a type (text, number, date, geopoint). -- Has a value (depending on type). -- Can be indexed, stored, or both. -- If indexed, can be analyzed. --m If indexed, can optionally store term vectors. - -## Scope - -Scorch *MUST* implement the bleve.index API without requiring any changes to this API. - -Scorch *MAY* introduce new interfaces, which can be discovered to allow use of new capabilities not in the current API. - -## Implementation - -The scorch implementation starts with the concept of a segmented index. - -A segment is simply a slice, subset, or portion of the entire index. A segmented index is one which is composed of one or more segments. Although segments are created in a particular order, knowing this ordering is not required to achieve correct semantics when querying. Because there is no ordering, this means that when searching an index, you can (and should) search all the segments concurrently. - -### Internal Wrapper - -In order to accommodate the existing APIs while also improving the implementation, the scorch implementation includes some wrapper functionality that must be described. - -#### \_id field - -In scorch, field 0 is prearranged to be named \_id. All documents have a value for this field, which is the documents external identifier. In this version the field *MUST* be both indexed AND stored. The scorch wrapper adds this field, as it will not be present in the Document from the calling bleve code. - -NOTE: If a document already contains a field \_id, it will be replaced. If this is problematic, the caller must ensure such a scenario does not happen. - -### Proposed Structures - -``` -type Segment interface { - - Dictionary(field string) TermDictionary - -} - -type TermDictionary interface { - - PostingsList(term string, excluding PostingsList) PostingsList - -} - -type PostingsList interface { - - Next() Posting - - And(other PostingsList) PostingsList - Or(other PostingsList) PostingsList - -} - -type Posting interface { - Number() uint64 - - Frequency() uint64 - Norm() float64 - - Locations() Locations -} - -type Locations interface { - Start() uint64 - End() uint64 - Pos() uint64 - ArrayPositions() ... -} - -type DeletedDocs { - -} - -type SegmentSnapshot struct { - segment Segment - deleted PostingsList -} - -type IndexSnapshot struct { - segment []SegmentSnapshot -} -``` -**What about errors?** -**What about memory mgmnt or context?** -**Postings List separate iterator to separate stateful from stateless** -### Mutating the Index - -The bleve.index API has methods for directly making individual mutations (Update/Delete/SetInternal/DeleteInternal), however for this first implementation, we assume that all of these calls can simply be turned into a Batch of size 1. This may be highly inefficient, but it will be correct. This decision is made based on the fact that Couchbase FTS always uses Batches. - -NOTE: As a side-effect of this decision, it should be clear that performance tuning may depend on the batch size, which may in-turn require changes in FTS. - -From this point forward, only Batch mutations will be discussed. - -Sequence of Operations: - -1. For each document in the batch, search through all existing segments. The goal is to build up a per-segment bitset which tells us which documents in that segment are obsoleted by the addition of the new segment we're currently building. NOTE: we're not ready for this change to take effect yet, so rather than this operation mutating anything, they simply return bitsets, which we can apply later. Logically, this is something like: - - ``` - foreach segment { - dict := segment.Dictionary("\_id") - postings := empty postings list - foreach docID { - postings = postings.Or(dict.PostingsList(docID, nil)) - } - } - ``` - - NOTE: it is illustrated above as nested for loops, but some or all of these could be concurrently. The end result is that for each segment, we have (possibly empty) bitset. - -2. Also concurrent with 1, the documents in the batch are analyzed. This analysis proceeds using the existing analyzer pool. - -3. (after 2 completes) Analyzed documents are fed into a function which builds a new Segment representing this information. - -4. We now have everything we need to update the state of the system to include this new snapshot. - - - Acquire a lock - - Create a new IndexSnapshot - - For each SegmentSnapshot in the IndexSnapshot, take the deleted PostingsList and OR it with the new postings list for this Segment. Construct a new SegmentSnapshot for the segment using this new deleted PostingsList. Append this SegmentSnapshot to the IndexSnapshot. - - Create a new SegmentSnapshot wrapping our new segment with nil deleted docs. - - Append the new SegmentSnapshot to the IndexSnapshot - - Release the lock - -An ASCII art example: - ``` - 0 - Empty Index - - No segments - - IndexSnapshot - segments [] - deleted [] - - - 1 - Index Batch [ A B C ] - - segment 0 - numbers [ 1 2 3 ] - \_id [ A B C ] - - IndexSnapshot - segments [ 0 ] - deleted [ nil ] - - - 2 - Index Batch [ B' ] - - segment 0 1 - numbers [ 1 2 3 ] [ 1 ] - \_id [ A B C ] [ B ] - - Compute bitset segment-0-deleted-by-1: - [ 0 1 0 ] - - OR it with previous (nil) (call it 0-1) - [ 0 1 0 ] - - IndexSnapshot - segments [ 0 1 ] - deleted [ 0-1 nil ] - - 3 - Index Batch [ C' ] - - segment 0 1 2 - numbers [ 1 2 3 ] [ 1 ] [ 1 ] - \_id [ A B C ] [ B ] [ C ] - - Compute bitset segment-0-deleted-by-2: - [ 0 0 1 ] - - OR it with previous ([ 0 1 0 ]) (call it 0-12) - [ 0 1 1 ] - - Compute bitset segment-1-deleted-by-2: - [ 0 ] - - OR it with previous (nil) - still just nil - - - IndexSnapshot - segments [ 0 1 2 ] - deleted [ 0-12 nil nil ] - ``` - -**is there opportunity to stop early when doc is found in one segment** -**also, more efficient way to find bits for long lists of ids?** - -### Searching - -In the bleve.index API all searching starts by getting an IndexReader, which represents a snapshot of the index at a point in time. - -As described in the section above, our index implementation maintains a pointer to the current IndexSnapshot. When a caller gets an IndexReader, they get a copy of this pointer, and can use it as long as they like. The IndexSnapshot contains SegmentSnapshots, which only contain pointers to immutable segments. The deleted posting lists associated with a segment change over time, but the particular deleted posting list in YOUR snapshot is immutable. This gives a stable view of the data. - -#### Term Search - -Term search is the only searching primitive exposed in today's bleve.index API. This ultimately could limit our ability to take advantage of the indexing improvements, but it also means it will be easier to get a first version of this working. - -A term search for term T in field F will look something like this: - -``` - searchResultPostings = empty - foreach segment { - dict := segment.Dictionary(F) - segmentResultPostings = dict.PostingsList(T, segmentSnapshotDeleted) - // make segmentLocal numbers into global numbers, and flip bits in searchResultPostings - } -``` - -The searchResultPostings will be a new implementation of the TermFieldReader inteface. - -As a reminder this interface is: - -``` -// TermFieldReader is the interface exposing the enumeration of documents -// containing a given term in a given field. Documents are returned in byte -// lexicographic order over their identifiers. -type TermFieldReader interface { - // Next returns the next document containing the term in this field, or nil - // when it reaches the end of the enumeration. The preAlloced TermFieldDoc - // is optional, and when non-nil, will be used instead of allocating memory. - Next(preAlloced *TermFieldDoc) (*TermFieldDoc, error) - - // Advance resets the enumeration at specified document or its immediate - // follower. - Advance(ID IndexInternalID, preAlloced *TermFieldDoc) (*TermFieldDoc, error) - - // Count returns the number of documents contains the term in this field. - Count() uint64 - Close() error -} -``` - -At first glance this appears problematic, we have no way to return documents in order of their identifiers. But it turns out the wording of this perhaps too strong, or a bit ambiguous. Originally, this referred to the external identifiers, but with the introduction of a distinction between internal/external identifiers, returning them in order of their internal identifiers is also acceptable. **ASIDE**: the reason for this is that most callers just use Next() and literally don't care what the order is, they could be in any order and it would be fine. There is only one search that cares and that is the ConjunctionSearcher, which relies on Next/Advance having very specific semantics. Later in this document we will have a proposal to split into multiple interfaces: - -- The weakest interface, only supports Next() no ordering at all. -- Ordered, supporting Advance() -- And/Or'able capable of internally efficiently doing these ops with like interfaces (if not capable then can always fall back to external walking) - -But, the good news is that we don't even have to do that for our first implementation. As long as the global numbers we use for internal identifiers are consistent within this IndexSnapshot, then Next() will be ordered by ascending document number, and Advance() will still work correctly. - -NOTE: there is another place where we rely on the ordering of these hits, and that is in the "\_id" sort order. Previously this was the natural order, and a NOOP for the collector, now it must be implemented by actually sorting on the "\_id" field. We probably should introduce at least a marker interface to detect this. - -An ASCII art example: - -``` -Let's start with the IndexSnapshot we ended with earlier: - -3 - Index Batch [ C' ] - - segment 0 1 2 - numbers [ 1 2 3 ] [ 1 ] [ 1 ] - \_id [ A B C ] [ B ] [ C ] - - Compute bitset segment-0-deleted-by-2: - [ 0 0 1 ] - - OR it with previous ([ 0 1 0 ]) (call it 0-12) - [ 0 1 1 ] - -Compute bitset segment-1-deleted-by-2: - [ 0 0 0 ] - -OR it with previous (nil) - still just nil - - - IndexSnapshot - segments [ 0 1 2 ] - deleted [ 0-12 nil nil ] - -Now let's search for the term 'cat' in the field 'desc' and let's assume that Document C (both versions) would match it. - -Concurrently: - - - Segment 0 - - Get Term Dictionary For Field 'desc' - - From it get Postings List for term 'cat' EXCLUDING 0-12 - - raw segment matches [ 0 0 1 ] but excluding [ 0 1 1 ] gives [ 0 0 0 ] - - Segment 1 - - Get Term Dictionary For Field 'desc' - - From it get Postings List for term 'cat' excluding nil - - [ 0 ] - - Segment 2 - - Get Term Dictionary For Field 'desc' - - From it get Postings List for term 'cat' excluding nil - - [ 1 ] - -Map local bitsets into global number space (global meaning cross-segment but still unique to this snapshot) - -IndexSnapshot already should have mapping something like: -0 - Offset 0 -1 - Offset 3 (because segment 0 had 3 docs) -2 - Offset 4 (becuase segment 1 had 1 doc) - -This maps to search result bitset: - -[ 0 0 0 0 1] - -Caller would call Next() and get doc number 5 (assuming 1 based indexing for now) - -Caller could then ask to get term locations, stored fields, external doc ID for document number 5. Internally in the IndexSnapshot, we can now convert that back, and realize doc number 5 comes from segment 2, 5-4=1 so we're looking for doc number 1 in segment 2. That happens to be C... - -``` - -#### Future improvements - -In the future, interfaces to detect these non-serially operating TermFieldReaders could expose their own And() and Or() up to the higher level Conjunction/Disjunction searchers. Doing this alone offers some win, but also means there would be greater burden on the Searcher code rewriting logical expressions for maximum performance. - -Another related topic is that of peak memory usage. With serially operating TermFieldReaders it was necessary to start them all at the same time and operate in unison. However, with these non-serially operating TermFieldReaders we have the option of doing a few at a time, consolidating them, dispoting the intermediaries, and then doing a few more. For very complex queries with many clauses this could reduce peak memory usage. - - -### Memory Tracking - -All segments must be able to produce two statistics, an estimate of their explicit memory usage, and their actual size on disk (if any). For in-memory segments, disk usage could be zero, and the memory usage represents the entire information content. For mmap-based disk segments, the memory could be as low as the size of tracking structure itself (say just a few pointers). - -This would allow the implementation to throttle or block incoming mutations when a threshold memory usage has (or would be) exceeded. - -### Persistence - -Obviously, we want to support (but maybe not require) asynchronous persistence of segments. My expectation is that segments are initially built in memory. At some point they are persisted to disk. This poses some interesting challenges. - -At runtime, the state of an index (it's IndexSnapshot) is not only the contents of the segments, but also the bitmasks of deleted documents. These bitmasks indirectly encode an ordering in which the segments were added. The reason is that the bitmasks encode which items have been obsoleted by other (subsequent or more future) segments. In the runtime implementation we compute bitmask deltas and then merge them at the same time we bring the new segment in. One idea is that we could take a similar approach on disk. When we persist a segment, we persist the bitmask deltas of segments known to exist at that time, and eventually these can get merged up into a base segment deleted bitmask. - -This also relates to the topic rollback, addressed next... - - -### Rollback - -One desirable property in the Couchbase ecosystem is the ability to rollback to some previous (though typically not long ago) state. One idea for keeping this property in this design is to protect some of the most recent segments from merging. Then, if necessary, they could be "undone" to reveal previous states of the system. In these scenarios "undone" has to properly undo the deleted bitmasks on the other segments. Again, the current thinking is that rather than "undo" anything, it could be work that was deferred in the first place, thus making it easier to logically undo. - -Another possibly related approach would be to tie this into our existing snapshot mechanism. Perhaps simulating a slow reader (holding onto index snapshots) for some period of time, can be the mechanism to achieve the desired end goal. - - -### Internal Storage - -The bleve.index API has support for "internal storage". The ability to store information under a separate name space. - -This is not used for high volume storage, so it is tempting to think we could just put a small k/v store alongside the rest of the index. But, the reality is that this storage is used to maintain key information related to the rollback scenario. Because of this, its crucial that ordering and overwriting of key/value pairs correspond with actual segment persistence in the index. Based on this, I believe its important to put the internal key/value pairs inside the segments themselves. But, this also means that they must follow a similar "deleted" bitmask approach to obsolete values in older segments. But, this also seems to substantially increase the complexity of the solution because of the separate name space, it would appear to require its own bitmask. Further keys aren't numeric, which then implies yet another mapping from internal key to number, etc. - -More thought is required here. - -### Merging - -The segmented index approach requires merging to prevent the number of segments from growing too large. - -Recent experience with LSMs has taught us that having the correct merge strategy can make a huge difference in the overall performance of the system. In particular, a simple merge strategy which merges segments too aggressively can lead to high write amplification and unnecessarily rendering cached data useless. - -A few simple principles have been identified. - -- Roughly we merge multiple smaller segments into a single larger one. -- The larger a segment gets the less likely we should be to ever merge it. -- Segments with large numbers of deleted/obsoleted items are good candidates as the merge will result in a space savings. -- Segments with all items deleted/obsoleted can be dropped. - -Merging of a segment should be able to proceed even if that segment is held by an ongoing snapshot, it should only delay the removal of it. diff --git a/vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/README.md b/vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/README.md deleted file mode 100644 index 179adceafd..0000000000 --- a/vendor/github.com/blevesearch/bleve/index/scorch/segment/zap/README.md +++ /dev/null @@ -1,167 +0,0 @@ -# zap file format - -The file is written in the reverse order that we typically access data. This helps us write in one pass since later sections of the file require file offsets of things we've already written. - -Current usage: - -- mmap the entire file -- crc-32 bytes and version are in fixed position at end of the file -- reading remainder of footer could be version specific -- remainder of footer gives us: - - 3 important offsets (docValue , fields index and stored data index) - - 2 important values (number of docs and chunk factor) -- field data is processed once and memoized onto the heap so that we never have to go back to disk for it -- access to stored data by doc number means first navigating to the stored data index, then accessing a fixed position offset into that slice, which gives us the actual address of the data. the first bytes of that section tell us the size of data so that we know where it ends. -- access to all other indexed data follows the following pattern: - - first know the field name -> convert to id - - next navigate to term dictionary for that field - - some operations stop here and do dictionary ops - - next use dictionary to navigate to posting list for a specific term - - walk posting list - - if necessary, walk posting details as we go - - if location info is desired, consult location bitmap to see if it is there - -## stored fields section - -- for each document - - preparation phase: - - produce a slice of metadata bytes and data bytes - - produce these slices in field id order - - field value is appended to the data slice - - metadata slice is govarint encoded with the following values for each field value - - field id (uint16) - - field type (byte) - - field value start offset in uncompressed data slice (uint64) - - field value length (uint64) - - field number of array positions (uint64) - - one additional value for each array position (uint64) - - compress the data slice using snappy - - file writing phase: - - remember the start offset for this document - - write out meta data length (varint uint64) - - write out compressed data length (varint uint64) - - write out the metadata bytes - - write out the compressed data bytes - -## stored fields idx - -- for each document - - write start offset (remembered from previous section) of stored data (big endian uint64) - -With this index and a known document number, we have direct access to all the stored field data. - -## posting details (freq/norm) section - -- for each posting list - - produce a slice containing multiple consecutive chunks (each chunk is govarint stream) - - produce a slice remembering offsets of where each chunk starts - - preparation phase: - - for each hit in the posting list - - if this hit is in next chunk close out encoding of last chunk and record offset start of next - - encode term frequency (uint64) - - encode norm factor (float32) - - file writing phase: - - remember start position for this posting list details - - write out number of chunks that follow (varint uint64) - - write out length of each chunk (each a varint uint64) - - write out the byte slice containing all the chunk data - -If you know the doc number you're interested in, this format lets you jump to the correct chunk (docNum/chunkFactor) directly and then seek within that chunk until you find it. - -## posting details (location) section - -- for each posting list - - produce a slice containing multiple consecutive chunks (each chunk is govarint stream) - - produce a slice remembering offsets of where each chunk starts - - preparation phase: - - for each hit in the posting list - - if this hit is in next chunk close out encoding of last chunk and record offset start of next - - encode field (uint16) - - encode field pos (uint64) - - encode field start (uint64) - - encode field end (uint64) - - encode number of array positions to follow (uint64) - - encode each array position (each uint64) - - file writing phase: - - remember start position for this posting list details - - write out number of chunks that follow (varint uint64) - - write out length of each chunk (each a varint uint64) - - write out the byte slice containing all the chunk data - -If you know the doc number you're interested in, this format lets you jump to the correct chunk (docNum/chunkFactor) directly and then seek within that chunk until you find it. - -## bitmaps of hits with location info - -- for each posting list - - preparation phase: - - encode roaring bitmap (inidicating which hits have location details indexed) posting list to bytes (so we know the length) - - file writing phase: - - remember the start position for this bitmap - - write length of encoded roaring bitmap - - write the serialized roaring bitmap data - -## postings list section - -- for each posting list - - preparation phase: - - encode roaring bitmap posting list to bytes (so we know the length) - - file writing phase: - - remember the start position for this posting list - - write freq/norm details offset (remembered from previous, as varint uint64) - - write location details offset (remembered from previous, as varint uint64) - - write location bitmap offset (remembered from pervious, as varint uint64) - - write length of encoded roaring bitmap - - write the serialized roaring bitmap data - -## dictionary - -- for each field - - preparation phase: - - encode vellum FST with dictionary data pointing to file offset of posting list (remembered from previous) - - file writing phase: - - remember the start position of this persistDictionary - - write length of vellum data (varint uint64) - - write out vellum data - -## fields section - -- for each field - - file writing phase: - - remember start offset for each field - - write dictionary address (remembered from previous) (varint uint64) - - write length of field name (varint uint64) - - write field name bytes - -## fields idx - -- for each field - - file writing phase: - - write big endian uint64 of start offset for each field - -NOTE: currently we don't know or record the length of this fields index. Instead we rely on the fact that we know it immediately precedes a footer of known size. - -## fields DocValue - -- for each field - - preparation phase: - - produce a slice containing multiple consecutive chunks, where each chunk is composed of a meta section followed by compressed columnar field data - - produce a slice remembering the length of each chunk - - file writing phase: - - remember the start position of this first field DocValue offset in the footer - - write out number of chunks that follow (varint uint64) - - write out length of each chunk (each a varint uint64) - - write out the byte slice containing all the chunk data - -NOTE: currently the meta header inside each chunk gives clue to the location offsets and size of the data pertaining to a given docID and any -read operation leverage that meta information to extract the document specific data from the file. - -## footer - -- file writing phase - - write number of docs (big endian uint64) - - write stored field index location (big endian uint64) - - write field index location (big endian uint64) - - write field docValue location (big endian uint64) - - write out chunk factor (big endian uint32) - - write out version (big endian uint32) - - write out file CRC of everything preceding this (big endian uint32) diff --git a/vendor/github.com/blevesearch/bleve/index/upsidedown/benchmark_all.sh b/vendor/github.com/blevesearch/bleve/index/upsidedown/benchmark_all.sh deleted file mode 100755 index 079fef1865..0000000000 --- a/vendor/github.com/blevesearch/bleve/index/upsidedown/benchmark_all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -BENCHMARKS=`grep "func Benchmark" *_test.go | sed 's/.*func //' | sed s/\(.*{//` - -for BENCHMARK in $BENCHMARKS -do - go test -v -run=xxx -bench=^$BENCHMARK$ -benchtime=10s -tags 'forestdb leveldb' | grep -v ok | grep -v PASS -done diff --git a/vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.proto b/vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.proto deleted file mode 100644 index cf0492a2db..0000000000 --- a/vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.proto +++ /dev/null @@ -1,14 +0,0 @@ -message BackIndexTermsEntry { - required uint32 field = 1; - repeated string terms = 2; -} - -message BackIndexStoreEntry { - required uint32 field = 1; - repeated uint64 arrayPositions = 2; -} - -message BackIndexRowValue { - repeated BackIndexTermsEntry termsEntries = 1; - repeated BackIndexStoreEntry storedEntries = 2; -} diff --git a/vendor/github.com/blevesearch/bleve/search/facet/benchmark_data.txt b/vendor/github.com/blevesearch/bleve/search/facet/benchmark_data.txt deleted file mode 100644 index b012f78ce5..0000000000 --- a/vendor/github.com/blevesearch/bleve/search/facet/benchmark_data.txt +++ /dev/null @@ -1,2909 +0,0 @@ -Boiling liquid expanding vapor explosion -From Wikipedia, the free encyclopedia -See also: Boiler explosion and Steam explosion - -Flames subsequent to a flammable liquid BLEVE from a tanker. BLEVEs do not necessarily involve fire. - -This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. See Wikipedia's guide to writing better articles for suggestions. (July 2013) -A boiling liquid expanding vapor explosion (BLEVE, /ˈblɛviː/ blev-ee) is an explosion caused by the rupture of a vessel containing a pressurized liquid above its boiling point.[1] -Contents [hide] -1 Mechanism -1.1 Water example -1.2 BLEVEs without chemical reactions -2 Fires -3 Incidents -4 Safety measures -5 See also -6 References -7 External links -Mechanism[edit] - -This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (July 2013) -There are three characteristics of liquids which are relevant to the discussion of a BLEVE: -If a liquid in a sealed container is boiled, the pressure inside the container increases. As the liquid changes to a gas it expands - this expansion in a vented container would cause the gas and liquid to take up more space. In a sealed container the gas and liquid are not able to take up more space and so the pressure rises. Pressurized vessels containing liquids can reach an equilibrium where the liquid stops boiling and the pressure stops rising. This occurs when no more heat is being added to the system (either because it has reached ambient temperature or has had a heat source removed). -The boiling temperature of a liquid is dependent on pressure - high pressures will yield high boiling temperatures, and low pressures will yield low boiling temperatures. A common simple experiment is to place a cup of water in a vacuum chamber, and then reduce the pressure in the chamber until the water boils. By reducing the pressure the water will boil even at room temperature. This works both ways - if the pressure is increased beyond normal atmospheric pressures, the boiling of hot water could be suppressed far beyond normal temperatures. The cooling system of a modern internal combustion engine is a real-world example. -When a liquid boils it turns into a gas. The resulting gas takes up far more space than the liquid did. -Typically, a BLEVE starts with a container of liquid which is held above its normal, atmospheric-pressure boiling temperature. Many substances normally stored as liquids, such as CO2, oxygen, and other similar industrial gases have boiling temperatures, at atmospheric pressure, far below room temperature. In the case of water, a BLEVE could occur if a pressurized chamber of water is heated far beyond the standard 100 °C (212 °F). That container, because the boiling water pressurizes it, is capable of holding liquid water at very high temperatures. -If the pressurized vessel, containing liquid at high temperature (which may be room temperature, depending on the substance) ruptures, the pressure which prevents the liquid from boiling is lost. If the rupture is catastrophic, where the vessel is immediately incapable of holding any pressure at all, then there suddenly exists a large mass of liquid which is at very high temperature and very low pressure. This causes the entire volume of liquid to instantaneously boil, which in turn causes an extremely rapid expansion. Depending on temperatures, pressures and the substance involved, that expansion may be so rapid that it can be classified as an explosion, fully capable of inflicting severe damage on its surroundings. -Water example[edit] -Imagine, for example, a tank of pressurized liquid water held at 204.4 °C (400 °F). This vessel would normally be pressurized to 1.7 MPa (250 psi) above atmospheric ("gauge") pressure. Were the tank containing the water to split open, there would momentarily exist a volume of liquid water which is -at atmospheric pressure, and -204.4 °C (400 °F). -At atmospheric pressure the boiling point of water is 100 °C (212 °F) - liquid water at atmospheric pressure cannot exist at temperatures higher than 100 °C (212 °F). It is obvious, then, that 204.4 °C (400 °F) liquid water at atmospheric pressure must immediately flash to gas causing an explosion. -BLEVEs without chemical reactions[edit] -It is important to note that a BLEVE need not be a chemical explosion - nor does there need to be a fire - however if a flammable substance is subject to a BLEVE it may also be subject to intense heating, either from an external source of heat which may have caused the vessel to rupture in the first place or from an internal source of localized heating such as skin friction. This heating can cause a flammable substance to ignite, adding a secondary explosion caused by the primary BLEVE. While blast effects of any BLEVE can be devastating, a flammable substance such as propane can add significantly to the danger. -Bleve explosion.svg -While the term BLEVE is most often used to describe the results of a container of flammable liquid rupturing due to fire, a BLEVE can occur even with a non-flammable substance such as water,[2] liquid nitrogen,[3] liquid helium or other refrigerants or cryogens, and therefore is not usually considered a type of chemical explosion. -Fires[edit] -BLEVEs can be caused by an external fire near the storage vessel causing heating of the contents and pressure build-up. While tanks are often designed to withstand great pressure, constant heating can cause the metal to weaken and eventually fail. If the tank is being heated in an area where there is no liquid, it may rupture faster without the liquid to absorb the heat. Gas containers are usually equipped with relief valves that vent off excess pressure, but the tank can still fail if the pressure is not released quickly enough.[1] Relief valves are sized to release pressure fast enough to prevent the pressure from increasing beyond the strength of the vessel, but not so fast as to be the cause of an explosion. An appropriately sized relief valve will allow the liquid inside to boil slowly, maintaining a constant pressure in the vessel until all the liquid has boiled and the vessel empties. -If the substance involved is flammable, it is likely that the resulting cloud of the substance will ignite after the BLEVE has occurred, forming a fireball and possibly a fuel-air explosion, also termed a vapor cloud explosion (VCE). If the materials are toxic, a large area will be contaminated.[4] -Incidents[edit] -The term "BLEVE" was coined by three researchers at Factory Mutual, in the analysis of an accident there in 1957 involving a chemical reactor vessel.[5] -In August 1959 the Kansas City Fire Department suffered its largest ever loss of life in the line of duty, when a 25,000 gallon (95,000 litre) gas tank exploded during a fire on Southwest Boulevard killing five firefighters. This was the first time BLEVE was used to describe a burning fuel tank.[citation needed] -Later incidents included the Cheapside Street Whisky Bond Fire in Glasgow, Scotland in 1960; Feyzin, France in 1966; Crescent City, Illinois in 1970; Kingman, Arizona in 1973; a liquid nitrogen tank rupture[6] at Air Products and Chemicals and Mobay Chemical Company at New Martinsville, West Virginia on January 31, 1978 [1];Texas City, Texas in 1978; Murdock, Illinois in 1983; San Juan Ixhuatepec, Mexico City in 1984; and Toronto, Ontario in 2008. -Safety measures[edit] -[icon] This section requires expansion. (July 2013) -Some fire mitigation measures are listed under liquefied petroleum gas. -See also[edit] -Boiler explosion -Expansion ratio -Explosive boiling or phase explosion -Rapid phase transition -Viareggio train derailment -2008 Toronto explosions -Gas carriers -Los Alfaques Disaster -Lac-Mégantic derailment -References[edit] -^ Jump up to: a b Kletz, Trevor (March 1990). Critical Aspects of Safety and Loss Prevention. London: Butterworth–Heinemann. pp. 43–45. ISBN 0-408-04429-2. -Jump up ^ "Temperature Pressure Relief Valves on Water Heaters: test, inspect, replace, repair guide". Inspect-ny.com. Retrieved 2011-07-12. -Jump up ^ Liquid nitrogen BLEVE demo -Jump up ^ "Chemical Process Safety" (PDF). Retrieved 2011-07-12. -Jump up ^ David F. Peterson, BLEVE: Facts, Risk Factors, and Fallacies, Fire Engineering magazine (2002). -Jump up ^ "STATE EX REL. VAPOR CORP. v. NARICK". Supreme Court of Appeals of West Virginia. 1984-07-12. Retrieved 2014-03-16. -External links[edit] - Look up boiling liquid expanding vapor explosion in Wiktionary, the free dictionary. - Wikimedia Commons has media related to BLEVE. -BLEVE Demo on YouTube — video of a controlled BLEVE demo -huge explosions on YouTube — video of propane and isobutane BLEVEs from a train derailment at Murdock, Illinois (3 September 1983) -Propane BLEVE on YouTube — video of BLEVE from the Toronto propane depot fire -Moscow Ring Road Accident on YouTube - Dozens of LPG tank BLEVEs after a road accident in Moscow -Kingman, AZ BLEVE — An account of the 5 July 1973 explosion in Kingman, with photographs -Propane Tank Explosions — Description of circumstances required to cause a propane tank BLEVE. -Analysis of BLEVE Events at DOE Sites - Details physics and mathematics of BLEVEs. -HID - SAFETY REPORT ASSESSMENT GUIDE: Whisky Maturation Warehouses - The liquor is aged in wooden barrels that can suffer BLEVE. -Categories: ExplosivesFirefightingFireTypes of fireGas technologiesIndustrial fires and explosions -Navigation menu -Create accountLog inArticleTalkReadEditView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -Català -Deutsch -Español -Français -Italiano -עברית -Nederlands -日本語 -Norsk bokmål -Polski -Português -Русский -Suomi -Edit links -This page was last modified on 18 November 2014 at 01:35. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -Thermobaric weapon -From Wikipedia, the free encyclopedia - -Blast from a US Navy fuel air explosive used against a decommissioned ship, USS McNulty, 1972. -A thermobaric weapon is a type of explosive that utilizes oxygen from the surrounding air to generate an intense, high-temperature explosion, and in practice the blast wave such a weapon produces is typically significantly longer in duration than a conventional condensed explosive. The fuel-air bomb is one of the most well-known types of thermobaric weapons. -Most conventional explosives consist of a fuel-oxidizer premix (gunpowder, for example, contains 25% fuel and 75% oxidizer), whereas thermobaric weapons are almost 100% fuel, so thermobaric weapons are significantly more energetic than conventional condensed explosives of equal weight. Their reliance on atmospheric oxygen makes them unsuitable for use underwater, at high altitude, and in adverse weather. They do, however, cause considerably more destruction when used inside confined environments such as tunnels, caves, and bunkers - partly due to the sustained blast wave, and partly by consuming the available oxygen inside those confined spaces. -There are many different types of thermobaric weapons rounds that can be fitted to hand-held launchers.[1] -Contents [hide] -1 Terminology -2 Mechanism -2.1 Fuel-air explosive -2.1.1 Effect -3 Development history -3.1 Soviet and Russian developments -3.2 US developments -4 History -4.1 Military use -4.2 Non-military use -5 See also -6 References -7 External links -Terminology[edit] -The term thermobaric is derived from the Greek words for "heat" and "pressure": thermobarikos (θερμοβαρικός), from thermos (θερμός), hot + baros (βάρος), weight, pressure + suffix -ikos (-ικός), suffix -ic. -Other terms used for this family of weapons are high-impulse thermobaric weapons (HITs), heat and pressure weapons, vacuum bombs, or fuel-air explosives (FAE or FAX). -Mechanism[edit] -In contrast to condensed explosive, where oxidation in a confined region produces a blast front from essentially a point source, a flame front accelerates to a large volume producing pressure fronts both within the mixture of fuel and oxidant and then in the surrounding air.[2] -Thermobaric explosives apply the principles underlying accidental unconfined vapor cloud explosions, which include those from dispersions of flammable dusts and droplets.[3] Previously, such explosions were most often encountered in flour mills and their storage containers, and later in coal mines; but, now, most commonly in discharged oil tankers and refineries, including an incident at Buncefield in the UK in 2005 where the blast wave woke people 150 kilometres (93 mi) from its centre.[4] -A typical weapon consists of a container packed with a fuel substance, in the center of which is a small conventional-explosive "scatter charge". Fuels are chosen on the basis of the exothermicity of their oxidation, ranging from powdered metals, such as aluminium or magnesium, to organic materials, possibly with a self-contained partial oxidant. The most recent development involves the use of nanofuels.[5][6] -A thermobaric bomb's effective yield requires the most appropriate combination of a number of factors; among these are how well the fuel is dispersed, how rapidly it mixes with the surrounding atmosphere, and the initiation of the igniter and its position relative to the container of fuel. In some designs, strong munitions cases allow the blast pressure to be contained long enough for the fuel to be heated up well above its auto-ignition temperature, so that once the container bursts the super-heated fuel will auto-ignite progressively as it comes into contact with atmospheric oxygen.[7][8][9][10][11][12][13][14][15][16][17] -Conventional upper and lower limits of flammability apply to such weapons. Close in, blast from the dispersal charge, compressing and heating the surrounding atmosphere, will have some influence on the lower limit. The upper limit has been demonstrated strongly to influence the ignition of fogs above pools of oil.[18] This weakness may be eliminated by designs where the fuel is preheated well above its ignition temperature, so that its cooling during its dispersion still results in a minimal ignition delay on mixing. The continual combustion of the outer layer of fuel molecules as they come into contact with the air, generates additional heat which maintains the temperature of the interior of the fireball, and thus sustains the detonation.[19][20][21] -In confinement, a series of reflective shock waves are generated,[22][23] which maintain the fireball and can extend its duration to between 10 and 50 ms as exothermic recombination reactions occur.[24] Further damage can result as the gases cool and pressure drops sharply, leading to a partial vacuum. This effect has given rise to the misnomer "vacuum bomb". Piston-type afterburning is also believed to occur in such structures, as flame-fronts accelerate through it.[25][26] -Fuel-air explosive[edit] -A fuel-air explosive (FAE) device consists of a container of fuel and two separate explosive charges. After the munition is dropped or fired, the first explosive charge bursts open the container at a predetermined height and disperses the fuel in a cloud that mixes with atmospheric oxygen (the size of the cloud varies with the size of the munition). The cloud of fuel flows around objects and into structures. The second charge then detonates the cloud, creating a massive blast wave. The blast wave destroys unreinforced buildings and equipment and kills and injures people. The antipersonnel effect of the blast wave is more severe in foxholes, on people with body armor, and in enclosed spaces such as caves, buildings, and bunkers. -Fuel-air explosives were first developed, and used in Vietnam, by the United States. Soviet scientists, however, quickly developed their own FAE weapons, which were reportedly used against China in the Sino-Soviet border conflict and in Afghanistan. Since then, research and development has continued and currently Russian forces field a wide array of third-generation FAE warheads. -Effect[edit] -A Human Rights Watch report of 1 February 2000[27] quotes a study made by the US Defense Intelligence Agency: -The [blast] kill mechanism against living targets is unique–and unpleasant.... What kills is the pressure wave, and more importantly, the subsequent rarefaction [vacuum], which ruptures the lungs.... If the fuel deflagrates but does not detonate, victims will be severely burned and will probably also inhale the burning fuel. Since the most common FAE fuels, ethylene oxide and propylene oxide, are highly toxic, undetonated FAE should prove as lethal to personnel caught within the cloud as most chemical agents. -According to a U.S. Central Intelligence Agency study,[27] "the effect of an FAE explosion within confined spaces is immense. Those near the ignition point are obliterated. Those at the fringe are likely to suffer many internal, and thus invisible injuries, including burst eardrums and crushed inner ear organs, severe concussions, ruptured lungs and internal organs, and possibly blindness." Another Defense Intelligence Agency document speculates that because the "shock and pressure waves cause minimal damage to brain tissue…it is possible that victims of FAEs are not rendered unconscious by the blast, but instead suffer for several seconds or minutes while they suffocate."[28] -Development history[edit] -Soviet and Russian developments[edit] - -A RPO-A rocket and launcher. -The Soviet armed forces extensively developed FAE weapons,[29] such as the RPO-A, and used them in Chechnya.[30] -The Russian armed forces have developed thermobaric ammunition variants for several of their weapons, such as the TGB-7V thermobaric grenade with a lethality radius of 10 metres (33 ft), which can be launched from a RPG-7. The GM-94 is a 43 mm pump-action grenade launcher which is designed mainly to fire thermobaric grenades for close quarters combat. With the grenade weighing 250 grams (8.8 oz) and holding a 160 grams (5.6 oz) explosive mixture, its lethality radius is 3 metres (9.8 ft); however, due to the deliberate "fragmentation-free" design of the grenade, 4 metres (13 ft) is already considered a safe distance.[31] The RPO-A and upgraded RPO-M are infantry-portable RPGs designed to fire thermobaric rockets. The RPO-M, for instance, has a thermobaric warhead with a TNT equivalence of 5.5 kilograms (12 lb) of TNT and destructive capabilities similar to a 152 mm High explosive fragmentation artillery shell.[32][33] The RShG-1 and the RShG-2 are thermobaric variants of the RPG-27 and RPG-26 respectively. The RShG-1 is the more powerful variant, with its warhead having a 10 metres (33 ft) lethality radius and producing about the same effect as 6 kg (13 lb) of TNT.[34] The RMG is a further derivative of the RPG-26 that uses a tandem-charge warhead, whereby the precursor HEAT warhead blasts an opening for the main thermobaric charge to enter and detonate inside.[35] The RMG's precursor HEAT warhead can penetrate 300 mm of reinforced concrete or over 100 mm of Rolled homogeneous armour, thus allowing the 105 millimetres (4.1 in) diameter thermobaric warhead to detonate inside.[36] -The other examples include the SACLOS or millimeter wave radar-guided thermobaric variants of the 9M123 Khrizantema, the 9M133F-1 thermobaric warhead variant of the 9M133 Kornet, and the 9M131F thermobaric warhead variant of the 9K115-2 Metis-M, all of which are anti-tank missiles. The Kornet has since been upgraded to the Kornet-EM, and its thermobaric variant has a maximum range of 10 kilometres (6.2 mi) and has the TNT equivalent of 7 kilograms (15 lb) of TNT.[37] The 300 mm 9M55S thermobaric cluster warhead rocket was built to be fired from the BM-30 Smerch MLRS. A dedicated carrier of thermobaric weapons is the purpose-built TOS-1, a 24-tube MLRS designed to fire 220 mm caliber thermobaric rockets. A full salvo from the TOS-1 will cover a rectangle 200x400 metres.[38] The Iskander-M theatre ballistic missile can also carry a 700 kilograms (1,500 lb) thermobaric warhead.[39] - -The fireball blast from the Russian Air Force's FOAB, the largest Thermobaric device to be detonated. -Many Russian Air Force munitions also have thermobaric variants. The 80 mm S-8 rocket has the S-8DM and S-8DF thermobaric variants. The S-8's larger 122 mm brother, the S-13 rocket, has the S-13D and S-13DF thermobaric variants. The S-13DF's warhead weighs only 32 kg (71 lb) but its power is equivalent to 40 kg (88 lb) of TNT. The KAB-500-OD variant of the KAB-500KR has a 250 kg (550 lb) thermobaric warhead. The ODAB-500PM and ODAB-500PMV unguided bombs carry a 190 kg (420 lb) fuel-air explosive each. The KAB-1500S GLONASS/GPS guided 1,500 kg (3,300 lb) bomb also has a thermobaric variant. Its fireball will cover over a 150-metre (490 ft) radius and its lethality zone is a 500-metre (1,600 ft) radius.[40] The 9M120 Ataka-V and the 9K114 Shturm ATGMs both have thermobaric variants. -In September 2007 Russia exploded the largest thermobaric weapon ever made. The weapon's yield was reportedly greater than that of the smallest dial-a-yield nuclear weapons at their lowest settings.[41][42] Russia named this particular ordnance the "Father of All Bombs" in response to the United States developed "Massive Ordnance Air Blast" (MOAB) bomb whose backronym is the "Mother of All Bombs", and which previously held the accolade of the most powerful non-nuclear weapon in history.[43] The bomb contains an about 7 tons charge of a liquid fuel such as ethylene oxide, mixed with an energetic nanoparticle such as aluminium, surrounding a high explosive burster[44] that when detonated created an explosion equivalent to 44 metric tons of TNT. -US developments[edit] - -A BLU-72/B bomb on a USAF A-1E taking off from Nakhon Phanom, in September 1968. -Current US FAE munitions include: -BLU-73 FAE I -BLU-95 500-lb (FAE-II) -BLU-96 2,000-lb (FAE-II) -CBU-55 FAE I -CBU-72 FAE I -The XM1060 40-mm grenade is a small-arms thermobaric device, which was delivered to U.S. forces in April 2003.[45] Since the 2003 Invasion of Iraq, the US Marine Corps has introduced a thermobaric 'Novel Explosive' (SMAW-NE) round for the Mk 153 SMAW rocket launcher. One team of Marines reported that they had destroyed a large one-story masonry type building with one round from 100 yards (91 m).[46] -The AGM-114N Hellfire II, first used by U.S. forces in 2003 in Iraq, uses a Metal Augmented Charge (MAC) warhead that contains a thermobaric explosive fill using fluoridated aluminium layered between the charge casing and a PBXN-112 explosive mixture. When the PBXN-112 detonates, the aluminium mixture is dispersed and rapidly burns. The resultant sustained high pressure is extremely effective against people and structures.[47] -History[edit] -Military use[edit] - -US Navy BLU-118B being prepared for shipping for use in Afghanistan, 5 March 2002. -The first experiments with thermobaric weapon were conducted in Germany during World War II and were led by Mario Zippermayr. The German bombs used coal dust as fuel and were extensively tested in 1943 and 1944, but did not reach mass production before the war ended. -The TOS-1 system was test fired in Panjshir valley during Soviet war in Afghanistan in the early 1980s.[48] -Unconfirmed reports suggest that Russian military forces used ground delivered thermobaric weapons in the storming of the Russian parliament during the 1993 Russian constitutional crisis and also during the Battle for Grozny (first and second Chechen wars) to attack dug in Chechen fighters. The use of both TOS-1 heavy MLRS and "RPO-A Shmel" shoulder-fired rocket system in the Chechen wars is reported to have occurred.[48][49] -It is theorized that a multitude of hand-held thermobaric weapons were used by the Russian Armed Forces in their efforts to retake the school during the 2004 Beslan school hostage crisis. The RPO-A and either the TGB-7V thermobaric rocket from the RPG-7 or rockets from either the RShG-1 or the RShG-2 is claimed to have been used by the Spetsnaz during the initial storming of the school.[50][51][52] At least 3 and as many as 9 RPO-A casings were later found at the positions of the Spetsnaz.[53][54] The Russian Government later admitted to the use of the RPO-A during the crisis.[55] -According to UK Ministry of Defence, British military forces have also used thermobaric weapons in their AGM-114N Hellfire missiles (carried by Apache helicopters and UAVs) against the Taliban in the War in Afghanistan.[56] -The US military also used thermobaric weapons in Afghanistan. On 3 March 2002, a single 2,000 lb (910 kg) laser guided thermobaric bomb was used by the United States Army against cave complexes in which Al-Qaeda and Taliban fighters had taken refuge in the Gardez region of Afghanistan.[57][58] The SMAW-NE was used by the US Marines during the First Battle of Fallujah and Second Battle of Fallujah. -Reports by the rebel fighters of the Free Syrian Army claim the Syrian Air Force used such weapons against residential area targets occupied by the rebel fighters, as for instance in the Battle for Aleppo[59] and also in Kafar Batna.[60] A United Nations panel of human rights investigators reported that the Syrian government used thermobaric bombs against the rebellious town of Qusayr in March 2013.[61] -Non-military use[edit] -Thermobaric and fuel-air explosives have been used in guerrilla warfare since the 1983 Beirut barracks bombing in Lebanon, which used a gas-enhanced explosive mechanism, probably propane, butane or acetylene.[62] The explosive used by the bombers in the 1993 World Trade Center bombing incorporated the FAE principle, using three tanks of bottled hydrogen gas to enhance the blast.[63][64] Jemaah Islamiyah bombers used a shock-dispersed solid fuel charge,[65] based on the thermobaric principle,[66] to attack the Sari nightclub in the 2002 Bali bombings.[67] -See also[edit] -Bunker buster -Dust explosion -FOAB -Flame fougasse -MOAB -RPO-A -SMAW -References[edit] -Jump up ^ Algeria Isp (2011-10-18). "Libye – l'Otan utilise une bombe FAE | Politique, Algérie". Algeria ISP. Retrieved 2013-04-23. -Jump up ^ Nettleton, J. Occ. Accidents, 1, 149 (1976). -Jump up ^ Strehlow, 14th. Symp. (Int.) Comb. 1189, Comb. Inst. (1973). -Jump up ^ Health and Safety Environmental Agency, 5th. and final report, 2008. -Jump up ^ See Nanofuel/Oxidizers For Energetic Compositions – John D. Sullivan and Charles N. Kingery (1994) High explosive disseminator for a high explosive air bomb. -Jump up ^ Slavica Terzić, Mirjana Dakić Kolundžija, Milovan Azdejković and Gorgi Minov (2004) Compatibility Of Thermobaric Mixtures Based On Isopropyl Nitrate And Metal Powders. -Jump up ^ Meyer, Rudolf; Josef Köhler and Axel Homburg (2007). Explosives. Weinheim: Wiley-VCH. pp. 312. ISBN 3-527-31656-6. OCLC 165404124. -Jump up ^ Howard C. Hornig (1998) Non-focusing active warhead. -Jump up ^ Chris Ludwig (Talley Defense) Verifying Performance of Thermobaric Materials for Small to Medium Caliber Rocket Warheads. -Jump up ^ Martin M.West (1982) Composite high explosives for high energy blast applications. -Jump up ^ Raafat H. Guirguis (2005) Reactively Induced Fragmenting Explosives. -Jump up ^ Michael Dunning, William Andrews and Kevin Jaansalu (2005) The Fragmentation of Metal Cylinders Using Thermobaric Explosives. -Jump up ^ David L. Frost, Fan Zhang, Stephen B. Murray and Susan McCahan Critical Conditions For Ignition Of Metal Particles In A Condensed Explosive. -Jump up ^ The Army Doctrine and Training Bulletin (2001) The Threat from Blast Weapons. -Jump up ^ INTERNATIONAL DEFENCE REVIEW (2004) ENHANCED BLAST AND THERMOBARICS. -Jump up ^ F. Winterberg Conjectured Metastable Super-Explosives formed under High Pressure for Thermonuclear Ignition. -Jump up ^ Zhang, Fan (Medicine Hat, CA) Murray, Stephen Burke (Medicine Hat, CA) Higgins, Andrew (Montreal, CA) (2005) Super compressed detonation method and device to effect such detonation. -Jump up ^ Nettleton, arch. combust.,1,131, (1981). -Jump up ^ Stephen B. Murray Fundamental and Applied Studies of Fuel-Air Detonation. -Jump up ^ John H. Lee (1992) Chemical initiation of detonation in fuel-air explosive clouds. -Jump up ^ Frank E. Lowther (1989) Nuclear-sized explosions without radiation. -Jump up ^ Nettleton, Comb. and Flame, 24,65 (1975). -Jump up ^ Fire Prev. Sci. and Tech. No. 19,4 (1976) -Jump up ^ May L.Chan (2001) Advanced Thermobaric Explosive Compositions. -Jump up ^ New Thermobaric Materials and Weapon Concepts. -Jump up ^ Robert C. Morris (2003) Small Thermobaric Weapons An Unnoticed Threat.[dead link] -^ Jump up to: a b "Backgrounder on Russian Fuel Air Explosives ("Vacuum Bombs") | Human Rights Watch". Hrw.org. 2000-02-01. Retrieved 2013-04-23. -Jump up ^ Defense Intelligence Agency, "Future Threat to the Soldier System, Volume I; Dismounted Soldier--Middle East Threat", September 1993, p. 73. Obtained by Human Rights Watch under the U.S. Freedom of Information Act. -Jump up ^ "Press | Human Rights Watch". Hrw.org. 2008-12-27. Retrieved 2009-07-30. -Jump up ^ Lester W. Grau and Timothy L. Thomas(2000)"Russian Lessons Learned From the Battles For Grozny" -Jump up ^ "Modern Firearms – GM-94". World.guns.ru. 2011-01-24. Retrieved 2011-07-12. -Jump up ^ "New RPO Shmel-M Infantry Rocket Flamethrower Man-Packable Thermobaric Weapon". defensereview.com. 2006-07-19. Retrieved 2012-08-27. -Jump up ^ "Shmel-M: Infantry Rocket-assisted Flamethrower of Enhanced Range and Lethality". Kbptula.ru. Retrieved 2013-12-28. -Jump up ^ "Modern Firearms – RShG-1". World.guns.ru. 2011-01-24. Retrieved 2011-07-12. -Jump up ^ "Modern Firearms – RMG". World.guns.ru. 2011-01-24. Retrieved 2011-07-12. -Jump up ^ "RMG - A new Multi-Purpose Assault Weapon from Bazalt". defense-update.com. Retrieved 2012-08-27. -Jump up ^ "Kornet-EM: Multi-purpose Long-range Missile System". Kbptula.ru. Retrieved 2013-12-28. -Jump up ^ "TOS-1 Heavy flamethrower system". military-today.com. Retrieved 2012-08-27. -Jump up ^ "SS-26". Missilethreat.com. Retrieved 2013-12-28. -Jump up ^ Air Power Australia (2007-07-04). "How to Destroy the Australian Defence Force". Ausairpower.net. Retrieved 2011-07-12. -Jump up ^ "Russia unveils devastating vacuum bomb". ABC News. 2007. Retrieved 2007-09-12. -Jump up ^ "Video of test explosion". BBC News. 2007. Retrieved 2007-09-12. -Jump up ^ Harding, Luke (2007-09-12). "Russia unveils the father of all bombs". London: The Guardian. Retrieved 2007-09-12. -Jump up ^ Berhie, Saba. "Dropping the Big One | Popular Science". Popsci.com. Retrieved 2011-07-12. -Jump up ^ John Pike (2003-04-22). "XM1060 40mm Thermobaric Grenade". Globalsecurity.org. Retrieved 2011-07-12. -Jump up ^ David Hambling (2005) "Marines Quiet About Brutal New Weapon" -Jump up ^ John Pike (2001-09-11). "AGM-114N Metal Augmented Charge (MAC) Thermobaric Hellfire". Globalsecurity.org. Retrieved 2011-07-12. -^ Jump up to: a b John Pike. "TOS-1 Buratino 220mm Multiple Rocket Launcher". Globalsecurity.org. Retrieved 2013-04-23. -Jump up ^ "Foreign Military Studies Office Publications - A 'Crushing' Victory: Fuel-Air Explosives and Grozny 2000". Fmso.leavenworth.army.mil. Retrieved 2013-04-23. -Jump up ^ "Russian forces faulted in Beslan school tragedy". Christian Science Monitor. 1 September 2006. Retrieved 14 February 2007. -Jump up ^ Russia: Independent Beslan Investigation Sparks Controversy, The Jamestown Foundation, 29 August 2006 -Jump up ^ Beslan still a raw nerve for Russia, BBC News, 1 September 2006 -Jump up ^ ACHING TO KNOW, Los Angeles Times, 27 August 2005 -Jump up ^ Searching for Traces of “Shmel” in Beslan School, Kommersant, 12 September 2005 -Jump up ^ A Reversal Over Beslan Only Fuels Speculation, The Moscow Times, 21 July 2005 -Jump up ^ "MoD's Controversial Thermobaric Weapons Use in Afghanistan". Armedforces-int.com. 2008-06-23. Retrieved 2013-04-23. -Jump up ^ "US Uses Bunker-Busting 'Thermobaric' Bomb for First Time". Commondreams.org. 2002-03-03. Retrieved 2013-04-23. -Jump up ^ John Pike. "BLU-118/B Thermobaric Weapon Demonstration / Hard Target Defeat Program". Globalsecurity.org. Retrieved 2013-04-23. -Jump up ^ "Syria rebels say Assad using 'mass-killing weapons' in Aleppo". October 10, 2012. Retrieved November 11, 2012. -Jump up ^ "Dropping Thermobaric Bombs on Residential Areas in Syria_ Nov. 5. 2012". First Post. November 11, 2012. Retrieved November 11, 2012. -Jump up ^ Cumming-Bruce, Nick (2013-06-04). "U.N. Panel Reports Increasing Brutality by Both Sides in Syria". The New York Times. -Jump up ^ Richard J. Grunawalt. Hospital Ships In The War On Terror: Sanctuaries or Targets? (PDF), Naval War College Review, Winter 2005, pp. 110–11. -Jump up ^ Paul Rogers (2000) "Politics in the Next 50 Years: The Changing Nature of International Conflict" -Jump up ^ J. Gilmore Childers, Henry J. DePippo (February 24, 1998). "Senate Judiciary Committee, Subcommittee on Technology, Terrorism, and Government Information hearing on "Foreign Terrorists in America: Five Years After the World Trade Center"". Fas.org. Retrieved 2011-07-12. -Jump up ^ P. Neuwald, H. Reichenbach, A. L. Kuhl (2003). "Shock-Dispersed-Fuel Charges-Combustion in Chambers and Tunnels". -Jump up ^ David Eshel (2006). "Is the world facing Thermobaric Terrorism?".[dead link] -Jump up ^ Wayne Turnbull (2003). "Bali:Preparations". -External links[edit] -Fuel/Air Explosive (FAE) -Thermobaric Explosive (Global Security) -Aspects of thermobaric weaponry (PDF) – Dr. Anna E Wildegger-Gaissmaier, Australian Defence Force Health -Thermobaric warhead for RPG-7 -XM1060 40 mm Thermobaric Grenade (Global Security) -Defense Update: Fuel-Air Explosive Mine Clearing System -Foreign Military Studies Office – A 'Crushing' Victory: Fuel-Air Explosives and Grozny 2000 -Soon to make a comeback in Afghanistan -Russia claims to have tested the most powerful "Vacuum" weapon -Categories: Explosive weaponsAmmunitionThermobaric weaponsAnti-personnel weapons -Navigation menu -Create accountLog inArticleTalkReadEditView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -العربية -Беларуская -Български -Čeština -Deutsch -Español -فارسی -Français -हिन्दी -Italiano -עברית -Latviešu -Македонски -Nederlands -日本語 -Polski -Русский -Suomi -Svenska -Türkçe -Українська -Tiếng Việt -粵語 -中文 -Edit links -This page was last modified on 28 November 2014 at 10:32. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -Gunpowder -From Wikipedia, the free encyclopedia -For other uses, see Gunpowder (disambiguation). -In American English, the term gunpowder also refers broadly to any gun propellant.[1] Gunpowder (black powder) as described in this article is not normally used in modern firearms, which instead use smokeless powders. - -Black powder for muzzleloading rifles and pistols in FFFG granulation size. American Quarter (diameter 24 mm) for comparison. -Gunpowder, also known as black powder, is a chemical explosive—the earliest known. It is a mixture of sulfur, charcoal, and potassium nitrate (saltpeter). The sulfur and charcoal act as fuels, and the saltpeter is an oxidizer.[2][3] Because of its burning properties and the amount of heat and gas volume that it generates, gunpowder has been widely used as a propellant in firearms and as a pyrotechnic composition in fireworks. -Gunpowder is assigned the UN number UN0027 and has a hazard class of 1.1D. It has a flash point of approximately 427–464 °C (801–867 °F). The specific flash point may vary based on the specific composition of the gunpowder. Gunpowder's gravity is 1.70–1.82 (mercury method) orŠ 1.92–2.08 (pycnometer), and it has a pH of 6.0–8.0. It is also considered to be an insoluble material.[4] -Gunpowder was, according to prevailing academic consensus, invented in the 9th century in China,[5][6] and the earliest record of a written formula for gunpowder appears in the 11th century Song Dynasty text, Wujing Zongyao.[7] This discovery led to the invention of fireworks and the earliest gunpowder weapons in China. In the centuries following the Chinese discovery, gunpowder weapons began appearing in the Muslim world, Europe, and India. The technology spread from China through the Middle East or Central Asia, and then into Europe.[8] The earliest Western accounts of gunpowder appear in texts written by English philosopher Roger Bacon in the 13th century.[9] -Gunpowder is classified as a low explosive because of its relatively slow decomposition rate and consequently low brisance. Low explosives deflagrate (i.e., burn) at subsonic speeds, whereas high explosives detonate, producing a supersonic wave. Gunpowder's burning rate increases with pressure, so it bursts containers if contained but otherwise just burns in the open. Ignition of the powder packed behind a bullet must generate enough pressure to force it from the muzzle at high speed, but not enough to rupture the gun barrel. Gunpowder thus makes a good propellant, but is less suitable for shattering rock or fortifications. Gunpowder was widely used to fill artillery shells and in mining and civil engineering to blast rock roughly until the second half of the 19th century, when the first high explosives (nitro-explosives) were discovered. Gunpowder is no longer used in modern explosive military warheads, nor is it used as main explosive in mining operations due to its cost relative to that of newer alternatives such as ammonium nitrate/fuel oil (ANFO).[10] Black powder is still used as a delay element in various munitions where its slow-burning properties are valuable. -Formulations used in blasting rock (such as in quarrying) are called blasting powder. -Contents [hide] -1 History -1.1 China -1.2 Middle East -1.3 Mainland Europe -1.4 Britain and Ireland -1.5 India -1.6 Indonesia -2 Manufacturing technology -3 Composition and characteristics -4 Serpentine -5 Corning -6 Modern types -7 Other types of gunpowder -8 Sulfur-free gunpowder -9 Combustion characteristics -9.1 Advantages -9.2 Disadvantages -9.3 Transportation -10 Other uses -11 See also -12 References -13 External links -History[edit] - -Early Chinese rocket - -A Mongol bomb thrown against a charging Japanese samurai during the Mongol invasions of Japan after founding the Yuan Dynasty, 1281. -Main article: History of gunpowder -Gunpowder was invented in China while taoists attempted to create a potion of immortality. Chinese military forces used gunpowder-based weapons (i.e. rockets, guns, cannons) and explosives (i.e. grenades and different types of bombs) against the Mongols when the Mongols attempted to invade and breach city fortifications on China's northern borders. After the Mongols conquered China and founded the Yuan Dynasty, they used the Chinese gunpowder-based weapons technology in their attempted invasion of Japan; they also used gunpowder to fuel rockets. -The mainstream scholarly consensus is that gunpowder was invented in China, spread through the Middle East, and then into Europe,[8] although there is a dispute over how much the Chinese advancements in gunpowder warfare influenced later advancements in the Middle East and Europe.[11][12] The spread of gunpowder across Asia from China is widely attributed to the Mongols. One of the first examples of Europeans encountering gunpowder and firearms is at the Battle of Mohi in 1241. At this battle the Mongols not only used gunpowder in early Chinese firearms but in the earliest grenades as well. -A major problem confronting the study of the early history of gunpowder is ready access to sources close to the events described. Often enough, the first records potentially describing use of gunpowder in warfare were written several centuries after the fact, and may well have been colored by the contemporary experiences of the chronicler.[13] It is also difficult to accurately translate original alchemy texts, especially medieval Chinese texts that try to explain phenomena through metaphor, into modern scientific language with rigidly defined terminology. The translation difficulty has led to errors or loose interpretations bordering on artistic licence.[14][15] Early writings potentially mentioning gunpowder are sometimes marked by a linguistic process where old words acquired new meanings.[16] For instance, the Arabic word naft transitioned from denoting naphtha to denoting gunpowder, and the Chinese word pao evolved from meaning catapult to referring to cannon.[17] According to science and technology historian Bert S. Hall: "It goes without saying, however, that historians bent on special pleading, or simply with axes of their own to grind, can find rich material in these terminological thickets."[18] -China[edit] -Further information: Wujing Zongyao, Four Great Inventions and List of Chinese inventions - -Chinese Ming Dynasty (1368-1644) matchlock firearms -Saltpeter was known to the Chinese by the mid-1st century AD and there is strong evidence of the use of saltpeter and sulfur in various largely medicinal combinations.[19] A Chinese alchemical text dated 492 noted saltpeter burnt with a purple flame, providing a practical and reliable means of distinguishing it from other inorganic salts, thus enabling alchemists to evaluate and compare purification techniques; the earliest Latin accounts of saltpeter purification are dated after 1200.[20] - -Yuan Dynasty bronze hand cannon from 1332 at th (c. 808); it describes mixing six parts sulfur to six parts saltpeter to one part birthwort herb (which would provide carbon).[21] -The first reference to the incendiary properties of such mixtures is the passage of the Zhenyuan miaodao yaolüe, a Taoist text tentatively dated to the mid-9th century AD:[20] "Some have heated together sulfur, realgar and saltpete with honey; smoke and flames result, so that their hands and faces have been burnt, and even the whole house where they were working burned down."[22] The Chinese word for "gunpowder" is Chinese: 火药/火藥; pinyin: huŏ yào /xuou yɑʊ/, which literally means "Fire Medicine";[23] however this name only came into use some centuries after the mixture's discovery.[24] During the 9th century, Taoist monks or alchemists searching for an elixir of immortality had serendipitously stumbled upon gunpowder.[8][25] The Chinese wasted little time in applying gunpowder to the development of weapons, and in the centuries that followed, they produced a variety of gunpowder weapons, including flamethrowers, rockets, bombs, and land mines, before inventing guns as a projectile weapon.[26] Archaeological evidence of a hand cannon has been excavated in Manchuria dated from the late 1200s[27] and the shells of explosive bombs have been discovered in a shipwreck off the shore of Japan dated from 1281, during the Mongol invasions of Japan.[28] -The Chinese "Wu Ching Tsung Yao" (Complete Essentials from the Military Classics), written by Tseng Kung-Liang between 1040–1044, provides encyclopedia references to a variety of mixtures that included petrochemicals—as well as garlic and honey. A slow match for flame throwing mechanisms using the siphon principle and for fireworks and rockets are mentioned. The mixture formulas in this book do not contain enough saltpeter to create an explosive however; being limited to at most 50% saltpeter, they produce an incendiary.[29] The Essentials was however written by a Song Dynasty court bureaucrat, and there's little evidence that it had any immediate impact on warfare; there is no mention of gunpowder use in the chronicles of the wars against the Tanguts in the eleventh century, and China was otherwise mostly at peace during this century. The first chronicled use of "fire spears" (or "fire lances") is at the siege of De'an in 1132.[30] - -Formula for gunpowder in 1044 Wujing zongyao part I vol 12 - - -Instruction for fire bomb in Wujing zongyao - - -Fire bomb - - -Fire grenade - - -Proto-cannon from the Ming Dynasty text Huolongjing - - -Land mine from the Ming Dynasty text Huolongjing - - -Fire arrow rocket launcher from the Wujing zongyao -Middle East[edit] -Main articles: Inventions in the Islamic world and Alchemy and chemistry in Islam - -The Sultani Cannon, a very heavy bronze breech-loading cannon of type used by Ottoman Empire in the conquest of Constantinople, in 1453. -The Muslims acquired knowledge of gunpowder some time between 1240 and 1280, by which time the Syrian Hasan al-Rammah had written, in Arabic, recipes for gunpowder, instructions for the purification of saltpeter, and descriptions of gunpowder incendiaries. Gunpowder arrived in the Middle East, possibly through India, from China. This is implied by al-Rammah's usage of "terms that suggested he derived his knowledge from Chinese sources" and his references to saltpeter as "Chinese snow" Arabic: ثلج الصين‎ thalj al-ṣīn, fireworks as "Chinese flowers" and rockets as "Chinese arrows".[31] However, because al-Rammah attributes his material to "his father and forefathers", al-Hassan argues that gunpowder became prevalent in Syria and Egypt by "the end of the twelfth century or the beginning of the thirteenth".[32] Persians called saltpeter "Chinese salt" [33][34][35][36][37] or "salt from Chinese salt marshes" (namak shūra chīnī Persian: نمک شوره چيني‎).[38][39] - -A picture of a 15th-century Granadian cannon from the book Al-izz wal rifa'a. -Al-Hassan claims that in the Battle of Ain Jalut of 1260, the Mamluks used against the Mongols in "the first cannon in history" gunpowder formula with near-identical ideal composition ratios for explosive gunpowder.[32] Other historians urge caution regarding claims of Islamic firearms use in the 1204-1324 period as late medieval Arabic texts used the same word for gunpowder, naft, that they used for an earlier incendiary, naphtha.[13][17] Khan claims that it was invading Mongols who introduced gunpowder to the Islamic world[40] and cites Mamluk antagonism towards early musketeers in their infantry as an example of how gunpowder weapons were not always met with open acceptance in the Middle East.[41] Similarly, the refusal of their Qizilbash forces to use firearms contributed to the Safavid rout at Chaldiran in 1514.[41] -The earliest surviving documentary evidence for the use of the hand cannon, considered the oldest type of portable firearm and a forerunner of the handgun, are from several Arabic manuscripts dated to the 14th century.[42] Al-Hassan argues that these are based on earlier originals and that they report hand-held cannons being used by the Mamluks at the Battle of Ain Jalut in 1260.[32] -Hasan al-Rammah included 107 gunpowder recipes in his text al-Furusiyyah wa al-Manasib al-Harbiyya (The Book of Military Horsemanship and Ingenious War Devices), 22 of which are for rockets. If one takes the median of 17 of these 22 compositions for rockets (75% nitrates, 9.06% sulfur, and 15.94% carbon), it is nearly identical to the modern reported ideal gunpowder recipe of 75% potassium nitrate, 10% sulfur, and 15% carbon.[32] -The state-controlled manufacture of gunpowder by the Ottoman Empire through early supply chains to obtain nitre, sulfur and high-quality charcoal from oaks in Anatolia contributed significantly to its expansion the 15th and 18th century. It was not until later in the 19th century when the syndicalist production of Turkish gunpowder was greatly reduced, which coincided with the decline of its military might.[43] -Mainland Europe[edit] -Several sources mention Chinese firearms and gunpowder weapons being deployed by the Mongols against European forces at the Battle of Mohi in 1241.[44][45][46] Professor Kenneth Warren Chase credits the Mongols for introducing into Europe gunpowder and its associated weaponry.[47] -C. F. Temler interprets Peter, Bishop of Leon, as reporting the use of cannons in Seville in 1248.[48] -In Europe, one of the first mentions of gunpowder use appears in a passage found in Roger Bacon's Opus Maius and Opus Tertium in what has been interpreted as being firecrackers. The most telling passage reads: "We have an example of these things (that act on the senses) in [the sound and fire of] that children's toy which is made in many [diverse] parts of the world; i.e., a device no bigger than one's thumb. From the violence of that salt called saltpeter [together with sulfur and willow charcoal, combined into a powder] so horrible a sound is made by the bursting of a thing so small, no more than a bit of parchment [containing it], that we find [the ear assaulted by a noise] exceeding the roar of strong thunder, and a flash brighter than the most brilliant lightning."[9] In the early 20th century, British artillery officer Henry William Lovett Hime proposed that another work tentatively attributed to Bacon, Epistola de Secretis Operibus Artis et Naturae, et de Nullitate Magiae contained an encrypted formula for gunpowder. This claim has been disputed by historians of science including Lynn Thorndike, John Maxson Stillman and George Sarton and by Bacon's editor Robert Steele, both in terms of authenticity of the work, and with respect to the decryption method.[9] In any case, the formula claimed to have been decrypted (7:5:5 saltpeter:charcoal:sulfur) is not useful for firearms use or even firecrackers, burning slowly and producing mostly smoke.[49][50] - -Cannon forged in 1667 at the Fortín de La Galera, Nueva Esparta, Venezuela. -The Liber Ignium, or Book of Fires, attributed to Marcus Graecus, is a collection of incendiary recipes, including some gunpowder recipes. Partington dates the gunpowder recipes to approximately 1300.[51] One recipe for "flying fire" (ingis volatilis) involves saltpeter, sulfur, and colophonium, which, when inserted into a reed or hollow wood, "flies away suddenly and burns up everything." Another recipe, for artificial "thunder", specifies a mixture of one pound native sulfur, two pounds linden or willow charcoal, and six pounds of saltpeter.[52] Another specifies a 1:3:9 ratio.[52] -Some of the gunpowder recipes of De Mirabilibus Mundi of Albertus Magnus are identical to the recipes of the Liber Ignium, and according to Partington, "may have been taken from that work, rather than conversely."[53] Partington suggests that some of the book may have been compiled by Albert's students, "but since it is found in thirteenth century manuscripts, it may well be by Albert."[53] Albertus Magnus died in 1280. -A common German folk-tale is of the German priest/monk named Berthold Schwarz who independently invented gunpowder, thus earning it the German name Schwarzpulver or in English Schwarz's powder. Schwarz is also German for black so this folk-tale, while likely containing elements of truth, is considered problematic. -A major advance in manufacturing began in Europe in the late 14th century when the safety and thoroughness of incorporation was improved by wet grinding; liquid, such as distilled spirits or perhaps the urine of wine-drinking bishops[54] was added during the grinding-together of the ingredients and the moist paste dried afterwards. (The principle of wet mixing to prevent the separation of dry ingredients, invented for gunpowder, is used today in the pharmaceutical industry.[55]) It was also discovered that if the paste was rolled into balls before drying the resulting gunpowder absorbed less water from the air during storage and traveled better. The balls were then crushed in a mortar by the gunner immediately before use, with the old problem of uneven particle size and packing causing unpredictable results. -If the right size particles were chosen, however, the result was a great improvement in power. Forming the damp paste into corn-sized clumps by hand or with the use of a sieve instead of larger balls produced a product after drying that loaded much better, as each tiny piece provided its own surrounding air space that allowed much more rapid combustion than a fine powder. This "corned" gunpowder was from 30% to 300% more powerful. An example is cited where 34 pounds of serpentine was needed to shoot a 47 pound ball, but only 18 pounds of corned powder.[54] The optimum size of the grain depended on its use; larger for large cannon, finer for small arms. Larger cast cannons were easily muzzle-loaded with corned powder using a long-handled ladle. Corned powder also retained the advantage of low moisture absorption, as even tiny grains still had much less surface area to attract water than a floury powder. -During this time, European manufacturers also began regularly purifying saltpeter, using wood ashes containing potassium carbonate to precipitate calcium from their dung liquor, and using ox blood, alum, and slices of turnip to clarify the solution.[54] -Gunpowder-making and metal-smelting and casting for shot and cannon fee was closely held by skilled military tradesmen, who formed guilds that collected dues, tested apprentices, and gave pensions. "Fire workers" were also required to craft fireworks for celebrations of victory or peace. During the Renaissance, two European schools of pyrotechnic thought emerged, one in Italy and the other at Nuremberg, Germany. Vannoccio Biringuccio, born in 1480, was a member of the guild Fraternita di Santa Barbara but broke with the tradition of secrecy by setting down everything he knew in a book titled De la pirotechnia, written in vernacular. The first printed book on either gunpowder or metalworking, it was published posthumously in 1540, with 9 editions over 138 years, and also reprinted by MIT Press in 1966.[54] By the mid-17th century fireworks were used for entertainment on an unprecedented scale in Europe, being popular even at resorts and public gardens.[56] -In 1774 Louis XVI ascended to the throne of France at age 20. After he discovered that France was not self-sufficient in gunpowder, a Gunpowder Administration was established; to head it, the lawyer Antoine Lavoisier was appointed. Although from a bourgeois family, after his degree in law Lavoisier became wealthy from a company set up to collect taxes for the Crown; this allowed him to pursue experimental natural science as a hobby.[57] -Without access to cheap Indian saltpeter (controlled by the British), for hundreds of years France had relied on saltpetermen with royal warrants, the droit de fouille or "right to dig", to seize nitrous-containing soil and demolished walls of barnyards, without compensation to the owners.[58] This caused farmers, the wealthy, or entire villages to bribe the petermen and the associated bureaucracy to leave their buildings alone and the saltpeter uncollected. Lavoisier instituted a crash program to increase saltpeter production, revised (and later eliminated) the droit de fouille, researched best refining and powder manufacturing methods, instituted management and record-keeping, and established pricing that encouraged private investment in works. Although saltpeter from new Prussian-style putrefaction works had not been produced yet (the process taking about 18 months), in only a year France had gunpowder to export. A chief beneficiary of this surplus was the American Revolution. By careful testing and adjusting the proportions and grinding time, powder from mills such as at Essonne outside Paris became the best in the world by 1788, and inexpensive.[58] [59] -Britain and Ireland[edit] - -The old Powder or Pouther magazine dating from 1642, built by order of Charles I. Irvine, North Ayrshire, Scotland -Gunpowder production in Britain appears to have started in the mid 14th century AD with the aim of supplying the English Crown.[60] Records show that gunpowder was being made, in England, in 1346, at the Tower of London; a powder house existed at the Tower in 1461; and in 1515 three King's gunpowder makers worked there.[60] Gunpowder was also being made or stored at other Royal castles, such as Portchester. By the early 14th century, according to N.J.G. Pounds's study The Medieval Castle in England and Wales, many English castles had been deserted and others were crumbling. Their military significance faded except on the borders. Gunpowder had made smaller castles useless.[61] -Henry VIII of England was short of gunpowder when he invaded France in 1544 and England needed to import gunpowder via the port of Antwerp in what is now Belgium.[60] -The English Civil War (1642–1645) led to an expansion of the gunpowder industry, with the repeal of the Royal Patent in August 1641.[60] -Two British physicists, Andrew Noble and Frederick Abel, worked to improve the properties of black powder during the late 19th century. This formed the basis for the Noble-Abel gas equation for internal ballistics.[62] -The introduction of smokeless powder in the late 19th century led to a contraction of the gunpowder industry. After the end of World War I, the majority of the United Kingdom gunpowder manufacturers merged into a single company, "Explosives Trades limited"; and number of sites were closed down, including those in Ireland. This company became Nobel Industries Limited; and in 1926 became a founding member of Imperial Chemical Industries. The Home Office removed gunpowder from its list of Permitted Explosives; and shortly afterwards, on 31 December 1931, the former Curtis & Harvey's Glynneath gunpowder factory at Pontneddfechan, in Wales, closed down, and it was demolished by fire in 1932.[63] - -Gunpowder storing barrels at Martello tower in Point Pleasant Park -The last remaining gunpowder mill at the Royal Gunpowder Factory, Waltham Abbey was damaged by a German parachute mine in 1941 and it never reopened.[64] This was followed by the closure of the gunpowder section at the Royal Ordnance Factory, ROF Chorley, the section was closed and demolished at the end of World War II; and ICI Nobel's Roslin gunpowder factory, which closed in 1954.[64][65] -This left the sole United Kingdom gunpowder factory at ICI Nobel's Ardeer site in Scotland; it too closed in October 1976.[64] Since then gunpowder has been imported into the United Kingdom. In the late 1970s/early 1980s gunpowder was bought from eastern Europe, particularly from what was then the German Democratic Republic and former Yugoslavia. -India[edit] - -In the year 1780 the British began to annex the territories of the Sultanate of Mysore, during the Second Anglo-Mysore War. The British battalion was defeated during the Battle of Guntur, by the forces of Hyder Ali, who effectively utilized Mysorean rockets and Rocket artillery against the closely massed British forces. - -Mughal Emperor Shah Jahan, hunting deer using a Matchlock as the sun sets in the horizon. -Gunpowder and gunpowder weapons were transmitted to India through the Mongol invasions of India.[66][67] The Mongols were defeated by Alauddin Khilji of the Delhi Sultanate, and some of the Mongol soldiers remained in northern India after their conversion to Islam.[67] It was written in the Tarikh-i Firishta (1606–1607) that Nasir ud din Mahmud the ruler of the Delhi Sultanate presented the envoy of the Mongol ruler Hulegu Khan with a dazzling pyrotechnics display upon his arrival in Delhi in 1258 AD. Nasir ud din Mahmud tried to express his strength as a ruler and tried to ward off any Mongol attempt similar to the Siege of Baghdad (1258).[68] Firearms known as top-o-tufak also existed in many Muslim kingdoms in India by as early as 1366 AD.[68] From then on the employment of gunpowder warfare in India was prevalent, with events such as the "Siege of Belgaum" in 1473 by Sultan Muhammad Shah Bahmani.[69] -The shipwrecked Ottoman Admiral Seydi Ali Reis is known to have introduced the earliest type of Matchlock weapons, which the Ottomans used against the Portuguese during the Siege of Diu (1531). After that, a diverse variety of firearms; large guns in particular, became visible in Tanjore, Dacca, Bijapur, and Murshidabad.[70] Guns made of bronze were recovered from Calicut (1504)- the former capital of the Zamorins[71] -The Mughal Emperor Akbar mass-produced matchlocks for the Mughal Army. Akbar is personally known to have shot a leading Rajput commander during the Siege of Chittorgarh.[72] The Mughals began to use Bamboo rockets (mainly for signalling) and employ Sappers: special units that undermined heavy stone fortifications to plant gunpowder charges. -The Mughal Emperor Shah Jahan is known to have introduced much more advanced Matchlocks, their designs were a combination of Ottoman and Mughal designs. Shah Jahan also countered the British and other Europeans in his province of Gujarāt, which supplied Europe saltpeter for use in gunpowder warfare during the 17th century.[73] Bengal and Mālwa participated in saltpeter production.[73] The Dutch, French, Portuguese, and English used Chhapra as a center of saltpeter refining.[73] -Ever since the founding of the Sultanate of Mysore by Hyder Ali, French military officers were employed to train the Mysore Army. Hyder Ali and his son Tipu Sultan were the first to introduce modern Cannons and Muskets, their army was also the first in India to have official uniforms. During the Second Anglo-Mysore War Hyder Ali and his son Tipu Sultan unleashed the Mysorean rockets at their British opponents effectively defeating them on various occasions. The Mysorean rockets inspired the development of the Congreve rocket, which the British widely utilized during the Napoleonic Wars and the War of 1812.[74] -Indonesia[edit] -The Javanese Majapahit Empire was arguably able to encompass much of modern day Indonesia due to its unique mastery of bronze smithing and use of a central arsenal fed by a large number of cottage industries within the immediate region. Documentary and archeological evidence indicate that Arab or Indian traders introduced gunpowder, gonnes, muskets, blunderbusses, and cannons to the Javanese, Acehnese, and Batak via long established commercial trade routes around the early to mid 14th century CE.[75] Portuguese and Spanish invaders were unpleasantly surprised and occasionally even outgunned on occasion.[76] The resurgent Singhasari Empire overtook Sriwijaya and later emerged as the Majapahit whose warfare featured the use of fire-arms and cannonade.[77] Circa 1540 CE the Javanese, always alert for new weapons found the newly arrived Portuguese weaponry superior to that of the locally made variants. Javanese bronze breech-loaded swivel-guns, known as meriam, or erroneously as lantaka, was used widely by the Majapahit navy as well as by pirates and rival lords. The demise of the Majapahit empire and the dispersal of disaffected skilled bronze cannon-smiths to Brunei, modern Sumatra, Malaysia and the Philippines lead to widespread use, especially in the Makassar Strait. -Saltpeter harvesting was recorded by Dutch and German travelers as being common in even the smallest villages and was collected from the decomposition process of large dung hills specifically piled for the purpose. The Dutch punishment for possession of non-permitted gunpowder appears to have been amputation.[78] Ownership and manufacture of gunpowder was later prohibited by the colonial Dutch occupiers.[75] According to a colonel McKenzie quoted in Sir Thomas Stamford Raffles, The History of Java (1817), the purest sulfur was supplied from a crater from a mountain near the straits of Bali.[77] -Manufacturing technology[edit] - -Edge-runner mill in a restored mill, at Eleutherian Mills -For the most powerful black powder meal, a wood charcoal is used. The best wood for the purpose is Pacific willow,[79] but others such as alder or buckthorn can be used. In Great Britain between the 15th to 19th centuries charcoal from alder buckthorn was greatly prized for gunpowder manufacture; cottonwood was used by the American Confederate States.[80] The ingredients are reduced in particle size and mixed as intimately as possible. Originally this was with a mortar-and-pestle or a similarly operating stamping-mill, using copper, bronze or other non-sparking materials, until supplanted by the rotating ball mill principle with non-sparking bronze or lead. Historically, a marble or limestone edge runner mill, running on a limestone bed was used in Great Britain; however, by the mid 19th century AD this had changed to either an iron shod stone wheel or a cast iron wheel running on an iron bed.[81] The mix was dampened with alcohol or water during grinding to prevent accidental ignition. This also helps the extremely soluble saltpeter mix into the microscopic nooks and crannies of the very high surface-area charcoal. -Around the late 14th century AD, European powdermakers first began adding liquid during grinding to improve mixing, reduce dust, and with it the risk of explosion.[82] The powder-makers would then shape the resulting paste of dampened gunpowder, known as mill cake, into corns, or grains, to dry. Not only did corned powder keep better because of its reduced surface area, gunners also found that it was more powerful and easier to load into guns. Before long, powder-makers standardized the process by forcing mill cake through sieves instead of corning powder by hand. -The improvement was based on reducing the surface area of a higher density composition. At the beginning of the 19th century, makers increased density further by static pressing. They shoveled damp mill cake into a two-foot square box, placed this beneath a screw press and reduced it to 1/2 its volume. "Presscake" had the hardness of slate. They broke the dried slabs with hammers or rollers, and sorted the granules with sieves into different grades. In the United States, Irenee du Pont, who had learned the trade from Lavoisier, tumbled the dried grains in rotating barrels to round the edges and increase durability during shipping and handling. (Sharp grains rounded off in transport, producing fine "meal dust" that changed the burning properties.) -Another advance was the manufacture of kiln charcoal by distilling wood in heated iron retorts instead of burning it in earthen pits. Controlling the temperature influenced the power and consistency of the finished gunpowder. In 1863, in response to high prices for Indian saltpeter, DuPont chemists developed a process using potash or mined potassium chloride to convert plentiful Chilean sodium nitrate to potassium nitrate.[83] -During the 18th century gunpowder factories became increasingly dependent on mechanical energy.[84] Despite mechanization, production difficulties related to humidity control, especially during the pressing, were still present in the late 19th century. A paper from 1885 laments that "Gunpowder is such a nervous and sensitive spirit, that in almost every process of manufacture it changes under our hands as the weather changes." Pressing times to the desired density could vary by factor of three depending on the atmospheric humidity.[85] -Composition and characteristics[edit] -The term black powder was coined in the late 19th century, primarily in the United States, to distinguish prior gunpowder formulations from the new smokeless powders and semi-smokeless powders, in cases where these are not referred to as cordite. Semi-smokeless powders featured bulk volume properties that approximated black powder, but had significantly reduced amounts of smoke and combustion products. Smokeless powder has different burning properties (pressure vs. time) and can generate higher pressures and work per gram. This can rupture older weapons designed for black powder. Smokeless powders ranged in color from brownish tan to yellow to white. Most of the bulk semi-smokeless powders ceased to be manufactured in the 1920s.[86][87][88] -Black powder is a granular mixture of -a nitrate, typically potassium nitrate (KNO3), which supplies oxygen for the reaction; -charcoal, which provides carbon and other fuel for the reaction, simplified as carbon (C); -sulfur (S), which, while also serving as a fuel, lowers the temperature required to ignite the mixture, thereby increasing the rate of combustion. -Potassium nitrate is the most important ingredient in terms of both bulk and function because the combustion process releases oxygen from the potassium nitrate, promoting the rapid burning of the other ingredients.[89] To reduce the likelihood of accidental ignition by static electricity, the granules of modern black powder are typically coated with graphite, which prevents the build-up of electrostatic charge. -Charcoal does not consist of pure carbon; rather, it consists of partially pyrolyzed cellulose, in which the wood is not completely decomposed. Carbon differs from charcoal. Whereas charcoal's autoignition temperature is relatively low, carbon's is much greater. Thus, a black powder composition containing pure carbon would burn similarly to a match head, at best.[90] -The current standard composition for the black powders that are manufactured by pyrotechnicians was adopted as long ago as 1780. Proportions by weight are 75% potassium nitrate (known as saltpeter or saltpetre), 15% softwood charcoal, and 10% sulfur.[81] These ratios have varied over the centuries and by country, and can be altered somewhat depending on the purpose of the powder. For instance, power grades of black powder, unsuitable for use in firearms but adequate for blasting rock in quarrying operations, is called blasting powder rather than gunpowder with standard proportions of 70% nitrate, 14% charcoal, and 16% sulfur; blasting powder may be made with the cheaper sodium nitrate substituted for potassium nitrate and proportions may be as low as 40% nitrate, 30% charcoal, and 30% sulfur.[91] In 1857, Lamont DuPont solved the main problem of using cheaper sodium nitrate formulations when he patented DuPont "B" Blasting powder. After manufacturing grains from press-cake in the usual way, his process tumbled the powder with graphite dust for 12 hours. This formed a graphite coating on each grain that reduced its ability to absorb moisture.[92] -French war powder in 1879 used the ratio 75% saltpeter, 12.5% charcoal, 12.5% sulfur. English war powder in 1879 used the ratio 75% saltpeter, 15% charcoal, 10% sulfur.[93] The British Congreve rockets used 62.4% saltpeter, 23.2% charcoal and 14.4% sulfur, but the British Mark VII gunpowder was changed to 65% saltpeter, 20% charcoal and 15% sulfur.[94] The explanation for the wide variety in formulation relates to usage. Powder used for rocketry can use a slower burn rate since it accelerates the projectile for a much longer time—whereas powders for weapons such as flintlocks, cap-locks, or matchlocks need a higher burn rate to accelerate the projectile in a much shorter distance. Cannons usually used lower burn rate powders, because most would burst with higher burn rate powders. -Serpentine[edit] -The original dry-compounded powder used in fifteenth-century Europe was known as "Serpentine", either a reference to Satan[95] or to a common artillery piece that used it.[96] The ingredients were ground together with a mortar and pestle, perhaps for 24 hours,[96] resulting in a fine flour. Vibration during transportation could cause the components to separate again, requiring remixing in the field. Also if the quality of the saltpeter was low (for instance if it was contaminated with highly hygroscopic calcium nitrate), or if the powder was simply old (due to the mildly hygroscopic nature of potassium nitrate), in humid weather it would need to be re-dried. The dust from "repairing" powder in the field was a major hazard. -Loading cannons or bombards before the powder-making advances of the Renaissance was a skilled art. Fine powder loaded haphazardly or too tightly would burn incompletely or too slowly. Typically, the breech-loading powder chamber in the rear of the piece was filled only about half full, the serpentine powder neither too compressed nor too loose, a wooden bung pounded in to seal the chamber from the barrel when assembled, and the projectile placed on. A carefully determined empty space was necessary for the charge to burn effectively. When the cannon was fired through the touchhole, turbulence from the initial surface combustion caused the rest of the powder to be rapidly exposed to the flame.[96] -The advent of much more powerful and easy to use corned powder changed this procedure, but serpentine was used with older guns into the seventeenth century.[97] -Corning[edit] -For gunpowder to explode effectively, the combustible ingredients must be reduced to the smallest possible particle sizes, and thoroughly mixed as possible. Once mixed, however, for better results in a gun, makers discovered that the final product should be in the form of individual, dense, grains that spread the fire quickly from grain to grain, much as straw or twigs catch fire more quickly than a pile of sawdust. -Primarily for safety reasons, size reduction and mixing is done while the ingredients are damp, usually with water. After 1800, instead of forming grains by hand or with sieves, the damp mill-cake was pressed in molds to increase its density and extract the liquid, forming press-cake. The pressing took varying amounts of time, depending on conditions such as atmospheric humidity. The hard, dense product was broken again into tiny pieces, which were separated with sieves to produce a uniform product for each purpose: coarse powders for cannons, finer grained powders for muskets, and the finest for small hand guns and priming.[97] Inappropriately fine-grained powder often caused cannons to burst before the projectile could move down the barrel, due to the high initial spike in pressure.[98] Mammoth powder with large grains made for Rodman's 15-inch cannon reduced the pressure to only 20 percent as high as ordinary cannon powder would have produced.[99] -In the mid-nineteenth century, measurements were made determining that the burning rate within a grain of black powder (or a tightly packed mass) is about 0.20 fps, while the rate of ignition propagation from grain to grain is around 30 fps, over two orders of magnitude faster.[97] -Modern types[edit] -Modern corning first compresses the fine black powder meal into blocks with a fixed density (1.7 g/cm³).[100] In the United States, gunpowder grains were designated F (for fine) or C (for coarse). Grain diameter decreased with a larger number of Fs and increased with a larger number of Cs, ranging from about 2 mm for 7F to 15 mm for 7C. Even larger grains were produced for artillery bore diameters greater than about 17 cm (6.7 in). The standard DuPont Mammoth powder developed by Thomas Rodman and Lammot du Pont for use during the American Civil War had grains averaging 0.6 inches diameter, with edges rounded in a glazing barrel.[99] Other versions had grains the size of golf and tennis balls for use in 20-inch (50-cm) Rodman guns.[101] In 1875 DuPont introduced Hexagonal powder for large artillery, which was pressed using shaped plates with a small center core—about 1.5 inches diameter, like a wagon wheel nut, the center hole widened as the grain burned.[102] By 1882 German makers also produced hexagonal grained powders of a similar size for artillery.[102] -By the late 19th century manufacturing focused on standard grades of black powder from Fg used in large bore rifles and shotguns, through FFg (medium and small-bore arms such as muskets and fusils), FFFg (small-bore rifles and pistols), and FFFFg (extreme small bore, short pistols and most commonly for priming flintlocks).[103] A coarser grade for use in military artillery blanks was designated A-1. These grades were sorted on a system of screens with oversize retained on a mesh of 6 wires per inch, A-1 retained on 10 wires per inch, Fg retained on 14, FFg on 24, FFFg on 46, and FFFFg on 60. Fines designated FFFFFg were usually reprocessed to minimize explosive dust hazards.[104] In the United Kingdom, the main service gunpowders were classified RFG (rifle grained fine) with diameter of one or two millimeters and RLG (rifle grained large) for grain diameters between two and six millimeters.[101] Gunpowder grains can alternatively be categorized by mesh size: the BSS sieve mesh size, being the smallest mesh size, which retains no grains. Recognized grain sizes are Gunpowder G 7, G 20, G 40, and G 90. -Owing to the large market of antique and replica black-powder firearms in the US, modern gunpowder substitutes like Pyrodex, Triple Seven and Black Mag3[105] pellets have been developed since the 1970s. These products, which should not be confused with smokeless powders, aim to produce less fouling (solid residue), while maintaining the traditional volumetric measurement system for charges. Claims of less corrosiveness of these products have been controversial however. New cleaning products for black-powder guns have also been developed for this market.[103] -Other types of gunpowder[edit] -Besides black powder, there are other historically important types of gunpowder. "Brown gunpowder" is cited as composed of 79% nitre, 3% sulfur, and 18% charcoal per 100 of dry powder, with about 2% moisture. Prismatic Brown Powder is a large-grained product the Rottweil Company introduced in 1884 in Germany, which was adopted by the British Royal Navy shortly thereafter. The French navy adopted a fine, 3.1 millimeter, not prismatic grained product called Slow Burning Cocoa (SBC) or "cocoa powder". These brown powders reduced burning rate even further by using as little as 2 percent sulfur and using charcoal made from rye straw that had not been completely charred, hence the brown color.[102] -Lesmok powder was a product developed by DuPont in 1911[106] one of several semi-smokeless products in the industry containing a mixture of black and nitrocellulose powder. It was sold to Winchester and others primarily for .22 and .32 small calibers. Its advantage was that it was believed at the time to be less corrosive than smokeless powders then in use. It was not understood in the U.S. until the 1920s that the actual source of corrosion was the potassium chloride residue from potassium chlorate sensitized primers. The bulkier black powder fouling better disperses primer residue. Failure to mitigate primer corrosion by dispersion caused the false impression that nitrocellulose-based powder caused corrosion.[107] Lesmok had some of the bulk of black powder for dispersing primer residue, but somewhat less total bulk than straight black powder, thus requiring less frequent bore cleaning.[108] It was last sold by Winchester in 1947. -Sulfur-free gunpowder[edit] - -Burst barrel of a muzzle loader pistol replica, which was loaded with nitrocellulose powder instead of black powder and couldn't withstand the higher pressures of the modern propellant -The development of smokeless powders, such as cordite, in the late 19th century created the need for a spark-sensitive priming charge, such as gunpowder. However, the sulfur content of traditional gunpowders caused corrosion problems with Cordite Mk I and this led to the introduction of a range of sulfur-free gunpowders, of varying grain sizes.[64] They typically contain 70.5 parts of saltpeter and 29.5 parts of charcoal.[64] Like black powder, they were produced in different grain sizes. In the United Kingdom, the finest grain was known as sulfur-free mealed powder (SMP). Coarser grains were numbered as sulfur-free gunpowder (SFG n): 'SFG 12', 'SFG 20', 'SFG 40' and 'SFG 90', for example; where the number represents the smallest BSS sieve mesh size, which retained no grains. -Sulfur's main role in gunpowder is to decrease the ignition temperature. A sample reaction for sulfur-free gunpowder would be -6 KNO3 + C7H4O → 3 K2CO3 + 4 CO2 + 2 H2O + 3 N2 -Combustion characteristics[edit] -A simple, commonly cited, chemical equation for the combustion of black powder is -2 KNO3 + S + 3 C → K2S + N2 + 3 CO2. -A balanced, but still simplified, equation is[109] -10 KNO3 + 3 S + 8 C → 2 K2CO3 + 3 K2SO4 + 6 CO2 + 5 N2. -Although charcoal's chemical formula varies, it can be best summed up by its empirical formula: C7H4O. -Therefore, an even more accurate equation of the decomposition of regular black powder with the use of sulfur can be described as: -6 KNO3 + C7H4O + 2 S → K2CO3 + K2SO4 + K2S + 4 CO2 + 2 CO + 2 H2O + 3 N2 -Black powder without the use of sulfur: -10 KNO3 + 2 C7H4O → 5 K2CO3 + 4 CO2 + 5 CO + 4 H2O + 5 N2 -The burning of gunpowder does not take place as a single reaction, however, and the byproducts are not easily predicted. One study's results showed that it produced (in order of descending quantities) 55.91% solid products: potassium carbonate, potassium sulfate, potassium sulfide, sulfur, potassium nitrate, potassium thiocyanate, carbon, ammonium carbonate and 42.98% gaseous products: carbon dioxide, nitrogen, carbon monoxide, hydrogen sulfide, hydrogen, methane, 1.11% water. -Black powder made with less-expensive and more plentiful sodium nitrate (in appropriate proportions) works just as well but is more hygroscopic than powders made from Potassium nitrate—popularly known as saltpeter. Because corned black powder grains made with saltpeter are less affected by moisture in the air, they can be stored unsealed without degradation by humidity. Muzzleloaders have been known to fire after hanging on a wall for decades in a loaded state, provided they remained dry. By contrast, black powder made with sodium nitrate must be kept sealed to remain stable. -Gunpowder contains 3 megajoules per kilogram, and contains its own oxidant. For comparison, the energy density of TNT is 4.7 megajoules per kilogram, and the energy density of gasoline is 47.2 megajoules per kilogram. Gunpowder is a low explosive and as such it does not detonate; rather it deflagrates. Since it contains its own oxidizer and additionally burns faster under pressure, its combustion is capable of rupturing containers such as shell, grenade, or improvised "pipe bomb" or "pressure cooker" casings, forming shrapnel. -Advantages[edit] -In quarrying, high explosives are generally preferred for shattering rock. However, because of its low brisance, black powder causes fewer fractures and results in more usable stone compared to other explosives, making black powder useful for blasting monumental stone such as granite and marble. Black powder is well suited for blank rounds, signal flares, burst charges, and rescue-line launches. Black powder is also used in fireworks for lifting shells, in rockets as fuel, and in certain special effects. -Disadvantages[edit] -Black powder has a low energy density compared to modern "smokeless" powders, and thus to achieve high energy loadings, large amounts of black powder are needed with heavy projectiles. Black powder also produces thick smoke as a byproduct, which in military applications may give a soldier's location away to an enemy observer and may also impair aiming for additional shots. -Combustion converts less than half the mass of black powder to gas. The rest ends up as a thick layer of soot inside the barrel. In addition to being a nuisance, the residue from burnt black powder is hygroscopic and with the addition of moisture absorbed from the air, this residue forms a caustic substance. The soot contains potassium oxide or sodium oxide that turns into potassium hydroxide, or sodium hydroxide, which corrodes wrought iron or steel gun barrels. Black powder arms must be well cleaned both inside and out to remove the residue. The matchlock musket or pistol (an early gun ignition system), as well as the flintlock would often be unusable in wet weather, due to powder in the pan being exposed and dampened. Because of this unreliability, soldiers carrying muskets, known as musketeers, were armed with additional weapons such as swords or pikes. The bayonet was developed to allow the musket to be used as a pike, thus eliminating the need for the soldier to carry a secondary weapon. -Transportation[edit] -The United Nations Model Regulations on the Transportation of Dangerous Goods and national transportation authorities, such as United States Department of Transportation, have classified gunpowder (black powder) as a Group A: Primary explosive substance for shipment because it ignites so easily. Complete manufactured devices containing black powder are usually classified as Group D: Secondary detonating substance, or black powder, or article containing secondary detonating substance, such as firework, class D model rocket engine, etc., for shipment because they are harder to ignite than loose powder. As explosives, they all fall into the category of Class 1. -Other uses[edit] -Besides its use as an explosive, gunpowder has been occasionally employed for other purposes; after the Battle of Aspern-Essling (1809), the surgeon of the Napoleonic Army Larrey combated the lack of food for the wounded under his care by preparing a bouillon of horse meat seasoned with gunpowder for lack of salt.[110][111] It was also used for sterilizing on ships when there was no alcohol. -Jack Tars (British sailors) used gunpowder to create tattoos when ink wasn't available, by pricking the skin and rubbing the powder into the wound in a method known as traumatic tattooing.[112] -Christiaan Huygens experimented with gunpowder in 1673 in an early attempt to build an internal combustion engine, but he did not succeed. Modern attempts to recreate his invention were similarly unsuccessful. -Fireworks use gunpowder as lifting and burst charges, although sometimes other more powerful compositions are added to the burst charge to improve performance in small shells or provide a louder report. Most modern firecrackers no longer contain black powder. -Beginning in the 1930s, gunpowder or smokeless powder was used in rivet guns, stun guns for animals, cable splicers and other industrial construction tools.[113] The "stud gun" drove nails or screws into solid concrete, a function not possible with hydraulic tools. See Powder-actuated tool. Shotguns have been used to eliminate persistent material rings in operating rotary kilns (such as those for cement, lime, phosphate, etc.) and clinker in operating furnaces, and commercial tools make the method more reliable.[114] -Near London in 1853, Captain Shrapnel demonstrated a method for crushing gold-bearing ores by firing them from a cannon into an iron chamber, and "much satisfaction was expressed by all present". He hoped it would be useful on the goldfields of California and Australia. Nothing came of the invention, as continuously-operating crushing machines that achieved more reliable comminution were already coming into use.[115] -See also[edit] -Ballistics -Black powder substitute -Faversham explosives industry -Bulk loaded liquid propellants -Gunpowder magazine -Gunpowder Plot -Berthold Schwarz -Gunpowder warfare -History of gunpowder -Technology of the Song Dynasty -References[edit] -Jump up ^ http://www.merriam-webster.com/dictionary/gunpowder -Jump up ^ Jai Prakash Agrawal (2010). High Energy Materials: Propellants, Explosives and Pyrotechnics. Wiley-VCH. p. 69. ISBN 978-3-527-32610-5. -Jump up ^ David Cressy, Saltpeter: The Mother of Gunpowder (Oxford University Press, 2013) -Jump up ^ Owen Compliance Services. "Black Powder". Material Safety Data Sheet. Retrieved 31 August 2014. -Jump up ^ http://www.history.com/shows/ancient-discoveries/articles/who-built-it-first-2 -Jump up ^ http://chemistry.about.com/od/historyofchemistry/a/gunpowder.htm -Jump up ^ Chase 2003:31 : "the earliest surviving formulas for gunpowder can be found in the Wujing zongyao, a military work from around 1040" -^ Jump up to: a b c Buchanan 2006, p. 2 "With its ninth century AD origins in China, the knowledge of gunpowder emerged from the search by alchemists for the secrets of life, to filter through the channels of Middle Eastern culture, and take root in Europe with consequences that form the context of the studies in this volume." -^ Jump up to: a b c Joseph Needham; Gwei-Djen Lu; Ling Wang (1987). Science and civilisation in China, Volume 5, Part 7. Cambridge University Press. pp. 48–50. ISBN 978-0-521-30358-3. -Jump up ^ Hazel Rossotti (2002). Fire: Servant, Scourge, and Enigma. Courier Dover Publications. pp. 132–137. ISBN 978-0-486-42261-9. -Jump up ^ Jack Kelly Gunpowder: Alchemy, Bombards, and Pyrotechnics: The History of the Explosive that Changed the World, Perseus Books Group: 2005, ISBN 0-465-03722-4, ISBN 978-0-465-03722-3: 272 pages -Jump up ^ St. C. Easton: "Roger Bacon and his Search for a Universal Science", Oxford (1962) -^ Jump up to: a b Gábor Ágoston (2005). Guns for the sultan: military power and the weapons industry in the Ottoman Empire. Cambridge University Press. p. 15. ISBN 978-0-521-84313-3. -Jump up ^ Ingham-Brown, George (1989) The Big Bang: A History of Explosives, Sutton Publishers, ISBN 0-7509-1878-0, ISBN 978-0-7509-1878-7, page vi -Jump up ^ Kelly, Jack (2005) Gunpowder: Alchemy, Bombards, and Pyrotechnics: The History of the Explosive that Changed the World, Perseus Books Group, ISBN 0-465-03722-4, ISBN 978-0-465-03722-3, page 22 -Jump up ^ Bert S. Hall, "Introduction, 1999" pp. xvi–xvii to the reprinting of James Riddick Partington (1960). A history of Greek fire and gunpowder. JHU Press. ISBN 978-0-8018-5954-0. -^ Jump up to: a b Peter Purton (2009). A History of the Late Medieval Siege, 1200–1500. Boydell & Brewer. pp. 108–109. ISBN 978-1-84383-449-6. -Jump up ^ Bert S. Hall, "Introduction, 1999" p. xvii to the reprinting of James Riddick Partington (1960). A history of Greek fire and gunpowder. JHU Press. ISBN 978-0-8018-5954-0. -Jump up ^ Buchanan. "Editor's Introduction: Setting the Context", in Buchanan 2006. -^ Jump up to: a b Chase 2003:31–32 -Jump up ^ Lorge, Peter A. (2008). The Asian military revolution, 1300-2000 : from gunpowder to the bomb (1. publ. ed.). Cambridge: Cambridge University Press. p. 32. ISBN 978052160954-8. -Jump up ^ Kelly 2004:4 -Jump up ^ The Big Book of Trivia Fun, Kidsbooks, 2004 -Jump up ^ Peter Allan Lorge (2008), The Asian military revolution: from gunpowder to the bomb, Cambridge University Press, p. 18, ISBN 978-0-521-60954-8 -Jump up ^ Needham 1986, p. 7 "Without doubt it was in the previous century, around +850, that the early alchemical experiments on the constituents of gunpowder, with its self-contained oxygen, reached their climax in the appearance of the mixture itself." -Jump up ^ Chase 2003:1 "The earliest known formula for gunpowder can be found in a Chinese work dating probably from the 800s. The Chinese wasted little time in applying it to warfare, and they produced a variety of gunpowder weapons, including flamethrowers, rockets, bombs, and land mines, before inventing firearms." -Jump up ^ Chase 2003:1 -Jump up ^ Delgado, James (February 2003). "Relics of the Kamikaze". Archaeology (Archaeological Institute of America) 56 (1). -Jump up ^ Chase 2003:31 -Jump up ^ Peter Allan Lorge (2008), The Asian military revolution: from gunpowder to the bomb, Cambridge University Press, pp. 33–34, ISBN 978-0-521-60954-8 -Jump up ^ Kelly 2004:22 'Around year 1240, Arabs acquired knowledge of saltpeter ("Chinese snow") from the East, perhaps through India. They knew of gunpowder soon afterward. They also learned about fireworks ("Chinese flowers") and rockets ("Chinese arrows"). Arab warriors had acquired fire lances before year 1280. Around that same year, a Syrian named Hasan al-Rammah wrote a book that, as he put it, "treats of machines of fire to be used for amusement or for useful purposes." He talked of rockets, fireworks, fire lances, and other incendiaries, using terms that suggested he derived his knowledge from Chinese sources. He gave instructions for the purification of saltpeter and recipes for making different types of gunpowder.' -^ Jump up to: a b c d Hassan, Ahmad Y. "Transfer of Islamic Technology to the West: Part III". History of Science and Technology in Islam. -Jump up ^ Peter Watson (2006). Ideas: A History of Thought and Invention, from Fire to Freud. HarperCollins. p. 304. ISBN 978-0-06-093564-1. The first use of a metal tube in this context was made around 1280 in the wars between the Song and the Mongols, where a new term, chong, was invented to describe the new horror...Like paper, it reached the West via the Muslims, in this case the writings of the Andalusian botanist Ibn al-Baytar, who died in Damascus in 1248. The Arabic term for saltpetre is 'Chinese snow' while the Persian usage is 'Chinese salt'.28 -Jump up ^ Cathal J. Nolan (2006). The age of wars of religion, 1000–1650: an encyclopedia of global warfare and civilization. Volume 1 of Greenwood encyclopedias of modern world wars. Greenwood Publishing Group. p. 365. ISBN 0-313-33733-0. Retrieved 2011-11-28. In either case, there is linguistic evidence of Chinese origins of the technology: in Damascus, Arabs called the saltpeter used in making gunpowder " Chinese snow," while in Iran it was called "Chinese salt." Whatever the migratory route -Jump up ^ Oliver Frederick Gillilan Hogg (1970). Artillery: its origin, heyday, and decline. Archon Books. p. 123. The Chinese were certainly acquainted with saltpetre, the essential ingredient of gunpowder. They called it Chinese Snow and employed it early in the Christian era in the manufacture of fireworks and rockets. -Jump up ^ Oliver Frederick Gillilan Hogg (1963). English artillery, 1326–1716: being the history of artillery in this country prior to the formation of the Royal Regiment of Artillery. Royal Artillery Institution. p. 42. The Chinese were certainly acquainted with saltpetre, the essential ingredient of gunpowder. They called it Chinese Snow and employed it early in the Christian era in the manufacture of fireworks and rockets. -Jump up ^ Oliver Frederick Gillilan Hogg (1993). Clubs to cannon: warfare and weapons before the introduction of gunpowder (reprint ed.). Barnes & Noble Books. p. 216. ISBN 1-56619-364-8. Retrieved 2011-11-28. The Chinese were certainly acquainted with saltpetre, the essential ingredient of gunpowder. They called it Chinese snow and used it early in the Christian era in the manufacture of fireworks and rockets. -Jump up ^ Partington, J. R. (1960). A History of Greek Fire and Gunpowder (illustrated, reprint ed.). JHU Press. p. 335. ISBN 0801859549. Retrieved 2014-11-21. -Jump up ^ Needham, Joseph; Yu, Ping-Yu (1980). Needham, Joseph, ed. Science and Civilisation in China: Volume 5, Chemistry and Chemical Technology, Part 4, Spagyrical Discovery and Invention: Apparatus, Theories and Gifts. Volume 5 (Issue 4 of Science and Civilisation in China). Contributors Joseph Needham, Lu Gwei-Djen, Nathan Sivin (illustrated, reprint ed.). Cambridge University Press. p. 194. ISBN 052108573X. Retrieved 2014-11-21. -Jump up ^ Khan 1996 -^ Jump up to: a b Khan 2004:6 -Jump up ^ Ancient Discoveries, Episode 12: Machines of the East, History Channel, 2007 (Part 4 and Part 5) -Jump up ^ Nelson, Cameron Rubaloff (2010-07). Manufacture and transportation of gunpowder in the Ottoman Empire: 1400-1800 M.A. Thesis. -Jump up ^ William H. McNeill (1992). The Rise of the West: A History of the Human Community. University of Chicago Press. p. 492. ISBN 0-226-56141-0. Retrieved 29 July 2011. -Jump up ^ Michael Kohn (2006), Dateline Mongolia: An American Journalist in Nomad's Land, RDR Books, p. 28, ISBN 1-57143-155-1, retrieved 29 July 2011 -Jump up ^ Robert Cowley (1993). Robert Cowley, ed. Experience of War (reprint ed.). Random House Inc. p. 86. ISBN 0-440-50553-4. Retrieved 29 July 2011. -Jump up ^ Kenneth Warren Chase (2003). Firearms: a global history to 1700 (illustrated ed.). Cambridge University Press. p. 58. ISBN 0-521-82274-2. Retrieved 29 July 2011. -Jump up ^ C. F. Temler, Historische Abhandlungen der Koniglichen Gesellschaft der Wissenschaften zu Kopenhagen ... ubersetzt ... von V. A. Heinze, Kiel, Dresden and Leipzig, 1782, i, 168, as cited in Partington, p. 228, footnote 6. -Jump up ^ Joseph Needham; Gwei-Djen Lu; Ling Wang (1987). Science and civilisation in China, Volume 5, Part 7. Cambridge University Press. p. 358. ISBN 978-0-521-30358-3. -Jump up ^ Bert S. Hall, "Introduction, 1999" p. xxiv to the reprinting of James Riddick Partington (1960). A history of Greek fire and gunpowder. JHU Press. ISBN 978-0-8018-5954-0. -Jump up ^ Partington 1960:60 -^ Jump up to: a b Partington 1960:48–49, 54 -^ Jump up to: a b Partington 1960:82–83 -^ Jump up to: a b c d Kelly 2004, p.61 -Jump up ^ Molerus, Otto. "History of Civilization in the Western Hemisphere from the Point of View of Particulate Technology, Part 2," Advanced Powder Technology 7 (1996): 161-66 -Jump up ^ Microsoft Encarta Online Encyclopedia 2007 Archived 31 October 2009. -Jump up ^ In 1777 Lavoisier named oxygen, which had earlier been isolated by Priestley; the realization that saltpeter contained this substance was fundamental to understanding gunpowder. -^ Jump up to: a b Kelly 2004, p.164 -Jump up ^ Metzner, Paul (1998), Crescendo of the Virtuoso: Spectacle, Skill, and Self-Promotion in Paris during the Age of Revolution, University of California Press -^ Jump up to: a b c d Cocroft 2000, "Success to the Black Art!". Chapter 1 -Jump up ^ Ross, Charles. The Custom of the Castle: From Malory to Macbeth. Berkeley: University of California Press, c1997. [1] pages 131-130 -Jump up ^ The Noble-Abel Equation of State: Thermodynamic Derivations for Ballistics Modelling -Jump up ^ Pritchard, Tom; Evans, Jack; Johnson, Sydney (1985), The Old Gunpowder Factory at Glynneath, Merthyr Tydfil: Merthyr Tydfil & District Naturalists' Society -^ Jump up to: a b c d e Cocroft 2000, "The demise of gunpowder". Chapter 4 -Jump up ^ MacDougall, Ian (2000). 'Oh, ye had to be careful' : personal recollections by Roslin gunpowder mill and bomb factory workers. East Linton, Scotland: Tuckwell Press in association with the European Ethnological Research Centre and the Scottish Working People's History Trust. ISBN 1-86232-126-4. -Jump up ^ Iqtidar Alam Khan (2004). Gunpowder And Firearms: Warfare In Medieval India. Oxford University Press. ISBN 978-0-19-566526-0. -^ Jump up to: a b Iqtidar Alam Khan (25 April 2008). Historical Dictionary of Medieval India. Scarecrow Press. p. 157. ISBN 978-0-8108-5503-8. -^ Jump up to: a b Khan 2004:9–10 -Jump up ^ Khan 2004:10 -Jump up ^ Partington (Johns Hopkins University Press edition, 1999), 225 -Jump up ^ Partington (Johns Hopkins University Press edition, 1999), 226 -Jump up ^ http://www.youtube.com/watch?v=DTfEDaWMj4o -^ Jump up to: a b c "India." Encyclopædia Britannica. Encyclopedia Britannica 2008 Ultimate Reference Suite. Chicago: Encyclopedia Britannica, 2008. -Jump up ^ "rocket and missile system." Encyclopædia Britannica. Encyclopædia Britannica 2008 Ultimate Reference Suite. Chicago: Encyclopædia Britannica, 2008. -^ Jump up to: a b Dipanegara, P. B. R. Carey, Babad Dipanagara: an account of the outbreak of the Java war, 1825-30 : the Surakarta court version of the Babad Dipanagara with translations into English and Indonesian volume 9: Council of the M.B.R.A.S. by Art Printing Works: 1981. -Jump up ^ Atsushi, Ota (2006). Changes of regime and social dynamics in West Java : society, state, and the outer world of Banten, 1750-1830. Leiden: Brill. ISBN 90-04-15091-9. -^ Jump up to: a b Thomas Stamford Raffles, The History of Java, Oxford University Press, 1965 (originally published in 1817), ISBN 0-19-580347-7 -Jump up ^ Raffles, Thomas Stamford (1978). The History of Java ([Repr.]. ed.). Kuala Lumpur: Oxford University Press. ISBN 0-19-580347-7. -Jump up ^ US Department of Agriculture (1917). Department Bulleting No. 316: Willows: Their growth, use, and importance. The Department. p. 31. -Jump up ^ Kelly 2004, p.200 -^ Jump up to: a b Earl 1978, Chapter 2: The Development of Gunpowder -Jump up ^ Kelly 2004:60–63 -Jump up ^ Kelly 2004, p.199 -Jump up ^ Frangsmyr, Tore, J. L. Heilbron, and Robin E. Rider, editors The Quantifying Spirit in the Eighteenth Century. Berkeley: University of California Press, c1990. http://ark.cdlib.org/ark:/13030/ft6d5nb455/ p. 292. -Jump up ^ C.E. Munroe (1885) "Notes on the literature of explosives no. VIII", Proceedings of the US Naval Institute, no. XI, p. 285 -Jump up ^ The History of the 10.4×38 Swiss Cartridge -Jump up ^ Blackpowder to Pyrodex and Beyond by Randy Wakeman at Chuck Hawks -Jump up ^ The History and Art of Shotshells by Jon Farrar, Nebraskaland Magazine -Jump up ^ Buchanan. "Editor's Introduction: Setting the Context", in Buchanan 2006, p. 4. -Jump up ^ Black Powder Recipes, Ulrich Bretscher -Jump up ^ Julian S. Hatcher, Hatcher's Notebook, Military Service Publishing Company, 1947. Chapter XIII Notes on Gunpowder, pages 300-305. -Jump up ^ Kelly 2004, p.218 -Jump up ^ Book title Workshop Receipts Publisher William Clowes and Son limited Author Ernest Spon. Date 1 August 1873. -Jump up ^ GunpowderTranslation. Academic. Retrieved 2014-08-31. -Jump up ^ Cathal J. Nolan (2006), The age of wars of religion, 1000-1650: an encyclopedia of global warfare and civilization, Greenwood Publishing Group, p. 365, ISBN 978-0-313-33733-8 -^ Jump up to: a b c Kelly 2004, p58 -^ Jump up to: a b c John Francis Guilmartin (2003). Gunpowder & galleys: changing technology & Mediterranean warfare at sea in the 16th century. Conway Maritime Press. pp. 109–110 and 298–300. ISBN 0851779514. -Jump up ^ T.J. Rodman (1861), Reports of experiments on the properties of metals for cannon and the qualities of cannon powder, p. 270 -^ Jump up to: a b Kelly 2004, p.195 -Jump up ^ Tenney L. Davis (1943). The Chemistry of Powder and Explosives (PDF). p. 139. -^ Jump up to: a b Brown, G.I. (1998) The Big Bang: A history of Explosives Sutton Publishing pp.22&32 ISBN 0-7509-1878-0 -^ Jump up to: a b c Kelly 2004, p.224 -^ Jump up to: a b Rodney James (2011). The ABCs of Reloading: The Definitive Guide for Novice to Expert (9 ed.). Krause Publications. pp. 53–59. ISBN 978-1-4402-1396-0. -Jump up ^ Sharpe, Philip B. (1953) Complete Guide to Handloading Funk & Wagnalls p.137 -Jump up ^ Wakeman, Randy. "Blackpowder to Pyrodex and Beyond". Retrieved 31 August 2014. -Jump up ^ "LESMOK POWDER". -Jump up ^ Julian S. Hatcher, Hatcher's Notebook, Stackpole Books, 1962. Chapter XIV, Gun Corrosion and Ammunition Developments, pages 346-349. -Jump up ^ Wakeman, Randy. "Blackpowder to Pyrodex and Beyond". -Jump up ^ Flash! Bang! Whiz!, University of Denver -Jump up ^ Parker, Harold T. (1983). Three Napoleonic battles. (Repr., Durham, 1944. ed.). Durham, NC: Duke Univ. Pr. p. 83. ISBN 0-8223-0547-X. -Jump up ^ Larrey is quoted in French at Dr Béraud, Études Hygiéniques de la chair de cheval comme aliment, Musée des Familles (1841-42). -Jump up ^ Rediker, Marcus (1989). Between the devil and the deep blue sea : merchant seamen, pirates, and the Anglo-American maritime world, 1700-1750 (1st pbk. ed. ed.). Cambridge: Cambridge University Press. p. 12. ISBN 9780521379830. -Jump up ^ "Gunpowder Now Used To Drive Rivets And Splice Cables", April 1932, Popular Science -Jump up ^ "MasterBlaster System". Remington Products. -Jump up ^ Mining Journal 22 January 1853, p. 61 -Benton, Captain James G. (1862). A Course of Instruction in Ordnance and Gunnery (2 ed.). West Point, New York: Thomas Publications. ISBN 1-57747-079-6.. -Brown, G. I. (1998). The Big Bang: A History of Explosives. Sutton Publishing. ISBN 0-7509-1878-0.. -Buchanan, Brenda J., ed. (2006). Gunpowder, Explosives and the State: A Technological History. Aldershot: Ashgate. ISBN 0-7546-5259-9.. -Chase, Kenneth (2003). Firearms: A Global History to 1700. Cambridge University Press. ISBN 0-521-82274-2.. -Cocroft, Wayne (2000). Dangerous Energy: The archaeology of gunpowder and military explosives manufacture. Swindon: English Heritage. ISBN 1-85074-718-0.. -Crosby, Alfred W. (2002). Throwing Fire: Projectile Technology Through History. Cambridge University Press. ISBN 0-521-79158-8.. -Earl, Brian (1978). Cornish Explosives. Cornwall: The Trevithick Society. ISBN 0-904040-13-5.. -al-Hassan, Ahmad Y.. "History of Science and Technology in Islam". |chapter= ignored (help). -Johnson, Norman Gardner. "explosive". Encyclopædia Britannica. Chicago: Encyclopædia Britannica Online.. -Kelly, Jack (2004). Gunpowder: Alchemy, Bombards, & Pyrotechnics: The History of the Explosive that Changed the World. Basic Books. ISBN 0-465-03718-6.. -Khan, Iqtidar Alam (1996). "Coming of Gunpowder to the Islamic World and North India: Spotlight on the Role of the Mongols". Journal of Asian History 30: 41–5.. -Khan, Iqtidar Alam (2004). "Gunpowder and Firearms: Warfare in Medieval India". Oxford University Press. doi:10.1086/ahr.111.3.817.. -Needham, Joseph (1986). "Science & Civilisation in China". V:7: The Gunpowder Epic. Cambridge University Press. ISBN 0-521-30358-3.. -Norris, John (2003). Early Gunpowder Artillery: 1300-1600. Marlborough: The Crowood Press. ISBN 9781861266156.. -Partington, J.R. (1960). A History of Greek Fire and Gunpowder. Cambridge, UK: W. Heffer & Sons.. -Partington, James Riddick; Hall, Bert S. (1999). A History of Greek Fire and Gunpowder. Baltimore: Johns Hopkins University Press. doi:10.1353/tech.2000.0031. ISBN 0-8018-5954-9. -Urbanski, Tadeusz (1967). "Chemistry and Technology of Explosives" III. New York: Pergamon Press.. -External links[edit] - Wikimedia Commons has media related to Gunpowder. - Look up gunpowder in Wiktionary, the free dictionary. -Gun and Gunpowder -The Origins of Gunpowder -Cannons and Gunpowder -Oare Gunpowder Works, Kent, UK -Royal Gunpowder Mills -The DuPont Company on the Brandywine A digital exhibit produced by the Hagley Library that covers the founding and early history of the DuPont Company powder yards in Delaware -"Ulrich Bretschler's Gunpowder Chemistry page". -Video Demonstration of the Medieval Siege Society's Guns, Including showing ignition of gunpowder -Black Powder Recipes -"Dr. Sasse's investigations (and others) found via search at US DTIC.MIL These contain scientific studies of BP properties and details of measurement techniques.". -Categories: GunpowderChinese inventionsExplosivesFirearm propellantsPyrotechnic compositionsRocket fuelsSolid fuels -Navigation menu -Create accountLog inArticleTalkReadEditView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -Afrikaans -العربية -Aragonés -Asturianu -Azərbaycanca -Башҡортса -Беларуская -Беларуская (тарашкевіца)‎ -Български -Bosanski -Brezhoneg -Буряад -Català -Чӑвашла -Čeština -Corsu -Cymraeg -Dansk -Deutsch -Eesti -Ελληνικά -Español -Esperanto -Euskara -فارسی -Français -Gaeilge -Galego -贛語 -Хальмг -한국어 -हिन्दी -Hrvatski -Ilokano -Bahasa Indonesia -Íslenska -Italiano -עברית -Kapampangan -Kiswahili -Kurdî -Latina -Latviešu -Lietuvių -Limburgs -Magyar -Македонски -മലയാളം -مصرى -Монгол -Nederlands -नेपाली -नेपाल भाषा -日本語 -Нохчийн -Norsk bokmål -Norsk nynorsk -Occitan -Oʻzbekcha -پنجابی -Polski -Português -Română -Runa Simi -Русский -Саха тыла -Scots -Shqip -Sicilianu -Simple English -Slovenčina -Slovenščina -کوردی -Српски / srpski -Srpskohrvatski / српскохрватски -Suomi -Svenska -Tagalog -தமிழ் -Татарча/tatarça -ไทย -Türkçe -Українська -اردو -Tiếng Việt -Võro -Winaray -ייִדיש -粵語 -Žemaitėška -中文 -Edit links -This page was last modified on 28 November 2014 at 05:37. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -Smokeless powder -From Wikipedia, the free encyclopedia - -Finnish smokeless powder -Smokeless powder is the name given to a number of propellants used in firearms and artillery that produce negligible smoke when fired, unlike the black powder they replaced. The term is unique to the United States and is generally not used in other English-speaking countries, which initially used proprietary names such as "Ballistite" and "Cordite" but gradually shifted to "propellant" as the generic term. -The basis of the term smokeless is that the combustion products are mainly gaseous, compared to around 55% solid products (mostly potassium carbonate, potassium sulfate, and potassium sulfide) for black powder.[1] Despite its name, smokeless powder is not completely smoke-free;[2] while there may be little noticeable smoke from small-arms ammunition, smoke from artillery fire can be substantial. This article focuses on nitrocellulose formulations, but the term smokeless powder was also used to describe various picrate mixtures with nitrate, chlorate, or dichromate oxidizers during the late 19th century, before the advantages of nitrocellulose became evident.[3] -Since the 14th century[4] gunpowder was not actually a physical "powder," and smokeless powder can only be produced as a pelletized or extruded granular material. Smokeless powder allowed the development of modern semi- and fully automatic firearms and lighter breeches and barrels for artillery. Burnt black powder leaves a thick, heavy fouling that is hygroscopic and causes rusting of the barrel. The fouling left by smokeless powder exhibits none of these properties (though some primer compounds can leave hygroscopic salts that have a similar effect; non-corrosive primer compounds were introduced in the 1920s[5][6]). This makes an autoloading firearm with many moving parts feasible (which would otherwise jam or seize under heavy black powder fouling). -Smokeless powders are classified as, typically, division 1.3 explosives under the UN Recommendations on the transportation of Dangerous goods – Model Regulations, regional regulations (such as ADR) and national regulations (such the United States' ATF). However, they are used as solid propellants; in normal use, they undergo deflagration rather than detonation. -Contents [hide] -1 Background -2 Nitroglycerine and guncotton -3 Propellant improvements -4 Chemical formulations -5 Instability and stabilization -6 Physical variations -7 Smokeless propellant components -8 Manufacturing -9 Flashless propellant -10 See also -11 References -11.1 Notes -11.2 Sources -12 External links -Background[edit] -Military commanders had been complaining since the Napoleonic Wars about the problems of giving orders on a battlefield obscured by the smoke of firing. Verbal commands could not be heard above the noise of the guns, and visual signals could not be seen through the thick smoke from the gunpowder used by the guns. Unless there was a strong wind, after a few shots, soldiers using black powder ammunition would have their view obscured by a huge cloud of smoke. Snipers or other concealed shooters were given away by a cloud of smoke over the firing position. Black powder is also corrosive, making cleaning mandatory after every use. Likewise, black powder's tendency to produce severe fouling caused actions to jam and often made reloading difficult. -Nitroglycerine and guncotton[edit] -Nitroglycerine was synthesized by the Italian chemist Ascanio Sobrero in 1847.[7] It was subsequently developed and manufactured by Alfred Nobel as an industrial explosive, but even then it was unsuitable as a propellant: despite its energetic and smokeless qualities, it detonates instead of deflagrating smoothly, making it more amenable to shattering a gun than propelling a projectile out of it. Nitroglycerine per se is also highly unstable, making it unfit to be carried in battlefield conditions. -A major step forward was the discovery of guncotton, a nitrocellulose-based material, by Swiss chemist Christian Friedrich Schönbein in 1846. He promoted its use as a blasting explosive[8] and sold manufacturing rights to the Austrian Empire. Guncotton was more powerful than gunpowder, but at the same time was once again somewhat more unstable. John Taylor obtained an English patent for guncotton; and John Hall & Sons began manufacture in Faversham. -English interest languished after an explosion destroyed the Faversham factory in 1847. Austrian Baron Wilhelm Lenk von Wolfsberg built two guncotton plants producing artillery propellent, but it too was dangerous under field conditions, and guns that could fire thousands of rounds using gunpowder would reach their service life after only a few hundred shots with the more powerful guncotton. Small arms could not withstand the pressures generated by guncotton at all. -After one of the Austrian factories blew up in 1862, Thomas Prentice & Company began manufacturing guncotton in Stowmarket in 1863; and British War Office chemist Sir Frederick Abel began thorough research at Waltham Abbey Royal Gunpowder Mills leading to a manufacturing process that eliminated the impurities in nitrocellulose making it safer to produce and a stable product safer to handle. Abel patented this process in 1865, when the second Austrian guncotton factory exploded. After the Stowmarket factory exploded in 1871, Waltham Abbey began production of guncotton for torpedo and mine warheads.[9] -Propellant improvements[edit] -In 1863, Prussian artillery captain Johann F. E. Schultze patented a small arms propellent of nitrated hardwood impregnated with saltpetre or barium nitrate. Prentice received an 1866 patent for a sporting powder of nitrated paper manufactured at Stowmarket, but ballistic uniformity suffered as the paper absorbed atmospheric moisture. In 1871, Frederick Volkmann received an Austrian patent for a colloided version of Schultze powder called Collodin, which he manufactured near Vienna for use in sporting firearms. Austrian patents were not published at the time, and the Austrian Empire considered the operation a violation of the government monopoly on explosives manufacture and closed the Volkmann factory in 1875.[9] In 1882, the Explosives Company at Stowmarket patented an improved formulation of nitrated cotton gelatinised by ether-alcohol with nitrates of potassium and barium. These propellants were suitable for shotguns but not rifles.[10] - -Poudre B single-base smokeless powder flakes -In 1884, Paul Vieille invented a smokeless powder called Poudre B (short for poudre blanche—white powder, as distinguished from black powder)[11] made from 68.2% insoluble nitrocellulose, 29.8% soluble nitrocellusose gelatinized with ether and 2% paraffin. This was adopted for the Lebel rifle.[12] It was passed through rollers to form paper thin sheets, which were cut into flakes of the desired size.[11] The resulting propellant, today known as pyrocellulose, contains somewhat less nitrogen than guncotton and is less volatile. A particularly good feature of the propellant is that it will not detonate unless it is compressed, making it very safe to handle under normal conditions. -Vieille's powder revolutionized the effectiveness of small guns, because it gave off almost no smoke and was three times more powerful than black powder. Higher muzzle velocity meant a flatter trajectory and less wind drift and bullet drop, making 1000 meter shots practicable. Since less powder was needed to propel a bullet, the cartridge could be made smaller and lighter. This allowed troops to carry more ammunition for the same weight. Also, it would burn even when wet. Black powder ammunition had to be kept dry and was almost always stored and transported in watertight cartridges. -Other European countries swiftly followed and started using their own versions of Poudre B, the first being Germany and Austria, which introduced new weapons in 1888. Subsequently Poudre B was modified several times with various compounds being added and removed. Krupp began adding diphenylamine as a stabilizer in 1888.[9] -Meanwhile, in 1887, Alfred Nobel obtained an English patent for a smokeless gunpowder he called Ballistite. In this propellant the fibrous structure of cotton (nitro-cellulose) was destroyed by a nitro-glycerine solution instead of a solvent.[13] In England in 1889, a similar powder was patented by Hiram Maxim, and in the USA in 1890 by Hudson Maxim.[14] Ballistite was patented in the United States in 1891. -The Germans adopted ballistite for naval use in 1898, calling it WPC/98. The Italians adopted it as filite, in cord instead of flake form, but realising its drawbacks changed to a formulation with nitroglycerine they called solenite. In 1891 the Russians tasked the chemist Mendeleef with finding a suitable propellant, he created nitrocellulose gelatinised by ether-alcohol, which produced more nitrogen and more uniform colloidal structure than the French use of nitro-cottons in Poudre B. He called it pyro-collodion.[13] -Britain conducted trials on all the various types of propellant brought to their attention, but were dissatisfied with them all and sought something superior to all existing types. In 1889, Sir Frederick Abel, James Dewar and Dr W Kellner patented (Nos 5614 and 11,664 in the names of Abel and Dewar) a new formulation that was manufactured at the Royal Gunpowder Factory at Waltham Abbey. It entered British service in 1891 as Cordite Mark 1. Its main composition was 58% Nitro-glycerine, 37% Guncotton and 3% mineral jelly. A modified version, Cordite MD, entered service in 1901, this increased guncotton to 65% and reduced nitro-glycerine to 30%, this change reduced the combustion temperature and hence erosion and barrel wear. Cordite's advantages over gunpowder were reduced maximum pressure in the chamber (hence lighter breeches, etc.) but longer high pressure. Cordite could be made in any desired shape or size.[15] The creation of cordite led to a lengthy court battle between Nobel, Maxim, and another inventor over alleged British patent infringement. -The Anglo-American Explosives Company began manufacturing its shotgun powder in Oakland, New Jersey in 1890. DuPont began producing guncotton at Carneys Point Township, New Jersey in 1891.[3] Charles E. Munroe of the Naval Torpedo Station in Newport, Rhode Island patented a formulation of guncotton colloided with nitrobenzene, called Indurite, in 1891.[16] Several United States firms began producing smokeless powder when Winchester Repeating Arms Company started loading sporting cartridges with Explosives Company powder in 1893. California Powder Works began producing a mixture of nitroglycerine and nitrocellulose with ammonium picrate as Peyton Powder, Leonard Smokeless Powder Company began producing nitroglycerine-nitrocellulose Ruby powders, Laflin & Rand negotiated a license to produce Ballistite, and DuPont started producing smokeless shotgun powder. The United States Army evaluated 25 varieties of smokeless powder and selected Ruby and Peyton Powders as the most suitable for use in the Krag-Jørgensen service rifle. Ruby was preferred, because tin-plating was required to protect brass cartridge cases from picric acid in the Peyton Powder. Rather than paying the required royalties for Ballistite, Laflin & Rand financed Leonard's reorganization as the American Smokeless Powder Company. United States Army Lieutenant Whistler assisted American Smokeless Powder Company factory superintendent Aspinwall in formulating an improved powder named W.A. for their efforts. W.A. smokeless powder was the standard for United States military service rifles from 1897 until 1908.[3] -In 1897, United States Navy Lieutenant John Bernadou patented a nitrocellulose powder colloided with ether-alcohol.[16] The Navy licensed or sold patents for this formulation to DuPont and the California Powder Works while retaining manufacturing rights for the Naval Powder Factory, Indian Head, Maryland constructed in 1900. The United States Army adopted the Navy single-base formulation in 1908 and began manufacture at Picatinny Arsenal.[3] By that time Laflin & Rand had taken over the American Powder Company to protect their investment, and Laflin & Rand had been purchased by DuPont in 1902.[17] Upon securing a 99-year lease of the Explosives Company in 1903, DuPont enjoyed use of all significant smokeless powder patents in the United States, and was able to optimize production of smokeless powder.[3] When government anti-trust action forced divestiture in 1912, DuPont retained the nitrocellulose smokeless powder formulations used by the United States military and released the double-base formulations used in sporting ammunition to the reorganized Hercules Powder Company. These newer propellants were more stable and thus safer to handle than Poudre B, and also more powerful. -Chemical formulations[edit] -"Double base" redirects here. For the musical instrument, see double bass. -Currently, propellants using nitrocellulose (detonation velocity 7,300 m/s (23,950 ft/s)) (typically an ether-alcohol colloid of nitrocellulose) as the sole explosive propellant ingredient are described as single-base powder.[18] -Propellants mixtures containing nitrocellulose and nitroglycerin (detonation velocity 7,700 m/s (25,260 ft/s)) as explosive propellant ingredients are known as double-base powder.[19] -During the 1930s triple-base propellant containing nitrocellulose, nitroglycerin, and a substantial quantity of nitroguanidine (detonation velocity 8,200 m/s (26,900 ft/s)) as explosive propellant ingredients was developed. These propellant mixtures have reduced flash and flame temperature without sacrificing chamber pressure compared to single and double base propellants, albeit at the cost of more smoke. -In practice, triple base propellants are reserved mainly for large caliber ammunition such as used in (naval) artillery and tank guns. During World War II it had some use by British artillery. After that war it became the standard propellant in all British large caliber ammunition designs except small-arms. Most western nations, except the United States, followed a similar path. -In the late 20th century new propellant formulations started to appear. These are based on nitroguanidine and high explosives of the RDX (detonation velocity 8,750 m/s (28,710 ft/s)) type. -Instability and stabilization[edit] -Nitrocellulose deteriorates with time, yielding acidic byproducts. Those byproducts catalyze the further deterioration, increasing its rate. The released heat, in case of bulk storage of the powder, or too large blocks of solid propellant, can cause self-ignition of the material. Single-base nitrocellulose propellants are hygroscopic and most susceptible to degradation; double-base and triple-base propellants tend to deteriorate more slowly. To neutralize the decomposition products, which could otherwise cause corrosion of metals of the cartridges and gun barrels, calcium carbonate is added to some formulations. -To prevent buildup of the deterioration products, stabilizers are added. Diphenylamine is one of the most common stabilizers used. Nitrated analogs of diphenylamine formed in the process of stabilizing decomposing powder are sometimes used as stabilizers themselves.[20][21] The stabilizers are added in the amount of 0.5–2% of the total amount of the formulation; higher amounts tend to degrade its ballistic properties. The amount of the stabilizer is depleted with time. Propellants in storage should be periodically tested for the amount of stabilizer remaining, as its depletion may lead to auto-ignition of the propellant. -Physical variations[edit] - -Ammunition handloading powders -Smokeless powder may be corned into small spherical balls or extruded into cylinders or strips with many cross-sectional shapes (strips with various rectangular proportions, single or multi-hole cylinders, slotted cylinders) using solvents such as ether. These extrusions can be cut into short ('flakes') or long pieces ('cords' many inches long). Cannon powder has the largest pieces. -The properties of the propellant are greatly influenced by the size and shape of its pieces. The specific surface area of the propellant influences the speed of burning, and the size and shape of the particles determine the specific surface area. By manipulation of the shape it is possible to influence the burning rate and hence the rate at which pressure builds during combustion. Smokeless powder burns only on the surfaces of the pieces. Larger pieces burn more slowly, and the burn rate is further controlled by flame-deterrent coatings that retard burning slightly. The intent is to regulate the burn rate so that a more or less constant pressure is exerted on the propelled projectile as long as it is in the barrel so as to obtain the highest velocity. The perforations stabilize the burn rate because as the outside burns inward (thus shrinking the burning surface area) the inside is burning outward (thus increasing the burning surface area, but faster, so as to fill up the increasing volume of barrel presented by the departing projectile).[22] Fast-burning pistol powders are made by extruding shapes with more area such as flakes or by flattening the spherical granules. Drying is usually performed under a vacuum. The solvents are condensed and recycled. The granules are also coated with graphite to prevent static electricity sparks from causing undesired ignitions.[23] -Faster-burning propellants generate higher temperatures and higher pressures, however they also increase wear on gun barrels. -Smokeless propellant components[edit] -The propellant formulations may contain various energetic and auxiliary components: -Propellants: -Nitrocellulose, an energetic component of most smokeless propellants[24] -Nitroglycerin, an energetic component of double-base and triple-base formulations[24] -Nitroguanidine, a component of triple-base formulations[24] -D1NA (bis-nitroxyethylnitramine)[25] -Fivonite (tetramethylolcyclopentanone)[25] -DGN (di-ethylene glycol dinitrate)[26] -Acetyl cellulose[27] -Deterrents, (or moderants), to slow the burning rate -Centralites (symmetrical diphenyl urea—primarily diethyl or dimethyl)[28][29] -Dibutyl phthalate[24][29] -Dinitrotoluene (toxic, carcinogenic, and obsolete)[24][30] -Akardite (asymmetrical diphenyl urea)[26] -ortho-tolyl urethane[31] -Polyester adipate -Camphor (obsolete)[29] -Stabilizers, to prevent or slow down self-decomposition[32] -Diphenylamine[33] -Petroleum jelly[34] -Calcium carbonate[24] -Magnesium oxide[26] -Sodium bicarbonate[27] -beta-naphthol methyl ether[31] -Amyl alcohol (obsolete)[35] -Aniline (obsolete)[36] -Decoppering additives, to hinder the buildup of copper residues from the gun barrel rifling -Tin metal and compounds (e.g., tin dioxide)[24][37] -Bismuth metal and compounds (e.g., bismuth trioxide, bismuth subcarbonate, bismuth nitrate, bismuth antimonide); the bismuth compounds are favored as copper dissolves in molten bismuth, forming brittle and easily removable alloy -Lead foil and lead compounds, phased out due to toxicity[25] -Flash reducers, to reduce the brightness of the muzzle flash (all have a disadvantage: the production of smoke)[38] -Potassium chloride[39] -Potassium nitrate -Potassium sulfate[24][37] -Potassium hydrogen tartarate (a byproduct of wine production formerly used by French artillery)[39] -Wear reduction additives, to lower the wear of the gun barrel liners[40] -Wax -Talc -Titanium dioxide -Polyurethane jackets over the powder bags, in large guns -Other additives -Ethyl acetate, a solvent for manufacture of spherical powder[34] -Rosin, a surfactant to hold the grain shape of spherical powder -Graphite, a lubricant to cover the grains and prevent them from sticking together, and to dissipate static electricity[23] -Manufacturing[edit] -This section describes procedures used in the United States. See Cordite for alternative procedures formerly used in the United Kingdom. -The United States Navy manufactured single-base tubular powder for naval artillery at Indian Head, Maryland, beginning in 1900. Similar procedures were used for United States Army production at Picatinny Arsenal beginning in 1907[18] and for manufacture of smaller grained Improved Military Rifle (IMR) powders after 1914. Short-fiber cotton linter was boiled in a solution of sodium hydroxide to remove vegetable waxes, and then dried before conversion to nitrocellulose by mixing with concentrated nitric and sulfuric acids. Nitrocellulose still resembles fibrous cotton at this point in the manufacturing process, and was typically identified as pyrocellulose because it would spontaneously ignite in air until unreacted acid was removed. The term guncotton was also used; although some references identify guncotton as a more extensively nitrated and refined product used in torpedo and mine warheads prior to use of TNT.[41] -Unreacted acid was removed from pyrocellulose pulp by a multistage draining and water washing process similar to that used in paper mills during production of chemical woodpulp. Pressurized alcohol removed remaining water from drained pyrocellulose prior to mixing with ether and diphenylamine. The mixture was then fed through a press extruding a long turbular cord form to be cut into grains of the desired length.[42] -Alcohol and ether were then evaporated from "green" powder grains to a remaining solvent concentration between 3 percent for rifle powders and 7 percent for large artillery powder grains. Burning rate is inversely proportional to solvent concentration. Grains were coated with electrically conductive graphite to minimize generation of static electricity during subsequent blending. "Lots" containing more than ten tonnes of powder grains were mixed through a tower arrangement of blending hoppers to minimize ballistic differences. Each blended lot was then subjected to testing to determine the correct loading charge for the desired performance.[43][44] -Military quantities of old smokeless powder were sometimes reworked into new lots of propellants.[45] Through the 1920s Dr. Fred Olsen worked at Picatinny Arsenal experimenting with ways to salvage tons of single-base cannon powder manufactured for World War I. Dr. Olsen was employed by Western Cartridge Company in 1929 and developed a process for manufacturing spherical smokeless powder by 1933.[46] Reworked powder or washed pyrocellulose can be dissolved in ethyl acetate containing small quantities of desired stabilizers and other additives. The resultant syrup, combined with water and surfactants, can be heated and agitated in a pressurized container until the syrup forms an emulsion of small spherical globules of the desired size. Ethyl acetate distills off as pressure is slowly reduced to leave small spheres of nitrocellulose and additives. The spheres can be subsequently modified by adding nitroglycerine to increase energy, flattening between rollers to a uniform minimum dimension, coating with phthalate deterrents to retard ignition, and/or glazing with graphite to improve flow characteristics during blending.[47][48] -Modern smokeless powder is produced in the United States by St. Marks Powder, Inc. owned by General Dynamics.[49] -Flashless propellant[edit] -Muzzle flash is the light emitted in the vicinity of the muzzle by the hot propellant gases and the chemical reactions that follow as the gases mix with the surrounding air. Before projectiles exit a slight pre-flash may occur from gases leaking past the projectiles. Following muzzle exit the heat of gases is usually sufficient to emit visible radiation – the primary flash. The gases expand but as they pass through the Mach disc they are re-compressed to produce an intermediate flash. Hot combustible gases (e.g. hydrogen and carbon-monoxide) may follow when they mix with oxygen in the surrounding air to produce the secondary flash, the brightest. The secondary flash does not usually occur with small-arms.[50] -Nitrocellulose contains insufficient oxygen to completely oxidize its carbon and hydrogen. The oxygen deficit is increased by addition of graphite and organic stabilizers. Products of combustion within the gun barrel include flammable gasses like hydrogen and carbon monoxide. At high temperature, these flammable gasses will ignite when turbulently mixed with atmospheric oxygen beyond the muzzle of the gun. During night engagements the flash produced by ignition can reveal the location of the gun to enemy forces[51] and cause temporary night-blindness among the gun crew by photo-bleaching visual purple.[52] -Flash suppressors are commonly used on small arms to reduce the flash signature, but this approach is not practical for artillery. Artillery muzzle flash up to 150 feet (46 m) from the muzzle has been observed, and can be reflected off clouds and be visible for distances up to 30 miles (48 km).[51] For artillery the most effective method is a propellant that produces a large proportion of inert nitrogen at relatively low temperatures that dilutes the combustible gases. Triple based propellants are used for this because of the nitrogen in the nitroguandine.[53] -Before the use of triple based propellants the usual method of flash reduction was to add inorganic salts like potassium chloride so their specific heat capacity might reduce the temperature of combustion gasses and their finely divided particulate smoke might block visible wavelengths of radiant energy of combustion.[39] -See also[edit] -Portal icon Pyrotechnics portal -Antique guns -Ballistite -Cordite -Firearms -Gunpowder -Nitrocellulose -Small arms -Brown-brown – a drug created by mixing cocaine with cartridge powder -References[edit] -Notes[edit] -Jump up ^ Hatcher, Julian S. and Barr, Al Handloading Hennage Lithograph Company (1951) p.34 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) p.44 -^ Jump up to: a b c d e Sharpe, Philip B. Complete Guide to Handloading 3rd Edition (1953) Funk & Wagnalls pp.146-149 -Jump up ^ seegunpowder -Jump up ^ Sharpe, Philip B. Complete Guide To Handloading (1953) Funk & Wagnalls p.60 -Jump up ^ Davis, William C., Jr. Handloading (1981) National Rifle Association p.21 -Jump up ^ Davis, Tenney L. The Chemistry of Powder & Explosives (1943) page 195 -Jump up ^ Davis, William C., Jr. Handloading National Rifle Association of America (1981) p.28 -^ Jump up to: a b c Sharpe, Philip B. Complete Guide to Handloading 3rd Edition (1953) Funk & Wagnalls pp.141-144 -Jump up ^ Hogg, Oliver F. G. Artillery: Its Origin, Heyday and Decline (1969) p.138-139 -^ Jump up to: a b Davis, Tenney L. The Chemistry of Powder & Explosives (1943) pages 289–292 -Jump up ^ Hogg, Oliver F. G. Artillery: Its Origin, Heyday and Decline (1969) p.139 -^ Jump up to: a b Hogg, Oliver F. G. Artillery: Its Origin, Heyday and Decline (1969) p.140 -Jump up ^ U.S. Patent 430,212 – Manufacture of explosive – H. S. Maxim -Jump up ^ Hogg, Oliver F. G. Artillery: Its Origin, Heyday and Decline (1969) p.141 -^ Jump up to: a b Davis, Tenney L. The Chemistry of Powder & Explosives (1943) pages 296-297 -Jump up ^ "Laflin & Rand Powder Company". DuPont. Retrieved 2012-02-24. -^ Jump up to: a b Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p.297 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p.298 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) p.28 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p. 310 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) pp.41–43 -^ Jump up to: a b Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p.306 -^ Jump up to: a b c d e f g h Campbell, John Naval Weapons of World War Two (1985) p. 5 -^ Jump up to: a b c Campbell, John Naval Weapons of World War Two (1985) p. 104 -^ Jump up to: a b c Campbell, John Naval Weapons of World War Two (1985) p. 221 -^ Jump up to: a b Campbell, John Naval Weapons of World War Two (1985) p. 318 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 317–320 -^ Jump up to: a b c Davis, William C., Jr. Handloading National Rifle Association of America (1981) p.30 -Jump up ^ Davis, William C., Jr. Handloading National Rifle Association of America (1981) p.31 -^ Jump up to: a b Campbell, John Naval Weapons of World War Two (1985) p. 174 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 307–311 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p. 302 -^ Jump up to: a b Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p. 296 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p. 307 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) p. 308 -^ Jump up to: a b Davis, William C., Jr. Handloading National Rifle Association of America (1981) p.32 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 322–327 -^ Jump up to: a b c Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 323–327 -Jump up ^ "USA 16"/50 (40.6 cm) Mark 7". NavWeaps. 2008-11-03. Retrieved 2008-12-05. -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) pages 28–31 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) pages 31–35 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) pages 35–41 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 293 & 306 -Jump up ^ Fairfield, A. P., CDR USN Naval Ordnance Lord Baltimore Press (1921) p.39 -Jump up ^ Matunas, E. A. Winchester-Western Ball Powder Loading Data Olin Corporation (1978) p.3 -Jump up ^ Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 328–330 -Jump up ^ Wolfe, Dave Propellant Profiles Volume 1 Wolfe Publishing Company (1982) pages 136–137 -Jump up ^ General Dynamics Commercial Powder Applications. -Jump up ^ Moss G. M., Leeming D. W., Farrar C. L. Military Ballisitcs (1969) pages 55–56 -^ Jump up to: a b Davis, Tenny L. The Chemistry of Powder & Explosives (1943) pages 322–323 -Jump up ^ Milner p.68 -Jump up ^ Moss G. M., Leeming D. W., Farrar C. L. Military Ballisitcs (1969) pages 59–60 -Sources[edit] -Campbell, John (1985). Naval Weapons of World War Two. Naval Institute Press. ISBN 0-87021-459-4. -Davis, Tenney L. (1943). The Chemistry of Powder & Explosives (Angriff Press [1992] ed.). John Wiley & Sons Inc. ISBN 0-913022-00-4. -Davis, William C., Jr. (1981). Handloading. National Rifle Association of America. ISBN 0-935998-34-9. -Fairfield, A. P., CDR USN (1921). Naval Ordnance. Lord Baltimore Press. -Hatcher, Julian S. and Barr, Al (1951). Handloading. Hennage Lithograph Company. -Matunas, E. A. (1978). Winchester-Western Ball Powder Loading Data. Olin Corporation. -Milner, Marc (1985). North Atlantic Run. Naval Institute Press. ISBN 0-87021-450-0. -Wolfe, Dave (1982). Propellant Profiles Volume 1. Wolfe Publishing Company. ISBN 0-935632-10-7. -External links[edit] -The Manufacture of Smokeless Powders and their Forensic Analysis: A Brief Review – Robert M. Heramb, Bruce R. McCord -Hudson Maxim papers (1851-1925) at Hagley Museum and Library. Collection includes material relating to Maxim's patent on the process of making smokeless powder. -Categories: CorditeExplosivesFirearm propellantsSolid fuels -Navigation menu -Create accountLog inArticleTalkReadEditView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -العربية -Български -Dansk -Deutsch -Español -فارسی -Français -Bahasa Indonesia -Íslenska -Italiano -עברית -Nederlands -日本語 -Polski -Português -Русский -Svenska -தமிழ் -中文 -Edit links -This page was last modified on 25 July 2014 at 22:33. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -Deflagration -From Wikipedia, the free encyclopedia - -[hide]This article has multiple issues. Please help improve it or discuss these issues on the talk page. -This article needs additional citations for verification. (April 2011) -This article may be too technical for most readers to understand. (December 2013) - -A log in a fireplace. -Deflagration [1] (Lat: de + flagrare, "to burn down") is a term describing subsonic combustion propagating through heat transfer; hot burning material heats the next layer of cold material and ignites it. Most "fire" found in daily life, from flames to explosions, is deflagration. Deflagration is different from detonation, which is supersonic and propagates through shock. -Contents [hide] -1 Applications -2 Oil/wax fire and water -3 Flame physics -4 Damaging deflagration events -5 See also -6 References -Applications[edit] -In engineering applications, deflagrations are easier to control than detonations. Consequently, they are better suited when the goal is to move an object (a bullet in a gun, or a piston in an internal combustion engine) with the force of the expanding gas. Typical examples of deflagrations are the combustion of a gas-air mixture in a gas stove or a fuel-air mixture in an internal combustion engine, and the rapid burning of gunpowder in a firearm or of pyrotechnic mixtures in fireworks. Deflagration systems and products can also be used in mining, demolition and stone quarrying via gas pressure blasting as a beneficial alternative to high explosives. -Oil/wax fire and water[edit] -Adding water to a burning hydrocarbon such as oil or wax produces a deflagration. The water boils rapidly and ejects the burning material as a fine spray of droplets. A deflagration then occurs as the fine mist of oil ignites and burns extremely rapidly. These are particularly common in chip pan fires, which are responsible for one in five household fires in Britain.[2] -Flame physics[edit] -The underlying flame physics can be understood with the help of an idealized model consisting of a uniform one-dimensional tube of unburnt and burned gaseous fuel, separated by a thin transitional region of width \delta\; in which the burning occurs. The burning region is commonly referred to as the flame or flame front. In equilibrium, thermal diffusion across the flame front is balanced by the heat supplied by burning. -There are two characteristic timescales which are important here. The first is the thermal diffusion timescale \tau_d\;, which is approximately equal to -\tau_d \simeq \delta^2 / \kappa, -where \kappa \; is the thermal diffusivity. The second is the burning timescale \tau_b that strongly decreases with temperature, typically as -\tau_b\propto \exp[\Delta U/(k_B T_f)], -where \Delta U\; is the activation barrier for the burning reaction and T_f\; is the temperature developed as the result of burning; the value of this so-called "flame temperature" can be determined from the laws of thermodynamics. -For a stationary moving deflagration front, these two timescales must be equal: the heat generated by burning is equal to the heat carried away by heat transfer. This makes it possible to calculate the characteristic width \delta\; of the flame front: -\tau_b = \tau_d\;, -thus - \delta \simeq \sqrt {\kappa \tau_b} . -Now, the thermal flame front propagates at a characteristic speed S_l\;, which is simply equal to the flame width divided by the burn time: -S_l \simeq \delta / \tau_b \simeq \sqrt {\kappa / \tau_b} . -This simplified model neglects the change of temperature and thus the burning rate across the deflagration front. This model also neglects the possible influence of turbulence. As a result, this derivation gives only the laminar flame speed -- hence the designation S_l\;. -Damaging deflagration events[edit] -Damage to buildings, equipment and people can result from a large-scale, short-duration deflagration. The potential damage is primarily a function of the total amount of fuel burned in the event (total energy available), the maximum flame velocity that is achieved, and the manner in which the expansion of the combustion gases is contained. -In free-air deflagrations, there is a continuous variation in deflagration effects relative to the maximum flame velocity. When flame velocities are low, the effect of a deflagration is to release heat. Some authors use the term flash fire to describe these low-speed deflagrations. At flame velocities near the speed of sound, the energy released is in the form of pressure and the results resemble a detonation. Between these extremes both heat and pressure are released. -When a low-speed deflagration occurs within a closed vessel or structure, pressure effects can produce damage due to expansion of gases as a secondary effect. The heat released by the deflagration causes the combustion gases and excess air to expand thermally. The net result is that the volume of the vessel or structure must expand to accommodate the hot combustion gases, or the vessel must be strong enough to withstand the additional internal pressure, or it fails, allowing the gases to escape. The risks of deflagration inside waste storage drums is a growing concern in storage facilities. -See also[edit] - Look up deflagration in Wiktionary, the free dictionary. -Pressure piling -References[edit] -Jump up ^ "Glossary D-H". Hutchisonrodway.co.nz. Retrieved 2013-12-29. -Jump up ^ UK Fire Service advice on chip pan fires -Categories: Explosives -Navigation menu -Create accountLog inArticleTalkReadEditView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -Català -Čeština -Deutsch -Español -Français -Italiano -Lietuvių -Nederlands -Norsk bokmål -Polski -Português -Русский -Српски / srpski -Svenska -Edit links -This page was last modified on 2 October 2014 at 16:44. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -United Kingdom -From Wikipedia, the free encyclopedia -This article is about the sovereign state. For the island, see Great Britain. For other uses, see United Kingdom (disambiguation) and UK (disambiguation). -Page semi-protected -United Kingdom of Great -Britain and Northern Ireland[show] - -A flag featuring both cross and saltire in red, white and blue Coat of arms containing shield and crown in centre, flanked by lion and unicorn -Flag Royal coat of arms[nb 1] -Anthem: "God Save the Queen"[nb 2] -MENU0:00 -Two islands to the north-west of continental Europe. Highlighted are the larger island and the north-eastern fifth of the smaller island to the west. -Location of the United Kingdom (dark green) -– in Europe (green & dark grey) -– in the European Union (green) -Capital -and largest city London -51°30′N 0°7′W -Official language -and national language English -Recognised regional -languages Cornish, Irish, Scots, Scottish Gaelic, Ulster-Scots, Welsh[nb 3] -Ethnic groups (2011) 87.1% White -7.0% Asian -3.0% Black -2.0% Mixed -0.9% Other -Demonym British, Briton -Government Unitary parliamentary constitutional monarchy - - Monarch Elizabeth II - - Prime Minister David Cameron -Legislature Parliament - - Upper house House of Lords - - Lower house House of Commons -Formation - - Acts of Union 1707 1 May 1707 - - Acts of Union 1800 1 January 1801 - - Irish Free State Constitution Act 5 December 1922 -Area - - Total 243,610 km2 (80th) -94,060 sq mi - - Water (%) 1.34 -Population - - 2013 estimate 64,100,000[3] (22nd) - - 2011 census 63,181,775[4] (22nd) - - Density 255.6/km2 (51st) -661.9/sq mi -GDP (PPP) 2014 estimate - - Total $2.435 trillion[5] (10th) - - Per capita $37,744[5] (27th) -GDP (nominal) 2014 estimate - - Total $2.848 trillion[5] (6th) - - Per capita $44,141[5] (22nd) -Gini (2012) positive decrease 32.8[6] -medium · 33rd -HDI (2013) Steady 0.892[7] -very high · 14th -Currency Pound sterling (GBP) -Time zone GMT (UTC​) - - Summer (DST) BST (UTC+1) -Date format dd/mm/yyyy (AD) -Drives on the left -Calling code +44 -ISO 3166 code GB -Internet TLD .uk -The United Kingdom of Great Britain and Northern Ireland Listeni/ɡreɪt ˈbrɪt(ə)n ənd ˈnɔːð(ə)n ˈʌɪələnd/, commonly known as the United Kingdom (UK) or Britain, is a sovereign state in Europe. Lying off the north-western coast of the European mainland, the country includes the island of Great Britain (a term also applied loosely to refer to the whole country),[8] the north-eastern part of the island of Ireland, and many smaller islands. Northern Ireland is the only part of the UK that shares a land border with another state: the Republic of Ireland.[nb 4] Apart from this land border, the UK is surrounded by the Atlantic Ocean, with the North Sea in the east and the English Channel in the south. The Irish Sea lies between Great Britain and Ireland. The UK has an area of 243,610 square kilometres (94,060 sq mi), making it the 78th-largest sovereign state in the world and the 11th-largest in Europe. -The United Kingdom is the 22nd-most populous country, with an estimated 64.1 million inhabitants.[3] It is a constitutional monarchy with a parliamentary system of governance.[9][10] Its capital city is London, an important global city and financial centre with the fourth-largest urban area in Europe.[11] The current monarch—since 6 February 1952—is Queen Elizabeth II. The UK consists of four countries: England, Scotland, Wales, and Northern Ireland.[12] The latter three have devolved administrations,[13] each with varying powers,[14][15] based in their capitals, Edinburgh, Cardiff, and Belfast, respectively. Guernsey, Jersey, and the Isle of Man are not part of the United Kingdom, being Crown dependencies with the British Government responsible for defence and international representation.[16] The UK has fourteen Overseas Territories,[17] including the disputed Falkland Islands, Gibraltar, and Indian Ocean Territory. -The relationships among the countries of the United Kingdom have changed over time. Wales was annexed by the Kingdom of England under the Acts of Union of 1536 and 1543. A treaty between England and Scotland resulted in a unified Kingdom of Great Britain in 1707, which in 1801, merged with the Kingdom of Ireland to form the United Kingdom of Great Britain and Ireland. In 1922, five-sixths of Ireland seceded from the country, leaving the present formulation of the United Kingdom of Great Britain and Northern Ireland.[nb 5] British Overseas Territories, formerly colonies, are the remnants of the British Empire which, at its height in the late 19th and early 20th centuries, encompassed almost a quarter of the world's land mass and was the largest empire in history. British influence can be observed in the language, culture, and legal systems of many of its former colonies. -The United Kingdom is a developed country and has the world's sixth-largest economy by nominal GDP and tenth-largest by purchasing power parity. The country is considered to have a high-income economy and is categorised as very high in the Human Development Index, currently ranking 14th in the world. It was the world's first industrialised country and the world's foremost power during the 19th and early 20th centuries.[18][19] The UK remains a great power with considerable economic, cultural, military, scientific, and political influence internationally.[20][21] It is a recognised nuclear weapons state and its military expenditure ranks fifth or sixth in the world.[22][23] The UK has been a permanent member of the United Nations Security Council since its first session in 1946. It has been a member state of the European Union (EU) and its predecessor, the European Economic Community (EEC), since 1973; it is also a member of the Commonwealth of Nations, the Council of Europe, the G7, the G8, the G20, NATO, the Organisation for Economic Co-operation and Development (OECD), and the World Trade Organization (WTO). -Contents [hide] -1 Etymology and terminology -2 History -2.1 Before 1707 -2.2 Since the Acts of Union of 1707 -3 Geography -3.1 Climate -3.2 Administrative divisions -4 Dependencies -5 Politics -5.1 Government -5.2 Devolved administrations -5.3 Law and criminal justice -5.4 Foreign relations -5.5 Military -6 Economy -6.1 Science and technology -6.2 Transport -6.3 Energy -7 Demographics -7.1 Ethnic groups -7.2 Languages -7.3 Religion -7.4 Migration -7.5 Education -7.6 Healthcare -8 Culture -8.1 Literature -8.2 Music -8.3 Visual art -8.4 Cinema -8.5 Media -8.6 Philosophy -8.7 Sport -8.8 Symbols -9 See also -10 Notes -11 References -12 Further reading -13 External links -Etymology and terminology -See also: Britain (placename) and Terminology of the British Isles -The 1707 Acts of Union declared that the kingdoms of England and Scotland were "United into One Kingdom by the Name of Great Britain", though the new state is also referred to in the Acts as the "Kingdom of Great Britain", "United Kingdom of Great Britain" and "United Kingdom".[24][25][nb 6] However, the term "united kingdom" is only found in informal use during the 18th century and the country was only occasionally referred to as he "United Kingdom of Great Britain".[26] The Acts of Union 1800 united the Kingdom of Great Britain and the Kingdom of Ireland in 1801, forming the United Kingdom of Great Britain and Ireland. The name "United Kingdom of Great Britain and Northern Ireland" was adopted following the independence of the Irish Free State, and the partition of Ireland, in 1922, which left Northern Ireland as the only part of the island of Ireland within the UK.[27] -Although the United Kingdom, as a sovereign state, is a country, England, Scotland, Wales, and to a lesser degree, Northern Ireland, are also regarded as countries, though they are not sovereign states.[28][29] Scotland, Wales and Northern Ireland have devolved self-government.[30][31] The British Prime Minister's website has used the phrase "countries within a country" to describe the United Kingdom.[12] Some statistical summaries, such as those for the twelve NUTS 1 regions of the UK, also refer to Scotland, Wales and Northern Ireland as "regions".[32][33] Northern Ireland is also referred to as a "province".[28][34] With regard to Northern Ireland, the descriptive name used "can be controversial, with the choice often revealing one's political preferences."[35] -The term Britain is often used as synonym for the United Kingdom. The term Great Britain, by contrast, refers conventionally to the island of Great Britain, or politically to England, Scotland and Wales in combination.[36][37][38] However, it is sometimes used as a loose synonym for the United Kingdom as a whole.[39][40] GB and GBR are the standard country codes for the United Kingdom (see ISO 3166-2 and ISO 3166-1 alpha-3) and are consequently used by international organisations to refer to the United Kingdom. Additionally, the United Kingdom's Olympic team competes under the name "Great Britain" or "Team GB".[41][42] -The adjective British is commonly used to refer to matters relating to the United Kingdom. The term has no definite legal connotation, but is used in law to refer to UK citizenship and matters to do with nationality.[43] People of the United Kingdom use a number of different terms to describe their national identity and may identify themselves as being British; or as being English, Scottish, Welsh, Northern Irish, or Irish;[44] or as being both.[45] -In 2006, a new design of British passport was introduced. Its first page shows the long form name of the state in English, Welsh and Scottish Gaelic.[46] In Welsh, the long form name of the state is "Teyrnas Unedig Prydain Fawr a Gogledd Iwerddon" with "Teyrnas Unedig" being used as a short form name on government websites.[47] In Scottish Gaelic, the long form is "Rìoghachd Aonaichte Bhreatainn is Èireann a Tuath" and the short form "Rìoghachd Aonaichte". -History -See also: History of the British Isles -Before 1707 - -Stonehenge, in Wiltshire, was erected around 2500 BC. -Main articles: History of England, History of Wales, History of Scotland, History of Ireland and History of the formation of the United Kingdom -Settlement by anatomically modern humans of what was to become the United Kingdom occurred in waves beginning by about 30,000 years ago.[48] By the end of the region's prehistoric period, the population is thought to have belonged, in the main, to a culture termed Insular Celtic, comprising Brythonic Britain and Gaelic Ireland.[49] The Roman conquest, beginning in 43 AD, and the 400-year rule of southern Britain, was followed by an invasion by Germanic Anglo-Saxon settlers, reducing the Brythonic area mainly to what was to become Wales and the historic Kingdom of Strathclyde.[50] Most of the region settled by the Anglo-Saxons became unified as the Kingdom of England in the 10th century.[51] Meanwhile, Gaelic-speakers in north west Britain (with connections to the north-east of Ireland and traditionally supposed to have migrated from there in the 5th century)[52][53] united with the Picts to create the Kingdom of Scotland in the 9th century.[54] -In 1066, the Normans invaded England from France and after its conquest, seized large parts of Wales, conquered much of Ireland and were invited to settle in Scotland, bringing to each country feudalism on the Northern French model and Norman-French culture.[55] The Norman elites greatly influenced, but eventually assimilated with, each of the local cultures.[56] Subsequent medieval English kings completed the conquest of Wales and made an unsuccessful attempt to annex Scotland. Thereafter, Scotland maintained its independence, albeit in near-constant conflict with England. The English monarchs, through inheritance of substantial territories in France and claims to the French crown, were also heavily involved in conflicts in France, most notably the Hundred Years War, while the Kings of Scots were in an alliance with the French during this period.[57] - -The Bayeux Tapestry depicts the Battle of Hastings and the events leading to it. -The early modern period saw religious conflict resulting from the Reformation and the introduction of Protestant state churches in each country.[58] Wales was fully incorporated into the Kingdom of England,[59] and Ireland was constituted as a kingdom in personal union with the English crown.[60] In what was to become Northern Ireland, the lands of the independent Catholic Gaelic nobility were confiscated and given to Protestant settlers from England and Scotland.[61] -In 1603, the kingdoms of England, Scotland and Ireland were united in a personal union when James VI, King of Scots, inherited the crowns of England and Ireland and moved his court from Edinburgh to London; each country nevertheless remained a separate political entity and retained its separate political, legal, and religious institutions.[62][63] -In the mid-17th century, all three kingdoms were involved in a series of connected wars (including the English Civil War) which led to the temporary overthrow of the monarchy and the establishment of the short-lived unitary republic of the Commonwealth of England, Scotland and Ireland.[64][65] -Although the monarchy was restored, it ensured (with the Glorious Revolution of 1688) that, unlike much of the rest of Europe, royal absolutism would not prevail, and a professed Catholic could never accede to the throne. The British constitution would develop on the basis of constitutional monarchy and the parliamentary system.[66] During this period, particularly in England, the development of naval power (and the interest in voyages of discovery) led to the acquisition and settlement of overseas colonies, particularly in North America.[67][68] -Since the Acts of Union of 1707 -Main article: History of the United Kingdom - -The Treaty of Union led to a single united kingdom encompassing all Great Britain. -On 1 May 1707, the united kingdom of Great Britain came into being, the result of Acts of Union being passed by the parliaments of England and Scotland to ratify the 1706 Treaty of Union and so unite the two kingdoms.[69][70][71] -In the 18th century, cabinet government developed under Robert Walpole, in practice the first prime minister (1721–1742). A series of Jacobite Uprisings sought to remove the Protestant House of Hanover from the British throne and restore the Catholic House of Stuart. The Jacobites were finally defeated at the Battle of Culloden in 1746, after which the Scottish Highlanders were brutally suppressed. The British colonies in North America that broke away from Britain in the American War of Independence became the United States of America in 1782. British imperial ambition turned elsewhere, particularly to India.[72] -During the 18th century, Britain was involved in the Atlantic slave trade. British ships transported an estimated 2 million slaves from Africa to the West Indies before banning the trade in 1807.[73] The term 'United Kingdom' became official in 1801 when the parliaments of Britain and Ireland each passed an Act of Union, uniting the two kingdoms and creating the United Kingdom of Great Britain and Ireland.[74] -In the early 19th century, the British-led Industrial Revolution began to transform the country. It slowly led to a shift in political power away from the old Tory and Whig landowning classes towards the new industrialists. An alliance of merchants and industrialists with the Whigs would lead to a new party, the Liberals, with an ideology of free trade and laissez-faire. In 1832 Parliament passed the Great Reform Act, which began the transfer of political power from the aristocracy to the middle classes. In the countryside, enclosure of the land was driving small farmers out. Towns and cities began to swell with a new urban working class. Few ordinary workers had the vote, and they created their own organisations in the form of trade unions. -Painting of a bloody battle. Horses and infantry fight or lie on grass. -The Battle of Waterloo marked the end of the Napoleonic Wars and the start of Pax Britannica. -After the defeat of France in the Revolutionary and Napoleonic Wars (1792–1815), the UK emerged as the principal naval and imperial power of the 19th century (with London the largest city in the world from about 1830).[75] Unchallenged at sea, British dominance was later described as Pax Britannica.[76][77] By the time of the Great Exhibition of 1851, Britain was described as the "workshop of the world".[78] The British Empire was expanded to include India, large parts of Africa and many other territories throughout the world. Alongside the formal control it exerted over its own colonies, British dominance of much of world trade meant that it effectively controlled the economies of many countries, such as China, Argentina and Siam.[79][80] Domestically, political attitudes favoured free trade and laissez-faire policies and a gradual widening of the voting franchise. During the century, the population increased at a dramatic rate, accompanied by rapid urbanisation, causing significant social and economic stresses.[81] After 1875, the UK's industrial monopoly was challenged by Germany and the USA. To seek new markets and sources of raw materials, the Conservative Party under Disraeli launched a period of imperialist expansion in Egypt, South Africa and elsewhere. Canada, Australia and New Zealand became self-governing dominions.[82] -Social reform and home rule for Ireland were important domestic issues after 1900. The Labour Party emerged from an alliance of trade unions and small Socialist groups in 1900, and suffragettes campaigned for women's right to vote before 1914. -Black-and-white photo of two dozen men in military uniforms and metal helmets sitting or standing in a muddy trench. -Infantry of the Royal Irish Rifles during the Battle of the Somme. More than 885,000 British soldiers died on the battlefields of World War I. -The UK fought with France, Russia and (after 1917) the US, against Germany and its allies in World War I (1914–18).[83] The UK armed forces were engaged across much of the British Empire and in several regions of Europe, particularly on the Western front.[84] The high fatalities of trench warfare caused the loss of much of a generation of men, with lasting social effects in the nation and a great disruption in the social order. -After the war, the UK received the League of Nations mandate over a number of former German and Ottoman colonies. The British Empire reached its greatest extent, covering a fifth of the world's land surface and a quarter of its population.[85] However, the UK had suffered 2.5 million casualties and finished the war with a huge national debt.[84] The rise of Irish Nationalism and disputes within Ireland over the terms of Irish Home Rule led eventually to the partition of the island in 1921,[86] and the Irish Free State became independent with Dominion status in 1922. Northern Ireland remained part of the United Kingdom.[87] A wave of strikes in the mid-1920s culminated in the UK General Strike of 1926. The UK had still not recovered from the effects of the war when the Great Depression (1929–32) occurred. This led to considerable unemployment and hardship in the old industrial areas, as well as political and social unrest in the 1930s. A coalition government was formed in 1931.[88] -The UK entered World War II by declaring war on Germany in 1939, after it had invaded Poland and Czechoslovakia. In 1940, Winston Churchill became prime minister and head of a coalition government. Despite the defeat of its European allies in the first year of the war, the UK continued the fight alone against Germany. In 1940, the RAF defeated the German Luftwaffe in a struggle for control of the skies in the Battle of Britain. The UK suffered heavy bombing during the Blitz. There were also eventual hard-fought victories in the Battle of the Atlantic, the North Africa campaign and Burma campaign. UK forces played an important role in the Normandy landings of 1944, achieved with its ally the US. After Germany's defeat, the UK was one of the Big Three powers who met to plan the post-war world; it was an original signatory to the Declaration of the United Nations. The UK became one of the five permanent members of the United Nations Security Council. However, the war left the UK severely weakened and depending financially on Marshall Aid and loans from the United States.[89] -Map of the world. Canada, the eastern United States, countries in east Africa, India, most of Australasia and some other countries are highlighted in pink. -Territories that were at one time part of the British Empire. Current British Overseas Territories are underlined in red. -In the immediate post-war years, the Labour government initiated a radical programme of reforms, which had a significant effect on British society in the following decades.[90] Major industries and public utilities were nationalised, a Welfare State was established, and a comprehensive, publicly funded healthcare system, the National Health Service, was created.[91] The rise of nationalism in the colonies coincided with Britain's now much-diminished economic position, so that a policy of decolonisation was unavoidable. Independence was granted to India and Pakistan in 1947.[92] Over the next three decades, most colonies of the British Empire gained their independence. Many became members of the Commonwealth of Nations.[93] -Although the UK was the third country to develop a nuclear weapons arsenal (with its first atomic bomb test in 1952), the new post-war limits of Britain's international role were illustrated by the Suez Crisis of 1956. The international spread of the English language ensured the continuing international influence of its literature and culture. From the 1960s onward, its popular culture was also influential abroad. As a result of a shortage of workers in the 1950s, the UK government encouraged immigration from Commonwealth countries. In the following decades, the UK became a multi-ethnic society.[94] Despite rising living standards in the late 1950s and 1960s, the UK's economic performance was not as successful as many of its competitors, such as West Germany and Japan. In 1973, the UK joined the European Economic Community (EEC), and when the EEC became the European Union (EU) in 1992, it was one of the 12 founding members. - -After the two vetos of France in 1961 and 1967, the UK entered in the European Union in 1973. In 1975, 67% of Britons voted yes to the permanence in the European Union. -From the late 1960s, Northern Ireland suffered communal and paramilitary violence (sometimes affecting other parts of the UK) conventionally known as the Troubles. It is usually considered to have ended with the Belfast "Good Friday" Agreement of 1998.[95][96][97] -Following a period of widespread economic slowdown and industrial strife in the 1970s, the Conservative Government of the 1980s initiated a radical policy of monetarism, deregulation, particularly of the financial sector (for example, Big Bang in 1986) and labour markets, the sale of state-owned companies (privatisation), and the withdrawal of subsidies to others.[98] This resulted in high unemployment and social unrest, but ultimately also economic growth, particularly in the services sector. From 1984, the economy was helped by the inflow of substantial North Sea oil revenues.[99] -Around the end of the 20th century there were major changes to the governance of the UK with the establishment of devolved administrations for Scotland, Wales and Northern Ireland.[13][100] The statutory incorporation followed acceptance of the European Convention on Human Rights. The UK is still a key global player diplomatically and militarily. It plays leading roles in the EU, UN and NATO. However, controversy surrounds some of Britain's overseas military deployments, particularly in Afghanistan and Iraq.[101] -The 2008 global financial crisis severely affected the UK economy. The coalition government of 2010 introduced austerity measures intended to tackle the substantial public deficits which resulted.[102] In 2014 the Scottish Government held a referendum on Scottish independence, with the majority of voters rejecting the independence proposal and opting to remain within the United Kingdom.[103] -Geography -Main article: Geography of the United Kingdom -Map of United Kingdom showing hilly regions to north and west, and flattest region in the south-east. -The topography of the UK -The total area of the United Kingdom is approximately 243,610 square kilometres (94,060 sq mi). The country occupies the major part of the British Isles[104] archipelago and includes the island of Great Britain, the northeastern one-sixth of the island of Ireland and some smaller surrounding islands. It lies between the North Atlantic Ocean and the North Sea with the south-east coast coming within 22 miles (35 km) of the coast of northern France, from which it is separated by the English Channel.[105] In 1993 10% of the UK was forested, 46% used for pastures and 25% cultivated for agriculture.[106] The Royal Greenwich Observatory in London is the defining point of the Prime Meridian.[107] -The United Kingdom lies between latitudes 49° to 61° N, and longitudes 9° W to 2° E. Northern Ireland shares a 224-mile (360 km) land boundary with the Republic of Ireland.[105] The coastline of Great Britain is 11,073 miles (17,820 km) long.[108] It is connected to continental Europe by the Channel Tunnel, which at 31 miles (50 km) (24 miles (38 km) underwater) is the longest underwater tunnel in the world.[109] -England accounts for just over half of the total area of the UK, covering 130,395 square kilometres (50,350 sq mi).[110] Most of the country consists of lowland terrain,[106] with mountainous terrain north-west of the Tees-Exe line; including the Cumbrian Mountains of the Lake District, the Pennines and limestone hills of the Peak District, Exmoor and Dartmoor. The main rivers and estuaries are the Thames, Severn and the Humber. England's highest mountain is Scafell Pike (978 metres (3,209 ft)) in the Lake District. Its principal rivers are the Severn, Thames, Humber, Tees, Tyne, Tweed, Avon, Exe and Mersey.[106] -Scotland accounts for just under a third of the total area of the UK, covering 78,772 square kilometres (30,410 sq mi)[111] and including nearly eight hundred islands,[112] predominantly west and north of the mainland; notably the Hebrides, Orkney Islands and Shetland Islands. The topography of Scotland is distinguished by the Highland Boundary Fault – a geological rock fracture – which traverses Scotland from Arran in the west to Stonehaven in the east.[113] The faultline separates two distinctively different regions; namely the Highlands to the north and west and the lowlands to the south and east. The more rugged Highland region contains the majority of Scotland's mountainous land, including Ben Nevis which at 1,343 metres (4,406 ft) is the highest point in the British Isles.[114] Lowland areas – especially the narrow waist of land between the Firth of Clyde and the Firth of Forth known as the Central Belt – are flatter and home to most of the population including Glasgow, Scotland's largest city, and Edinburgh, its capital and political centre. -A view of Ben Nevis in the distance, fronted by rolling plains -Ben Nevis, in Scotland, is the highest point in the British Isles -Wales accounts for less than a tenth of the total area of the UK, covering 20,779 square kilometres (8,020 sq mi).[115] Wales is mostly mountainous, though South Wales is less mountainous than North and mid Wales. The main population and industrial areas are in South Wales, consisting of the coastal cities of Cardiff, Swansea and Newport, and the South Wales Valleys to their north. The highest mountains in Wales are in Snowdonia and include Snowdon (Welsh: Yr Wyddfa) which, at 1,085 metres (3,560 ft), is the highest peak in Wales.[106] The 14, or possibly 15, Welsh mountains over 3,000 feet (914 m) high are known collectively as the Welsh 3000s. Wales has over 2,704 kilometres (1,680 miles) of coastline.[116] Several islands lie off the Welsh mainland, the largest of which is Anglesey (Ynys Môn) in the northwest. -Northern Ireland, separated from Great Britain by the Irish Sea and North Channel, has an area of 14,160 square kilometres (5,470 sq mi) and is mostly hilly. It includes Lough Neagh which, at 388 square kilometres (150 sq mi), is the largest lake in the British Isles by area.[117] The highest peak in Northern Ireland is Slieve Donard in the Mourne Mountains at 852 metres (2,795 ft).[106] -Climate -Main article: Climate of the United Kingdom -The United Kingdom has a temperate climate, with plentiful rainfall all year round.[105] The temperature varies with the seasons seldom dropping below −11 °C (12 °F) or rising above 35 °C (95 °F).[118] The prevailing wind is from the south-west and bears frequent spells of mild and wet weather from the Atlantic Ocean,[105] although the eastern parts are mostly sheltered from this wind since the majority of the rain falls over the western regions the eastern parts are therefore the driest. Atlantic currents, warmed by the Gulf Stream, bring mild winters; especially in the west where winters are wet and even more so over high ground. Summers are warmest in the south-east of England, being closest to the European mainland, and coolest in the north. Heavy snowfall can occur in winter and early spring on high ground, and occasionally settles to great depth away from the hills. -Administrative divisions -Main article: Administrative geography of the United Kingdom -Each country of the United Kingdom has its own system of administrative and geographic demarcation, whose origins often pre-date the formation of the United Kingdom. Thus there is "no common stratum of administrative unit encompassing the United Kingdom".[119] Until the 19th century there was little change to those arrangements, but there has since been a constant evolution of role and function.[120] Change did not occur in a uniform manner and the devolution of power over local government to Scotland, Wales and Northern Ireland means that future changes are unlikely to be uniform either. -The organisation of local government in England is complex, with the distribution of functions varying according to local arrangements. Legislation concerning local government in England is the responsibility of the UK parliament and the Government of the United Kingdom, as England has no devolved parliament. The upper-tier subdivisions of England are the nine Government office regions or European Union government office regions.[121] One region, Greater London, has had a directly elected assembly and mayor since 2000 following popular support for the proposal in a referendum.[122] It was intended that other regions would also be given their own elected regional assemblies, but a proposed assembly in the North East region was rejected by a referendum in 2004.[123] Below the regional tier, some parts of England have county councils and district councils and others have unitary authorities; while London consists of 32 London boroughs and the City of London. Councillors are elected by the first-past-the-post system in single-member wards or by the multi-member plurality system in multi-member wards.[124] -For local government purposes, Scotland is divided into 32 council areas, with wide variation in both size and population. The cities of Glasgow, Edinburgh, Aberdeen and Dundee are separate council areas, as is the Highland Council which includes a third of Scotland's area but only just over 200,000 people. Local councils are made up of elected councillors, of whom there are currently 1,222;[125] they are paid a part-time salary. Elections are conducted by single transferable vote in multi-member wards that elect either three or four councillors. Each council elects a Provost, or Convenor, to chair meetings of the council and to act as a figurehead for the area. Councillors are subject to a code of conduct enforced by the Standards Commission for Scotland.[126] The representative association of Scotland's local authorities is the Convention of Scottish Local Authorities (COSLA).[127] -Local government in Wales consists of 22 unitary authorities. These include the cities of Cardiff, Swansea and Newport which are unitary authorities in their own right.[128] Elections are held every four years under the first-past-the-post system.[129] The most recent elections were held in May 2012, except for the Isle of Anglesey. The Welsh Local Government Association represents the interests of local authorities in Wales.[130] -Local government in Northern Ireland has since 1973 been organised into 26 district councils, each elected by single transferable vote. Their powers are limited to services such as collecting waste, controlling dogs and maintaining parks and cemeteries.[131] On 13 March 2008 the executive agreed on proposals to create 11 new councils and replace the present system.[132] The next local elections were postponed until 2016 to facilitate this.[133] -Dependencies - -A view of the Caribbean Sea from the Cayman Islands, one of the world's foremost international financial centres[134] and tourist destinations.[135] -Main articles: British Overseas Territories, Crown dependencies and British Islands -The United Kingdom has sovereignty over seventeen territories which do not form part of the United Kingdom itself: fourteen British Overseas Territories[136] and three Crown dependencies.[137] -The fourteen British Overseas Territories are: Anguilla; Bermuda; the British Antarctic Territory; the British Indian Ocean Territory; the British Virgin Islands; the Cayman Islands; the Falkland Islands; Gibraltar; Montserrat; Saint Helena, Ascension and Tristan da Cunha; the Turks and Caicos Islands; the Pitcairn Islands; South Georgia and the South Sandwich Islands; and Sovereign Base Areas on Cyprus.[138] British claims in Antarctica are not universally recognised.[139] Collectively Britain's overseas territories encompass an approximate land area of 1,727,570 square kilometres (667,018 sq mi) and a population of approximately 260,000 people.[140] They are the remnants of the British Empire and several have specifically voted to remain British territories (Bermuda in 1995, Gibraltar in 2002 and the Falkland Islands in 2013).[141] -The Crown dependencies are possessions of the Crown, as opposed to overseas territories of the UK.[142] They comprise three independently administered jurisdictions: the Channel Islands of Jersey and Guernsey in the English Channel, and the Isle of Man in the Irish Sea. By mutual agreement, the British Government manages the islands' foreign affairs and defence and the UK Parliament has the authority to legislate on their behalf. However, internationally, they are regarded as "territories for which the United Kingdom is responsible".[143] The power to pass legislation affecting the islands ultimately rests with their own respective legislative assemblies, with the assent of the Crown (Privy Council or, in the case of the Isle of Man, in certain circumstances the Lieutenant-Governor).[144] Since 2005 each Crown dependency has had a Chief Minister as its head of government.[145] -Politics -Main articles: Politics of the United Kingdom, Monarchy of the United Kingdom and Elections in the United Kingdom -Elderly lady with a yellow hat and grey hair is smiling in outdoor setting. -Elizabeth II, Queen of the United Kingdom and the other Commonwealth realms -The United Kingdom is a unitary state under a constitutional monarchy. Queen Elizabeth II is the head of state of the UK as well as monarch of fifteen other independent Commonwealth countries. The monarch has "the right to be consulted, the right to encourage, and the right to warn".[146] The United Kingdom is one of only four countries in the world to have an uncodified constitution.[147][nb 7] The Constitution of the United Kingdom thus consists mostly of a collection of disparate written sources, including statutes, judge-made case law and international treaties, together with constitutional conventions. As there is no technical difference between ordinary statutes and "constitutional law", the UK Parliament can perform "constitutional reform" simply by passing Acts of Parliament, and thus has the political power to change or abolish almost any written or unwritten element of the constitution. However, no Parliament can pass laws that future Parliaments cannot change.[148] -Government -Main article: Government of the United Kingdom -The UK has a parliamentary government based on the Westminster system that has been emulated around the world: a legacy of the British Empire. The parliament of the United Kingdom that meets in the Palace of Westminster has two houses; an elected House of Commons and an appointed House of Lords. All bills passed are given Royal Assent before becoming law. -The position of prime minister,[nb 8] the UK's head of government,[149] belongs to the person most likely to command the confidence of the House of Commons; this individual is typically the leader of the political party or coalition of parties that holds the largest number of seats in that chamber. The prime minister chooses a cabinet and they are formally appointed by the monarch to form Her Majesty's Government. By convention, the Queen respects the prime minister's decisions of government.[150] -Large sand-coloured building of Gothic design beside brown river and road bridge. The building has several large towers, including large clock-tower. -The Palace of Westminster, seat of both houses of the Parliament of the United Kingdom -The cabinet is traditionally drawn from members of a prime minister's party or coalition and mostly from the House of Commons but always from both legislative houses, the cabinet being responsible to both. Executive power is exercised by the prime minister and cabinet, all of whom are sworn into the Privy Council of the United Kingdom, and become Ministers of the Crown. The current Prime Minister is David Cameron, who has been in office since 11 May 2010.[151] Cameron is the leader of the Conservative Party and heads a coalition with the Liberal Democrats. For elections to the House of Commons, the UK is currently divided into 650 constituencies,[152] each electing a single member of parliament (MP) by simple plurality. General elections are called by the monarch when the prime minister so advises. The Parliament Acts 1911 and 1949 require that a new election must be called no later than five years after the previous general election.[153] -The UK's three major political parties are the Conservative Party (Tories), the Labour Party and the Liberal Democrats, representing the British traditions of conservatism, socialism and social liberalism, respectively. During the 2010 general election these three parties won 622 out of 650 seats available in the House of Commons.[154][155] Most of the remaining seats were won by parties that contest elections only in one part of the UK: the Scottish National Party (Scotland only); Plaid Cymru (Wales only); and the Alliance Party, Democratic Unionist Party, Social Democratic and Labour Party and Sinn Féin (Northern Ireland only[nb 9]). In accordance with party policy, no elected Sinn Féin members of parliament have ever attended the House of Commons to speak on behalf of their constituents because of the requirement to take an oath of allegiance to the monarch. -Devolved administrations -Main articles: Devolution in the United Kingdom, Northern Ireland Executive, Scottish Government and Welsh Government -Modern one-story building with grass on roof and large sculpted grass area in front. Behind are residential buildings in a mixture of styles. -The Scottish Parliament Building in Holyrood is the seat of the Scottish Parliament. -Scotland, Wales and Northern Ireland each have their own government or executive, led by a First Minister (or, in the case of Northern Ireland, a diarchal First Minister and deputy First Minister), and a devolved unicameral legislature. England, the largest country of the United Kingdom, has no such devolved executive or legislature and is administered and legislated for directly by the UK government and parliament on all issues. This situation has given rise to the so-called West Lothian question which concerns the fact that members of parliament from Scotland, Wales and Northern Ireland can vote, sometimes decisively,[156] on matters that only affect England.[157] The McKay Commission reported on this matter in March 2013 recommending that laws affecting only England should need support from a majority of English members of parliament.[158] -The Scottish Government and Parliament have wide-ranging powers over any matter that has not been specifically reserved to the UK parliament, including education, healthcare, Scots law and local government.[159] At the 2011 elections the Scottish National Party won re-election and achieved an overall majority in the Scottish parliament, with its leader, Alex Salmond, as First Minister of Scotland.[160][161] In 2012, the UK and Scottish governments signed the Edinburgh Agreement setting out the terms for a referendum on Scottish independence in 2014, which was defeated 55% to 45%. -The Welsh Government and the National Assembly for Wales have more limited powers than those devolved to Scotland.[162] The Assembly is able to legislate on devolved matters through Acts of the Assembly, which require no prior consent from Westminster. The 2011 elections resulted in a minority Labour administration led by Carwyn Jones.[163] -The Northern Ireland Executive and Assembly have powers similar to those devolved to Scotland. The Executive is led by a diarchy representing unionist and nationalist members of the Assembly. Currently, Peter Robinson (Democratic Unionist Party) and Martin McGuinness (Sinn Féin) are First Minister and deputy First Minister respectively.[164] Devolution to Northern Ireland is contingent on participation by the Northern Ireland administration in the North-South Ministerial Council, where the Northern Ireland Executive cooperates and develops joint and shared policies with the Government of Ireland. The British and Irish governments co-operate on non-devolved matters affecting Northern Ireland through the British–Irish Intergovernmental Conference, which assumes the responsibilities of the Northern Ireland administration in the event of its non-operation. -The UK does not have a codified constitution and constitutional matters are not among the powers devolved to Scotland, Wales or Northern Ireland. Under the doctrine of parliamentary sovereignty, the UK Parliament could, in theory, therefore, abolish the Scottish Parliament, Welsh Assembly or Northern Ireland Assembly.[165][166] Indeed, in 1972, the UK Parliament unilaterally prorogued the Parliament of Northern Ireland, setting a precedent relevant to contemporary devolved institutions.[167] In practice, it would be politically difficult for the UK Parliament to abolish devolution to the Scottish Parliament and the Welsh Assembly, given the political entrenchment created by referendum decisions.[168] The political constraints placed upon the UK Parliament's power to interfere with devolution in Northern Ireland are even greater than in relation to Scotland and Wales, given that devolution in Northern Ireland rests upon an international agreement with the Government of Ireland.[169] -Law and criminal justice -Main article: Law of the United Kingdom - -The Royal Courts of Justice of England and Wales -The United Kingdom does not have a single legal system, as Article 19 of the 1706 Treaty of Union provided for the continuation of Scotland's separate legal system.[170] Today the UK has three distinct systems of law: English law, Northern Ireland law and Scots law. A new Supreme Court of the United Kingdom came into being in October 2009 to replace the Appellate Committee of the House of Lords.[171][172] The Judicial Committee of the Privy Council, including the same members as the Supreme Court, is the highest court of appeal for several independent Commonwealth countries, the British Overseas Territories and the Crown Dependencies.[173] -Both English law, which applies in England and Wales, and Northern Ireland law are based on common-law principles.[174] The essence of common law is that, subject to statute, the law is developed by judges in courts, applying statute, precedent and common sense to the facts before them to give explanatory judgements of the relevant legal principles, which are reported and binding in future similar cases (stare decisis).[175] The courts of England and Wales are headed by the Senior Courts of England and Wales, consisting of the Court of Appeal, the High Court of Justice (for civil cases) and the Crown Court (for criminal cases). The Supreme Court is the highest court in the land for both criminal and civil appeal cases in England, Wales and Northern Ireland and any decision it makes is binding on every other court in the same jurisdiction, often having a persuasive effect in other jurisdictions.[176] - -The High Court of Justiciary – the supreme criminal court of Scotland. -Scots law is a hybrid system based on both common-law and civil-law principles. The chief courts are the Court of Session, for civil cases,[177] and the High Court of Justiciary, for criminal cases.[178] The Supreme Court of the United Kingdom serves as the highest court of appeal for civil cases under Scots law.[179] Sheriff courts deal with most civil and criminal cases including conducting criminal trials with a jury, known as sheriff solemn court, or with a sheriff and no jury, known as sheriff summary Court.[180] The Scots legal system is unique in having three possible verdicts for a criminal trial: "guilty", "not guilty" and "not proven". Both "not guilty" and "not proven" result in an acquittal.[181] -Crime in England and Wales increased in the period between 1981 and 1995, though since that peak there has been an overall fall of 48% in crime from 1995 to 2007/08,[182] according to crime statistics. The prison population of England and Wales has almost doubled over the same period, to over 80,000, giving England and Wales the highest rate of incarceration in Western Europe at 147 per 100,000.[183] Her Majesty's Prison Service, which reports to the Ministry of Justice, manages most of the prisons within England and Wales. Crime in Scotland fell to its lowest recorded level for 32 years in 2009/10, falling by ten per cent.[184] At the same time Scotland's prison population, at over 8,000,[185] is at record levels and well above design capacity.[186] The Scottish Prison Service, which reports to the Cabinet Secretary for Justice, manages Scotland's prisons. -Foreign relations -Main article: Foreign relations of the United Kingdom - -The Prime Minister of the United Kingdom, David Cameron, and the President of the United States, Barack Obama, during the 2010 G-20 Toronto summit. -The UK is a permanent member of the United Nations Security Council, a member of NATO, the Commonwealth of Nations, G7, G8, G20, the OECD, the WTO, the Council of Europe, the OSCE, and is a member state of the European Union. The UK is said to have a "Special Relationship" with the United States and a close partnership with France—the "Entente cordiale"—and shares nuclear weapons technology with both countries.[187][188] The UK is also closely linked with the Republic of Ireland; the two countries share a Common Travel Area and co-operate through the British-Irish Intergovernmental Conference and the British-Irish Council. Britain's global presence and influence is further amplified through its trading relations, foreign investments, official development assistance and military engagements.[189] -Military - -Troopers of the Blues and Royals during the 2007 Trooping the Colour ceremony -Main article: British Armed Forces -The armed forces of the United Kingdom—officially, Her Majesty's Armed Forces—consist of three professional service branches: the Royal Navy and Royal Marines (forming the Naval Service), the British Army and the Royal Air Force.[190] The forces are managed by the Ministry of Defence and controlled by the Defence Council, chaired by the Secretary of State for Defence. The Commander-in-Chief is the British monarch, Elizabeth II, to whom members of the forces swear an oath of allegiance.[191] The Armed Forces are charged with protecting the UK and its overseas territories, promoting the UK's global security interests and supporting international peacekeeping efforts. They are active and regular participants in NATO, including the Allied Rapid Reaction Corps, as well as the Five Power Defence Arrangements, RIMPAC and other worldwide coalition operations. Overseas garrisons and facilities are maintained in Ascension Island, Belize, Brunei, Canada, Cyprus, Diego Garcia, the Falkland Islands, Germany, Gibraltar, Kenya and Qatar.[192] -The British armed forces played a key role in establishing the British Empire as the dominant world power in the 18th, 19th and early 20th centuries. Throughout its unique history the British forces have seen action in a number of major wars, such as the Seven Years' War, the Napoleonic Wars, the Crimean War, World War I and World War II—as well as many colonial conflicts. By emerging victorious from such conflicts, Britain has often been able to decisively influence world events. Since the end of the British Empire, the UK has nonetheless remained a major military power. Following the end of the Cold War, defence policy has a stated assumption that "the most demanding operations" will be undertaken as part of a coalition.[193] Setting aside the intervention in Sierra Leone, recent UK military operations in Bosnia, Kosovo, Afghanistan, Iraq and, most recently, Libya, have followed this approach. The last time the British military fought alone was the Falklands War of 1982. -According to various sources, including the Stockholm International Peace Research Institute and the International Institute for Strategic Studies, the United Kingdom has the fifth- or sixth-highest military expenditure in the world. Total defence spending currently accounts for around 2.4% of total national GDP.[22][23] -Economy -Main article: Economy of the United Kingdom - -The Bank of England – the central bank of the United Kingdom -The UK has a partially regulated market economy.[194] Based on market exchange rates the UK is today the sixth-largest economy in the world and the third-largest in Europe after Germany and France, having fallen behind France for the first time in over a decade in 2008.[195] HM Treasury, led by the Chancellor of the Exchequer, is responsible for developing and executing the British government's public finance policy and economic policy. The Bank of England is the UK's central bank and is responsible for issuing notes and coins in the nation's currency, the pound sterling. Banks in Scotland and Northern Ireland retain the right to issue their own notes, subject to retaining enough Bank of England notes in reserve to cover their issue. Pound sterling is the world's third-largest reserve currency (after the US Dollar and the Euro).[196] Since 1997 the Bank of England's Monetary Policy Committee, headed by the Governor of the Bank of England, has been responsible for setting interest rates at the level necessary to achieve the overall inflation target for the economy that is set by the Chancellor each year.[197] -The UK service sector makes up around 73% of GDP.[198] London is one of the three "command centres" of the global economy (alongside New York City and Tokyo),[199] it is the world's largest financial centre alongside New York,[200][201][202] and it has the largest city GDP in Europe.[203] Edinburgh is also one of the largest financial centres in Europe.[204] Tourism is very important to the British economy and, with over 27 million tourists arriving in 2004, the United Kingdom is ranked as the sixth major tourist destination in the world and London has the most international visitors of any city in the world.[205][206] The creative industries accounted for 7% GVA in 2005 and grew at an average of 6% per annum between 1997 and 2005.[207] - -The Airbus A350 has its wings and engines manufactured in the UK. -The Industrial Revolution started in the UK with an initial concentration on the textile industry,[208] followed by other heavy industries such as shipbuilding, coal mining and steelmaking.[209][210] -The empire was exploited as an overseas market for British products, allowing the UK to dominate international trade in the 19th century. As other nations industrialised, coupled with economic decline after two world wars, the United Kingdom began to lose its competitive advantage and heavy industry declined, by degrees, throughout the 20th century. Manufacturing remains a significant part of the economy but accounted for only 16.7% of national output in 2003.[211] -The automotive industry is a significant part of the UK manufacturing sector and employs over 800,000 people, with a turnover of some £52 billion, generating £26.6 billion of exports.[212] -The aerospace industry of the UK is the second- or third-largest national aerospace industry in the world depending upon the method of measurement and has an annual turnover of around £20 billion. The wings for the Airbus A380 and the A350 XWB are designed and manufactured at Airbus UK's world-leading Broughton facility, whilst over a quarter of the value of the Boeing 787 comes from UK manufacturers including Eaton (fuel subsystem pumps), Messier-Bugatti-Dowty (the landing gear) and Rolls-Royce (the engines). Other key names include GKN Aerospace – an expert in metallic and composite aerostructures that's involved in almost every civil and military fixed and rotary wing aircraft in production and development today.[213][214][215][216] -BAE Systems - plays a critical role on some of the world's biggest defence aerospace projects. The company makes large sections of the Typhoon Eurofighter at its sub-assembly plant in Salmesbury and assembles the aircraft for the RAF at its Warton Plant, near Preston. It is also a principal subcontractor on the F35 Joint Strike Fighter - the world's largest single defence project - for which it designs and manufactures a range of components including the aft fuselage, vertical and horizontal tail and wing tips and fuel system. As well as this it manufactures the Hawk, the world's most successful jet training aircraft.[216] Airbus UK also manufactures the wings for the A400m military transporter. Rolls-Royce, is the world's second-largest aero-engine manufacturer. Its engines power more than 30 types of commercial aircraft and it has more than 30,000 engines currently in service across both the civil and defence sectors. Agusta Westland designs and manufactures complete helicopters in the UK.[216] -The UK space industry is growing very fast. Worth £9.1bn in 2011 and employing 29,000 people, it is growing at a rate of some 7.5 per cent annually, according to its umbrella organisation, the UK Space Agency. Government strategy is for the space industry to be a £40bn business for the UK by 2030, capturing a 10 per cent share of the $250bn world market for commercial space technology.[216] On 16 July 2013, the British government pledged £60m to the Skylon project: this investment will provide support at a "crucial stage" to allow a full-scale prototype of the SABRE engine to be built. -The pharmaceutical industry plays an important role in the UK economy and the country has the third-highest share of global pharmaceutical R&D expenditures (after the United States and Japan).[217][218] -Agriculture is intensive, highly mechanised and efficient by European standards, producing about 60% of food needs with less than 1.6% of the labour force (535,000 workers).[219] Around two-thirds of production is devoted to livestock, one-third to arable crops. Farmers are subsidised by the EU's Common Agricultural Policy. The UK retains a significant, though much reduced fishing industry. It is also rich in a number of natural resources including coal, petroleum, natural gas, tin, limestone, iron ore, salt, clay, chalk, gypsum, lead, silica and an abundance of arable land. - -The City of London is the world's largest financial centre alongside New York[200][201][202] -In the final quarter of 2008 the UK economy officially entered recession for the first time since 1991.[220] Unemployment increased from 5.2% in May 2008 to 7.6% in May 2009 and by January 2012 the unemployment rate among 18 to 24-year-olds had risen from 11.9% to 22.5%, the highest since current records began in 1992.[221][222] Total UK government debt rose from 44.4% of GDP in 2007 to 82.9% of GDP in 2011.[223] In February 2013, the UK lost its top AAA credit rating for the first time since 1978.[224] -Inflation-adjusted wages in the UK fell by 3.2% between the third quarter of 2010 and the third quarter of 2012.[225] Since the 1980s, economic inequality has grown faster in the UK than in any other developed country.[226] -The poverty line in the UK is commonly defined as being 60% of the median household income.[nb 10] In 2007–2008 13.5 million people, or 22% of the population, lived below this line. This is a higher level of relative poverty than all but four other EU members.[227] In the same year 4.0 million children, 31% of the total, lived in households below the poverty line after housing costs were taken into account. This is a decrease of 400,000 children since 1998–1999.[228] The UK imports 40% of its food supplies.[229] The Office for National Statistics has estimated that in 2011, 14 million people were at risk of poverty or social exclusion, and that one person in 20 (5.1%) was now experiencing "severe material depression,"[230] up from 3 million people in 1977.[231][232] -Science and technology -Main article: Science and technology in the United Kingdom - -Charles Darwin (1809–82), whose theory of evolution by natural selection is the foundation of modern biological sciences -England and Scotland were leading centres of the Scientific Revolution from the 17th century[233] and the United Kingdom led the Industrial Revolution from the 18th century,[208] and has continued to produce scientists and engineers credited with important advances.[234] Major theorists from the 17th and 18th centuries include Isaac Newton, whose laws of motion and illumination of gravity have been seen as a keystone of modern science;[235] from the 19th century Charles Darwin, whose theory of evolution by natural selection was fundamental to the development of modern biology, and James Clerk Maxwell, who formulated classical electromagnetic theory; and more recently Stephen Hawking, who has advanced major theories in the fields of cosmology, quantum gravity and the investigation of black holes.[236] Major scientific discoveries from the 18th century include hydrogen by Henry Cavendish;[237] from the 20th century penicillin by Alexander Fleming,[238] and the structure of DNA, by Francis Crick and others.[239] Major engineering projects and applications by people from the UK in the 18th century include the steam locomotive, developed by Richard Trevithick and Andrew Vivian;[240] from the 19th century the electric motor by Michael Faraday, the incandescent light bulb by Joseph Swan,[241] and the first practical telephone, patented by Alexander Graham Bell;[242] and in the 20th century the world's first working television system by John Logie Baird and others,[243] the jet engine by Frank Whittle, the basis of the modern computer by Alan Turing, and the World Wide Web by Tim Berners-Lee.[244] -Scientific research and development remains important in British universities, with many establishing science parks to facilitate production and co-operation with industry.[245] Between 2004 and 2008 the UK produced 7% of the world's scientific research papers and had an 8% share of scientific citations, the third and second highest in the world (after the United States and China, and the United States, respectively).[246] Scientific journals produced in the UK include Nature, the British Medical Journal and The Lancet.[247] -Transport -Main article: Transport in the United Kingdom - -Heathrow Terminal 5 building. London Heathrow Airport has the most international passenger traffic of any airport in the world.[248][249] -A radial road network totals 29,145 miles (46,904 km) of main roads, 2,173 miles (3,497 km) of motorways and 213,750 miles (344,000 km) of paved roads.[105] In 2009 there were a total of 34 million licensed vehicles in Great Britain.[250] -The UK has a railway network of 10,072 miles (16,209 km) in Great Britain and 189 miles (304 km) in Northern Ireland. Railways in Northern Ireland are operated by NI Railways, a subsidiary of state-owned Translink. In Great Britain, the British Rail network was privatised between 1994 and 1997. Network Rail owns and manages most of the fixed assets (tracks, signals etc.). About 20 privately owned (and foreign state-owned railways including: Deutsche Bahn; SNCF and Nederlandse Spoorwegen) Train Operating Companies (including state-owned East Coast), operate passenger trains and carry over 18,000 passenger trains daily. There are also some 1,000 freight trains in daily operation.[105] The UK government is to spend £30 billion on a new high-speed railway line, HS2, to be operational by 2025.[251] Crossrail, under construction in London, Is Europe's largest construction project with a £15 billion projected cost.[252][253] -In the year from October 2009 to September 2010 UK airports handled a total of 211.4 million passengers.[254] In that period the three largest airports were London Heathrow Airport (65.6 million passengers), Gatwick Airport (31.5 million passengers) and London Stansted Airport (18.9 million passengers).[254] London Heathrow Airport, located 15 miles (24 km) west of the capital, has the most international passenger traffic of any airport in the world[248][249] and is the hub for the UK flag carrier British Airways, as well as for BMI and Virgin Atlantic.[255] -Energy -Main article: Energy in the United Kingdom - -An oil platform in the North Sea -In 2006, the UK was the world's ninth-largest consumer of energy and the 15th-largest producer.[256] The UK is home to a number of large energy companies, including two of the six oil and gas "supermajors" – BP and Royal Dutch Shell – and BG Group.[257][258] In 2011, 40% of the UK's electricity was produced by gas, 30% by coal, 19% by nuclear power and 4.2% by wind, hydro, biofuels and wastes.[259] -In 2009, the UK produced 1.5 million barrels per day (bbl/d) of oil and consumed 1.7 million bbl/d.[260] Production is now in decline and the UK has been a net importer of oil since 2005.[260] In 2010 the UK had around 3.1 billion barrels of proven crude oil reserves, the largest of any EU member state.[260] In 2009, 66.5% of the UK's oil supply was imported.[261] -In 2009, the UK was the 13th-largest producer of natural gas in the world and the largest producer in the EU.[262] Production is now in decline and the UK has been a net importer of natural gas since 2004.[262] In 2009, half of British gas was supplied from imports and this is expected to increase to at least 75% by 2015, as domestic reserves are depleted.[259] -Coal production played a key role in the UK economy in the 19th and 20th centuries. In the mid-1970s, 130 million tonnes of coal was being produced annually, not falling below 100 million tonnes until the early 1980s. During the 1980s and 1990s the industry was scaled back considerably. In 2011, the UK produced 18.3 million tonnes of coal.[263] In 2005 it had proven recoverable coal reserves of 171 million tons.[263] The UK Coal Authority has stated there is a potential to produce between 7 billion tonnes and 16 billion tonnes of coal through underground coal gasification (UCG) or 'fracking',[264] and that, based on current UK coal consumption, such reserves could last between 200 and 400 years.[265] However, environmental and social concerns have been raised over chemicals getting into the water table and minor earthquakes damaging homes.[266][267] -In the late 1990s, nuclear power plants contributed around 25% of total annual electricity generation in the UK, but this has gradually declined as old plants have been shut down and ageing-related problems affect plant availability. In 2012, the UK had 16 reactors normally generating about 19% of its electricity. All but one of the reactors will be retired by 2023. Unlike Germany and Japan, the UK intends to build a new generation of nuclear plants from about 2018.[259] -Demographics -Main article: Demographics of the United Kingdom - -Map of population density in the UK as at the 2011 census. -A census is taken simultaneously in all parts of the UK every ten years.[268] The Office for National Statistics is responsible for collecting data for England and Wales, the General Register Office for Scotland and the Northern Ireland Statistics and Research Agency each being responsible for censuses in their respective countries.[269] In the 2011 census the total population of the United Kingdom was 63,181,775.[270] It is the third-largest in the European Union, the fifth-largest in the Commonwealth and the 21st-largest in the world. 2010 was the third successive year in which natural change contributed more to population growth than net long-term international migration.[271][271] Between 2001 and 2011 the population increased by an average annual rate of approximately 0.7 per cent.[270] This compares to 0.3 per cent per year in the period 1991 to 2001 and 0.2 per cent in the decade 1981 to 1991.[271] The 2011 census also confirmed that the proportion of the population aged 0–14 has nearly halved (31 per cent in 1911 compared to 18 in 2011) and the proportion of older people aged 65 and over has more than trebled (from 5 to 16 per cent).[270] It has been estimated that the number of people aged 100 or over will rise steeply to reach over 626,000 by 2080.[272] -England's population in 2011 was found to be 53 million.[273] It is one of the most densely populated countries in the world, with 383 people resident per square kilometre in mid-2003,[274] with a particular concentration in London and the south-east.[275] The 2011 census put Scotland's population at 5.3 million,[276] Wales at 3.06 million and Northern Ireland at 1.81 million.[273] In percentage terms England has had the fastest growing population of any country of the UK in the period from 2001 to 2011, with an increase of 7.9%. -In 2012 the average total fertility rate (TFR) across the UK was 1.92 children per woman.[277] While a rising birth rate is contributing to current population growth, it remains considerably below the 'baby boom' peak of 2.95 children per woman in 1964,[278] below the replacement rate of 2.1, but higher than the 2001 record low of 1.63.[277] In 2012, Scotland had the lowest TFR at only 1.67, followed by Wales at 1.88, England at 1.94, and Northern Ireland at 2.03.[277] In 2011, 47.3% of births in the UK were to unmarried women.[279] A government figure estimated that there are 3.6 million homosexual people in Britain comprising 6 per cent of the population.[280] -view talk edit -view talk edit -Largest urban areas of the United Kingdom -United Kingdom 2011 census Built-up areas[281][282][283] -Rank Urban area Pop. Principal settlement Rank Urban area Pop. Principal settlement -Greater London Urban Area -Greater London Urban Area -Greater Manchester Urban Area -Greater Manchester Urban Area -1 Greater London Urban Area 9,787,426 London 11 Bristol Urban Area 617,280 Bristol West Midlands Urban Area -West Midlands Urban Area -West Yorkshire Urban Area -West Yorkshire Urban Area -2 Greater Manchester Urban Area 2,553,379 Manchester 12 Belfast Metropolitan Urban Area 579,236 Belfast -3 West Midlands Urban Area 2,440,986 Birmingham 13 Leicester Urban Area 508,916 Leicester -4 West Yorkshire Urban Area 1,777,934 Leeds 14 Edinburgh 488,610 Edinburgh -5 Greater Glasgow 976,970 Glasgow 15 Brighton/Worthing/Littlehampton 474,485 Brighton -6 Liverpool Urban Area 864,122 Liverpool 16 South East Dorset conurbation 466,266 Bournemouth -7 South Hampshire 855,569 Southampton 17 Cardiff Urban Area 390,214 Cardiff -8 Tyneside 774,891 Newcastle 18 Teesside 376,633 Middlesbrough -9 Nottingham Urban Area 729,977 Nottingham 19 The Potteries Urban Area 372,775 Stoke-on-Trent -10 Sheffield Urban Area 685,368 Sheffield 20 Coventry and Bedworth Urban Area 359,262 Coventry - -Ethnic groups - -Map showing the percentage of the population who are not white according to the 2011 census. -Ethnic group 2011 -population 2011 -% -White 55,010,359 87.1 -White: Irish Traveller 63,193 0.1 -Asian or Asian British: Indian 1,451,862 -2.3 -Asian or Asian British: Pakistani 1,173,892 -1.9 -Asian or Asian British: Bangladeshi 451,529 -0.7 -Asian or Asian British: Chinese 433,150 -0.7 -Asian or Asian British: Asian Other 861,815 -1.4 -Asian or Asian British: Total 4,373,339 -7.0 -Black or Black British 1,904,684 -3.0 -British Mixed 1,250,229 -2.0 -Other: Total 580,374 -0.9 -Total[284] 63,182,178 -100 -Historically, indigenous British people were thought to be descended from the various ethnic groups that settled there before the 11th century: the Celts, Romans, Anglo-Saxons, Norse and the Normans. Welsh people could be the oldest ethnic group in the UK.[285] A 2006 genetic study shows that more than 50 per cent of England's gene pool contains Germanic Y chromosomes.[286] Another 2005 genetic analysis indicates that "about 75 per cent of the traceable ancestors of the modern British population had arrived in the British isles by about 6,200 years ago, at the start of the British Neolithic or Stone Age", and that the British broadly share a common ancestry with the Basque people.[287][288][289] -The UK has a history of small-scale non-white immigration, with Liverpool having the oldest Black population in the country dating back to at least the 1730s during the period of the African slave trade,[290] and the oldest Chinese community in Europe, dating to the arrival of Chinese seamen in the 19th century.[291] In 1950 there were probably fewer than 20,000 non-white residents in Britain, almost all born overseas.[292] -Since 1948 substantial immigration from Africa, the Caribbean and South Asia has been a legacy of ties forged by the British Empire. Migration from new EU member states in Central and Eastern Europe since 2004 has resulted in growth in these population groups but, as of 2008, the trend is reversing. Many of these migrants are returning to their home countries, leaving the size of these groups unknown.[293] In 2011, 86% of the population identified themselves as White, meaning 12.9% of the UK population identify themselves as of mixed ethnic minority. -Ethnic diversity varies significantly across the UK. 30.4% of London's population and 37.4% of Leicester's was estimated to be non-white in 2005,[294][295] whereas less than 5% of the populations of North East England, Wales and the South West were from ethnic minorities, according to the 2001 census.[296] In 2011, 26.5% of primary and 22.2% of secondary pupils at state schools in England were members of an ethnic minority.[297] -The non-white British population of England and Wales increased by 38% from 6.6 million in 2001 to 9.1 million in 2009.[298] The fastest-growing group was the mixed-ethnicity population, which doubled from 672,000 in 2001 to 986,600 in 2009. Also in the same period, a decrease of 36,000 white British people was recorded.[299] -Languages -Main article: Languages of the United Kingdom - -The English-speaking world. Countries in dark blue have a majority of native speakers; countries where English is an official but not a majority language are shaded in light blue. English is one of the official languages of the European Union[300] and the United Nations[301] -The UK's de facto official language is English.[302][303] It is estimated that 95% of the UK's population are monolingual English speakers.[304] 5.5% of the population are estimated to speak languages brought to the UK as a result of relatively recent immigration.[304] South Asian languages, including Bengali, Tamil, Punjabi, Hindi and Gujarati, are the largest grouping and are spoken by 2.7% of the UK population.[304] According to the 2011 census, Polish has become the second-largest language spoken in England and has 546,000 speakers.[305] -Four Celtic languages are spoken in the UK: Welsh; Irish; Scottish Gaelic; and Cornish. All are recognised as regional or minority languages, subject to specific measures of protection and promotion under the European Charter for Regional or Minority Languages[2][306] and the Framework Convention for the Protection of National Minorities.[307] In the 2001 Census over a fifth (21%) of the population of Wales said they could speak Welsh,[308] an increase from the 1991 Census (18%).[309] In addition it is estimated that about 200,000 Welsh speakers live in England.[310] In the same census in Northern Ireland 167,487 people (10.4%) stated that they had "some knowledge of Irish" (see Irish language in Northern Ireland), almost exclusively in the nationalist (mainly Catholic) population. Over 92,000 people in Scotland (just under 2% of the population) had some Gaelic language ability, including 72% of those living in the Outer Hebrides.[311] The number of schoolchildren being taught through Welsh, Scottish Gaelic and Irish is increasing.[312] Among emigrant-descended populations some Scottish Gaelic is still spoken in Canada (principally Nova Scotia and Cape Breton Island),[313] and Welsh in Patagonia, Argentina.[314] -Scots, a language descended from early northern Middle English, has limited recognition alongside its regional variant, Ulster Scots in Northern Ireland, without specific commitments to protection and promotion.[2][315] -It is compulsory for pupils to study a second language up to the age of 14 in England,[316] and up to age 16 in Scotland. French and German are the two most commonly taught second languages in England and Scotland. All pupils in Wales are taught Welsh as a second language up to age 16, or are taught in Welsh.[317] -Religion -Main article: Religion in the United Kingdom - -Westminster Abbey is used for the coronation of British monarchs -Forms of Christianity have dominated religious life in what is now the United Kingdom for over 1,400 years.[318] Although a majority of citizens still identify with Christianity in many surveys, regular church attendance has fallen dramatically since the middle of the 20th century,[319] while immigration and demographic change have contributed to the growth of other faiths, most notably Islam.[320] This has led some commentators to variously describe the UK as a multi-faith,[321] secularised,[322] or post-Christian society.[323] -In the 2001 census 71.6% of all respondents indicated that they were Christians, with the next largest faiths (by number of adherents) being Islam (2.8%), Hinduism (1.0%), Sikhism (0.6%), Judaism (0.5%), Buddhism (0.3%) and all other religions (0.3%).[324] 15% of respondents stated that they had no religion, with a further 7% not stating a religious preference.[325] A Tearfund survey in 2007 showed only one in ten Britons actually attend church weekly.[326] Between the 2001 and 2011 census there was a decrease in the amount of people who identified as Christian by 12%, whilst the percentage of those reporting no religious affiliation doubled. This contrasted with growth in the other main religious group categories, with the number of Muslims increasing by the most substantial margin to a total of about 5%.[327] -The Church of England is the established church in England.[328] It retains a representation in the UK Parliament and the British monarch is its Supreme Governor.[329] In Scotland the Presbyterian Church of Scotland is recognised as the national church. It is not subject to state control, and the British monarch is an ordinary member, required to swear an oath to "maintain and preserve the Protestant Religion and Presbyterian Church Government" upon his or her accession.[330][331] The (Anglican) Church in Wales was disestablished in 1920 and, as the (Anglican) Church of Ireland was disestablished in 1870 before the partition of Ireland, there is no established church in Northern Ireland.[332] Although there are no UK-wide data in the 2001 census on adherence to individual Christian denominations, it has been estimated that 62% of Christians are Anglican, 13.5% Catholic, 6% Presbyterian, 3.4% Methodist with small numbers of other Protestant denominations such as Open Brethren, and Orthodox churches.[333] -Migration -Main article: Immigration to the United Kingdom since 1922 -See also: Foreign-born population of the United Kingdom - -Estimated foreign-born population by country of birth, April 2007 – March 2008 -The United Kingdom has experienced successive waves of migration. The Great Famine in Ireland, then part of the United Kingdom, resulted in perhaps a million people migrating to Great Brtain.[334] Unable to return to Poland at the end of World War II, over 120,000 Polish veterans remained in the UK permanently.[335] After World War II, there was significant immigration from the colonies and newly independent former colonies, partly as a legacy of empire and partly driven by labour shortages. Many of these migrants came from the Caribbean and the Indian subcontinent.[336] The British Asian population has increased from 2.2 million in 2001 to over 4.2 million in 2011.[337] -One of the more recent trends in migration has been the arrival of workers from the new EU member states in Eastern Europe. In 2010, there were 7.0 million foreign-born residents in the UK, corresponding to 11.3% of the total population. Of these, 4.76 million (7.7%) were born outside the EU and 2.24 million (3.6%) were born in another EU Member State.[338] The proportion of foreign-born people in the UK remains slightly below that of many other European countries.[339] However, immigration is now contributing to a rising population[340] with arrivals and UK-born children of migrants accounting for about half of the population increase between 1991 and 2001. Analysis of Office for National Statistics (ONS) data shows that a net total of 2.3 million migrants moved to the UK in the 15 years from 1991 to 2006.[341][342] In 2008 it was predicted that migration would add 7 million to the UK population by 2031,[343] though these figures are disputed.[344] The ONS reported that net migration rose from 2009 to 2010 by 21 per cent to 239,000.[345] In 2011 the net increase was 251,000: immigration was 589,000, while the number of people emigrating (for more than 12 months) was 338,000.[346][347] -195,046 foreign nationals became British citizens in 2010,[348] compared to 54,902 in 1999.[348][349] A record 241,192 people were granted permanent settlement rights in 2010, of whom 51 per cent were from Asia and 27 per cent from Africa.[350] 25.5 per cent of babies born in England and Wales in 2011 were born to mothers born outside the UK, according to official statistics released in 2012.[351] -Citizens of the European Union, including those of the UK, have the right to live and work in any EU member state.[352] The UK applied temporary restrictions to citizens of Romania and Bulgaria, which joined the EU in January 2007.[353] Research conducted by the Migration Policy Institute for the Equality and Human Rights Commission suggests that, between May 2004 and September 2009, 1.5 million workers migrated from the new EU member states to the UK, two-thirds of them Polish, but that many subsequently returned home, resulting in a net increase in the number of nationals of the new member states in the UK of some 700,000 over that period.[354][355] The late-2000s recession in the UK reduced the economic incentive for Poles to migrate to the UK,[356] the migration becoming temporary and circular.[357] In 2009, for the first time since enlargement, more nationals of the eight central and eastern European states that had joined the EU in 2004 left the UK than arrived.[358] In 2011, citizens of the new EU member states made up 13% of the immigrants entering the country.[346] - -Estimated number of British citizens living overseas by country, 2006 -The UK government has introduced a points-based immigration system for immigration from outside the European Economic Area to replace former schemes, including the Scottish Government's Fresh Talent Initiative.[359] In June 2010 the UK government introduced a temporary limit of 24,000 on immigration from outside the EU, aiming to discourage applications before a permanent cap was imposed in April 2011.[360] The cap has caused tension within the coalition: business secretary Vince Cable has argued that it is harming British businesses.[361] -Emigration was an important feature of British society in the 19th century. Between 1815 and 1930 around 11.4 million people emigrated from Britain and 7.3 million from Ireland. Estimates show that by the end of the 20th century some 300 million people of British and Irish descent were permanently settled around the globe.[362] Today, at least 5.5 million UK-born people live abroad,[363][364][365] mainly in Australia, Spain, the United States and Canada.[363][366] -Education -Main article: Education in the United Kingdom -See also: Education in England, Education in Northern Ireland, Education in Scotland and Education in Wales - -King's College, part of the University of Cambridge, which was founded in 1209 -Education in the United Kingdom is a devolved matter, with each country having a separate education system. -Whilst education in England is the responsibility of the Secretary of State for Education, the day-to-day administration and funding of state schools is the responsibility of local authorities.[367] Universally free of charge state education was introduced piecemeal between 1870 and 1944.[368][369] Education is now mandatory from ages five to sixteen (15 if born in late July or August). In 2011, the Trends in International Mathematics and Science Study (TIMSS) rated 13–14-year-old pupils in England and Wales 10th in the world for maths and 9th for science.[370] The majority of children are educated in state-sector schools, a small proportion of which select on the grounds of academic ability. Two of the top ten performing schools in terms of GCSE results in 2006 were state-run grammar schools. Over half of students at the leading universities of Cambridge and Oxford had attended state schools.[371] Despite a fall in actual numbers the proportion of children in England attending private schools has risen to over 7%.[372] In 2010, more than 45% of places at the University of Oxford and 40% at the University of Cambridge were taken by students from private schools, even though they educate just 7% of the population.[373] England has the two oldest universities in English-speaking world, Universities of Oxford and Cambridge (jointly known as "Oxbridge") with history of over eight centuries. The United Kingdom has 9 universities featured in the Times Higher Education top 100 rankings, making it second to the United States in terms of representation.[374] - -Queen's University Belfast, built in 1849[375] -Education in Scotland is the responsibility of the Cabinet Secretary for Education and Lifelong Learning, with day-to-day administration and funding of state schools the responsibility of Local Authorities. Two non-departmental public bodies have key roles in Scottish education. The Scottish Qualifications Authority is responsible for the development, accreditation, assessment and certification of qualifications other than degrees which are delivered at secondary schools, post-secondary colleges of further education and other centres.[376] The Learning and Teaching Scotland provides advice, resources and staff development to education professionals.[377] Scotland first legislated for compulsory education in 1496.[378] The proportion of children in Scotland attending private schools is just over 4%, and it has been rising slowly in recent years.[379] Scottish students who attend Scottish universities pay neither tuition fees nor graduate endowment charges, as fees were abolished in 2001 and the graduate endowment scheme was abolished in 2008.[380] -The Welsh Government has responsibility for education in Wales. A significant number of Welsh students are taught either wholly or largely in the Welsh language; lessons in Welsh are compulsory for all until the age of 16.[381] There are plans to increase the provision of Welsh-medium schools as part of the policy of creating a fully bilingual Wales. -Education in Northern Ireland is the responsibility of the Minister of Education and the Minister for Employment and Learning, although responsibility at a local level is administered by five education and library boards covering different geographical areas. The Council for the Curriculum, Examinations & Assessment (CCEA) is the body responsible for advising the government on what should be taught in Northern Ireland's schools, monitoring standards and awarding qualifications.[382] -A government commission's report in 2014 found that privately educated people comprise 7% of the general population of the UK but much larger percentages of the top professions, the most extreme case quoted being 71% of senior judges.[383][384] -Healthcare -Main article: Healthcare in the United Kingdom - -The Royal Aberdeen Children's Hospital, an NHS Scotland specialist children's hospital -Healthcare in the United Kingdom is a devolved matter and each country has its own system of private and publicly funded health care, together with alternative, holistic and complementary treatments. Public healthcare is provided to all UK permanent residents and is mostly free at the point of need, being paid for from general taxation. The World Health Organization, in 2000, ranked the provision of healthcare in the United Kingdom as fifteenth best in Europe and eighteenth in the world.[385][386] -Regulatory bodies are organised on a UK-wide basis such as the General Medical Council, the Nursing and Midwifery Council and non-governmental-based, such as the Royal Colleges. However, political and operational responsibility for healthcare lies with four national executives; healthcare in England is the responsibility of the UK Government; healthcare in Northern Ireland is the responsibility of the Northern Ireland Executive; healthcare in Scotland is the responsibility of the Scottish Government; and healthcare in Wales is the responsibility of the Welsh Assembly Government. Each National Health Service has different policies and priorities, resulting in contrasts.[387][388] -Since 1979 expenditure on healthcare has been increased significantly to bring it closer to the European Union average.[389] The UK spends around 8.4 per cent of its gross domestic product on healthcare, which is 0.5 percentage points below the Organisation for Economic Co-operation and Development average and about one percentage point below the average of the European Union.[390] -Culture -Main article: Culture of the United Kingdom -The culture of the United Kingdom has been influenced by many factors including: the nation's island status; its history as a western liberal democracy and a major power; as well as being a political union of four countries with each preserving elements of distinctive traditions, customs and symbolism. As a result of the British Empire, British influence can be observed in the language, culture and legal systems of many of its former colonies including Australia, Canada, India, Ireland, New Zealand, South Africa and the United States. The substantial cultural influence of the United Kingdom has led it to be described as a "cultural superpower."[391][392] -Literature -Main article: British literature - -The Chandos portrait, believed to depict William Shakespeare -'British literature' refers to literature associated with the United Kingdom, the Isle of Man and the Channel Islands. Most British literature is in the English language. In 2005, some 206,000 books were published in the United Kingdom and in 2006 it was the largest publisher of books in the world.[393] -The English playwright and poet William Shakespeare is widely regarded as the greatest dramatist of all time,[394][395][396] and his contemporaries Christopher Marlowe and Ben Jonson have also been held in continuous high esteem. More recently the playwrights Alan Ayckbourn, Harold Pinter, Michael Frayn, Tom Stoppard and David Edgar have combined elements of surrealism, realism and radicalism. -Notable pre-modern and early-modern English writers include Geoffrey Chaucer (14th century), Thomas Malory (15th century), Sir Thomas More (16th century), John Bunyan (17th century) and John Milton (17th century). In the 18th century Daniel Defoe (author of Robinson Crusoe) and Samuel Richardson were pioneers of the modern novel. In the 19th century there followed further innovation by Jane Austen, the gothic novelist Mary Shelley, the children's writer Lewis Carroll, the Brontë sisters, the social campaigner Charles Dickens, the naturalist Thomas Hardy, the realist George Eliot, the visionary poet William Blake and romantic poet William Wordsworth. 20th-century English writers include the science-fiction novelist H. G. Wells; the writers of children's classics Rudyard Kipling, A. A. Milne (the creator of Winnie-the-Pooh), Roald Dahl and Enid Blyton; the controversial D. H. Lawrence; the modernist Virginia Woolf; the satirist Evelyn Waugh; the prophetic novelist George Orwell; the popular novelists W. Somerset Maugham and Graham Greene; the crime writer Agatha Christie (the best-selling novelist of all time);[397] Ian Fleming (the creator of James Bond); the poets T.S. Eliot, Philip Larkin and Ted Hughes; the fantasy writers J. R. R. Tolkien, C. S. Lewis and J. K. Rowling; the graphic novelist Alan Moore, whose novel Watchmen is often cited by critics as comic's greatest series and graphic novel[398] and one of the best-selling graphic novels ever published.[399] - -A photograph of Victorian era novelist Charles Dickens -Scotland's contributions include the detective writer Arthur Conan Doyle (the creator of Sherlock Holmes), romantic literature by Sir Walter Scott, the children's writer J. M. Barrie, the epic adventures of Robert Louis Stevenson and the celebrated poet Robert Burns. More recently the modernist and nationalist Hugh MacDiarmid and Neil M. Gunn contributed to the Scottish Renaissance. A more grim outlook is found in Ian Rankin's stories and the psychological horror-comedy of Iain Banks. Scotland's capital, Edinburgh, was UNESCO's first worldwide City of Literature.[400] -Britain's oldest known poem, Y Gododdin, was composed in Yr Hen Ogledd (The Old North), most likely in the late 6th century. It was written in Cumbric or Old Welsh and contains the earliest known reference to King Arthur.[401] From around the seventh century, the connection between Wales and the Old North was lost, and the focus of Welsh-language culture shifted to Wales, where Arthurian legend was further developed by Geoffrey of Monmouth.[402] Wales's most celebrated medieval poet, Dafydd ap Gwilym (fl.1320–1370), composed poetry on themes including nature, religion and especially love. He is widely regarded as one of the greatest European poets of his age.[403] Until the late 19th century the majority of Welsh literature was in Welsh and much of the prose was religious in character. Daniel Owen is credited as the first Welsh-language novelist, publishing Rhys Lewis in 1885. The best-known of the Anglo-Welsh poets are both Thomases. Dylan Thomas became famous on both sides of the Atlantic in the mid-20th century. He is remembered for his poetry – his "Do not go gentle into that good night; Rage, rage against the dying of the light." is one of the most quoted couplets of English language verse – and for his 'play for voices', Under Milk Wood. The influential Church in Wales 'poet-priest' and Welsh nationalist R. S. Thomas was nominated for the Nobel Prize in Literature in 1996. Leading Welsh novelists of the twentieth century include Richard Llewellyn and Kate Roberts.[404][405] -Authors of other nationalities, particularly from Commonwealth countries, the Republic of Ireland and the United States, have lived and worked in the UK. Significant examples through the centuries include Jonathan Swift, Oscar Wilde, Bram Stoker, George Bernard Shaw, Joseph Conrad, T.S. Eliot, Ezra Pound and more recently British authors born abroad such as Kazuo Ishiguro and Sir Salman Rushdie.[406][407] -Music -Main article: Music of the United Kingdom -See also: British rock - -The Beatles are the most commercially successful and critically acclaimed band in the history of music, selling over a billion records internationally.[408][409][410] -Various styles of music are popular in the UK from the indigenous folk music of England, Wales, Scotland and Northern Ireland to heavy metal. Notable composers of classical music from the United Kingdom and the countries that preceded it include William Byrd, Henry Purcell, Sir Edward Elgar, Gustav Holst, Sir Arthur Sullivan (most famous for working with the librettist Sir W. S. Gilbert), Ralph Vaughan Williams and Benjamin Britten, pioneer of modern British opera. Sir Peter Maxwell Davies is one of the foremost living composers and current Master of the Queen's Music. The UK is also home to world-renowned symphonic orchestras and choruses such as the BBC Symphony Orchestra and the London Symphony Chorus. Notable conductors include Sir Simon Rattle, John Barbirolli and Sir Malcolm Sargent. Some of the notable film score composers include John Barry, Clint Mansell, Mike Oldfield, John Powell, Craig Armstrong, David Arnold, John Murphy, Monty Norman and Harry Gregson-Williams. George Frideric Handel, although born German, was a naturalised British citizen[411] and some of his best works, such as Messiah, were written in the English language.[412] Andrew Lloyd Webber has achieved enormous worldwide commercial success and is a prolific composer of musical theatre, works which have dominated London's West End for a number of years and have travelled to Broadway in New York.[413] -The Beatles have international sales of over one billion units and are the biggest-selling and most influential band in the history of popular music.[408][409][410][414] Other prominent British contributors to have influenced popular music over the last 50 years include; The Rolling Stones, Led Zeppelin, Pink Floyd, Queen, the Bee Gees, and Elton John, all of whom have world wide record sales of 200 million or more.[415][416][417][418][419][420] The Brit Awards are the BPI's annual music awards, and some of the British recipients of the Outstanding Contribution to Music award include; The Who, David Bowie, Eric Clapton, Rod Stewart and The Police.[421] More recent UK music acts that have had international success include Coldplay, Radiohead, Oasis, Spice Girls, Robbie Williams, Amy Winehouse and Adele.[422] -A number of UK cities are known for their music. Acts from Liverpool have had more UK chart number one hit singles per capita (54) than any other city worldwide.[423] Glasgow's contribution to music was recognised in 2008 when it was named a UNESCO City of Music, one of only three cities in the world to have this honour.[424] -Visual art -Main article: Art of the United Kingdom - -J. M. W. Turner self-portrait, oil on canvas, c. 1799 -The history of British visual art forms part of western art history. Major British artists include: the Romantics William Blake, John Constable, Samuel Palmer and J.M.W. Turner; the portrait painters Sir Joshua Reynolds and Lucian Freud; the landscape artists Thomas Gainsborough and L. S. Lowry; the pioneer of the Arts and Crafts Movement William Morris; the figurative painter Francis Bacon; the Pop artists Peter Blake, Richard Hamilton and David Hockney; the collaborative duo Gilbert and George; the abstract artist Howard Hodgkin; and the sculptors Antony Gormley, Anish Kapoor and Henry Moore. During the late 1980s and 1990s the Saatchi Gallery in London helped to bring to public attention a group of multi-genre artists who would become known as the "Young British Artists": Damien Hirst, Chris Ofili, Rachel Whiteread, Tracey Emin, Mark Wallinger, Steve McQueen, Sam Taylor-Wood and the Chapman Brothers are among the better-known members of this loosely affiliated movement. -The Royal Academy in London is a key organisation for the promotion of the visual arts in the United Kingdom. Major schools of art in the UK include: the six-school University of the Arts London, which includes the Central Saint Martins College of Art and Design and Chelsea College of Art and Design; Goldsmiths, University of London; the Slade School of Fine Art (part of University College London); the Glasgow School of Art; the Royal College of Art; and The Ruskin School of Drawing and Fine Art (part of the University of Oxford). The Courtauld Institute of Art is a leading centre for the teaching of the history of art. Important art galleries in the United Kingdom include the National Gallery, National Portrait Gallery, Tate Britain and Tate Modern (the most-visited modern art gallery in the world, with around 4.7 million visitors per year).[425] -Cinema -Main article: Cinema of the United Kingdom - -Film director Alfred Hitchcock -The United Kingdom has had a considerable influence on the history of the cinema. The British directors Alfred Hitchcock, whose film Vertigo is considered by some critics as the best film of all time,[426] and David Lean are among the most critically acclaimed of all-time.[427] Other important directors including Charlie Chaplin,[428] Michael Powell,[429] Carol Reed[430] and Ridley Scott.[431] Many British actors have achieved international fame and critical success, including: Julie Andrews,[432] Richard Burton,[433] Michael Caine,[434] Charlie Chaplin,[435] Sean Connery,[436] Vivien Leigh,[437] David Niven,[438] Laurence Olivier,[439] Peter Sellers,[440] Kate Winslet,[441] and Daniel Day-Lewis, the only person to win an Oscar in the best actor category three times.[442] Some of the most commercially successful films of all time have been produced in the United Kingdom, including the two highest-grossing film franchises (Harry Potter and James Bond).[443] Ealing Studios has a claim to being the oldest continuously working film studio in the world.[444] -Despite a history of important and successful productions, the industry has often been characterised by a debate about its identity and the level of American and European influence. British producers are active in international co-productions and British actors, directors and crew feature regularly in American films. Many successful Hollywood films have been based on British people, stories or events, including Titanic, The Lord of the Rings, Pirates of the Caribbean. -In 2009, British films grossed around $2 billion worldwide and achieved a market share of around 7% globally and 17% in the United Kingdom.[445] UK box-office takings totalled £944 million in 2009, with around 173 million admissions.[445] The British Film Institute has produced a poll ranking of what it considers to be the 100 greatest British films of all time, the BFI Top 100 British films.[446] The annual British Academy Film Awards, hosted by the British Academy of Film and Television Arts, are the British equivalent of the Oscars.[447] -Media -Main article: Media of the United Kingdom - -Broadcasting House in London, headquarters of the BBC, the oldest and largest broadcaster in the world.[448][449][450] -The BBC, founded in 1922, is the UK's publicly funded radio, television and Internet broadcasting corporation, and is the oldest and largest broadcaster in the world.[448][449][450] It operates numerous television and radio stations in the UK and abroad and its domestic services are funded by the television licence.[451][452] Other major players in the UK media include ITV plc, which operates 11 of the 15 regional television broadcasters that make up the ITV Network,[453] and News Corporation, which owns a number of national newspapers through News International such as the most popular tabloid The Sun and the longest-established daily "broadsheet" The Times,[454] as well as holding a large stake in satellite broadcaster British Sky Broadcasting.[455] London dominates the media sector in the UK: national newspapers and television and radio are largely based there, although Manchester is also a significant national media centre. Edinburgh and Glasgow, and Cardiff, are important centres of newspaper and broadcasting production in Scotland and Wales respectively.[456] The UK publishing sector, including books, directories and databases, journals, magazines and business media, newspapers and news agencies, has a combined turnover of around £20 billion and employs around 167,000 people.[457] -In 2009, it was estimated that individuals viewed a mean of 3.75 hours of television per day and 2.81 hours of radio. In that year the main BBC public service broadcasting channels accounted for an estimated 28.4% of all television viewing; the three main independent channels accounted for 29.5% and the increasingly important other satellite and digital channels for the remaining 42.1%.[458] Sales of newspapers have fallen since the 1970s and in 2009 42% of people reported reading a daily national newspaper.[459] In 2010 82.5% of the UK population were Internet users, the highest proportion amongst the 20 countries with the largest total number of users in that year.[460] -Philosophy -Main article: British philosophy -The United Kingdom is famous for the tradition of 'British Empiricism', a branch of the philosophy of knowledge that states that only knowledge verified by experience is valid, and 'Scottish Philosophy', sometimes referred to as the 'Scottish School of Common Sense'.[461] The most famous philosophers of British Empiricism are John Locke, George Berkeley and David Hume; while Dugald Stewart, Thomas Reid and William Hamilton were major exponents of the Scottish "common sense" school. Two Britons are also notable for a theory of moral philosophy utilitarianism, first used by Jeremy Bentham and later by John Stuart Mill in his short work Utilitarianism.[462][463] Other eminent philosophers from the UK and the unions and countries that preceded it include Duns Scotus, John Lilburne, Mary Wollstonecraft, Sir Francis Bacon, Adam Smith, Thomas Hobbes, William of Ockham, Bertrand Russell and A.J. "Freddie" Ayer. Foreign-born philosophers who settled in the UK include Isaiah Berlin, Karl Marx, Karl Popper and Ludwig Wittgenstein. -Sport -Main article: Sport in the United Kingdom - -Wembley Stadium, London, home of the England national football team, is one of the most expensive stadia ever built.[464] -Major sports, including association football, tennis, rugby union, rugby league, golf, boxing, rowing and cricket, originated or were substantially developed in the UK and the states that preceded it. With the rules and codes of many modern sports invented and codified in late 19th-century Victorian Britain, in 2012, the President of the IOC, Jacques Rogge, stated; "This great, sports-loving country is widely recognized as the birthplace of modern sport. It was here that the concepts of sportsmanship and fair play were first codified into clear rules and regulations. It was here that sport was included as an educational tool in the school curriculum".[465][466] -In most international competitions, separate teams represent England, Scotland and Wales. Northern Ireland and the Republic of Ireland usually field a single team representing all of Ireland, with notable exceptions being association football and the Commonwealth Games. In sporting contexts, the English, Scottish, Welsh and Irish / Northern Irish teams are often referred to collectively as the Home Nations. There are some sports in which a single team represents the whole of United Kingdom, including the Olympics, where the UK is represented by the Great Britain team. The 1908, 1948 and 2012 Summer Olympics were held in London, making it the first city to host the games three times. Britain has participated in every modern Olympic Games to date and is third in the medal count. -A 2003 poll found that football is the most popular sport in the United Kingdom.[467] Each of the Home Nations has its own football association, national team and league system. The English top division, the Premier League, is the most watched football league in the world.[468] The first-ever international football match was contested by England and Scotland on 30 November 1872.[469] England, Scotland, Wales and Northern Ireland compete as separate countries in international competitions.[470] A Great Britain Olympic football team was assembled for the first time to compete in the London 2012 Olympic Games. However, the Scottish, Welsh and Northern Irish football associations declined to participate, fearing that it would undermine their independent status – a fear confirmed by FIFA president Sepp Blatter.[471] - -The Millennium Stadium, Cardiff, opened for the 1999 Rugby World Cup. -Cricket was invented in England. The England cricket team, controlled by the England and Wales Cricket Board,[472] is the only national team in the UK with Test status. Team members are drawn from the main county sides, and include both English and Welsh players. Cricket is distinct from football and rugby where Wales and England field separate national teams, although Wales had fielded its own team in the past. Irish and Scottish players have played for England because neither Scotland nor Ireland have Test status and have only recently started to play in One Day Internationals.[473][474] Scotland, England (and Wales), and Ireland (including Northern Ireland) have competed at the Cricket World Cup, with England reaching the finals on three occasions. There is a professional league championship in which clubs representing 17 English counties and 1 Welsh county compete.[475] -Rugby league is a popular sport in some regions of the UK. It originated in Huddersfield and is generally played in Northern England.[476] A single 'Great Britain Lions' team had competed in the Rugby League World Cup and Test match games, but this changed in 2008 when England, Scotland and Ireland competed as separate nations.[477] Great Britain is still being retained as the full national team for Ashes tours against Australia, New Zealand and France. Super League is the highest level of professional rugby league in the UK and Europe. It consists of 11 teams from Northern England, 1 from London, 1 from Wales and 1 from France. -In rugby union, England, Scotland, Wales, Ireland, France and Italy compete in the Six Nations Championship; the premier international tournament in the northern hemisphere. Sport governing bodies in England, Scotland, Wales and Ireland organise and regulate the game separately.[478] If any of the British teams or the Irish team beat the other three in a tournament, then it is awarded the Triple Crown.[479] - -The Wimbledon Championships, a Grand Slam tennis tournament, is held in Wimbledon, London every June or July. -Thoroughbred racing, which originated under Charles II of England as the "sport of kings", is popular throughout the UK with world-famous races including the Grand National, the Epsom Derby, Royal Ascot and the Cheltenham National Hunt Festival (including the Cheltenham Gold Cup). The UK has proved successful in the international sporting arena in rowing. -The UK is closely associated with motorsport. Many teams and drivers in Formula One (F1) are based in the UK, and the country has won more drivers' and constructors' titles than any other. The UK hosted the very first F1 Grand Prix in 1950 at Silverstone, the current location of the British Grand Prix held each year in July. The country also hosts legs of the Grand Prix motorcycle racing, World Rally Championship and FIA World Endurance Championship. The premier national auto racing event is the British Touring Car Championship (BTCC). Motorcycle road racing has a long tradition with races such as the Isle of Man TT and the North West 200. -Golf is the sixth-most popular sport, by participation, in the UK. Although The Royal and Ancient Golf Club of St Andrews in Scotland is the sport's home course,[480] the world's oldest golf course is actually Musselburgh Links' Old Golf Course.[481] -Snooker is one of the UK's popular sporting exports, with the world championships held annually in Sheffield.[482] The modern game of lawn tennis first originated in the city of Birmingham between 1859 and 1865.[483] The Championships, Wimbledon are international tennis events held in Wimbledon in south London every summer and are regarded as the most prestigious event of the global tennis calendar. In Northern Ireland Gaelic football and hurling are popular team sports, both in terms of participation and spectating, and Irish expatriates in the UK and the US also play them.[484] Shinty (or camanachd) is popular in the Scottish Highlands.[485] -Symbols -Main article: Symbols of the United Kingdom, the Channel Islands and the Isle of Man - -The Statue of Britannia in Plymouth. Britannia is a national personification of the UK. -The flag of the United Kingdom is the Union Flag (also referred to as the Union Jack). It was created in 1606 by the superimposition of the Flag of England on the Flag of Scotland and updated in 1801 with the addition of Saint Patrick's Flag. Wales is not represented in the Union Flag, as Wales had been conquered and annexed to England prior to the formation of the United Kingdom. The possibility of redesigning the Union Flag to include representation of Wales has not been completely ruled out.[486] The national anthem of the United Kingdom is "God Save the King", with "King" replaced with "Queen" in the lyrics whenever the monarch is a woman. -Britannia is a national personification of the United Kingdom, originating from Roman Britain.[487] Britannia is symbolised as a young woman with brown or golden hair, wearing a Corinthian helmet and white robes. She holds Poseidon's three-pronged trident and a shield, bearing the Union Flag. Sometimes she is depicted as riding on the back of a lion. Since the height of the British Empire in the late 19th century, Britannia has often been associated with British maritime dominance, as in the patriotic song "Rule, Britannia!". Up until 2008, the lion symbol was depicted behind Britannia on the British fifty pence coin and on the back of the British ten pence coin. It is also used as a symbol on the non-ceremonial flag of the British Army. The bulldog is sometimes used as a symbol of the United Kingdom and has been associated with Winston Churchill's defiance of Nazi Germany.[488] -See also -Outline of the United Kingdom - United Kingdom – Wikipedia book -Walking in the United Kingdom -Flag of the United Kingdom.svgUnited Kingdom portal Flag of Europe.svgEuropean Union portal Europe green light.pngEurope portal -Notes -Jump up ^ The Royal coat of arms used in Scotland: - Royal Coat of Arms of the United Kingdom (Scotland).svg -Jump up ^ There is no authorised version of the national anthem as the words are a matter of tradition; only the first verse is usually sung.[1] No law was passed making "God Save the Queen" the official anthem. In the English tradition, such laws are not necessary; proclamation and usage are sufficient to make it the national anthem. "God Save the Queen" also serves as the Royal anthem for several other countries, namely certain Commonwealth realms. -Jump up ^ Under the Council of Europe's European Charter for Regional or Minority Languages, Scots, Ulster-Scots, Welsh, Cornish, Irish and Scottish Gaelic, are officially recognised as regional or minority languages by the British government for the purposes of the Charter. See also Languages of the United Kingdom.[2] -Jump up ^ Although Northern Ireland is the only part of the UK that shares a land border with another state, two of its Overseas Territories also share land borders with other states. Gibraltar shares a border with Spain, while the Sovereign Base Areas of Akrotiri and Dhekelia share borders with the Republic of Cyprus, Turkish Republic of Northern Cyprus and UN buffer zone separating the two Cypriot polities. -Jump up ^ The Anglo-Irish Treaty was signed on 6 December 1921 to resolve the Irish War of Independence. Effective one year later, it established the Irish Free State as a separate dominion within the Commonwealth. The UK's current name was adopted in 1927 to reflect the change. -Jump up ^ Compare to section 1 of both of the 1800 Acts of Union which reads: the Kingdoms of Great Britain and Ireland shall...be united into one Kingdom, by the Name of "The United Kingdom of Great Britain and Ireland" -Jump up ^ New Zealand, Israel and San Marino are the other countries with uncodified constitutions. -Jump up ^ Since the early twentieth century the prime minister has held the office of First Lord of the Treasury, and in recent decades has also held the office of Minister for the Civil Service. -Jump up ^ Sinn Féin, an Irish republican party, also contests elections in the Republic of Ireland. -Jump up ^ In 2007–2008, this was calculated to be £115 per week for single adults with no dependent children; £199 per week for couples with no dependent children; £195 per week for single adults with two dependent children under 14; and £279 per week for couples with two dependent children under 14. -References -Jump up ^ National Anthem, British Monarchy official website. Retrieved 16 November 2013. -^ Jump up to: a b c "List of declarations made with respect to treaty No. 148". Council of Europe. Retrieved 12 December 2013. -^ Jump up to: a b "Population Estimates for UK, England and Wales, Scotland and Northern Ireland, Mid-2013". Office for National Statistics. Retrieved 26 June 2014. -Jump up ^ "2011 UK censuses". Office for National Statistics. Retrieved 17 December 2012. -^ Jump up to: a b c d "United Kingdom". International Monetary Fund. Retrieved 1 November 2014. -Jump up ^ "Gini coefficient of equivalised disposable income (source: SILC)". Eurostat Data Explorer. Retrieved 13 August 2013. -Jump up ^ "2014 Human Development Report". 14 March 2013. pp. 22–25. Retrieved 27 July 2014. -Jump up ^ "Definition of Great Britain in English". Oxford University Press. Retrieved 29 October 2014. Great Britain is the name for the island that comprises England, Scotland, and Wales, although the term is also used loosely to refer to the United Kingdom. -Jump up ^ The British Monarchy, What is constitutional monarchy?. Retrieved 17 July 2013 -Jump up ^ CIA, The World Factbook. Retrieved 17 July 2013 -Jump up ^ "The World Factbook". Central Intelligence Agency. 1 February 2014. Retrieved 23 February 2014. -^ Jump up to: a b "Countries within a country". Prime Minister's Office. 10 January 2003. -^ Jump up to: a b "Devolution of powers to Scotland, Wales, and Northern Ireland". United Kingdom Government. Retrieved 17 April 2013. In a similar way to how the government is formed from members from the two Houses of Parliament, members of the devolved legislatures nominate ministers from among themselves to comprise an executive, known as the devolved administrations... -Jump up ^ "Fall in UK university students". BBC News. 29 January 2009. -Jump up ^ "Country Overviews: United Kingdom". Transport Research Knowledge Centre. Retrieved 28 March 2010. -Jump up ^ "Key facts about the United Kingdom". Directgov. Retrieved 3 May 2011. The full title of this country is 'the United Kingdom of Great Britain and Northern Ireland'. 'The UK' is made up of England, Scotland, Wales and Northern Ireland. 'Britain' is used informally, usually meaning the United Kingdom. 'Great Britain' is made up of England, Scotland and Wales. The Channel Islands and the Isle of Man are not part of the UK.[dead link] -Jump up ^ "Working with Overseas Territories". Foreign and Commonwealth Office. Retrieved 3 May 2011. -Jump up ^ Mathias, P. (2001). The First Industrial Nation: the Economic History of Britain, 1700–1914. London: Routledge. ISBN 0-415-26672-6. -Jump up ^ Ferguson, Niall (2004). Empire: The rise and demise of the British world order and the lessons for global power. New York: Basic Books. ISBN 0-465-02328-2. -Jump up ^ Sheridan, Greg (15 May 2010). "Cameron has chance to make UK great again". The Australian (Sydney). Retrieved 23 May 2011. -Jump up ^ Dugan, Emily (18 November 2012). "Britain is now most powerful nation on earth". The Independent (London). Retrieved 18 November 2012. -^ Jump up to: a b "The 15 countries with the highest military expenditure in 2013 (table)" (PDF). Stockholm International Peace Research Institute. Retrieved 4 May 2014. -^ Jump up to: a b The Military Balance 2014: Top 15 Defence Budgets 2013 (IISS) -Jump up ^ "Treaty of Union, 1706". Scots History Online. Retrieved 23 August 2011. -Jump up ^ Barnett, Hilaire; Jago, Robert (2011). Constitutional & Administrative Law (8th ed.). Abingdon: Routledge. p. 165. ISBN 978-0-415-56301-7. -Jump up ^ Gascoigne, Bamber. "History of Great Britain (from 1707)". History World. Retrieved 18 July 2011. -Jump up ^ Cottrell, P. (2008). The Irish Civil War 1922–23. p. 85. ISBN 1-84603-270-9. -^ Jump up to: a b S. Dunn; H. Dawson (2000), An Alphabetical Listing of Word, Name and Place in Northern Ireland and the Living Language of Conflict, Lampeter: Edwin Mellen Press, One specific problem - in both general and particular senses - is to know what to call Northern Ireland itself: in the general sense, it is not a country, or a province, or a state - although some refer to it contemptuously as a statelet: the least controversial word appears to be jurisdiction, but this might change. -Jump up ^ "Changes in the list of subdivision names and code elements". ISO 3166-2. International Organization for Standardization. 15 December 2011. Retrieved 28 May 2012. -Jump up ^ Population Trends, Issues 75–82, p.38, 1994, UK Office of Population Censuses and Surveys -Jump up ^ Life in the United Kingdom: a journey to citizenship, p. 7, United Kingdom Home Office, 2007, ISBN 978-0-11-341313-3. -Jump up ^ "Statistical bulletin: Regional Labour Market Statistics". Retrieved 5 March 2014. -Jump up ^ "13.4% Fall In Earnings Value During Recession". Retrieved 5 March 2014. -Jump up ^ Murphy, Dervla (1979). A Place Apart. London: Penguin. ISBN 978-0-14-005030-1. -Jump up ^ Whyte, John; FitzGerald, Garret (1991). Interpreting Northern Ireland. Oxford: Clarendon Press. ISBN 978-0-19-827380-6. -Jump up ^ "Guardian Unlimited Style Guide". London: Guardian News and Media Limited. 19 December 2008. Retrieved 23 August 2011. -Jump up ^ "BBC style guide (Great Britain)". BBC News. 19 August 2002. Retrieved 23 August 2011. -Jump up ^ "Key facts about the United Kingdom". Government, citizens and rights. HM Government. Retrieved 24 August 2011.[dead link] -Jump up ^ "Merriam-Webster Dictionary Online Definition of ''Great Britain''". Merriam Webster. 31 August 2012. Retrieved 9 April 2013. -Jump up ^ New Oxford American Dictionary: "Great Britain: England, Wales, and Scotland considered as a unit. The name is also often used loosely to refer to the United Kingdom." -Jump up ^ "Great Britain". International Olympic Committee. Retrieved 10 May 2011. -Jump up ^ "Team GB – Our Greatest Team". British Olympic Association. Retrieved 10 May 2011.[dead link] -Jump up ^ Bradley, Anthony Wilfred; Ewing, Keith D. (2007). Constitutional and administrative law 1 (14th ed.). Harlow: Pearson Longman. p. 36. ISBN 978-1-4058-1207-8. -Jump up ^ "Which of these best describes the way you think of yourself?". Northern Ireland Life and Times Survey 2010. ARK – Access Research Knowledge. 2010. Retrieved 1 July 2010. -Jump up ^ Schrijver, Frans (2006). Regionalism after regionalisation: Spain, France and the United Kingdom. Amsterdam University Press. pp. 275–277. ISBN 978-90-5629-428-1. -Jump up ^ Jack, Ian (11 December 2010). "Why I'm saddened by Scotland going Gaelic". The Guardian (London). -Jump up ^ Ffeithiau allweddol am y Deyrnas Unedig : Directgov – Llywodraeth, dinasyddion a hawliau[dead link] -Jump up ^ "Ancient skeleton was 'even older'". BBC News. 30 October 2007. Retrieved 27 April 2011. -Jump up ^ Koch, John T. (2006). Celtic culture: A historical encyclopedia. Santa Barbara, CA: ABC-CLIO. p. 973. ISBN 978-1-85109-440-0. -Jump up ^ Davies, John; Jenkins, Nigel; Baines, Menna; Lynch, Peredur I., eds. (2008). The Welsh Academy Encyclopaedia of Wales. Cardiff: University of Wales Press. p. 915. ISBN 978-0-7083-1953-6. -Jump up ^ "Short Athelstan biography". BBC History. Retrieved 9 April 2013. -Jump up ^ Mackie, J.D. (1991). A History of Scotland. London: Penguin. pp. 18–19. ISBN 978-0-14-013649-4. -Jump up ^ Campbell, Ewan (1999). Saints and Sea-kings: The First Kingdom of the Scots. Edinburgh: Canongate. pp. 8–15. ISBN 0-86241-874-7. -Jump up ^ Haigh, Christopher (1990). The Cambridge Historical Encyclopedia of Great Britain and Ireland. Cambridge University Press. p. 30. ISBN 978-0-521-39552-6. -Jump up ^ Ganshof, F.L. (1996). Feudalism. University of Toronto. p. 165. ISBN 978-0-8020-7158-3. -Jump up ^ Chibnall, Marjorie (1999). The debate on the Norman Conquest. Manchester University Press. pp. 115–122. ISBN 978-0-7190-4913-2. -Jump up ^ Keen, Maurice. "The Hundred Years War". BBC History. -Jump up ^ The Reformation in England and Scotland and Ireland: The Reformation Period & Ireland under Elizabth I, Encyclopædia Britannica Online. -Jump up ^ "British History in Depth – Wales under the Tudors". BBC History. 5 November 2009. Retrieved 21 September 2010. -Jump up ^ Nicholls, Mark (1999). A history of the modern British Isles, 1529–1603: The two kingdoms. Oxford: Blackwell. pp. 171–172. ISBN 978-0-631-19334-0. -Jump up ^ Canny, Nicholas P. (2003). Making Ireland British, 1580–1650. Oxford University Press. pp. 189–200. ISBN 978-0-19-925905-2. -Jump up ^ Ross, D. (2002). Chronology of Scottish History. Glasgow: Geddes & Grosset. p. 56. ISBN 1-85534-380-0 -Jump up ^ Hearn, J. (2002). Claiming Scotland: National Identity and Liberal Culture. Edinburgh University Press. p. 104. ISBN 1-902930-16-9 -Jump up ^ "English Civil Wars". Encyclopaedia Britannica. Retrieved 28 April 2013. -Jump up ^ "Scotland and the Commonwealth: 1651–1660". Archontology.org. 14 March 2010. Retrieved 20 April 2010. -Jump up ^ Lodge, Richard (2007) [1910]. The History of England – From the Restoration to the Death of William III (1660–1702). Read Books. p. 8. ISBN 978-1-4067-0897-4. -Jump up ^ "Tudor Period and the Birth of a Regular Navy". Royal Navy History. Institute of Naval History. Retrieved 24 December 2010.[dead link] -Jump up ^ Canny, Nicholas (1998). The Origins of Empire, The Oxford History of the British Empire Volume I. Oxford University Press. ISBN 0-19-924676-9. -Jump up ^ "Articles of Union with Scotland 1707". UK Parliament. Retrieved 19 October 2008. -Jump up ^ "Acts of Union 1707". UK Parliament. Retrieved 6 January 2011. -Jump up ^ "Treaty (act) of Union 1706". Scottish History online. Retrieved 3 February 2011. -Jump up ^ Library of Congress, The Impact of the American Revolution Abroad, p. 73. -Jump up ^ Loosemore, Jo (2007). Sailing against slavery. BBC Devon. 2007. -Jump up ^ "The Act of Union". Act of Union Virtual Library. Retrieved 15 May 2006. -Jump up ^ Tellier, L.-N. (2009). Urban World History: an Economic and Geographical Perspective. Quebec: PUQ. p. 463. ISBN 2-7605-1588-5. -Jump up ^ Sondhaus, L. (2004). Navies in Modern World History. London: Reaktion Books. p. 9. ISBN 1-86189-202-0. -Jump up ^ Porter, Andrew (1998). The Nineteenth Century, The Oxford History of the British Empire Volume III. Oxford University Press. p. 332. ISBN 0-19-924678-5. -Jump up ^ "The Workshop of the World". BBC History. Retrieved 28 April 2013. -Jump up ^ Porter, Andrew (1998). The Nineteenth Century, The Oxford History of the British Empire Volume III. Oxford University Press. p. 8. ISBN 0-19-924678-5. -Jump up ^ Marshall, P.J. (1996). The Cambridge Illustrated History of the British Empire. Cambridge University Press. pp. 156–57. ISBN 0-521-00254-0. -Jump up ^ Tompson, Richard S. (2003). Great Britain: a reference guide from the Renaissance to the present. New York: Facts on File. p. 63. ISBN 978-0-8160-4474-0. -Jump up ^ Hosch, William L. (2009). World War I: People, Politics, and Power. America at War. New York: Britannica Educational Publishing. p. 21. ISBN 978-1-61530-048-8. -Jump up ^ Turner, John (1988). Britain and the First World War. London: Unwin Hyman. pp. 22–35. ISBN 978-0-04-445109-9. -^ Jump up to: a b Westwell, I.; Cove, D. (eds) (2002). History of World War I, Volume 3. London: Marshall Cavendish. pp. 698 and 705. ISBN 0-7614-7231-2. -Jump up ^ Turner, J. (1988). Britain and the First World War. Abingdon: Routledge. p. 41. ISBN 0-04-445109-1. -Jump up ^ SR&O 1921, No. 533 of 3 May 1921. -Jump up ^ "The Anglo-Irish Treaty, 6 December 1921". CAIN. Retrieved 15 May 2006. -Jump up ^ Rubinstein, W. D. (2004). Capitalism, Culture, and Decline in Britain, 1750–1990. Abingdon: Routledge. p. 11. ISBN 0-415-03719-0. -Jump up ^ "Britain to make its final payment on World War II loan from U.S.". The New York Times. 28 December 2006. Retrieved 25 August 2011. -Jump up ^ Francis, Martin (1997). Ideas and policies under Labour, 1945–1951: Building a new Britain. Manchester University Press. pp. 225–233. ISBN 978-0-7190-4833-3. -Jump up ^ Lee, Stephen J. (1996). Aspects of British political history, 1914–1995. London; New York: Routledge. pp. 173–199. ISBN 978-0-415-13103-2. -Jump up ^ Larres, Klaus (2009). A companion to Europe since 1945. Chichester: Wiley-Blackwell. p. 118. ISBN 978-1-4051-0612-2. -Jump up ^ "Country List". Commonwealth Secretariat. 19 March 2009. Retrieved 11 September 2012.[dead link] -Jump up ^ Julios, Christina (2008). Contemporary British identity: English language, migrants, and public discourse. Studies in migration and diaspora. Aldershot: Ashgate. p. 84. ISBN 978-0-7546-7158-9. -Jump up ^ Aughey, Arthur (2005). The Politics of Northern Ireland: Beyond the Belfast Agreement. London: Routledge. p. 7. ISBN 978-0-415-32788-6. -Jump up ^ "The troubles were over, but the killing continued. Some of the heirs to Ireland's violent traditions refused to give up their inheritance." Holland, Jack (1999). Hope against History: The Course of Conflict in Northern Ireland. New York: Henry Holt. p. 221. ISBN 978-0-8050-6087-4. -Jump up ^ Elliot, Marianne (2007). The Long Road to Peace in Northern Ireland: Peace Lectures from the Institute of Irish Studies at Liverpool University. University of Liverpool Institute of Irish Studies, Liverpool University Press. p. 2. ISBN 1-84631-065-2. -Jump up ^ Dorey, Peter (1995). British politics since 1945. Making contemporary Britain. Oxford: Blackwell. pp. 164–223. ISBN 978-0-631-19075-2. -Jump up ^ Griffiths, Alan; Wall, Stuart (2007). Applied Economics (11th ed.). Harlow: Financial Times Press. p. 6. ISBN 978-0-273-70822-3. Retrieved 26 December 2010. -Jump up ^ Keating, Michael (1 January 1998). "Reforging the Union: Devolution and Constitutional Change in the United Kingdom". Publius: the Journal of Federalism 28 (1): 217. doi:10.1093/oxfordjournals.pubjof.a029948. Retrieved 4 February 2009. -Jump up ^ Jackson, Mike (3 April 2011). "Military action alone will not save Libya". Financial Times (London). -Jump up ^ "United Kingdom country profile". BBC. 24 January 2013. Retrieved 9 April 2013. -Jump up ^ "Scotland to hold independence poll in 2014 – Salmond". BBC News. 10 January 2012. Retrieved 10 January 2012. -Jump up ^ Oxford English Dictionary: "British Isles: a geographical term for the islands comprising Great Britain and Ireland with all their offshore islands including the Isle of Man and the Channel Islands." -^ Jump up to: a b c d e f "United Kingdom". The World Factbook. Central Intelligence Agency. Retrieved 23 September 2008. -^ Jump up to: a b c d e Latimer Clarke Corporation Pty Ltd. "United Kingdom – Atlapedia Online". Atlapedia.com. Retrieved 26 October 2010. -Jump up ^ ROG Learing Team (23 August 2002). "The Prime Meridian at Greenwich". Royal Museums Greenwich. Royal Museums Greenwich. Retrieved 11 September 2012. -Jump up ^ Neal, Clare. "How long is the UK coastline?". British Cartographic Society. Retrieved 26 October 2010. -Jump up ^ "The Channel Tunnel". Eurotunnel. Retrieved 29 November 2010.[dead link] -Jump up ^ "England – Profile". BBC News. 11 February 2010. -Jump up ^ "Scotland Facts". Scotland Online Gateway. Archived from the original on 21 June 2008. Retrieved 16 July 2008. -Jump up ^ Winter, Jon (19 May 2001). "The complete guide to Scottish Islands". The Independent (London). -Jump up ^ "Overview of Highland Boundary Fault". Gazetteer for Scotland. University of Edinburgh. Retrieved 27 December 2010. -Jump up ^ "Ben Nevis Weather". Ben Nevis Weather. Retrieved 26 October 2008. -Jump up ^ "Profile: Wales". BBC News. 9 June 2010. Retrieved 7 November 2010. -Jump up ^ Giles Darkes (26 April 2014). "How long is the UK coastline?". The British Cartographic Society. -Jump up ^ "Geography of Northern Ireland". University of Ulster. Retrieved 22 May 2006. -Jump up ^ "UK climate summaries". Met Office. Retrieved 1 May 2011. -Jump up ^ United Nations Economic and Social Council (August 2007). "Ninth UN Conference on the standardization of Geographical Names". UN Statistics Division. Archived from the original on 1 December 2009. Retrieved 21 October 2008. -Jump up ^ Barlow, I.M. (1991). Metropolitan Government. London: Routledge. ISBN 978-0-415-02099-2. -Jump up ^ "Welcome to the national site of the Government Office Network". Government Offices. Archived from the original on 15 June 2009. Retrieved 3 July 2008. -Jump up ^ "A short history of London government". Greater London Authority. Archived from the original on 21 April 2008. Retrieved 4 October 2008. -Jump up ^ Sherman, Jill; Norfolk, Andrew (5 November 2004). "Prescott's dream in tatters as North East rejects assembly". The Times (London). Retrieved 15 February 2008. The Government is now expected to tear up its twelve-year-old plan to create eight or nine regional assemblies in England to mirror devolution in Scotland and Wales. (subscription required) -Jump up ^ "Local Authority Elections". Local Government Association. Retrieved 3 October 2008.[dead link] -Jump up ^ "STV in Scotland: Local Government Elections 2007". Political Studies Association. Archived from the original on 20 March 2011. Retrieved 2 August 2008. -Jump up ^ Ethical Standards in Public Life framework: "Ethical Standards in Public Life". The Scottish Government. Retrieved 3 October 2008. -Jump up ^ "Who we are". Convention of Scottish Local Authorities. Retrieved 5 July 2011. -Jump up ^ "Local Authorities". The Welsh Assembly Government. Retrieved 31 July 2008. -Jump up ^ "Local government elections in Wales". The Electoral Commission. 2008. Retrieved 8 April 2011. -Jump up ^ "Welsh Local Government Association". Welsh Local Government Association. Retrieved 20 March 2008. -Jump up ^ Devenport, Mark (18 November 2005). "NI local government set for shake-up". BBC News. Retrieved 15 November 2008. -Jump up ^ "Foster announces the future shape of local government" (Press release). Northern Ireland Executive. 13 March 2008. Retrieved 20 October 2008. -Jump up ^ "Local Government elections to be aligned with review of public administration" (Press release). Northern Ireland Office. 25 April 2008. Retrieved 2 August 2008.[dead link] -Jump up ^ "CIBC PWM Global – Introduction to The Cayman Islands". Cibc.com. 11 July 2012. Retrieved 17 August 2012. -Jump up ^ Rappeport, Laurie. "Cayman Islands Tourism". Washington DC: USA Today Travel Tips. Retrieved 9 April 2013. -Jump up ^ "Working with Overseas Territories". Foreign & Commonwealth Office. 6 October 2010. Retrieved 5 November 2010. -Jump up ^ http://www.justice.gov.uk/downloads/about/moj/our-responsibilities/Background_Briefing_on_the_Crown_Dependencies2.pdf -Jump up ^ "Overseas Territories". Foreign & Commonwealth Office. Retrieved 6 September 2010. -Jump up ^ "The World Factbook". CIA. Retrieved 26 December 2010. -Jump up ^ "Country profiles". Foreign & Commonwealth Office. 21 February 2008. Retrieved 6 September 2010.[dead link] -Jump up ^ Davison, Phil (18 August 1995). "Bermudians vote to stay British". The Independent (London). Retrieved 11 September 2012. -Jump up ^ The Committee Office, House of Commons. "House of Commons – Crown Dependencies – Justice Committee". Publications.parliament.uk. Retrieved 7 November 2010. -Jump up ^ Fact sheet on the UK's relationship with the Crown Dependencies – gov.uk, Ministry of Justice. Retrieved 25 August 2014. -Jump up ^ "Profile of Jersey". States of Jersey. Retrieved 31 July 2008. The legislature passes primary legislation, which requires approval by The Queen in Council, and enacts subordinate legislation in many areas without any requirement for Royal Sanction and under powers conferred by primary legislation. -Jump up ^ "Chief Minister to meet Channel Islands counterparts – Isle of Man Public Services" (Press release). Isle of Man Government. 29 May 2012. Retrieved 9 April 2013.[dead link] -Jump up ^ Bagehot, Walter (1867). The English Constitution. London: Chapman and Hall. p. 103. -Jump up ^ Carter, Sarah. "A Guide To the UK Legal System". University of Kent at Canterbury. Retrieved 16 May 2006. -Jump up ^ "Parliamentary sovereignty". UK Parliament. n.d. Archived from the original on 27 May 2012. -Jump up ^ "The Government, Prime Minister and Cabinet". Public services all in one place. Directgov. Retrieved 12 February 2010. -Jump up ^ "Brown is UK's new prime minister". BBC News. 27 June 2007. Retrieved 23 January 2008. -Jump up ^ "David Cameron is UK's new prime minister". BBC News. 11 May 2010. Retrieved 11 May 2010. -Jump up ^ November 2010 "Elections and voting". UK Parliament. Archived from the original on 14 November 2010. Retrieved 14 November 2010. -Jump up ^ November 2010 "The Parliament Acts". UK Parliament. Archived from the original on 14 November 2010. -Jump up ^ "United Kingdom". European Election Database. Norwegian Social Science Data Services. Retrieved 3 July 2010. -Jump up ^ Wainwright, Martin (28 May 2010). "Thirsk and Malton: Conservatives take final seat in parliament". The Guardian (London). Retrieved 3 July 2010. -Jump up ^ "Scots MPs attacked over fees vote". BBC News. 27 January 2004. Retrieved 21 October 2008. -Jump up ^ Taylor, Brian (1 June 1998). "Talking Politics: The West Lothian Question". BBC News. Retrieved 21 October 2008. -Jump up ^ "England-only laws 'need majority from English MPs'". BBC News. 25 March 2013. Retrieved 28 April 2013. -Jump up ^ "Scotland's Parliament – powers and structures". BBC News. 8 April 1999. Retrieved 21 October 2008. -Jump up ^ "Salmond elected as first minister". BBC News. 16 May 2007. Retrieved 21 October 2008. -Jump up ^ "Scottish election: SNP wins election". BBC News. 6 May 2011. -Jump up ^ "Structure and powers of the Assembly". BBC News. 9 April 1999. Retrieved 21 October 2008. -Jump up ^ "Carwyn Jones clinches leadership in Wales". WalesOnline (Media Wales). 1 December 2009. Retrieved 1 December 2009. -Jump up ^ "Devolved Government – Ministers and their departments". Northern Ireland Executive. Archived from the original on 22 August 2007. -Jump up ^ Burrows, N. (1999). "Unfinished Business: The Scotland Act 1998". The Modern Law Review 62 (2): 241–60 [p. 249]. doi:10.1111/1468-2230.00203. The UK Parliament is sovereign and the Scottish Parliament is subordinate. The White Paper had indicated that this was to be the approach taken in the legislation. The Scottish Parliament is not to be seen as a reflection of the settled will of the people of Scotland or of popular sovereignty but as a reflection of its subordination to a higher legal authority. Following the logic of this argument, the power of the Scottish Parliament to legislate can be withdrawn or overridden... -Jump up ^ Elliot, M. (2004). "United Kingdom: Parliamentary sovereignty under pressure". International Journal of Constitutional Law 2 (3): 545–627 [pp. 553–554]. doi:10.1093/icon/2.3.545. Notwithstanding substantial differences among the schemes, an important common factor is that the U.K. Parliament has not renounced legislative sovereignty in relation to the three nations concerned. For example, the Scottish Parliament is empowered to enact primary legislation on all matters, save those in relation to which competence is explicitly denied ... but this power to legislate on what may be termed "devolved matters" is concurrent with the Westminster Parliament's general power to legislate for Scotland on any matter at all, including devolved matters ... In theory, therefore, Westminster may legislate on Scottish devolved matters whenever it chooses... -Jump up ^ Walker, G. (2010). "Scotland, Northern Ireland, and Devolution, 1945–1979". Journal of British Studies 39 (1): 124 & 133. doi:10.1086/644536. -Jump up ^ Gamble, A. "The Constitutional Revolution in the United Kingdom". Publius 36 (1): 19–35 [p. 29]. doi:10.1093/publius/pjj011. The British parliament has the power to abolish the Scottish parliament and the Welsh assembly by a simple majority vote in both houses, but since both were sanctioned by referenda, it would be politically difficult to abolish them without the sanction of a further vote by the people. In this way several of the constitutional measures introduced by the Blair government appear to be entrenched and not subject to a simple exercise of parliamentary sovereignty at Westminster. -Jump up ^ Meehan, E. (1999). "The Belfast Agreement—Its Distinctiveness and Points of Cross-Fertilization in the UK's Devolution Programme". Parliamentary Affairs 52 (1): 19–31 [p. 23]. doi:10.1093/pa/52.1.19. [T]he distinctive involvement of two governments in the Northern Irish problem means that Northern Ireland's new arrangements rest upon an intergovernmental agreement. If this can be equated with a treaty, it could be argued that the forthcoming distribution of power between Westminster and Belfast has similarities with divisions specified in the written constitutions of federal states... Although the Agreement makes the general proviso that Westminster's 'powers to make legislation for Northern Ireland' remains 'unaffected', without an explicit categorical reference to reserved matters, it may be more difficult than in Scotland or Wales for devolved powers to be repatriated. The retraction of devolved powers would not merely entail consultation in Northern Ireland backed implicitly by the absolute power of parliamentary sovereignty but also the renegotiation of an intergovernmental agreement. -Jump up ^ "The Treaty (act) of the Union of Parliament 1706". Scottish History Online. Retrieved 5 October 2008. -Jump up ^ "UK Supreme Court judges sworn in". BBC News. 1 October 2009. -Jump up ^ "Constitutional reform: A Supreme Court for the United Kingdom". Department for Constitutional Affairs. July 2003. Retrieved 13 May 2013. -Jump up ^ "Role of the JCPC". Judicial Committee of the Privy Council. Retrieved 28 April 2013. -Jump up ^ Bainham, Andrew (1998). The international survey of family law: 1996. The Hague: Martinus Nijhoff. p. 298. ISBN 978-90-411-0573-8. -Jump up ^ Adeleye, Gabriel; Acquah-Dadzie, Kofi; Sienkewicz, Thomas; McDonough, James (1999). World dictionary of foreign expressions. Waucojnda, IL: Bolchazy-Carducci. p. 371. ISBN 978-0-86516-423-9. -Jump up ^ "The Australian courts and comparative law". Australian Law Postgraduate Network. Retrieved 28 December 2010. -Jump up ^ "Court of Session – Introduction". Scottish Courts. Retrieved 5 October 2008.[dead link] -Jump up ^ "High Court of Justiciary – Introduction". Scottish Courts. Retrieved 5 October 2008.[dead link] -Jump up ^ "House of Lords – Practice Directions on Permission to Appeal". UK Parliament. Retrieved 22 June 2009. -Jump up ^ "Introduction". Scottish Courts. Retrieved 5 October 2008.[dead link] -Jump up ^ Samuel Bray (2005). "Not proven: introducing a third verdict". The University of Chicago Law Review 72 (4): 1299. Retrieved 30 November 2013. -Jump up ^ "Police-recorded crime down by 9%". BBC News. 17 July 2008. Retrieved 21 October 2008. -Jump up ^ "New record high prison population". BBC News. 8 February 2008. Retrieved 21 October 2008. -Jump up ^ "Crime falls to 32 year low" (Press release). Scottish Government. 7 September 2010. Retrieved 21 April 2011. -Jump up ^ "Prisoner Population at Friday 22 August 2008". Scottish Prison Service. Retrieved 28 August 2008. -Jump up ^ "Scots jail numbers at record high". BBC News. 29 August 2008. Retrieved 21 October 2008. -Jump up ^ Swaine, Jon (13 January 2009). "Barack Obama presidency will strengthen special relationship, says Gordon Brown". The Daily Telegraph (London). Retrieved 3 May 2011. -Jump up ^ Kirchner, E. J.; Sperling, J. (2007). Global Security Governance: Competing Perceptions of Security in the 21st Century. London: Taylor & Francis. p. 100. ISBN 0-415-39162-8 -Jump up ^ The Committee Office, House of Commons (19 February 2009). "DFID's expenditure on development assistance". UK Parliament. Retrieved 28 April 2013. -Jump up ^ "Ministry of Defence". Ministry of Defence. Retrieved 21 February 2012. -Jump up ^ "Speaker addresses Her Majesty Queen Elizabeth II". UK Parliament. 30 March 2012. Retrieved 28 April 2013. -Jump up ^ "House of Commons Hansard". UK Parliament. Retrieved 23 October 2008. -Jump up ^ UK 2005: The Official Yearbook of the United Kingdom of Great Britain and Northern Ireland. Office for National Statistics. p. 89. -Jump up ^ "Principles for Economic Regulation". Department for Business, Innovation & Skills. April 2011. Retrieved 1 May 2011. -Jump up ^ "United Kingdom". International Monetary Fund. Retrieved 1 October 2009. -Jump up ^ Chavez-Dreyfuss, Gertrude (1 April 2008). "Global reserves, dollar share up at end of 2007-IMF". Reuters. Retrieved 21 December 2009. -Jump up ^ "More About the Bank". Bank of England. n.d. Archived from the original on 12 March 2008. -Jump up ^ "Index of Services (experimental)". Office for National Statistics. 7 May 2006. Archived from the original on 7 May 2006. -Jump up ^ Sassen, Saskia (2001). The Global City: New York, London, Tokyo (2nd ed.). Princeton University Press. ISBN 0-691-07866-1. -^ Jump up to: a b "Global Financial Centres 7". Z/Yen. 2010. Retrieved 21 April 2010. -^ Jump up to: a b "Worldwide Centres of Commerce Index 2008". Mastercard. Retrieved 5 July 2011. -^ Jump up to: a b Zumbrun, Joshua (15 July 2008). ""World's Most Economically Powerful Cities".". Forbes (New York). Archived from the original on 19 May 2011. Retrieved 3 October 2010. -Jump up ^ "Global city GDP rankings 2008–2025". PricewaterhouseCoopers. Archived from the original on 19 May 2011. Retrieved 16 November 2010. -Jump up ^ Lazarowicz, Mark (Labour MP) (30 April 2003). "Financial Services Industry". UK Parliament. Retrieved 17 October 2008. -Jump up ^ International Tourism Receipts[dead link]. UNWTO Tourism Highlights, Edition 2005. page 12. World Tourism Organisation. Retrieved 24 May 2006. -Jump up ^ Bremner, Caroline (10 January 2010). "Euromonitor International's Top City Destination Ranking". Euromonitor International. Archived from the original on 19 May 2011. Retrieved 31 May 2011. -Jump up ^ "From the Margins to the Mainstream – Government unveils new action plan for the creative industries". DCMS. 9 March 2007. Retrieved 9 March 2007.[dead link] -^ Jump up to: a b "European Countries – United Kingdom". Europa (web portal). Retrieved 15 December 2010. -Jump up ^ Harrington, James W.; Warf, Barney (1995). Industrial location: Principles, practices, and policy. London: Routledge. p. 121. ISBN 978-0-415-10479-1. -Jump up ^ Spielvogel, Jackson J. (2008). Western Civilization: Alternative Volume: Since 1300. Belmont, CA: Thomson Wadsworth. ISBN 978-0-495-55528-5. -Jump up ^ Hewitt, Patricia (15 July 2004). "TUC Manufacturing Conference". Department of Trade and Industry. Retrieved 16 May 2006. -Jump up ^ "Industry topics". Society of Motor Manufacturers and Traders. 2011. Retrieved 5 July 2011. -Jump up ^ Robertson, David (9 January 2009). "The Aerospace industry has thousands of jobs in peril". The Times (London). Retrieved 9 June 2011. (subscription required) -Jump up ^ "Facts & Figures – 2009". Aerospace & Defence Association of Europe. Retrieved 9 June 2011.[dead link] -Jump up ^ "UK Aerospace Industry Survey – 2010". ADS Group. Retrieved 9 June 2011. -^ Jump up to: a b c d http://www.theengineer.co.uk/aerospace/in-depth/reasons-to-be-cheerful-about-the-uk-aerospace-sector/1017274.article -Jump up ^ "The Pharmaceutical sector in the UK". Department for Business, Innovation & Skills. Retrieved 9 June 2011. -Jump up ^ "Ministerial Industry Strategy Group – Pharmaceutical Industry: Competitiveness and Performance Indicators". Department of Health. Retrieved 9 June 2011.[dead link] -Jump up ^ [1][dead link] -Jump up ^ "UK in recession as economy slides". BBC News. 23 January 2009. Retrieved 23 January 2009. -Jump up ^ "UK youth unemployment at its highest in two decades: 22.5%". MercoPress. 15 April 2012. -Jump up ^ Groom, Brian (19 January 2011). "UK youth unemployment reaches record". Financial Times (London). -Jump up ^ "Release: EU Government Debt and Deficit returns". Office for National Statistics. March 2012. Retrieved 17 August 2012. -Jump up ^ "UK loses top AAA credit rating for first time since 1978". BBC News. 23 February 2013. Retrieved 23 February 2013. -Jump up ^ "Britain sees real wages fall 3.2%". Daily Express (London). 2 March 2013. -Jump up ^ Beckford, Martin (5 December 2011). "Gap between rich and poor growing fastest in Britain". The Daily Telegraph (London). -Jump up ^ "United Kingdom: Numbers in low income". The Poverty Site. Retrieved 25 September 2009. -Jump up ^ "United Kingdom: Children in low income households". The Poverty Site. Retrieved 25 September 2009. -Jump up ^ "Warning of food price hike crisis". BBC News. 4 April 2009. -Jump up ^ Andrews, J. (16 January 2013). "How poor is Britain now". Yahoo! Finance UK -Jump up ^ Glynn, S.; Booth, A. (1996). Modern Britain: An Economic and Social History. London: Routledge. -Jump up ^ "Report highlights 'bleak' poverty levels in the UK" Phys.org, 29 March 2013 -Jump up ^ Gascoin, J. "A reappraisal of the role of the universities in the Scientific Revolution", in Lindberg, David C. and Westman, Robert S., eds (1990), Reappraisals of the Scientific Revolution. Cambridge University Press. p. 248. ISBN 0-521-34804-8. -Jump up ^ Reynolds, E.E.; Brasher, N.H. (1966). Britain in the Twentieth Century, 1900–1964. Cambridge University Press. p. 336. OCLC 474197910 -Jump up ^ Burtt, E.A. (2003) [1924].The Metaphysical Foundations of Modern Science. Mineola, NY: Courier Dover. p. 207. ISBN 0-486-42551-7. -Jump up ^ Hatt, C. (2006). Scientists and Their Discoveries. London: Evans Brothers. pp. 16, 30 and 46. ISBN 0-237-53195-X. -Jump up ^ Jungnickel, C.; McCormmach, R. (1996). Cavendish. American Philosophical Society. ISBN 0-87169-220-1. -Jump up ^ "The Nobel Prize in Physiology or Medicine 1945: Sir Alexander Fleming, Ernst B. Chain, Sir Howard Florey". The Nobel Foundation. Archived from the original on 21 June 2011. -Jump up ^ Hatt, C. (2006). Scientists and Their Discoveries. London: Evans Brothers. p. 56. ISBN 0-237-53195-X. -Jump up ^ James, I. (2010). Remarkable Engineers: From Riquet to Shannon. Cambridge University Press. pp. 33–6. ISBN 0-521-73165-8. -Jump up ^ Bova, Ben (2002) [1932]. The Story of Light. Naperville, IL: Sourcebooks. p. 238. ISBN 978-1-4022-0009-0. -Jump up ^ "Alexander Graham Bell (1847–1922)". Scottish Science Hall of Fame. Archived from the original on 21 June 2011. -Jump up ^ "John Logie Baird (1888–1946)". BBC History. Archived from the original on 21 June 2011. -Jump up ^ Cole, Jeffrey (2011). Ethnic Groups of Europe: An Encyclopedia. Santa Barbara, CA: ABC-CLIO. p. 121. ISBN 1-59884-302-8. -Jump up ^ Castells, M.; Hall, P.; Hall, P.G. (2004). Technopoles of the World: the Making of Twenty-First-Century Industrial Complexes. London: Routledge. pp. 98–100. ISBN 0-415-10015-1. -Jump up ^ "Knowledge, networks and nations: scientific collaborations in the twenty-first century". Royal Society. 2011. Archived from the original on 22 June 2011. -Jump up ^ McCook, Alison. "Is peer review broken?". Reprinted from the Scientist 20(2) 26, 2006. Archived from the original on 21 June 2011. -^ Jump up to: a b "Heathrow 'needs a third runway'". BBC News. 25 June 2008. Retrieved 17 October 2008. -^ Jump up to: a b "Statistics: Top 30 World airports" (Press release). Airports Council International. July 2008. Retrieved 15 October 2008. -Jump up ^ "Transport Statistics Great Britain: 2010". Department for Transport. Archived from the original on 16 December 2010. -Jump up ^ "Major new rail lines considered". BBC News. 21 June 2008. Archived from the original on 9 October 2010. -Jump up ^ "Crossrail's giant tunnelling machines unveiled". BBC News. 2 January 2012. -Jump up ^ Leftly, Mark (29 August 2010). "Crossrail delayed to save £1bn". The Independent on Sunday (London). -^ Jump up to: a b "Size of Reporting Airports October 2009 – September 2010". Civil Aviation Authority. Retrieved 5 December 2010. -Jump up ^ "BMI being taken over by Lufthansa". BBC News. 29 October 2008. Retrieved 23 December 2009. -Jump up ^ "United Kingdom Energy Profile". U.S. Energy Information Administration. Retrieved 4 November 2010. -Jump up ^ Mason, Rowena (24 October 2009). "Let the battle begin over black gold". The Daily Telegraph (London). Retrieved 26 November 2010. -Jump up ^ Heath, Michael (26 November 2010). "RBA Says Currency Containing Prices, Rate Level 'Appropriate' in Near Term". Bloomberg (New York). Retrieved 26 November 2010. -^ Jump up to: a b c "Nuclear Power in the United Kingdom". World Nuclear Association. April 2013. Retrieved 9 April 2013. -^ Jump up to: a b c "United Kingdom – Oil". U.S. Energy Information Administration. Retrieved 4 November 2010.[dead link] -Jump up ^ "Diminishing domestic reserves, escalating imports". EDF Energy. Retrieved 9 April 2013. -^ Jump up to: a b "United Kingdom – Natural Gas". U.S. Energy Information Administration. Retrieved 4 November 2010.[dead link] -^ Jump up to: a b "United Kingdom – Quick Facts Energy Overview". U.S. Energy Information Administration. Retrieved 4 November 2010.[dead link] -Jump up ^ The Coal Authority (10 April 2006). "Coal Reserves in the United Kingdom". The Coal Authority. Archived from the original on 4 January 2009. Retrieved 5 July 2011. -Jump up ^ "England Expert predicts 'coal revolution'". BBC News. 16 October 2007. Retrieved 23 September 2008. -Jump up ^ Watts, Susan (20 March 2012). "Fracking: Concerns over gas extraction regulations". BBC News. Retrieved 9 April 2013. -Jump up ^ "Quit fracking aboot". Friends of the Earth Scotland. Retrieved 9 April 2013. -Jump up ^ "Census Geography". Office for National Statistics. 30 October 2007. Archived from the original on 4 June 2011. Retrieved 14 April 2012. -Jump up ^ "Welcome to the 2011 Census for England and Wales". Office for National Statistics. n.d. Retrieved 11 October 2008. -^ Jump up to: a b c "2011 Census: Population Estimates for the United Kingdom". Office for National Statistics. 27 March 2011. Retrieved 18 December 2012. -^ Jump up to: a b c "Annual Mid-year Population Estimates, 2010". Office for National Statistics. 2011. Retrieved 14 April 2012. -Jump up ^ Batty, David (30 December 2010). "One in six people in the UK today will live to 100, study says". The Guardian (London). -^ Jump up to: a b "2011 UK censuses". Office for National Statistics. Retrieved 18 December 2012. -Jump up ^ "Population: UK population grows to 59.6 million" (Press release). Office for National Statistics. 24 June 2004. Archived from the original on 22 July 2004. Retrieved 14 April 2012. -Jump up ^ Khan, Urmee (16 September 2008). "England is most crowded country in Europe". The Daily Telegraph (London). Retrieved 5 September 2009. -Jump up ^ Carrell, Severin (17 December 2012). "Scotland's population at record high". The Guardian. London. Retrieved 18 December 2012. -^ Jump up to: a b c "Vital Statistics: Population and Health Reference Tables (February 2014 Update): Annual Time Series Data". ONS. Retrieved 27 April 2014. -Jump up ^ Boseley, Sarah (14 July 2008). "The question: What's behind the baby boom?". The Guardian (London). p. 3. Retrieved 28 August 2009. -Jump up ^ Tables, Graphs and Maps Interface (TGM) table. Eurostat (26 February 2013). Retrieved 12 July 2013. -Jump up ^ Campbell, Denis (11 December 2005). "3.6m people in Britain are gay – official". The Observer (London). Retrieved 28 April 2013. -Jump up ^ "2011 Census - Built-up areas". ONS. Retrieved 1 July 2013. -Jump up ^ Mid-2012 Population Estimates for Settlements and Localities in Scotland General Register Office for Scotland -Jump up ^ "Belfast Metropolitan Urban Area NISRA 2005". Retrieved 28 April 2013. -Jump up ^ 2011 Census: KS201UK Ethnic group, local authorities in the United Kingdom, Accessed 21 February 2014 -Jump up ^ "Welsh people could be most ancient in UK, DNA suggests". BBC News. 19 June 2012. Retrieved 28 April 2013. -Jump up ^ Thomas, Mark G. et al. "Evidence for a segregated social structure in early Anglo-Saxon England". Proceedings of the Royal Society B: Biological Sciences 273(1601): 2651–2657. -Jump up ^ Owen, James (19 July 2005). "Review of 'The Tribes of Britain'". National Geographic (Washington DC). -Jump up ^ Oppenheimer, Stephen (October 2006). "Myths of British ancestry" at the Wayback Machine (archived 26 September 2006). Prospect (London). Retrieved 5 November 2010. -Jump up ^ Henderson, Mark (23 October 2009). "Scientist – Griffin hijacked my work to make race claim about 'British aborigines'". The Times (London). Retrieved 26 October 2009. (subscription required) -Jump up ^ Costello, Ray (2001). Black Liverpool: The Early History of Britain's Oldest Black Community 1730–1918. Liverpool: Picton Press. ISBN 1-873245-07-6. -Jump up ^ "Culture and Ethnicity Differences in Liverpool – Chinese Community". Chambré Hardman Trust. Retrieved 26 October 2009. -Jump up ^ Coleman, David; Compton, Paul; Salt, John (2002). "The demographic characteristics of immigrant populations", Council of Europe, p.505. ISBN 92-871-4974-7. -Jump up ^ Mason, Chris (30 April 2008). "'Why I left UK to return to Poland'". BBC News. -Jump up ^ "Resident population estimates by ethnic group (percentages): London". Office for National Statistics. Retrieved 23 April 2008. -Jump up ^ "Resident population estimates by ethnic group (percentages): Leicester". Office for National Statistics. Retrieved 23 April 2008. -Jump up ^ "Census 2001 – Ethnicity and religion in England and Wales". Office for National Statistics. Retrieved 23 April 2008. -Jump up ^ Loveys, Kate (22 June 2011). "One in four primary school pupils are from an ethnic minority and almost a million schoolchildren do not speak English as their first language". Daily Mail (London). Retrieved 28 June 2011. -Jump up ^ Rogers, Simon (19 May 2011). "Non-white British population reaches 9.1 million". The Guardian (London). -Jump up ^ Wallop, Harry (18 May 2011). "Population growth of last decade driven by non-white British". The Daily Telegraph (London). -Jump up ^ "Official EU languages". European Commission. 8 May 2009. Retrieved 16 October 2009. -Jump up ^ "Language Courses in New York". United Nations. 2006. Retrieved 29 November 2010. -Jump up ^ "English language – Government, citizens and rights". Directgov. Retrieved 23 August 2011. -Jump up ^ "Commonwealth Secretariat – UK". Commonwealth Secretariat. Retrieved 23 August 2011. -^ Jump up to: a b c "Languages across Europe: United Kingdom". BBC. Retrieved 4 February 2013. -Jump up ^ Booth, Robert (30 January 2013). "Polish becomes England's second language". The Guardian (London). Retrieved 4 February 2012. -Jump up ^ European Charter for Regional or Minority Languages, Strasbourg, 5.XI.1992 - http://conventions.coe.int/treaty/en/Treaties/Html/148.htm -Jump up ^ Framework Convention for the Protection of National Minorities, Strasbourg, 1.II.1995 - http://conventions.coe.int/Treaty/en/Treaties/Html/157.htm -Jump up ^ National Statistics Online – Welsh Language[dead link]. National Statistics Office. -Jump up ^ "Differences in estimates of Welsh Language Skills". Office for National Statistics. Archived from the original on 12 January 2010. Retrieved 30 December 2008. -Jump up ^ Wynn Thomas, Peter (March 2007). "Welsh today". Voices. BBC. Retrieved 5 July 2011. -Jump up ^ "Scotland's Census 2001 – Gaelic Report". General Register Office for Scotland. Retrieved 28 April 2013. -Jump up ^ "Local UK languages 'taking off'". BBC News. 12 February 2009. -Jump up ^ Edwards, John R. (2010). Minority languages and group identity: cases and categories. John Benjamins. pp. 150–158. ISBN 978-90-272-1866-7. Retrieved 12 March 2011. -Jump up ^ Koch, John T. (2006). Celtic culture: a historical encyclopedia. ABC-CLIO. p. 696. ISBN 978-1-85109-440-0. -Jump up ^ "Language Data – Scots". European Bureau for Lesser-Used Languages. Archived from the original on 23 June 2007. Retrieved 2 November 2008. -Jump up ^ "Fall in compulsory language lessons". BBC News. 4 November 2004. -Jump up ^ "The School Gate for parents in Wales". BBC. Retrieved 28 April 2013. -Jump up ^ Cannon, John, ed. (2nd edn., 2009). A Dictionary of British History. Oxford University Press. p. 144. ISBN 0-19-955037-9. -Jump up ^ Field, Clive D. (November 2009). "British religion in numbers"[dead link]. BRIN Discussion Series on Religious Statistics, Discussion Paper 001. Retrieved 3 June 2011. -Jump up ^ Yilmaz, Ihsan (2005). Muslim Laws, Politics and Society in Modern Nation States: Dynamic Legal Pluralisms in England, Turkey, and Pakistan. Aldershot: Ashgate Publishing. pp. 55–6. ISBN 0-7546-4389-1. -Jump up ^ Brown, Callum G. (2006). Religion and Society in Twentieth-Century Britain. Harlow: Pearson Education. p. 291. ISBN 0-582-47289-X. -Jump up ^ Norris, Pippa; Inglehart, Ronald (2004). Sacred and Secular: Religion and Politics Worldwide. Cambridge University Press. p. 84. ISBN 0-521-83984-X. -Jump up ^ Fergusson, David (2004). Church, State and Civil Society. Cambridge University Press. p. 94. ISBN 0-521-52959-X. -Jump up ^ "UK Census 2001". National Office for Statistics. Archived from the original on 12 March 2007. Retrieved 22 April 2007. -Jump up ^ "Religious Populations". Office for National Statistics. 11 October 2004. Archived from the original on 6 June 2011. -Jump up ^ "United Kingdom: New Report Finds Only One in 10 Attend Church". News.adventist.org. 4 April 2007. Retrieved 12 September 2010. -Jump up ^ Philby, Charlotte (12 December 2012). "Less religious and more ethnically diverse: Census reveals a picture of Britain today". The Independent (London). -Jump up ^ The History of the Church of England. The Church of England. Retrieved 23 November 2008. -Jump up ^ "Queen and Church of England". British Monarchy Media Centre. Archived from the original on 8 October 2006. Retrieved 5 June 2010. -Jump up ^ "Queen and the Church". The British Monarchy (Official Website). Archived from the original on 7 June 2011. -Jump up ^ "How we are organised". Church of Scotland. Archived from the original on 7 June 2011. -Jump up ^ Weller, Paul (2005). Time for a Change: Reconfiguring Religion, State, and Society. London: Continuum. pp. 79–80. ISBN 0567084876. -Jump up ^ Peach, Ceri, "United Kingdom, a major transformation of the religious landscape", in H. Knippenberg. ed. (2005). The Changing Religious Landscape of Europe. Amsterdam: Het Spinhuis. pp. 44–58. ISBN 90-5589-248-3. -Jump up ^ Richards, Eric (2004). Britannia's children: Emigration from England, Scotland, Wales and Ireland since 1600. London: Hambledon, p. 143. ISBN 978-1-85285-441-6. -Jump up ^ Gibney, Matthew J.; Hansen, Randall (2005). Immigration and asylum: from 1900 to the present, ABC-CLIO, p. 630. ISBN 1-57607-796-9 -Jump up ^ "Short history of immigration". BBC. 2005. Retrieved 28 August 2010. -Jump up ^ Rogers, Simon (11 December 2012). "Census 2011 mapped and charted: England & Wales in religion, immigration and race". London: Guardian. Retrieved 11 December 2012. -Jump up ^ 6.5% of the EU population are foreigners and 9.4% are born abroad, Eurostat, Katya Vasileva, 34/2011. -Jump up ^ Muenz, Rainer (June 2006). "Europe: Population and Migration in 2005". Migration Policy Institute. Retrieved 2 April 2007. -Jump up ^ "Immigration and births to non-British mothers pushes British population to record high". London Evening Standard. 21 August 2008. -Jump up ^ Doughty, Steve; Slack, James (3 June 2008). "Third World migrants behind our 2.3m population boom". Daily Mail (London). -Jump up ^ Bentham, Martin (20 October 2008). "Tories call for tougher control of immigration". London Evening Standard. -Jump up ^ "Minister rejects migrant cap plan". BBC News. 8 September 2008. Retrieved 26 April 2011. -Jump up ^ Johnston, Philip (5 January 2007). "Immigration 'far higher' than figures say". The Daily Telegraph (London). Retrieved 20 April 2007. -Jump up ^ Travis, Alan (25 August 2011). "UK net migration rises 21%". The Guardian (London). -^ Jump up to: a b "Migration Statistics Quarterly Report May 2012". Office for National Statistics. 24 May 2012. -Jump up ^ "Migration to UK more than double government target". BBC News. 24 May 2012. -^ Jump up to: a b "Citizenship". Home Office. August 2011. Retrieved 24 October 2011.[dead link] -Jump up ^ Bamber, David (20 December 2000). "Migrant squad to operate in France". The Daily Telegraph (London). -Jump up ^ "Settlement". Home Office. August 2011. Retrieved 24 October 2011.[dead link] -Jump up ^ "Births in England and Wales by parents' country of birth, 2011". Office for National Statistics. 30 August 2012. Retrieved 28 April 2013. -Jump up ^ "Right of Union citizens and their family members to move and reside freely within the territory of the Member States". European Commission. Retrieved 28 April 2013. -Jump up ^ Doward, Jamie; Temko, Ned (23 September 2007). "Home Office shuts the door on Bulgaria and Romania". The Observer (London). p. 2. Retrieved 23 August 2008. -Jump up ^ Sumption, Madeleine; Somerville, Will (January 2010). The UK's new Europeans: Progress and challenges five years after accession. Policy Report (London: Equality and Human Rights Commission). p. 13. ISBN 978-1-84206-252-4. Retrieved 19 January 2010. -Jump up ^ Doward, Jamie; Rogers, Sam (17 January 2010). "Young, self-reliant, educated: portrait of UK's eastern European migrants". The Observer (London). Retrieved 19 January 2010. -Jump up ^ Hopkirk, Elizabeth (20 October 2008). "Packing up for home: Poles hit by UK's economic downturn". London Evening Standard. -Jump up ^ "Migrants to UK 'returning home'". BBC News. 8 September 2009. Retrieved 8 September 2009. -Jump up ^ "UK sees shift in migration trend". BBC News. 27 May 2010. Retrieved 28 May 2010. -Jump up ^ "Fresh Talent: Working in Scotland". London: UK Border Agency. Retrieved 30 October 2010. -Jump up ^ Boxell, James (28 June 2010). "Tories begin consultation on cap for migrants". Financial Times (London). Retrieved 17 September 2010. -Jump up ^ "Vince Cable: Migrant cap is hurting economy". The Guardian (London). Press Association. 17 September 2010. Retrieved 17 September 2010. -Jump up ^ Richards (2004), pp. 6–7. -^ Jump up to: a b Sriskandarajah, Dhananjayan; Drew, Catherine (11 December 2006). "Brits Abroad: Mapping the scale and nature of British emigration". Institute for Public Policy Research. Retrieved 20 January 2007. -Jump up ^ "Brits Abroad: world overview". BBC. n.d. Retrieved 20 April 2007. -Jump up ^ Casciani, Dominic (11 December 2006). "5.5 m Britons 'opt to live abroad'". BBC News. Retrieved 20 April 2007. -Jump up ^ "Brits Abroad: Country-by-country". BBC News. 11 December 2006. -Jump up ^ "Local Authorities". Department for Children, Schools and Families. Retrieved 21 December 2008. -Jump up ^ Gordon, J.C.B. (1981). Verbal Deficit: A Critique. London: Croom Helm. p. 44 note 18. ISBN 978-0-85664-990-5. -Jump up ^ Section 8 ('Duty of local education authorities to secure provision of primary and secondary schools'), Sections 35–40 ('Compulsory attendance at Primary and Secondary Schools') and Section 61 ('Prohibition of fees in schools maintained by local education authorities ...'), Education Act 1944. -Jump up ^ "England's pupils in global top 10". BBC News. 10 December 2008. -Jump up ^ "More state pupils in universities". BBC News. 19 July 2007. -Jump up ^ MacLeod, Donald (9 November 2007). "Private school pupil numbers in decline". The Guardian (London). Retrieved 31 March 2010. -Jump up ^ Frankel, Hannah (3 September 2010). "Is Oxbridge still a preserve of the posh?". TES (London). Retrieved 9 April 2013. -Jump up ^ "World's top 100 universities 2013: their reputations ranked by Times Higher Education". The Guardian (London). 2013. Retrieved 23 October 2014. -Jump up ^ Davenport, F.; Beech, C.; Downs, T.; Hannigan, D. (2006). Ireland. Lonely Planet, 7th edn. ISBN 1-74059-968-3. p. 564. -Jump up ^ "About SQA". Scottish Qualifications Authority. 10 April 2013. Retrieved 28 April 2013. -Jump up ^ "About Learning and Teaching Scotland". Learning and Teaching Scotland. Retrieved 28 April 2013. -Jump up ^ "Brain drain in reverse". Scotland Online Gateway. July 2002. Archived from the original on 4 December 2007. -Jump up ^ "Increase in private school intake". BBC News. 17 April 2007. -Jump up ^ "MSPs vote to scrap endowment fee". BBC News. 28 February 2008. -Jump up ^ What will your child learn?[dead link] The Welsh Assembly Government. Retrieved 22 January 2010. -Jump up ^ CCEA. "About Us – What we do". Council for the Curriculum Examinations & Assessment. Retrieved 28 April 2013. -Jump up ^ Elitist Britain?, Social Mobility and Child Poverty Commission, 28 August 2014 -Jump up ^ Arnett, George (28 August 2014). "Elitism in Britain - breakdown by profession". The Guardian: Datablog. -Jump up ^ Haden, Angela; Campanini, Barbara, eds. (2000). The world health report 2000 – Health systems: improving performance. Geneva: World Health Organisation. ISBN 92-4-156198-X. Retrieved 5 July 2011. -Jump up ^ World Health Organization. "Measuring overall health system performance for 191 countries". New York University. Retrieved 5 July 2011. -Jump up ^ "'Huge contrasts' in devolved NHS". BBC News. 28 August 2008. -Jump up ^ Triggle, Nick (2 January 2008). "NHS now four different systems". BBC News. -Jump up ^ Fisher, Peter. "The NHS from Thatcher to Blair". NHS Consultants Association (International Association of Health Policy). The Budget ... was even more generous to the NHS than had been expected amounting to an annual rise of 7.4% above the rate of inflation for the next 5 years. This would take us to 9.4% of GDP spent on health ie around EU average. -Jump up ^ "OECD Health Data 2009 – How Does the United Kingdom Compare". Paris: Organisation for Economic Co-operation and Development. Retrieved 28 April 2013.[dead link] -Jump up ^ "The cultural superpower: British cultural projection abroad". Journal of the British Politics Society, Norway. Volume 6. No. 1. Winter 2011 -Jump up ^ Sheridan, Greg (15 May 2010). "Cameron has chance to make UK great again". The Australian (Sydney). Retrieved 20 May 2012. -Jump up ^ Goldfarb, Jeffrey (10 May 2006). "Bookish Britain overtakes America as top publisher". RedOrbit (Texas). Reuters. -Jump up ^ "William Shakespeare (English author)". Britannica Online encyclopedia. Retrieved 26 February 2006. -Jump up ^ MSN Encarta Encyclopedia article on Shakespeare. Archived from the original on 9 February 2006. Retrieved 26 February 2006. -Jump up ^ William Shakespeare. Columbia Electronic Encyclopedia. Retrieved 26 February 2006. -Jump up ^ "Mystery of Christie's success is solved". The Daily Telegraph (London). 19 December 2005. Retrieved 14 November 2010. -Jump up ^ "All-Time Essential Comics". IGN. Retrieved 15 August 2013. -Jump up ^ Johnston, Rich."Before Watchmen To Double Up For Hardcover Collections". Bleeding Cool. 10 December 2012. Retrieved 15 August 2013. -Jump up ^ "Edinburgh, UK appointed first UNESCO City of Literature". Unesco. 2004. Retrieved 28 April 2013.[dead link] -Jump up ^ "Early Welsh poetry". BBC Wales. Retrieved 29 December 2010. -Jump up ^ Lang, Andrew (2003) [1913]. History of English Literature from Beowulf to Swinburne. Holicong, PA: Wildside Press. p. 42. ISBN 978-0-8095-3229-2. -Jump up ^ "Dafydd ap Gwilym". Academi website. Academi. 2011. Retrieved 3 January 2011. Dafydd ap Gwilym is widely regarded as one of the greatest Welsh poets of all time, and amongst the leading European poets of the Middle Ages. -Jump up ^ True birthplace of Wales's literary hero. BBC News. Retrieved 28 April 2012 -Jump up ^ Kate Roberts: Biography at the Wayback Machine. BBC Wales. Retrieved 28 April 2012 -Jump up ^ Swift, Jonathan; Fox, Christopher (1995). Gulliver's travels: complete, authoritative text with biographical and historical contexts, critical history, and essays from five contemporary critical perspectives. Basingstoke: Macmillan. p. 10. ISBN 978-0-333-63438-7. -Jump up ^ "Bram Stoker." (PDF). The New York Times. 23 April 1912. Retrieved 1 January 2011. -^ Jump up to: a b "1960–1969". EMI Group. Retrieved 31 May 2008. -^ Jump up to: a b "Paul At Fifty". Time (New York). 8 June 1992. -^ Jump up to: a b Most Successful Group The Guinness Book of Records 1999, p. 230. Retrieved 19 March 2011. -Jump up ^ "British Citizen by Act of Parliament: George Frideric Handel". UK Parliament. 20 July 2009. Retrieved 11 September 2009.[dead link] -Jump up ^ Andrews, John (14 April 2006). "Handel all'inglese". Playbill (New York). Retrieved 11 September 2009. -Jump up ^ Citron, Stephen (2001). Sondheim and Lloyd-Webber: The new musical. London: Chatto & Windus. ISBN 978-1-85619-273-6. -Jump up ^ "Beatles a big hit with downloads". Belfast Telegraph. 25 November 2010. Retrieved 16 May 2011. -Jump up ^ "British rock legends get their own music title for PlayStation3 and PlayStation2" (Press release). EMI. 2 February 2009. -Jump up ^ Khan, Urmee (17 July 2008). "Sir Elton John honoured in Ben and Jerry ice cream". The Daily Telegraph (London). -Jump up ^ Alleyne, Richard (19 April 2008). "Rock group Led Zeppelin to reunite". The Daily Telegraph (London). Retrieved 31 March 2010. -Jump up ^ Fresco, Adam (11 July 2006). "Pink Floyd founder Syd Barrett dies at home". The Times (London). Retrieved 31 March 2010. (subscription required) -Jump up ^ Holton, Kate (17 January 2008). "Rolling Stones sign Universal album deal". Reuters. Retrieved 26 October 2008. -Jump up ^ Walker, Tim (12 May 2008). "Jive talkin': Why Robin Gibb wants more respect for the Bee Gees". The Independent (London). Retrieved 26 October 2008. -Jump up ^ "Brit awards winners list 2012: every winner since 1977". The Guardian (London). Retrieved 28 February 2012. -Jump up ^ Corner, Lewis (16 February 2012). "Adele, Coldplay biggest-selling UK artists worldwide in 2011". Digital Spy. Retrieved 22 March 2012. -Jump up ^ Hughes, Mark (14 January 2008). "A tale of two cities of culture: Liverpool vs Stavanger". The Independent (London). Retrieved 2 August 2009. -Jump up ^ "Glasgow gets city of music honour". BBC News. 20 August 2008. Retrieved 2 August 2009. -Jump up ^ Bayley, Stephen (24 April 2010). "The startling success of Tate Modern". The Times (London). Retrieved 19 January 2011. (subscription required) -Jump up ^ "Vertigo is named 'greatest film of all time'". BBC News. 2 August 2012. Retrieved 18 August 2012. -Jump up ^ "The Directors' Top Ten Directors". British Film Institute. Archived from the original on 27 May 2012. -Jump up ^ "Chaplin, Charles (1889–1977)". British Film Institute. Retrieved 25 January 2011. -Jump up ^ "Powell, Michael (1905–1990)". British Film Institute. Retrieved 25 January 2011. -Jump up ^ "Reed, Carol (1906–1976)". British Film Institute. Retrieved 25 January 2011. -Jump up ^ "Scott, Sir Ridley (1937–)". British Film Institute. Retrieved 25 January 2011. -Jump up ^ "Andrews, Julie (1935–)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Burton, Richard (1925–1984)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Caine, Michael (1933–)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Chaplin, Charles (1889–1977)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Connery, Sean (1930–)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Leigh, Vivien (1913–1967)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Niven, David (1910–1983)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Olivier, Laurence (1907–1989)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Sellers, Peter (1925–1980)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Winslet, Kate (1975–)". British Film Institute. Retrieved 11 December 2010. -Jump up ^ "Daniel Day-Lewis makes Oscar history with third award"'. BBC News. Retrieved 15 August 2013 -Jump up ^ "Harry Potter becomes highest-grossing film franchise". The Guardian (London). 11 September 2007. Retrieved 2 November 2010. -Jump up ^ "History of Ealing Studios". Ealing Studios. Retrieved 5 June 2010. -^ Jump up to: a b "UK film – the vital statistics". UK Film Council. Retrieved 22 October 2010.[dead link] -Jump up ^ "The BFI 100". British Film Institute. 6 September 2006. Archived from the original on 1 April 2011. -Jump up ^ "Baftas fuel Oscars race". BBC News. 26 February 2001. Retrieved 14 February 2011. -^ Jump up to: a b "BBC: World's largest broadcaster & Most trusted media brand". Media Newsline. Archived from the original on 5 October 2010. Retrieved 23 September 2010. -^ Jump up to: a b "Digital licence". Prospect. Retrieved 23 September 2010. -^ Jump up to: a b "About the BBC – What is the BBC". BBC Online. Retrieved 23 September 2010. -Jump up ^ Newswire7 (13 August 2009). "BBC: World's largest broadcaster & Most trusted media brand". Media Newsline. Archived from the original on 17 June 2011. -Jump up ^ "TV Licence Fee: facts & figures". BBC Press Office. April 2010. Archived from the original on 17 June 2011. -Jump up ^ "Publications & Policies: The History of ITV". ITV.com. Archived from the original on 17 June 2011. -Jump up ^ "Publishing". News Corporation. Archived from the original on 17 June 2011. -Jump up ^ "Direct Broadcast Satellite Television". News Corporation. Archived from the original on 17 June 2011. -Jump up ^ William, D. (2010). UK Cities: A Look at Life and Major Cities in England, Scotland, Wales and Northern Ireland. Eastbourne: Gardners Books. ISBN 978-9987-16-021-1, pp. 22, 46, 109 and 145. -Jump up ^ "Publishing". Department of Culture, Media and Sport. Archived from the original on 17 June 2011. -Jump up ^ Ofcom "Communication Market Report 2010", 19 August 2010, pp. 97, 164 and 191 -Jump up ^ "Social Trends: Lifestyles and social participation". Office for National Statistics. 16 February 2010. Archived from the original on 17 June 2011. -Jump up ^ "Top 20 countries with the highest number of Internet users". Internet World Stats. Archived from the original on 17 June 2011. -Jump up ^ Fieser, James, ed. (2000). A bibliography of Scottish common sense philosophy: Sources and origins. Bristol: Thoemmes Press. Retrieved 17 December 2010. -Jump up ^ Palmer, Michael (1999). Moral Problems in Medicine: A Practical Coursebook. Cambridge: Lutterworth Press. p. 66. ISBN 978-0-7188-2978-0. -Jump up ^ Scarre, Geoffrey (1995). Utilitarianism. London: Routledge. p. 82. ISBN 978-0-415-12197-2. -Jump up ^ Gysin, Christian (9 March 2007). "Wembley kick-off: Stadium is ready and England play first game in fortnight". Daily Mail (London). Retrieved 19 March 2007. -Jump up ^ "Opening ceremony of the games of the XXX Olympiad". Olympic.org. Retrieved 30 November 2013 -Jump up ^ "Unparalleled Sporting History" . Reuters. Retrieved 30 November 2013 -Jump up ^ "Rugby Union 'Britain's Second Most Popular Sport'". Ipsos-Mori. 22 December 2003. Retrieved 28 April 2013. -Jump up ^ Ebner, Sarah (2 July 2013). "History and time are key to power of football, says Premier League chief". The Times (London). Retrieved 30 November 2013. -Jump up ^ Mitchell, Paul (November 2005). "The first international football match". BBC Sport Scotland. Retrieved 15 December 2013. -Jump up ^ "Why is there no GB Olympics football team?". BBC Sport. 5 August 2008. Retrieved 31 December 2010. -Jump up ^ "Blatter against British 2012 team". BBC News. 9 March 2008. Retrieved 2 April 2008. -Jump up ^ "About ECB". England and Wales Cricket Board. n.d. Retrieved 28 April 2013. -Jump up ^ McLaughlin, Martyn (4 August 2009). "Howzat happen? England fields a Gaelic-speaking Scotsman in Ashes". The Scotsman (Edinburgh). Retrieved 30 December 2010. -Jump up ^ "Uncapped Joyce wins Ashes call up". BBC Sport. 15 November 2006. Retrieved 30 December 2010. -Jump up ^ "Glamorgan". BBC South East Wales. August 2009. Retrieved 30 December 2010. -Jump up ^ Ardener, Shirley (2007). Professional identities: policy and practice in business and bureaucracy. New York: Berghahn. p. 27. ISBN 978-1-84545-054-0. -Jump up ^ "Official Website of Rugby League World Cup 2008". Archived from the original on 16 October 2007. -Jump up ^ Louw, Jaco; Nesbit, Derrick (2008). The Girlfriends Guide to Rugby. Johannesburg: South Publishers. ISBN 978-0-620-39541-0. -Jump up ^ "Triple Crown". RBS 6 Nations. Retrieved 6 March 2011. -Jump up ^ "Tracking the Field". Ipsos MORI. Archived from the original on 5 February 2009. Retrieved 17 October 2008. -Jump up ^ "Links plays into the record books". BBC News. 17 March 2009. -Jump up ^ Chowdhury, Saj (22 January 2007). "China in Ding's hands". BBC Sport. Retrieved 2 January 2011. -Jump up ^ "Lawn Tennis and Major T.Gem". The Birmingham Civic Society. Archived from the original on 18 August 2011. Retrieved 31 December 2010. -Jump up ^ Gould, Joe (10 April 2007). "The ancient Irish sport of hurling catches on in America". Columbia News Service (Columbia Journalism School). Retrieved 17 May 2011. -Jump up ^ "Shinty". Scottishsport.co.uk. Retrieved 28 April 2013. -Jump up ^ "Welsh dragon call for Union flag". BBC News. 27 November 2007. Retrieved 17 October 2008. -Jump up ^ "Britannia on British Coins". Chard. Retrieved 25 June 2006. -Jump up ^ Baker, Steve (2001). Picturing the Beast. University of Illinois Press. p. 52. ISBN 0-252-07030-5. -Further reading -Hitchens, Peter (2000). The Abolition of Britain: from Winston Churchill to Princess Diana. Second ed. San Francisco, Calif.: Encounter Books. xi, 332 p. ISBN 1-893554-18-X. -Lambert, Richard S. (1964). The Great Heritage: a History of Britain for Canadians. House of Grant, 1964 (and earlier editions and/or printings). -External links -Find more about -United Kingdom -at Wikipedia's sister projects -Search Wiktionary Definitions from Wiktionary -Search Commons Media from Commons -Search Wikinews News stories from Wikinews -Search Wikiquote Quotations from Wikiquote -Search Wikisource Source texts from Wikisource -Search Wikibooks Textbooks from Wikibooks -Search Wikivoyage Travel guide from Wikivoyage -Search Wikiversity Learning resources from Wikiversity -Government -Official website of HM Government -Official website of the British Monarchy -Official Yearbook of the United Kingdom statistics -The official site of the British Prime Minister's Office -General information -United Kingdom from the BBC News -United Kingdom entry at The World Factbook -United Kingdom from UCB Libraries GovPubs -United Kingdom at DMOZ -United Kingdom Encyclopædia Britannica entry -United Kingdom from the OECD -United Kingdom at the EU - Wikimedia Atlas of United Kingdom - Geographic data related to United Kingdom at OpenStreetMap -Key Development Forecasts for the United Kingdom from International Futures -Travel -Official tourist guide to Britain -[hide] v t e -United Kingdom topics -History -Chronology -Formation Georgian era Victorian era Edwardian era World War I Interwar World War II UK since 1945 (Postwar Britain) -By topic -Economic Empire Maritime Military -Geography -Administrative -Countries of the United Kingdom Crown dependencies Overseas territories City status Towns Former colonies -Physical -British Isles terminology Great Britain Geology Northern Ireland Lakes and lochs Mountains Rivers Volcanoes -Resources -Energy/Renewable energy Biodiesel Coal Geothermal Hydraulic frac. Hydroelectricity Marine North Sea oil Solar Wind Food Agriculture Fishing English Scottish Hunting Materials Flora Forestry Mining -Politics -Constitution Courts Elections Foreign relations Judiciary Law Law enforcement Legislation Monarchy monarchs Nationality Parliament House of Commons House of Lords Political parties -Government -Cabinet list Civil service Departments Prime Minister list -Military -Royal Navy Army Royal Air Force Weapons of mass destruction -Economy -Banks Bank of England Budget Economic geography Pound (currency) Stock Exchange Taxation Telecommunications Tourism Transport -Society -Affordability of housing Crime Demography Drug policy Education Ethnic groups Health care Immigration Languages Poverty Food banks Prostitution Public holidays Social care Social structure -Culture -Art Cinema Cuisine Identity Literature Media television Music Religion Sport Symbols Theatre -[show] -Countries of the United Kingdom -Outline Index -Book Category Portal WikiProject -[show] -Gnome-globe.svg Geographic locale -[show] v t e -Member states of the European Union -[show] -International organisations -[show] v t e -English-speaking world -[show] v t e -National personifications -Coordinates: 55°N 3°W -Categories: United KingdomBritish IslandsConstitutional monarchiesCountries in EuropeEnglish-speaking countries and territoriesG20 nationsG7 nationsG8 nationsIsland countriesLiberal democraciesMember states of NATOMember states of the Commonwealth of NationsMember states of the Council of EuropeMember states of the European UnionMember states of the Union for the MediterraneanMember states of the United NationsNorthern EuropeWestern Europe -Navigation menu -Create accountLog inArticleTalkReadView sourceView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -Адыгэбзэ -Afrikaans -Akan -Alemannisch -አማርኛ -Ænglisc -Аҧсшәа -العربية -Aragonés -ܐܪܡܝܐ -Armãneashti -Arpetan -Asturianu -Avañe'ẽ -Авар -Azərbaycanca -বাংলা -Bahasa Banjar -Bân-lâm-gú -Башҡортса -Беларуская -Беларуская (тарашкевіца)‎ -भोजपुरी -Bikol Central -Bislama -Български -Boarisch -བོད་ཡིག -Bosanski -Brezhoneg -Буряад -Català -Чӑвашла -Cebuano -Čeština -Chavacano de Zamboanga -ChiShona -Corsu -Cymraeg -Dansk -Deutsch -ދިވެހިބަސް -Diné bizaad -Dolnoserbski -ཇོང་ཁ -Eesti -Ελληνικά -Emiliàn e rumagnòl -Español -Esperanto -Estremeñu -Euskara -فارسی -Fiji Hindi -Føroyskt -Français -Frysk -Furlan -Gaeilge -Gaelg -Gagauz -Gàidhlig -Galego -贛語 -ગુજરાતી -客家語/Hak-kâ-ngî -Хальмг -한국어 -Hausa -Hawaii -Հայերեն -हिन्दी -Hornjoserbsce -Hrvatski -Ido -Igbo -Ilokano -বিষ্ণুপ্রিয়া মণিপুরী -Bahasa Indonesia -Interlingua -Interlingue -Ирон -IsiZulu -Íslenska -Italiano -עברית -Basa Jawa -Kalaallisut -ಕನ್ನಡ -Kapampangan -Къарачай-малкъар -ქართული -Kaszëbsczi -Қазақша -Kernowek -Kinyarwanda -Kiswahili -Коми -Kongo -Kreyòl ayisyen -Kurdî -Кыргызча -Кырык мары -Ladino -Лезги -ລາວ -Latgaļu -Latina -Latviešu -Lëtzebuergesch -Lietuvių -Ligure -Limburgs -Lingála -Lojban -Lumbaart -Magyar -Македонски -Malagasy -മലയാളം -Malti -Māori -मराठी -მარგალური -مصرى -مازِرونی -Bahasa Melayu -Mìng-dĕ̤ng-ngṳ̄ -Mirandés -Монгол -မြန်မာဘာသာ -Nāhuatl -Dorerin Naoero -Nederlands -Nedersaksies -नेपाली -नेपाल भाषा -日本語 -Napulitano -Нохчийн -Nordfriisk -Norfuk / Pitkern -Norsk bokmål -Norsk nynorsk -Nouormand -Novial -Occitan -Олык марий -ଓଡ଼ିଆ -Oromoo -Oʻzbekcha -ਪੰਜਾਬੀ -Pangasinan -پنجابی -Papiamentu -پښتو -Перем Коми -ភាសាខ្មែរ -Picard -Piemontèis -Tok Pisin -Plattdüütsch -Polski -Ποντιακά -Português -Qırımtatarca -Reo tahiti -Ripoarisch -Română -Romani -Rumantsch -Runa Simi -Русиньскый -Русский -Саха тыла -Sámegiella -संस्कृतम् -Sardu -Scots -Seeltersk -Shqip -Sicilianu -සිංහල -Simple English -SiSwati -Slovenčina -Slovenščina -Словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ -Ślůnski -Soomaaliga -کوردی -Sranantongo -Српски / srpski -Srpskohrvatski / српскохрватски -Basa Sunda -Suomi -Svenska -Tagalog -தமிழ் -Taqbaylit -Tarandíne -Татарча/tatarça -తెలుగు -Tetun -ไทย -Тоҷикӣ -ᏣᎳᎩ -Tsetsêhestâhese -Türkçe -Twi -Удмурт -ᨅᨔ ᨕᨘᨁᨗ -Українська -اردو -ئۇيغۇرچە / Uyghurche -Vahcuengh -Vèneto -Vepsän kel’ -Tiếng Việt -Volapük -Võro -Walon -文言 -West-Vlams -Winaray -Wolof -吴语 -ייִדיש -Yorùbá -粵語 -Zazaki -Zeêuws -Žemaitėška -中文 -Edit links -This page was last modified on 22 November 2014 at 11:19. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki - - -World Trade Organization -From Wikipedia, the free encyclopedia -"WTO" redirects here. For other uses, see WTO (disambiguation). -World Trade Organization (English) -Organisation mondiale du commerce (French) -Organización Mundial del Comercio (Spanish) -World Trade Organization (logo and wordmark).svg -Official logo of WTO -WTO members and observers.svg - Members - Members, dually represented by the EU - Observers - Non-members -Abbreviation WTO -Formation 1 January 1995; 19 years ago -Type International trade organization -Purpose Liberalize international trade -Headquarters Centre William Rappard, Geneva, Switzerland -Coordinates 46.12°N 6.09°ECoordinates: 46.12°N 6.09°E -Region served Worldwide -Membership 160 member states[1] -Official language English, French, Spanish[2] -Director-General Roberto Azevêdo -Budget 196 million Swiss francs (approx. 209 million US$) in 2011.[3] -Staff 640[4] -Website www.wto.org -The World Trade Organization (WTO) is an organization that intends to supervise and liberalize international trade. The organization officially commenced on 1 January 1995 under the Marrakech Agreement, replacing the General Agreement on Tariffs and Trade (GATT), which commenced in 1948.[5] The organization deals with regulation of trade between participating countries by providing a framework for negotiating and formalizing trade agreements and a dispute resolution process aimed at enforcing participants' adherence to WTO agreements, which are signed by representatives of member governments[6]:fol.9–10 and ratified by their parliaments.[7] Most of the issues that the WTO focuses on derive from previous trade negotiations, especially from the Uruguay Round (1986–1994). -The organization is attempting to complete negotiations on the Doha Development Round, which was launched in 2001 with an explicit focus on addressing the needs of developing countries. As of June 2012, the future of the Doha Round remained uncertain: the work programme lists 21 subjects in which the original deadline of 1 January 2005 was missed, and the round is still incomplete.[8] The conflict between free trade on industrial goods and services but retention of protectionism on farm subsidies to domestic agricultural sector (requested by developed countries) and the substantiation of the international liberalization of fair trade on agricultural products (requested by developing countries) remain the major obstacles. These points of contention have hindered any progress to launch new WTO negotiations beyond the Doha Development Round. As a result of this impasse, there has been an increasing number of bilateral free trade agreements signed.[9] As of July 2012, there were various negotiation groups in the WTO system for the current agricultural trade negotiation which is in the condition of stalemate.[10] -WTO's current Director-General is Roberto Azevêdo,[11][12] who leads a staff of over 600 people in Geneva, Switzerland.[13] A trade facilitation agreement known as the Bali Package was reached by all members on 7 December 2013, the first comprehensive agreement in the organization's history.[14][15] -Contents [hide] -1 History -1.1 GATT rounds of negotiations -1.1.1 From Geneva to Tokyo -1.1.2 Uruguay Round -1.2 Ministerial conferences -1.3 Doha Round (Doha Agenda) -2 Functions -3 Principles of the trading system -4 Organizational structure -5 Decision-making -6 Dispute settlement -7 Accession and membership -7.1 Accession process -7.2 Members and observers -8 Agreements -9 Office of director-general -9.1 List of directors-general -10 See also -11 Notes and references -12 External links -History - -The economists Harry White (left) and John Maynard Keynes at the Bretton Woods Conference. Both had been strong advocates of a central-controlled international trade environment and recommended the establishment of three institutions: the IMF (for fiscal and monetary issues); the World Bank (for financial and structural issues); and the ITO (for international economic cooperation).[16] -The WTO's predecessor, the General Agreement on Tariffs and Trade (GATT), was established after World War II in the wake of other new multilateral institutions dedicated to international economic cooperation – notably the Bretton Woods institutions known as the World Bank and the International Monetary Fund. A comparable international institution for trade, named the International Trade Organization was successfully negotiated. The ITO was to be a United Nations specialized agency and would address not only trade barriers but other issues indirectly related to trade, including employment, investment, restrictive business practices, and commodity agreements. But the ITO treaty was not approved by the U.S. and a few other signatories and never went into effect.[17][18][19] -In the absence of an international organization for trade, the GATT would over the years "transform itself" into a de facto international organization.[20] -GATT rounds of negotiations -See also: General Agreement on Tariffs and Trade -The GATT was the only multilateral instrument governing international trade from 1946 until the WTO was established on 1 January 1995.[21] Despite attempts in the mid-1950s and 1960s to create some form of institutional mechanism for international trade, the GATT continued to operate for almost half a century as a semi-institutionalized multilateral treaty regime on a provisional basis.[22] -From Geneva to Tokyo -Seven rounds of negotiations occurred under GATT. The first real GATT trade rounds concentrated on further reducing tariffs. Then, the Kennedy Round in the mid-sixties brought about a GATT anti-dumping Agreement and a section on development. The Tokyo Round during the seventies was the first major attempt to tackle trade barriers that do not take the form of tariffs, and to improve the system, adopting a series of agreements on non-tariff barriers, which in some cases interpreted existing GATT rules, and in others broke entirely new ground. Because these plurilateral agreements were not accepted by the full GATT membership, they were often informally called "codes". Several of these codes were amended in the Uruguay Round, and turned into multilateral commitments accepted by all WTO members. Only four remained plurilateral (those on government procurement, bovine meat, civil aircraft and dairy products), but in 1997 WTO members agreed to terminate the bovine meat and dairy agreements, leaving only two.[21] -Uruguay Round -Main article: Uruguay Round - -During the Doha Round, the US government blamed Brazil and India for being inflexible and the EU for impeding agricultural imports.[23] The then-President of Brazil, Luiz Inácio Lula da Silva (above right), responded to the criticisms by arguing that progress would only be achieved if the richest countries (especially the US and countries in the EU) made deeper cuts in agricultural subsidies and further opened their markets for agricultural goods.[24] -Well before GATT's 40th anniversary, its members concluded that the GATT system was straining to adapt to a new globalizing world economy.[25][26] In response to the problems identified in the 1982 Ministerial Declaration (structural deficiencies, spill-over impacts of certain countries' policies on world trade GATT could not manage etc.), the eighth GATT round – known as the Uruguay Round – was launched in September 1986, in Punta del Este, Uruguay.[25] -It was the biggest negotiating mandate on trade ever agreed: the talks were going to extend the trading system into several new areas, notably trade in services and intellectual property, and to reform trade in the sensitive sectors of agriculture and textiles; all the original GATT articles were up for review.[26] The Final Act concluding the Uruguay Round and officially establishing the WTO regime was signed 15 April 1994, during the ministerial meeting at Marrakesh, Morocco, and hence is known as the Marrakesh Agreement.[27] -The GATT still exists as the WTO's umbrella treaty for trade in goods, updated as a result of the Uruguay Round negotiations (a distinction is made between GATT 1994, the updated parts of GATT, and GATT 1947, the original agreement which is still the heart of GATT 1994).[25] GATT 1994 is not however the only legally binding agreement included via the Final Act at Marrakesh; a long list of about 60 agreements, annexes, decisions and understandings was adopted. The agreements fall into a structure with six main parts: -The Agreement Establishing the WTO -Goods and investment – the Multilateral Agreements on Trade in Goods including the GATT 1994 and the Trade Related Investment Measures (TRIMS) -Services — the General Agreement on Trade in Services -Intellectual property – the Agreement on Trade-Related Aspects of Intellectual Property Rights (TRIPS) -Dispute settlement (DSU) -Reviews of governments' trade policies (TPRM)[28] -In terms of the WTO's principle relating to tariff "ceiling-binding" (No. 3), the Uruguay Round has been successful in increasing binding commitments by both developed and developing countries, as may be seen in the percentages of tariffs bound before and after the 1986–1994 talks.[29] -Ministerial conferences - -The World Trade Organization Ministerial Conference of 1998, in the Palace of Nations (Geneva, Switzerland). -The highest decision-making body of the WTO is the Ministerial Conference, which usually meets every two years. It brings together all members of the WTO, all of which are countries or customs unions. The Ministerial Conference can take decisions on all matters under any of the multilateral trade agreements. The inaugural ministerial conference was held in Singapore in 1996. Disagreements between largely developed and developing economies emerged during this conference over four issues initiated by this conference, which led to them being collectively referred to as the "Singapore issues". The second ministerial conference was held in Geneva in Switzerland. The third conference in Seattle, Washington ended in failure, with massive demonstrations and police and National Guard crowd-control efforts drawing worldwide attention. The fourth ministerial conference was held in Doha in the Persian Gulf nation of Qatar. The Doha Development Round was launched at the conference. The conference also approved the joining of China, which became the 143rd member to join. The fifth ministerial conference was held in Cancún, Mexico, aiming at forging agreement on the Doha round. An alliance of 22 southern states, the G20 developing nations (led by India, China,[30] Brazil, ASEAN led by the Philippines), resisted demands from the North for agreements on the so-called "Singapore issues" and called for an end to agricultural subsidies within the EU and the US. The talks broke down without progress. -The sixth WTO ministerial conference was held in Hong Kong from 13–18 December 2005. It was considered vital if the four-year-old Doha Development Round negotiations were to move forward sufficiently to conclude the round in 2006. In this meeting, countries agreed to phase out all their agricultural export subsidies by the end of 2013, and terminate any cotton export subsidies by the end of 2006. Further concessions to developing countries included an agreement to introduce duty-free, tariff-free access for goods from the Least Developed Countries, following the Everything but Arms initiative of the European Union — but with up to 3% of tariff lines exempted. Other major issues were left for further negotiation to be completed by the end of 2010. The WTO General Council, on 26 May 2009, agreed to hold a seventh WTO ministerial conference session in Geneva from 30 November-3 December 2009. A statement by chairman Amb. Mario Matus acknowledged that the prime purpose was to remedy a breach of protocol requiring two-yearly "regular" meetings, which had lapsed with the Doha Round failure in 2005, and that the "scaled-down" meeting would not be a negotiating session, but "emphasis will be on transparency and open discussion rather than on small group processes and informal negotiating structures". The general theme for discussion was "The WTO, the Multilateral Trading System and the Current Global Economic Environment"[31] -Doha Round (Doha Agenda) -Main article: Doha Development Round - -The Doha Development Round started in 2001 is at an impasse. -The WTO launched the current round of negotiations, the Doha Development Round, at the fourth ministerial conference in Doha, Qatar in November 2001. This was to be an ambitious effort to make globalization more inclusive and help the world's poor, particularly by slashing barriers and subsidies in farming.[32] The initial agenda comprised both further trade liberalization and new rule-making, underpinned by commitments to strengthen substantial assistance to developing countries.[33] -The negotiations have been highly contentious. Disagreements still continue over several key areas including agriculture subsidies, which emerged as critical in July 2006.[34] According to a European Union statement, "The 2008 Ministerial meeting broke down over a disagreement between exporters of agricultural bulk commodities and countries with large numbers of subsistence farmers on the precise terms of a 'special safeguard measure' to protect farmers from surges in imports."[35] The position of the European Commission is that "The successful conclusion of the Doha negotiations would confirm the central role of multilateral liberalisation and rule-making. It would confirm the WTO as a powerful shield against protectionist backsliding."[33] An impasse remains and, as of August 2013, agreement has not been reached, despite intense negotiations at several ministerial conferences and at other sessions. On 27 March 2013, the chairman of agriculture talks announced "a proposal to loosen price support disciplines for developing countries’ public stocks and domestic food aid." He added: “...we are not yet close to agreement—in fact, the substantive discussion of the proposal is only beginning.”[36] -[show]v · t · eGATT and WTO trade rounds[37] -Functions -Among the various functions of the WTO, these are regarded by analysts as the most important: -It oversees the implementation, administration and operation of the covered agreements.[38][39] -It provides a forum for negotiations and for settling disputes.[40][41] -Additionally, it is the WTO's duty to review and propagate the national trade policies, and to ensure the coherence and transparency of trade policies through surveillance in global economic policy-making.[39][41] Another priority of the WTO is the assistance of developing, least-developed and low-income countries in transition to adjust to WTO rules and disciplines through technical cooperation and training.[42] -(i) The WTO shall facilitate the implementation, administration and operation and further the objec­tives of this Agreement and of the Multilateral Trade Agreements, and shall also provide the frame work for the implementation, administration and operation of the multilateral Trade Agreements. -(ii) The WTO shall provide the forum for negotiations among its members concerning their multilateral trade relations in matters dealt with under the Agreement in the Annexes to this Agreement. -(iii) The WTO shall administer the Understanding on Rules and Procedures Governing the Settlement of Disputes. -(iv) The WTO shall administer Trade Policy Review Mechanism. -(v) With a view to achieving greater coherence in global economic policy making, the WTO shall cooperate, as appropriate, with the international Monetary Fund (IMF) and with the International Bank for Reconstruction and Development (IBRD) and its affiliated agencies. [43] -The above five listings are the additional functions of the World Trade Organization. As globalization proceeds in today's society, the necessity of an International Organization to manage the trading systems has been of vital importance. As the trade volume increases, issues such as protectionism, trade barriers, subsidies, violation of intellectual property arise due to the differences in the trading rules of every nation. The World Trade Organization serves as the mediator between the nations when such problems arise. WTO could be referred to as the product of globalization and also as one of the most important organizations in today's globalized society. -The WTO is also a center of economic research and analysis: regular assessments of the global trade picture in its annual publications and research reports on specific topics are produced by the organization.[44] Finally, the WTO cooperates closely with the two other components of the Bretton Woods system, the IMF and the World Bank.[40] -Principles of the trading system -The WTO establishes a framework for trade policies; it does not define or specify outcomes. That is, it is concerned with setting the rules of the trade policy games.[45] Five principles are of particular importance in understanding both the pre-1994 GATT and the WTO: -Non-discrimination. It has two major components: the most favoured nation (MFN) rule, and the national treatment policy. Both are embedded in the main WTO rules on goods, services, and intellectual property, but their precise scope and nature differ across these areas. The MFN rule requires that a WTO member must apply the same conditions on all trade with other WTO members, i.e. a WTO member has to grant the most favorable conditions under which it allows trade in a certain product type to all other WTO members.[45] "Grant someone a special favour and you have to do the same for all other WTO members."[29] National treatment means that imported goods should be treated no less favorably than domestically produced goods (at least after the foreign goods have entered the market) and was introduced to tackle non-tariff barriers to trade (e.g. technical standards, security standards et al. discriminating against imported goods).[45] -Reciprocity. It reflects both a desire to limit the scope of free-riding that may arise because of the MFN rule, and a desire to obtain better access to foreign markets. A related point is that for a nation to negotiate, it is necessary that the gain from doing so be greater than the gain available from unilateral liberalization; reciprocal concessions intend to ensure that such gains will materialise.[46] -Binding and enforceable commitments. The tariff commitments made by WTO members in a multilateral trade negotiation and on accession are enumerated in a schedule (list) of concessions. These schedules establish "ceiling bindings": a country can change its bindings, but only after negotiating with its trading partners, which could mean compensating them for loss of trade. If satisfaction is not obtained, the complaining country may invoke the WTO dispute settlement procedures.[29][46] -Transparency. The WTO members are required to publish their trade regulations, to maintain institutions allowing for the review of administrative decisions affecting trade, to respond to requests for information by other members, and to notify changes in trade policies to the WTO. These internal transparency requirements are supplemented and facilitated by periodic country-specific reports (trade policy reviews) through the Trade Policy Review Mechanism (TPRM).[47] The WTO system tries also to improve predictability and stability, discouraging the use of quotas and other measures used to set limits on quantities of imports.[29] -Safety valves. In specific circumstances, governments are able to restrict trade. The WTO's agreements permit members to take measures to protect not only the environment but also public health, animal health and plant health.[48] -There are three types of provision in this direction: -articles allowing for the use of trade measures to attain non-economic objectives; -articles aimed at ensuring "fair competition"; members must not use environmental protection measures as a means of disguising protectionist policies.[48] -provisions permitting intervention in trade for economic reasons.[47] -Exceptions to the MFN principle also allow for preferential treatment of developing countries, regional free trade areas and customs unions.[6]:fol.93 -Organizational structure -The General Council has the following subsidiary bodies which oversee committees in different areas: -Council for Trade in Goods -There are 11 committees under the jurisdiction of the Goods Council each with a specific task. All members of the WTO participate in the committees. The Textiles Monitoring Body is separate from the other committees but still under the jurisdiction of Goods Council. The body has its own chairman and only 10 members. The body also has several groups relating to textiles.[49] -Council for Trade-Related Aspects of Intellectual Property Rights -Information on intellectual property in the WTO, news and official records of the activities of the TRIPS Council, and details of the WTO's work with other international organizations in the field.[50] -Council for Trade in Services -The Council for Trade in Services operates under the guidance of the General Council and is responsible for overseeing the functioning of the General Agreement on Trade in Services (GATS). It is open to all WTO members, and can create subsidiary bodies as required.[51] -Trade Negotiations Committee -The Trade Negotiations Committee (TNC) is the committee that deals with the current trade talks round. The chair is WTO's director-general. As of June 2012 the committee was tasked with the Doha Development Round.[52] -The Service Council has three subsidiary bodies: financial services, domestic regulations, GATS rules and specific commitments.[49] The council has several different committees, working groups, and working parties.[53] There are committees on the following: Trade and Environment; Trade and Development (Subcommittee on Least-Developed Countries); Regional Trade Agreements; Balance of Payments Restrictions; and Budget, Finance and Administration. There are working parties on the following: Accession. There are working groups on the following: Trade, debt and finance; and Trade and technology transfer. -Decision-making -The WTO describes itself as "a rules-based, member-driven organization — all decisions are made by the member governments, and the rules are the outcome of negotiations among members".[54] The WTO Agreement foresees votes where consensus cannot be reached, but the practice of consensus dominates the process of decision-making.[55] -Richard Harold Steinberg (2002) argues that although the WTO's consensus governance model provides law-based initial bargaining, trading rounds close through power-based bargaining favouring Europe and the U.S., and may not lead to Pareto improvement.[56] -Dispute settlement -Main article: Dispute settlement in the WTO -In 1994, the WTO members agreed on the Understanding on Rules and Procedures Governing the Settlement of Disputes (DSU) annexed to the "Final Act" signed in Marrakesh in 1994.[57] Dispute settlement is regarded by the WTO as the central pillar of the multilateral trading system, and as a "unique contribution to the stability of the global economy".[58] WTO members have agreed that, if they believe fellow-members are violating trade rules, they will use the multilateral system of settling disputes instead of taking action unilaterally.[59] -The operation of the WTO dispute settlement process involves the DSB panels, the Appellate Body, the WTO Secretariat, arbitrators, independent experts and several specialized institutions.[60] Bodies involved in the dispute settlement process, World Trade Organization. -Accession and membership -Main article: World Trade Organization accession and membership -The process of becoming a WTO member is unique to each applicant country, and the terms of accession are dependent upon the country's stage of economic development and current trade regime.[61] The process takes about five years, on average, but it can last more if the country is less than fully committed to the process or if political issues interfere. The shortest accession negotiation was that of the Kyrgyz Republic, while the longest was that of Russia, which, having first applied to join GATT in 1993, was approved for membership in December 2011 and became a WTO member on 22 August 2012.[62] The second longest was that of Vanuatu, whose Working Party on the Accession of Vanuatu was established on 11 July 1995. After a final meeting of the Working Party in October 2001, Vanuatu requested more time to consider its accession terms. In 2008, it indicated its interest to resume and conclude its WTO accession. The Working Party on the Accession of Vanuatu was reconvened informally on 4 April 2011 to discuss Vanuatu's future WTO membership. The re-convened Working Party completed its mandate on 2 May 2011. The General Council formally approved the Accession Package of Vanuatu on 26 October 2011. On 24 August 2012, the WTO welcomed Vanuatu as its 157th member.[63] An offer of accession is only given once consensus is reached among interested parties.[64] -Accession process - -WTO accession progress: - Members (including dual-representation with the European Union) - Draft Working Party Report or Factual Summary adopted - Goods and/or Services offers submitted - Memorandum on Foreign Trade Regime (FTR) submitted - Observer, negotiations to start later or no Memorandum on FTR submitted - Frozen procedures or no negotiations in the last 3 years - No official interaction with the WTO -A country wishing to accede to the WTO submits an application to the General Council, and has to describe all aspects of its trade and economic policies that have a bearing on WTO agreements.[65] The application is submitted to the WTO in a memorandum which is examined by a working party open to all interested WTO Members.[66] -After all necessary background information has been acquired, the working party focuses on issues of discrepancy between the WTO rules and the applicant's international and domestic trade policies and laws. The working party determines the terms and conditions of entry into the WTO for the applicant nation, and may consider transitional periods to allow countries some leeway in complying with the WTO rules.[61] -The final phase of accession involves bilateral negotiations between the applicant nation and other working party members regarding the concessions and commitments on tariff levels and market access for goods and services. The new member's commitments are to apply equally to all WTO members under normal non-discrimination rules, even though they are negotiated bilaterally.[65] -When the bilateral talks conclude, the working party sends to the general council or ministerial conference an accession package, which includes a summary of all the working party meetings, the Protocol of Accession (a draft membership treaty), and lists ("schedules") of the member-to-be's commitments. Once the general council or ministerial conference approves of the terms of accession, the applicant's parliament must ratify the Protocol of Accession before it can become a member.[67] Some countries may have faced tougher and a much longer accession process due to challenges during negotiations with other WTO members, such as Vietnam, whose negotiations took more than 11 years before it became official member in January 2007.[68] -Members and observers -The WTO has 160 members and 24 observer governments.[69] In addition to states, the European Union is a member. WTO members do not have to be full sovereign nation-members. Instead, they must be a customs territory with full autonomy in the conduct of their external commercial relations. Thus Hong Kong has been a member since 1995 (as "Hong Kong, China" since 1997) predating the People's Republic of China, which joined in 2001 after 15 years of negotiations. The Republic of China (Taiwan) acceded to the WTO in 2002 as "Separate Customs Territory of Taiwan, Penghu, Kinmen and Matsu" (Chinese Taipei) despite its disputed status.[70] The WTO Secretariat omits the official titles (such as Counselor, First Secretary, Second Secretary and Third Secretary) of the members of Chinese Taipei's Permanent Mission to the WTO, except for the titles of the Permanent Representative and the Deputy Permanent Representative.[71] -As of 2007, WTO member states represented 96.4% of global trade and 96.7% of global GDP.[72] Iran, followed by Algeria, are the economies with the largest GDP and trade outside the WTO, using 2005 data.[73][74] With the exception of the Holy See, observers must start accession negotiations within five years of becoming observers. A number of international intergovernmental organizations have also been granted observer status to WTO bodies.[75] 14 UN member states have no official affiliation with the WTO. -Agreements -Further information: Uruguay Round -The WTO oversees about 60 different agreements which have the status of international legal texts. Member countries must sign and ratify all WTO agreements on accession.[76] A discussion of some of the most important agreements follows. The Agreement on Agriculture came into effect with the establishment of the WTO at the beginning of 1995. The AoA has three central concepts, or "pillars": domestic support, market access and export subsidies. The General Agreement on Trade in Services was created to extend the multilateral trading system to service sector, in the same way as the General Agreement on Tariffs and Trade (GATT) provided such a system for merchandise trade. The agreement entered into force in January 1995. The Agreement on Trade-Related Aspects of Intellectual Property Rights sets down minimum standards for many forms of intellectual property (IP) regulation. It was negotiated at the end of the Uruguay Round of the General Agreement on Tariffs and Trade (GATT) in 1994.[77] -The Agreement on the Application of Sanitary and Phytosanitary Measures—also known as the SPS Agreement—was negotiated during the Uruguay Round of GATT, and entered into force with the establishment of the WTO at the beginning of 1995. Under the SPS agreement, the WTO sets constraints on members' policies relating to food safety (bacterial contaminants, pesticides, inspection and labelling) as well as animal and plant health (imported pests and diseases). The Agreement on Technical Barriers to Trade is an international treaty of the World Trade Organization. It was negotiated during the Uruguay Round of the General Agreement on Tariffs and Trade, and entered into force with the establishment of the WTO at the end of 1994. The object ensures that technical negotiations and standards, as well as testing and certification procedures, do not create unnecessary obstacles to trade".[78] The Agreement on Customs Valuation, formally known as the Agreement on Implementation of Article VII of GATT, prescribes methods of customs valuation that Members are to follow. Chiefly, it adopts the "transaction value" approach. -In December 2013, the biggest agreement within the WTO was signed and known as the Bali Package.[79] -Office of director-general - -The headquarters of the World Trade Organization, in Geneva, Switzerland. -The procedures for the appointment of the WTO director-general were published in January 2003.[80] Additionally, there are four deputy directors-general. As of 1 October 2013, under director-general Roberto Azevêdo, the four deputy directors-general are Yi Xiaozhun of China, Karl-Ernst Brauner of Germany, Yonov Frederick Agah of Nigeria and David Shark of the United States.[81] -List of directors-general -Source: Official website[82] -Brazil Roberto Azevedo, 2013– -France Pascal Lamy, 2005–2013 -Thailand Supachai Panitchpakdi, 2002–2005 -New Zealand Mike Moore, 1999–2002 -Italy Renato Ruggiero, 1995–1999 -Republic of Ireland Peter Sutherland, 1995 -(Heads of the precursor organization, GATT): -Republic of Ireland Peter Sutherland, 1993–1995 -Switzerland Arthur Dunkel, 1980–1993 -Switzerland Olivier Long, 1968–1980 -United Kingdom Eric Wyndham White, 1948–1968 -See also -Agreement on Trade Related Investment Measures (TRIMS) -Agreement on Trade-Related Aspects of Intellectual Property Rights (TRIPS) -Aide-mémoire non-paper -Anti-globalization movement -Criticism of the World Trade Organization -Foreign Affiliate Trade Statistics -Global administrative law -Globality -Information Technology Agreement -International Trade Centre -Labour Standards in the World Trade Organisation -List of member states of the World Trade Organization -North American Free Trade Agreement (NAFTA) -Subsidy -Swiss Formula -Trade bloc -Washington Consensus -World Trade Report -World Trade Organization Ministerial Conference of 1999 protest activity -China and the World Trade Organization -Notes and references -Jump up ^ Members and Observers at WTO official website -Jump up ^ Languages, Documentation and Information Management Division at WTO official site -Jump up ^ "WTO Secretariat budget for 2011". WTO official site. Retrieved 25 August 2008. -Jump up ^ Understanding the WTO: What We Stand For_ Fact File -Jump up ^ World Trade Organization - UNDERSTANDING THE WTO: BASICS -^ Jump up to: a b Understanding the WTO Handbook at WTO official website. (Note that the document's printed folio numbers do not match the pdf page numbers.) -Jump up ^ Malanczuk, P. (1999). "International Organisations and Space Law: World Trade Organization". Encyclopaedia Britannica 442. p. 305. Bibcode:1999ESASP.442..305M. -Jump up ^ Understanding the WTO: The Doha Agenda -Jump up ^ The Challenges to the World Trade Organization: It’s All About Legitimacy THE BROOKINGS INSTITUTION, Policy Paper 2011-04 -Jump up ^ GROUPS IN THE WTO Updated 1 July 2013 -Jump up ^ Bourcier, Nicolas (21 May 2013). "Roberto Azevedo's WTO appointment gives Brazil a seat at the top table". Guardian Weekly. Retrieved 2 September 2013. -Jump up ^ "Roberto Azevêdo takes over". WTO official website. 1 September 2013. Retrieved 2 September 2013. -Jump up ^ "Overview of the WTO Secretariat". WTO official website. Retrieved 2 September 2013. -Jump up ^ Ninth WTO Ministerial Conference | WTO - MC9 -Jump up ^ BBC News - WTO agrees global trade deal worth $1tn -Jump up ^ A.E. Eckes Jr., US Trade History, 73 -* A. Smithies, Reflections on the Work of Keynes, 578–601 -* N. Warren, Internet and Globalization, 193 -Jump up ^ P. van den Bossche, The Law and Policy of the World Trade Organization, 80 -Jump up ^ Palmeter-Mavroidis, Dispute Settlement, 2 -Jump up ^ Fergusson, Ian F. (9 May 2007). "The World Trade Organization: Background and Issues" (PDF). Congressional Research Service. p. 4. Retrieved 15 August 2008. -Jump up ^ It was contemplated that the GATT would be applied for several years until the ITO came into force. However, since the ITO was never brought into being, the GATT gradually became the focus for international governmental cooperation on trade matters with economist Nicholas Halford overseeing the implementation of GATT in members policies. (P. van den Bossche, The Law and Policy of the World Trade Organization, 81; J.H. Jackson, Managing the Trading System, 134). -^ Jump up to: a b The GATT Years: from Havana to Marrakesh, WTO official site -Jump up ^ Footer, M. E. Analysis of the World Trade Organization, 17 -Jump up ^ B.S. Klapper, With a "Short Window" -Jump up ^ Lula, Time to Get Serious about Agricultural Subsidies -^ Jump up to: a b c P. Gallagher, The First Ten Years of the WTO, 4 -^ Jump up to: a b The Uruguay Round, WTO official site -Jump up ^ "Legal texts – Marrakesh agreement". WTO. Retrieved 30 May 2010. -Jump up ^ Overview: a Navigational Guide, WTO official site. For the complete list of "The Uruguay Round Agreements", see WTO legal texts, WTO official site, and Uruguay Round Agreements, Understandings, Decisions and Declarations, WorldTradeLaw.net -^ Jump up to: a b c d Principles of the Trading System, WTO official site -Jump up ^ "Five Years of China WTO Membership. EU and US Perspectives about China's Compliance with Transparency Commitments and the Transitional Review Mechanism". Papers.ssrn.com. Retrieved 30 May 2010. -Jump up ^ WTO to hold 7th Ministerial Conference on 30 November-2 December 2009 WTO official website -Jump up ^ "In the twilight of Doha". The Economist (The Economist): 65. 27 July 2006. -^ Jump up to: a b European Commission The Doha Round -Jump up ^ Fergusson, Ian F. (18 January 2008). "World Trade Organization Negotiations: The Doha Development Agenda" (PDF). Congressional Research Service. Retrieved 13 April 2012. Page 9 (folio CRS-6) -Jump up ^ WTO trade negotiations: Doha Development Agenda Europa press release, 31 October 2011 -Jump up ^ "Members start negotiating proposal on poor countries’ food stockholding". WTO official website. 27 March 2013. Retrieved 2 September 2013. -Jump up ^ a)The GATT years: from Havana to Marrakesh, World Trade Organization -b)Timeline: World Trade Organization – A chronology of key events, BBC News -c)Brakman-Garretsen-Marrewijk-Witteloostuijn, Nations and Firms in the Global Economy, Chapter 10: Trade and Capital Restriction -Jump up ^ Functions of the WTO, IISD -^ Jump up to: a b Main Functions, WTO official site -^ Jump up to: a b A Bredimas, International Economic Law, II, 17 -^ Jump up to: a b C. Deere, Decision-making in the WTO: Medieval or Up-to-Date? -Jump up ^ WTO Assistance for Developing Countries[dead link], WTO official site -Jump up ^ Sinha, Aparijita. [1]. "What are the functions and objectives of the WTO?". Retrieved on 13 April, 2014. -Jump up ^ Economic research and analysis, WTO official site -^ Jump up to: a b c B. Hoekman, The WTO: Functions and Basic Principles, 42 -^ Jump up to: a b B. Hoekman, The WTO: Functions and Basic Principles, 43 -^ Jump up to: a b B. Hoekman, The WTO: Functions and Basic Principles, 44 -^ Jump up to: a b Understanding the WTO: What we stand for -^ Jump up to: a b "Fourth level: down to the nitty-gritty". WTO official site. Retrieved 18 August 2008. -Jump up ^ "Intellectual property – overview of TRIPS Agreement". Wto.org. 15 April 1994. Retrieved 30 May 2010. -Jump up ^ "The Services Council, its Committees and other subsidiary bodies". WTO official site. Retrieved 14 August 2008. -Jump up ^ "The Trade Negotiations Committee". WTO official site. Retrieved 14 August 2008. -Jump up ^ "WTO organization chart". WTO official site. Retrieved 14 August 2008. -Jump up ^ Decision-making at WTO official site -Jump up ^ Decision-Making in the World Trade Organization Abstract from Journal of International Economic Law at Oxford Journals -Jump up ^ Steinberg, Richard H. "In the Shadow of Law or Power? Consensus-based Bargaining and Outcomes in the GATT/WTO." International Organization. Spring 2002. pp. 339–374. -Jump up ^ Stewart-Dawyer, The WTO Dispute Settlement System, 7 -Jump up ^ S. Panitchpakdi, The WTO at ten, 8. -Jump up ^ Settling Disputes:a Unique Contribution, WTO official site -Jump up ^ "Disputes – Dispute Settlement CBT – WTO Bodies involved in the dispute settlement process – The Dispute Settlement Body (DSB) – Page 1". WTO. 25 July 1996. Retrieved 21 May 2011. -^ Jump up to: a b Accessions Summary, Center for International Development -Jump up ^ Ministerial Conference approves Russia's WTO membership WTO News Item, 16 December 2011 -Jump up ^ Accession status: Vanuatu. WTO. Retrieved on 12 July 2013. -Jump up ^ C. Michalopoulos, WTO Accession, 64 -^ Jump up to: a b Membership, Alliances and Bureaucracy, WTO official site -Jump up ^ C. Michalopoulos, WTO Accession, 62–63 -Jump up ^ How to Become a Member of the WTO, WTO official site -Jump up ^ Napier, Nancy K.; Vuong, Quan Hoang (2013). What we see, why we worry, why we hope: Vietnam going forward. Boise, ID, USA: Boise State University CCI Press. p. 140. ISBN 978-0985530587. -Jump up ^ "Members and Observers". World Trade Organization. 24 August 2012. -Jump up ^ Jackson, J. H. Sovereignty, 109 -Jump up ^ ROC Government Publication -Jump up ^ "Accession in perspective". World Trade Organization. Retrieved 22 December 2013. -Jump up ^ "ANNEX 1. STATISTICAL SURVEY". World Trade Organization. 2005. Retrieved 22 December 2013. -Jump up ^ Arjomandy, Danial (21 November 2013). "Iranian Membership in the World Trade Organization: An Unclear Future". Iranian Studies. Retrieved 22 December 2013. -Jump up ^ International intergovernmental organizations granted observer status to WTO bodies at WTO official website -Jump up ^ "Legal texts – the WTO agreements". WTO. Retrieved 30 May 2010. -Jump up ^ Understanding the WTO - Intellectual property: protection and enforcement. WTO. Retrieved on 29 July 2013. -Jump up ^ "A Summary of the Final Act of the Uruguay Round". Wto.org. Retrieved 30 May 2010. -Jump up ^ Zarocostas, John (7 December 2013). "Global Trade Deal Reached". WWD. Retrieved 8 December 2013. -Jump up ^ "WT/L/509". WTO. Retrieved 18 February 2013. -Jump up ^ "Director-General Elect Azevêdo announces his four Deputy Directors-General". 17 August 2013. Retrieved 2 September 2013. -Jump up ^ "Previous GATT and WTO Directors-General". WTO. Retrieved 21 May 2011. -External links - Wikiquote has quotations related to: World Trade Organization - Wikimedia Commons has media related to World Trade Organization. -Official pages -Official WTO homepage -WTO 10th Anniversary PDF (1.40 MB) — Highlights of the first decade, Annual Report 2005 pages 116–166 -Glossary of terms—a guide to 'WTO-speak' -International Trade Centre — joint UN/WTO agency -Government pages on the WTO -European Union position on the WTO -Media pages on the WTO -World Trade Organization -BBC News — Profile: WTO -Guardian Unlimited — Special Report: The World Trade Organisation ongoing coverage -Non-governmental organization pages on the WTO -Gatt.org — Parody of official WTO page by The Yes Men -Public Citizen -Transnational Institute: Beyond the WTO -[show] v t e -World Trade Organization -[show] v t e -International trade -[show] v t e -International organizations -Authority control -WorldCat VIAF: 149937768 LCCN: no94018277 ISNI: 0000 0001 2296 2735 GND: 2145784-0 SELIBR: 135910 ULAN: 500292980 NDL: 00577475 NKC: kn20010711437 BNE: XX4574846 -Categories: World Trade OrganizationInternational tradeInternational trade organizationsOrganisations based in GenevaOrganizations established in 1995World government -Navigation menu -Create accountLog inArticleTalkReadView sourceView history - -Main page -Contents -Featured content -Current events -Random article -Donate to Wikipedia -Wikimedia Shop -Interaction -Help -About Wikipedia -Community portal -Recent changes -Contact page -Tools -What links here -Related changes -Upload file -Special pages -Permanent link -Page information -Wikidata item -Cite this page -Print/export -Create a book -Download as PDF -Printable version -Languages -Afrikaans -العربية -Aragonés -Asturianu -Azərbaycanca -বাংলা -Bân-lâm-gú -Беларуская -Беларуская (тарашкевіца)‎ -Български -Bosanski -Brezhoneg -Català -Čeština -Cymraeg -Dansk -Deutsch -Eesti -Ελληνικά -Español -Esperanto -Euskara -فارسی -Fiji Hindi -Føroyskt -Français -Frysk -Galego -ગુજરાતી -客家語/Hak-kâ-ngî -한국어 -Հայերեն -हिन्दी -Hrvatski -Ido -Ilokano -Bahasa Indonesia -Íslenska -Italiano -עברית -Basa Jawa -ಕನ್ನಡ -Къарачай-малкъар -ქართული -Қазақша -Kiswahili -Latina -Latviešu -Lietuvių -Magyar -Македонски -മലയാളം -मराठी -مصرى -Bahasa Melayu -Baso Minangkabau -မြန်မာဘာသာ -Nederlands -नेपाली -नेपाल भाषा -日本語 -Нохчийн -Norsk bokmål -Norsk nynorsk -Occitan -Oʻzbekcha -ਪੰਜਾਬੀ -پنجابی -پښتو -ភាសាខ្មែរ -Piemontèis -Polski -Português -Română -Русиньскый -Русский -Саха тыла -Shqip -සිංහල -Simple English -Slovenčina -Slovenščina -کوردی -Српски / srpski -Srpskohrvatski / српскохрватски -Suomi -Svenska -Tagalog -தமிழ் -Татарча/tatarça -తెలుగు -ไทย -Тоҷикӣ -Türkçe -Türkmençe -Українська -اردو -ئۇيغۇرچە / Uyghurche -Tiếng Việt -Winaray -ייִדיש -Yorùbá -粵語 -Žemaitėška -中文 -Edit links -This page was last modified on 22 November 2014 at 14:33. -Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. -Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersMobile viewWikimedia Foundation Powered by MediaWiki \ No newline at end of file diff --git a/vendor/github.com/blevesearch/bleve/search/query/query_string.y b/vendor/github.com/blevesearch/bleve/search/query/query_string.y deleted file mode 100644 index d3e5ac9d7e..0000000000 --- a/vendor/github.com/blevesearch/bleve/search/query/query_string.y +++ /dev/null @@ -1,328 +0,0 @@ -%{ -package query -import ( - "fmt" - "strconv" - "strings" - "time" -) - -func logDebugGrammar(format string, v ...interface{}) { - if debugParser { - logger.Printf(format, v...) - } -} -%} - -%union { -s string -n int -f float64 -q Query -pf *float64} - -%token tSTRING tPHRASE tPLUS tMINUS tCOLON tBOOST tNUMBER tSTRING tGREATER tLESS -tEQUAL tTILDE - -%type tSTRING -%type tPHRASE -%type tNUMBER -%type posOrNegNumber -%type tTILDE -%type tBOOST -%type searchBase -%type searchSuffix -%type searchPrefix - -%% - -input: -searchParts { - logDebugGrammar("INPUT") -}; - -searchParts: -searchPart searchParts { - logDebugGrammar("SEARCH PARTS") -} -| -searchPart { - logDebugGrammar("SEARCH PART") -}; - -searchPart: -searchPrefix searchBase searchSuffix { - query := $2 - if $3 != nil { - if query, ok := query.(BoostableQuery); ok { - query.SetBoost(*$3) - } - } - switch($1) { - case queryShould: - yylex.(*lexerWrapper).query.AddShould(query) - case queryMust: - yylex.(*lexerWrapper).query.AddMust(query) - case queryMustNot: - yylex.(*lexerWrapper).query.AddMustNot(query) - } -}; - - -searchPrefix: -/* empty */ { - $$ = queryShould -} -| -tPLUS { - logDebugGrammar("PLUS") - $$ = queryMust -} -| -tMINUS { - logDebugGrammar("MINUS") - $$ = queryMustNot -}; - -searchBase: -tSTRING { - str := $1 - logDebugGrammar("STRING - %s", str) - var q FieldableQuery - if strings.HasPrefix(str, "/") && strings.HasSuffix(str, "/") { - q = NewRegexpQuery(str[1:len(str)-1]) - } else if strings.ContainsAny(str, "*?"){ - q = NewWildcardQuery(str) - } else { - q = NewMatchQuery(str) - } - $$ = q -} -| -tSTRING tTILDE { - str := $1 - fuzziness, err := strconv.ParseFloat($2, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid fuzziness value: %v", err)) - } - logDebugGrammar("FUZZY STRING - %s %f", str, fuzziness) - q := NewMatchQuery(str) - q.SetFuzziness(int(fuzziness)) - $$ = q -} -| -tSTRING tCOLON tSTRING tTILDE { - field := $1 - str := $3 - fuzziness, err := strconv.ParseFloat($4, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid fuzziness value: %v", err)) - } - logDebugGrammar("FIELD - %s FUZZY STRING - %s %f", field, str, fuzziness) - q := NewMatchQuery(str) - q.SetFuzziness(int(fuzziness)) - q.SetField(field) - $$ = q -} -| -tNUMBER { - str := $1 - logDebugGrammar("STRING - %s", str) - q1 := NewMatchQuery(str) - val, err := strconv.ParseFloat($1, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - inclusive := true - q2 := NewNumericRangeInclusiveQuery(&val, &val, &inclusive, &inclusive) - q := NewDisjunctionQuery([]Query{q1,q2}) - q.queryStringMode = true - $$ = q -} -| -tPHRASE { - phrase := $1 - logDebugGrammar("PHRASE - %s", phrase) - q := NewMatchPhraseQuery(phrase) - $$ = q -} -| -tSTRING tCOLON tSTRING { - field := $1 - str := $3 - logDebugGrammar("FIELD - %s STRING - %s", field, str) - var q FieldableQuery - if strings.HasPrefix(str, "/") && strings.HasSuffix(str, "/") { - q = NewRegexpQuery(str[1:len(str)-1]) - } else if strings.ContainsAny(str, "*?"){ - q = NewWildcardQuery(str) - } else { - q = NewMatchQuery(str) - } - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON posOrNegNumber { - field := $1 - str := $3 - logDebugGrammar("FIELD - %s STRING - %s", field, str) - q1 := NewMatchQuery(str) - q1.SetField(field) - val, err := strconv.ParseFloat($3, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - inclusive := true - q2 := NewNumericRangeInclusiveQuery(&val, &val, &inclusive, &inclusive) - q2.SetField(field) - q := NewDisjunctionQuery([]Query{q1,q2}) - q.queryStringMode = true - $$ = q -} -| -tSTRING tCOLON tPHRASE { - field := $1 - phrase := $3 - logDebugGrammar("FIELD - %s PHRASE - %s", field, phrase) - q := NewMatchPhraseQuery(phrase) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tGREATER posOrNegNumber { - field := $1 - min, err := strconv.ParseFloat($4, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - minInclusive := false - logDebugGrammar("FIELD - GREATER THAN %f", min) - q := NewNumericRangeInclusiveQuery(&min, nil, &minInclusive, nil) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tGREATER tEQUAL posOrNegNumber { - field := $1 - min, err := strconv.ParseFloat($5, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - minInclusive := true - logDebugGrammar("FIELD - GREATER THAN OR EQUAL %f", min) - q := NewNumericRangeInclusiveQuery(&min, nil, &minInclusive, nil) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tLESS posOrNegNumber { - field := $1 - max, err := strconv.ParseFloat($4, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - maxInclusive := false - logDebugGrammar("FIELD - LESS THAN %f", max) - q := NewNumericRangeInclusiveQuery(nil, &max, nil, &maxInclusive) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tLESS tEQUAL posOrNegNumber { - field := $1 - max, err := strconv.ParseFloat($5, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("error parsing number: %v", err)) - } - maxInclusive := true - logDebugGrammar("FIELD - LESS THAN OR EQUAL %f", max) - q := NewNumericRangeInclusiveQuery(nil, &max, nil, &maxInclusive) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tGREATER tPHRASE { - field := $1 - minInclusive := false - phrase := $4 - - logDebugGrammar("FIELD - GREATER THAN DATE %s", phrase) - minTime, err := queryTimeFromString(phrase) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid time: %v", err)) - } - q := NewDateRangeInclusiveQuery(minTime, time.Time{}, &minInclusive, nil) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tGREATER tEQUAL tPHRASE { - field := $1 - minInclusive := true - phrase := $5 - - logDebugGrammar("FIELD - GREATER THAN OR EQUAL DATE %s", phrase) - minTime, err := queryTimeFromString(phrase) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid time: %v", err)) - } - q := NewDateRangeInclusiveQuery(minTime, time.Time{}, &minInclusive, nil) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tLESS tPHRASE { - field := $1 - maxInclusive := false - phrase := $4 - - logDebugGrammar("FIELD - LESS THAN DATE %s", phrase) - maxTime, err := queryTimeFromString(phrase) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid time: %v", err)) - } - q := NewDateRangeInclusiveQuery(time.Time{}, maxTime, nil, &maxInclusive) - q.SetField(field) - $$ = q -} -| -tSTRING tCOLON tLESS tEQUAL tPHRASE { - field := $1 - maxInclusive := true - phrase := $5 - - logDebugGrammar("FIELD - LESS THAN OR EQUAL DATE %s", phrase) - maxTime, err := queryTimeFromString(phrase) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid time: %v", err)) - } - q := NewDateRangeInclusiveQuery(time.Time{}, maxTime, nil, &maxInclusive) - q.SetField(field) - $$ = q -}; - -searchSuffix: -/* empty */ { - $$ = nil -} -| -tBOOST { - $$ = nil - boost, err := strconv.ParseFloat($1, 64) - if err != nil { - yylex.(*lexerWrapper).lex.Error(fmt.Sprintf("invalid boost value: %v", err)) - } else { - $$ = &boost - } - logDebugGrammar("BOOST %f", boost) -}; - -posOrNegNumber: -tNUMBER { - $$ = $1 -} -| -tMINUS tNUMBER { - $$ = "-" + $2 -}; diff --git a/vendor/github.com/blevesearch/go-porterstemmer/README.md b/vendor/github.com/blevesearch/go-porterstemmer/README.md deleted file mode 100644 index d96911ace5..0000000000 --- a/vendor/github.com/blevesearch/go-porterstemmer/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# This fork... - -I'm maintaining this fork because the original author was not replying to issues or pull requests. For now I plan on maintaining this fork as necessary. - -## Status - -[![Build Status](https://travis-ci.org/blevesearch/go-porterstemmer.svg?branch=master)](https://travis-ci.org/blevesearch/go-porterstemmer) - -[![Coverage Status](https://coveralls.io/repos/blevesearch/go-porterstemmer/badge.png?branch=HEAD)](https://coveralls.io/r/blevesearch/go-porterstemmer?branch=HEAD) - -# Go Porter Stemmer - -A native Go clean room implementation of the Porter Stemming Algorithm. - -This algorithm is of interest to people doing Machine Learning or -Natural Language Processing (NLP). - -This is NOT a port. This is a native Go implementation from the human-readable -description of the algorithm. - -I've tried to make it (more) efficient by NOT internally using string's, but -instead internally using []rune's and using the same (array) buffer used by -the []rune slice (and sub-slices) at all steps of the algorithm. - -For Porter Stemmer algorithm, see: - -http://tartarus.org/martin/PorterStemmer/def.txt (URL #1) - -http://tartarus.org/martin/PorterStemmer/ (URL #2) - -# Departures - -Also, since when I initially implemented it, it failed the tests at... - -http://tartarus.org/martin/PorterStemmer/voc.txt (URL #3) - -http://tartarus.org/martin/PorterStemmer/output.txt (URL #4) - -... after reading the human-readble text over and over again to try to figure out -what the error I made was (and doing all sorts of things to debug it) I came to the -conclusion that the some of these tests were wrong according to the human-readable -description of the algorithm. - -This led me to wonder if maybe other people's code that was passing these tests had -rules that were not in the human-readable description. Which led me to look at the source -code here... - -http://tartarus.org/martin/PorterStemmer/c.txt (URL #5) - -... When I looked there I noticed that there are some items marked as a "DEPARTURE", -which differ from the original algorithm. (There are 2 of these.) - -I implemented these departures, and the tests at URL #3 and URL #4 all passed. - -## Usage - -To use this Golang library, use with something like: - - package main - - import ( - "fmt" - "github.com/reiver/go-porterstemmer" - ) - - func main() { - - word := "Waxes" - - stem := porterstemmer.StemString(word) - - fmt.Printf("The word [%s] has the stem [%s].\n", word, stem) - } - -Alternatively, if you want to be a bit more efficient, use []rune slices instead, with code like: - - package main - - import ( - "fmt" - "github.com/reiver/go-porterstemmer" - ) - - func main() { - - word := []rune("Waxes") - - stem := porterstemmer.Stem(word) - - fmt.Printf("The word [%s] has the stem [%s].\n", string(word), string(stem)) - } - -Although NOTE that the above code may modify original slice (named "word" in the example) as a side -effect, for efficiency reasons. And that the slice named "stem" in the example above may be a -sub-slice of the slice named "word". - -Also alternatively, if you already know that your word is already lowercase (and you don't need -this library to lowercase your word for you) you can instead use code like: - - package main - - import ( - "fmt" - "github.com/reiver/go-porterstemmer" - ) - - func main() { - - word := []rune("waxes") - - stem := porterstemmer.StemWithoutLowerCasing(word) - - fmt.Printf("The word [%s] has the stem [%s].\n", string(word), string(stem)) - } - -Again NOTE (like with the previous example) that the above code may modify original slice (named -"word" in the example) as a side effect, for efficiency reasons. And that the slice named "stem" -in the example above may be a sub-slice of the slice named "word". diff --git a/vendor/github.com/blevesearch/segment/README.md b/vendor/github.com/blevesearch/segment/README.md deleted file mode 100644 index 0840962d05..0000000000 --- a/vendor/github.com/blevesearch/segment/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# segment - -A Go library for performing Unicode Text Segmentation -as described in [Unicode Standard Annex #29](http://www.unicode.org/reports/tr29/) - -## Features - -* Currently only segmentation at Word Boundaries is supported. - -## License - -Apache License Version 2.0 - -## Usage - -The functionality is exposed in two ways: - -1. You can use a bufio.Scanner with the SplitWords implementation of SplitFunc. -The SplitWords function will identify the appropriate word boundaries in the input -text and the Scanner will return tokens at the appropriate place. - - scanner := bufio.NewScanner(...) - scanner.Split(segment.SplitWords) - for scanner.Scan() { - tokenBytes := scanner.Bytes() - } - if err := scanner.Err(); err != nil { - t.Fatal(err) - } - -2. Sometimes you would also like information returned about the type of token. -To do this we have introduce a new type named Segmenter. It works just like Scanner -but additionally a token type is returned. - - segmenter := segment.NewWordSegmenter(...) - for segmenter.Segment() { - tokenBytes := segmenter.Bytes()) - tokenType := segmenter.Type() - } - if err := segmenter.Err(); err != nil { - t.Fatal(err) - } - -## Choosing Implementation - -By default segment does NOT use the fastest runtime implementation. The reason is that it adds approximately 5s to compilation time and may require more than 1GB of ram on the machine performing compilation. - -However, you can choose to build with the fastest runtime implementation by passing the build tag as follows: - - -tags 'prod' - -## Generating Code - -Several components in this package are generated. - -1. Several Ragel rules files are generated from Unicode properties files. -2. Ragel machine is generated from the Ragel rules. -3. Test tables are generated from the Unicode test files. - -All of these can be generated by running: - - go generate - -## Fuzzing - -There is support for fuzzing the segment library with [go-fuzz](https://github.com/dvyukov/go-fuzz). - -1. Install go-fuzz if you haven't already: - - go get github.com/dvyukov/go-fuzz/go-fuzz - go get github.com/dvyukov/go-fuzz/go-fuzz-build - -2. Build the package with go-fuzz: - - go-fuzz-build github.com/blevesearch/segment - -3. Convert the Unicode provided test cases into the initial corpus for go-fuzz: - - go test -v -run=TestGenerateWordSegmentFuzz -tags gofuzz_generate - -4. Run go-fuzz: - - go-fuzz -bin=segment-fuzz.zip -workdir=workdir - -## Status - - -[![Build Status](https://travis-ci.org/blevesearch/segment.svg?branch=master)](https://travis-ci.org/blevesearch/segment) - -[![Coverage Status](https://img.shields.io/coveralls/blevesearch/segment.svg)](https://coveralls.io/r/blevesearch/segment?branch=master) - -[![GoDoc](https://godoc.org/github.com/blevesearch/segment?status.svg)](https://godoc.org/github.com/blevesearch/segment) \ No newline at end of file diff --git a/vendor/github.com/blevesearch/segment/segment_words.rl b/vendor/github.com/blevesearch/segment/segment_words.rl deleted file mode 100644 index e69af8b214..0000000000 --- a/vendor/github.com/blevesearch/segment/segment_words.rl +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) 2015 Couchbase, Inc. -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file -// except in compliance with the License. You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software distributed under the -// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. - -// +build BUILDTAGS - -package segment - -import ( - "fmt" - "unicode/utf8" -) - -var RagelFlags = "RAGELFLAGS" - -var ParseError = fmt.Errorf("unicode word segmentation parse error") - -// Word Types -const ( - None = iota - Number - Letter - Kana - Ideo -) - -%%{ - machine s; - write data; -}%% - -func segmentWords(data []byte, maxTokens int, atEOF bool, val [][]byte, types []int) ([][]byte, []int, int, error) { - cs, p, pe := 0, 0, len(data) - cap := maxTokens - if cap < 0 { - cap = 1000 - } - if val == nil { - val = make([][]byte, 0, cap) - } - if types == nil { - types = make([]int, 0, cap) - } - - // added for scanner - ts := 0 - te := 0 - act := 0 - eof := pe - _ = ts // compiler not happy - _ = te - _ = act - - // our state - startPos := 0 - endPos := 0 - totalConsumed := 0 - %%{ - - include SCRIPTS "ragel/uscript.rl"; - include WB "ragel/uwb.rl"; - - action startToken { - startPos = p - } - - action endToken { - endPos = p - } - - action finishNumericToken { - if !atEOF { - return val, types, totalConsumed, nil - } - - val = append(val, data[startPos:endPos+1]) - types = append(types, Number) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishHangulToken { - if endPos+1 == pe && !atEOF { - return val, types, totalConsumed, nil - } else if dr, size := utf8.DecodeRune(data[endPos+1:]); dr == utf8.RuneError && size == 1 { - return val, types, totalConsumed, nil - } - - val = append(val, data[startPos:endPos+1]) - types = append(types, Letter) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishKatakanaToken { - if endPos+1 == pe && !atEOF { - return val, types, totalConsumed, nil - } else if dr, size := utf8.DecodeRune(data[endPos+1:]); dr == utf8.RuneError && size == 1 { - return val, types, totalConsumed, nil - } - - val = append(val, data[startPos:endPos+1]) - types = append(types, Ideo) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishWordToken { - if !atEOF { - return val, types, totalConsumed, nil - } - val = append(val, data[startPos:endPos+1]) - types = append(types, Letter) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishHanToken { - if endPos+1 == pe && !atEOF { - return val, types, totalConsumed, nil - } else if dr, size := utf8.DecodeRune(data[endPos+1:]); dr == utf8.RuneError && size == 1 { - return val, types, totalConsumed, nil - } - - val = append(val, data[startPos:endPos+1]) - types = append(types, Ideo) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishHiraganaToken { - if endPos+1 == pe && !atEOF { - return val, types, totalConsumed, nil - } else if dr, size := utf8.DecodeRune(data[endPos+1:]); dr == utf8.RuneError && size == 1 { - return val, types, totalConsumed, nil - } - - val = append(val, data[startPos:endPos+1]) - types = append(types, Ideo) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - action finishNoneToken { - lastPos := startPos - for lastPos <= endPos { - _, size := utf8.DecodeRune(data[lastPos:]) - lastPos += size - } - endPos = lastPos -1 - p = endPos - - if endPos+1 == pe && !atEOF { - return val, types, totalConsumed, nil - } else if dr, size := utf8.DecodeRune(data[endPos+1:]); dr == utf8.RuneError && size == 1 { - return val, types, totalConsumed, nil - } - // otherwise, consume this as well - val = append(val, data[startPos:endPos+1]) - types = append(types, None) - totalConsumed = endPos+1 - if maxTokens > 0 && len(val) >= maxTokens { - return val, types, totalConsumed, nil - } - } - - HangulEx = Hangul ( Extend | Format )*; - HebrewOrALetterEx = ( Hebrew_Letter | ALetter ) ( Extend | Format )*; - NumericEx = Numeric ( Extend | Format )*; - KatakanaEx = Katakana ( Extend | Format )*; - MidLetterEx = ( MidLetter | MidNumLet | Single_Quote ) ( Extend | Format )*; - MidNumericEx = ( MidNum | MidNumLet | Single_Quote ) ( Extend | Format )*; - ExtendNumLetEx = ExtendNumLet ( Extend | Format )*; - HanEx = Han ( Extend | Format )*; - HiraganaEx = Hiragana ( Extend | Format )*; - SingleQuoteEx = Single_Quote ( Extend | Format )*; - DoubleQuoteEx = Double_Quote ( Extend | Format )*; - HebrewLetterEx = Hebrew_Letter ( Extend | Format )*; - RegionalIndicatorEx = Regional_Indicator ( Extend | Format )*; - NLCRLF = Newline | CR | LF; - OtherEx = ^(NLCRLF) ( Extend | Format )* ; - - # UAX#29 WB8. Numeric × Numeric - # WB11. Numeric (MidNum | MidNumLet | Single_Quote) × Numeric - # WB12. Numeric × (MidNum | MidNumLet | Single_Quote) Numeric - # WB13a. (ALetter | Hebrew_Letter | Numeric | Katakana | ExtendNumLet) × ExtendNumLet - # WB13b. ExtendNumLet × (ALetter | Hebrew_Letter | Numeric | Katakana) - # - WordNumeric = ( ( ExtendNumLetEx )* NumericEx ( ( ( ExtendNumLetEx )* | MidNumericEx ) NumericEx )* ( ExtendNumLetEx )* ) >startToken @endToken; - - # subset of the below for typing purposes only! - WordHangul = ( HangulEx )+ >startToken @endToken; - WordKatakana = ( KatakanaEx )+ >startToken @endToken; - - # UAX#29 WB5. (ALetter | Hebrew_Letter) × (ALetter | Hebrew_Letter) - # WB6. (ALetter | Hebrew_Letter) × (MidLetter | MidNumLet | Single_Quote) (ALetter | Hebrew_Letter) - # WB7. (ALetter | Hebrew_Letter) (MidLetter | MidNumLet | Single_Quote) × (ALetter | Hebrew_Letter) - # WB7a. Hebrew_Letter × Single_Quote - # WB7b. Hebrew_Letter × Double_Quote Hebrew_Letter - # WB7c. Hebrew_Letter Double_Quote × Hebrew_Letter - # WB9. (ALetter | Hebrew_Letter) × Numeric - # WB10. Numeric × (ALetter | Hebrew_Letter) - # WB13. Katakana × Katakana - # WB13a. (ALetter | Hebrew_Letter | Numeric | Katakana | ExtendNumLet) × ExtendNumLet - # WB13b. ExtendNumLet × (ALetter | Hebrew_Letter | Numeric | Katakana) - # - # Marty -deviated here to allow for (ExtendNumLetEx x ExtendNumLetEx) part of 13a - # - Word = ( ( ExtendNumLetEx )* ( KatakanaEx ( ( ExtendNumLetEx )* KatakanaEx )* - | ( HebrewLetterEx ( SingleQuoteEx | DoubleQuoteEx HebrewLetterEx ) - | NumericEx ( ( ( ExtendNumLetEx )* | MidNumericEx ) NumericEx )* - | HebrewOrALetterEx ( ( ( ExtendNumLetEx )* | MidLetterEx ) HebrewOrALetterEx )* - |ExtendNumLetEx - )+ - ) - ( - ( ExtendNumLetEx )+ ( KatakanaEx ( ( ExtendNumLetEx )* KatakanaEx )* - | ( HebrewLetterEx ( SingleQuoteEx | DoubleQuoteEx HebrewLetterEx ) - | NumericEx ( ( ( ExtendNumLetEx )* | MidNumericEx ) NumericEx )* - | HebrewOrALetterEx ( ( ( ExtendNumLetEx )* | MidLetterEx ) HebrewOrALetterEx )* - )+ - ) - )* ExtendNumLetEx*) >startToken @endToken; - - # UAX#29 WB14. Any ÷ Any - WordHan = HanEx >startToken @endToken; - WordHiragana = HiraganaEx >startToken @endToken; - - WordExt = ( ( Extend | Format )* ) >startToken @endToken; # maybe plus not star - - WordCRLF = (CR LF) >startToken @endToken; - - WordCR = CR >startToken @endToken; - - WordLF = LF >startToken @endToken; - - WordNL = Newline >startToken @endToken; - - WordRegional = (RegionalIndicatorEx+) >startToken @endToken; - - Other = OtherEx >startToken @endToken; - - main := |* - WordNumeric => finishNumericToken; - WordHangul => finishHangulToken; - WordKatakana => finishKatakanaToken; - Word => finishWordToken; - WordHan => finishHanToken; - WordHiragana => finishHiraganaToken; - WordRegional =>finishNoneToken; - WordCRLF => finishNoneToken; - WordCR => finishNoneToken; - WordLF => finishNoneToken; - WordNL => finishNoneToken; - WordExt => finishNoneToken; - Other => finishNoneToken; - *|; - - write init; - write exec; - }%% - - if cs < s_first_final { - return val, types, totalConsumed, ParseError - } - - return val, types, totalConsumed, nil -} diff --git a/vendor/github.com/boltdb/bolt/Makefile b/vendor/github.com/boltdb/bolt/Makefile deleted file mode 100644 index e035e63adc..0000000000 --- a/vendor/github.com/boltdb/bolt/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -BRANCH=`git rev-parse --abbrev-ref HEAD` -COMMIT=`git rev-parse --short HEAD` -GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)" - -default: build - -race: - @go test -v -race -test.run="TestSimulate_(100op|1000op)" - -# go get github.com/kisielk/errcheck -errcheck: - @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt - -test: - @go test -v -cover . - @go test -v ./cmd/bolt - -.PHONY: fmt test diff --git a/vendor/github.com/boltdb/bolt/README.md b/vendor/github.com/boltdb/bolt/README.md deleted file mode 100644 index d7f80e9774..0000000000 --- a/vendor/github.com/boltdb/bolt/README.md +++ /dev/null @@ -1,915 +0,0 @@ -Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](https://godoc.org/github.com/boltdb/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg) -==== - -Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas] -[LMDB project][lmdb]. The goal of the project is to provide a simple, -fast, and reliable database for projects that don't require a full database -server such as Postgres or MySQL. - -Since Bolt is meant to be used as such a low-level piece of functionality, -simplicity is key. The API will be small and only focus on getting values -and setting values. That's it. - -[hyc_symas]: https://twitter.com/hyc_symas -[lmdb]: http://symas.com/mdb/ - -## Project Status - -Bolt is stable, the API is fixed, and the file format is fixed. Full unit -test coverage and randomized black box testing are used to ensure database -consistency and thread safety. Bolt is currently used in high-load production -environments serving databases as large as 1TB. Many companies such as -Shopify and Heroku use Bolt-backed services every day. - -## Table of Contents - -- [Getting Started](#getting-started) - - [Installing](#installing) - - [Opening a database](#opening-a-database) - - [Transactions](#transactions) - - [Read-write transactions](#read-write-transactions) - - [Read-only transactions](#read-only-transactions) - - [Batch read-write transactions](#batch-read-write-transactions) - - [Managing transactions manually](#managing-transactions-manually) - - [Using buckets](#using-buckets) - - [Using key/value pairs](#using-keyvalue-pairs) - - [Autoincrementing integer for the bucket](#autoincrementing-integer-for-the-bucket) - - [Iterating over keys](#iterating-over-keys) - - [Prefix scans](#prefix-scans) - - [Range scans](#range-scans) - - [ForEach()](#foreach) - - [Nested buckets](#nested-buckets) - - [Database backups](#database-backups) - - [Statistics](#statistics) - - [Read-Only Mode](#read-only-mode) - - [Mobile Use (iOS/Android)](#mobile-use-iosandroid) -- [Resources](#resources) -- [Comparison with other databases](#comparison-with-other-databases) - - [Postgres, MySQL, & other relational databases](#postgres-mysql--other-relational-databases) - - [LevelDB, RocksDB](#leveldb-rocksdb) - - [LMDB](#lmdb) -- [Caveats & Limitations](#caveats--limitations) -- [Reading the Source](#reading-the-source) -- [Other Projects Using Bolt](#other-projects-using-bolt) - -## Getting Started - -### Installing - -To start using Bolt, install Go and run `go get`: - -```sh -$ go get github.com/boltdb/bolt/... -``` - -This will retrieve the library and install the `bolt` command line utility into -your `$GOBIN` path. - - -### Opening a database - -The top-level object in Bolt is a `DB`. It is represented as a single file on -your disk and represents a consistent snapshot of your data. - -To open your database, simply use the `bolt.Open()` function: - -```go -package main - -import ( - "log" - - "github.com/boltdb/bolt" -) - -func main() { - // Open the my.db data file in your current directory. - // It will be created if it doesn't exist. - db, err := bolt.Open("my.db", 0600, nil) - if err != nil { - log.Fatal(err) - } - defer db.Close() - - ... -} -``` - -Please note that Bolt obtains a file lock on the data file so multiple processes -cannot open the same database at the same time. Opening an already open Bolt -database will cause it to hang until the other process closes it. To prevent -an indefinite wait you can pass a timeout option to the `Open()` function: - -```go -db, err := bolt.Open("my.db", 0600, &bolt.Options{Timeout: 1 * time.Second}) -``` - - -### Transactions - -Bolt allows only one read-write transaction at a time but allows as many -read-only transactions as you want at a time. Each transaction has a consistent -view of the data as it existed when the transaction started. - -Individual transactions and all objects created from them (e.g. buckets, keys) -are not thread safe. To work with data in multiple goroutines you must start -a transaction for each one or use locking to ensure only one goroutine accesses -a transaction at a time. Creating transaction from the `DB` is thread safe. - -Read-only transactions and read-write transactions should not depend on one -another and generally shouldn't be opened simultaneously in the same goroutine. -This can cause a deadlock as the read-write transaction needs to periodically -re-map the data file but it cannot do so while a read-only transaction is open. - - -#### Read-write transactions - -To start a read-write transaction, you can use the `DB.Update()` function: - -```go -err := db.Update(func(tx *bolt.Tx) error { - ... - return nil -}) -``` - -Inside the closure, you have a consistent view of the database. You commit the -transaction by returning `nil` at the end. You can also rollback the transaction -at any point by returning an error. All database operations are allowed inside -a read-write transaction. - -Always check the return error as it will report any disk failures that can cause -your transaction to not complete. If you return an error within your closure -it will be passed through. - - -#### Read-only transactions - -To start a read-only transaction, you can use the `DB.View()` function: - -```go -err := db.View(func(tx *bolt.Tx) error { - ... - return nil -}) -``` - -You also get a consistent view of the database within this closure, however, -no mutating operations are allowed within a read-only transaction. You can only -retrieve buckets, retrieve values, and copy the database within a read-only -transaction. - - -#### Batch read-write transactions - -Each `DB.Update()` waits for disk to commit the writes. This overhead -can be minimized by combining multiple updates with the `DB.Batch()` -function: - -```go -err := db.Batch(func(tx *bolt.Tx) error { - ... - return nil -}) -``` - -Concurrent Batch calls are opportunistically combined into larger -transactions. Batch is only useful when there are multiple goroutines -calling it. - -The trade-off is that `Batch` can call the given -function multiple times, if parts of the transaction fail. The -function must be idempotent and side effects must take effect only -after a successful return from `DB.Batch()`. - -For example: don't display messages from inside the function, instead -set variables in the enclosing scope: - -```go -var id uint64 -err := db.Batch(func(tx *bolt.Tx) error { - // Find last key in bucket, decode as bigendian uint64, increment - // by one, encode back to []byte, and add new key. - ... - id = newValue - return nil -}) -if err != nil { - return ... -} -fmt.Println("Allocated ID %d", id) -``` - - -#### Managing transactions manually - -The `DB.View()` and `DB.Update()` functions are wrappers around the `DB.Begin()` -function. These helper functions will start the transaction, execute a function, -and then safely close your transaction if an error is returned. This is the -recommended way to use Bolt transactions. - -However, sometimes you may want to manually start and end your transactions. -You can use the `DB.Begin()` function directly but **please** be sure to close -the transaction. - -```go -// Start a writable transaction. -tx, err := db.Begin(true) -if err != nil { - return err -} -defer tx.Rollback() - -// Use the transaction... -_, err := tx.CreateBucket([]byte("MyBucket")) -if err != nil { - return err -} - -// Commit the transaction and check for error. -if err := tx.Commit(); err != nil { - return err -} -``` - -The first argument to `DB.Begin()` is a boolean stating if the transaction -should be writable. - - -### Using buckets - -Buckets are collections of key/value pairs within the database. All keys in a -bucket must be unique. You can create a bucket using the `DB.CreateBucket()` -function: - -```go -db.Update(func(tx *bolt.Tx) error { - b, err := tx.CreateBucket([]byte("MyBucket")) - if err != nil { - return fmt.Errorf("create bucket: %s", err) - } - return nil -}) -``` - -You can also create a bucket only if it doesn't exist by using the -`Tx.CreateBucketIfNotExists()` function. It's a common pattern to call this -function for all your top-level buckets after you open your database so you can -guarantee that they exist for future transactions. - -To delete a bucket, simply call the `Tx.DeleteBucket()` function. - - -### Using key/value pairs - -To save a key/value pair to a bucket, use the `Bucket.Put()` function: - -```go -db.Update(func(tx *bolt.Tx) error { - b := tx.Bucket([]byte("MyBucket")) - err := b.Put([]byte("answer"), []byte("42")) - return err -}) -``` - -This will set the value of the `"answer"` key to `"42"` in the `MyBucket` -bucket. To retrieve this value, we can use the `Bucket.Get()` function: - -```go -db.View(func(tx *bolt.Tx) error { - b := tx.Bucket([]byte("MyBucket")) - v := b.Get([]byte("answer")) - fmt.Printf("The answer is: %s\n", v) - return nil -}) -``` - -The `Get()` function does not return an error because its operation is -guaranteed to work (unless there is some kind of system failure). If the key -exists then it will return its byte slice value. If it doesn't exist then it -will return `nil`. It's important to note that you can have a zero-length value -set to a key which is different than the key not existing. - -Use the `Bucket.Delete()` function to delete a key from the bucket. - -Please note that values returned from `Get()` are only valid while the -transaction is open. If you need to use a value outside of the transaction -then you must use `copy()` to copy it to another byte slice. - - -### Autoincrementing integer for the bucket -By using the `NextSequence()` function, you can let Bolt determine a sequence -which can be used as the unique identifier for your key/value pairs. See the -example below. - -```go -// CreateUser saves u to the store. The new user ID is set on u once the data is persisted. -func (s *Store) CreateUser(u *User) error { - return s.db.Update(func(tx *bolt.Tx) error { - // Retrieve the users bucket. - // This should be created when the DB is first opened. - b := tx.Bucket([]byte("users")) - - // Generate ID for the user. - // This returns an error only if the Tx is closed or not writeable. - // That can't happen in an Update() call so I ignore the error check. - id, _ := b.NextSequence() - u.ID = int(id) - - // Marshal user data into bytes. - buf, err := json.Marshal(u) - if err != nil { - return err - } - - // Persist bytes to users bucket. - return b.Put(itob(u.ID), buf) - }) -} - -// itob returns an 8-byte big endian representation of v. -func itob(v int) []byte { - b := make([]byte, 8) - binary.BigEndian.PutUint64(b, uint64(v)) - return b -} - -type User struct { - ID int - ... -} -``` - -### Iterating over keys - -Bolt stores its keys in byte-sorted order within a bucket. This makes sequential -iteration over these keys extremely fast. To iterate over keys we'll use a -`Cursor`: - -```go -db.View(func(tx *bolt.Tx) error { - // Assume bucket exists and has keys - b := tx.Bucket([]byte("MyBucket")) - - c := b.Cursor() - - for k, v := c.First(); k != nil; k, v = c.Next() { - fmt.Printf("key=%s, value=%s\n", k, v) - } - - return nil -}) -``` - -The cursor allows you to move to a specific point in the list of keys and move -forward or backward through the keys one at a time. - -The following functions are available on the cursor: - -``` -First() Move to the first key. -Last() Move to the last key. -Seek() Move to a specific key. -Next() Move to the next key. -Prev() Move to the previous key. -``` - -Each of those functions has a return signature of `(key []byte, value []byte)`. -When you have iterated to the end of the cursor then `Next()` will return a -`nil` key. You must seek to a position using `First()`, `Last()`, or `Seek()` -before calling `Next()` or `Prev()`. If you do not seek to a position then -these functions will return a `nil` key. - -During iteration, if the key is non-`nil` but the value is `nil`, that means -the key refers to a bucket rather than a value. Use `Bucket.Bucket()` to -access the sub-bucket. - - -#### Prefix scans - -To iterate over a key prefix, you can combine `Seek()` and `bytes.HasPrefix()`: - -```go -db.View(func(tx *bolt.Tx) error { - // Assume bucket exists and has keys - c := tx.Bucket([]byte("MyBucket")).Cursor() - - prefix := []byte("1234") - for k, v := c.Seek(prefix); k != nil && bytes.HasPrefix(k, prefix); k, v = c.Next() { - fmt.Printf("key=%s, value=%s\n", k, v) - } - - return nil -}) -``` - -#### Range scans - -Another common use case is scanning over a range such as a time range. If you -use a sortable time encoding such as RFC3339 then you can query a specific -date range like this: - -```go -db.View(func(tx *bolt.Tx) error { - // Assume our events bucket exists and has RFC3339 encoded time keys. - c := tx.Bucket([]byte("Events")).Cursor() - - // Our time range spans the 90's decade. - min := []byte("1990-01-01T00:00:00Z") - max := []byte("2000-01-01T00:00:00Z") - - // Iterate over the 90's. - for k, v := c.Seek(min); k != nil && bytes.Compare(k, max) <= 0; k, v = c.Next() { - fmt.Printf("%s: %s\n", k, v) - } - - return nil -}) -``` - -Note that, while RFC3339 is sortable, the Golang implementation of RFC3339Nano does not use a fixed number of digits after the decimal point and is therefore not sortable. - - -#### ForEach() - -You can also use the function `ForEach()` if you know you'll be iterating over -all the keys in a bucket: - -```go -db.View(func(tx *bolt.Tx) error { - // Assume bucket exists and has keys - b := tx.Bucket([]byte("MyBucket")) - - b.ForEach(func(k, v []byte) error { - fmt.Printf("key=%s, value=%s\n", k, v) - return nil - }) - return nil -}) -``` - -Please note that keys and values in `ForEach()` are only valid while -the transaction is open. If you need to use a key or value outside of -the transaction, you must use `copy()` to copy it to another byte -slice. - -### Nested buckets - -You can also store a bucket in a key to create nested buckets. The API is the -same as the bucket management API on the `DB` object: - -```go -func (*Bucket) CreateBucket(key []byte) (*Bucket, error) -func (*Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error) -func (*Bucket) DeleteBucket(key []byte) error -``` - -Say you had a multi-tenant application where the root level bucket was the account bucket. Inside of this bucket was a sequence of accounts which themselves are buckets. And inside the sequence bucket you could have many buckets pertaining to the Account itself (Users, Notes, etc) isolating the information into logical groupings. - -```go - -// createUser creates a new user in the given account. -func createUser(accountID int, u *User) error { - // Start the transaction. - tx, err := db.Begin(true) - if err != nil { - return err - } - defer tx.Rollback() - - // Retrieve the root bucket for the account. - // Assume this has already been created when the account was set up. - root := tx.Bucket([]byte(strconv.FormatUint(accountID, 10))) - - // Setup the users bucket. - bkt, err := root.CreateBucketIfNotExists([]byte("USERS")) - if err != nil { - return err - } - - // Generate an ID for the new user. - userID, err := bkt.NextSequence() - if err != nil { - return err - } - u.ID = userID - - // Marshal and save the encoded user. - if buf, err := json.Marshal(u); err != nil { - return err - } else if err := bkt.Put([]byte(strconv.FormatUint(u.ID, 10)), buf); err != nil { - return err - } - - // Commit the transaction. - if err := tx.Commit(); err != nil { - return err - } - - return nil -} - -``` - - - - -### Database backups - -Bolt is a single file so it's easy to backup. You can use the `Tx.WriteTo()` -function to write a consistent view of the database to a writer. If you call -this from a read-only transaction, it will perform a hot backup and not block -your other database reads and writes. - -By default, it will use a regular file handle which will utilize the operating -system's page cache. See the [`Tx`](https://godoc.org/github.com/boltdb/bolt#Tx) -documentation for information about optimizing for larger-than-RAM datasets. - -One common use case is to backup over HTTP so you can use tools like `cURL` to -do database backups: - -```go -func BackupHandleFunc(w http.ResponseWriter, req *http.Request) { - err := db.View(func(tx *bolt.Tx) error { - w.Header().Set("Content-Type", "application/octet-stream") - w.Header().Set("Content-Disposition", `attachment; filename="my.db"`) - w.Header().Set("Content-Length", strconv.Itoa(int(tx.Size()))) - _, err := tx.WriteTo(w) - return err - }) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } -} -``` - -Then you can backup using this command: - -```sh -$ curl http://localhost/backup > my.db -``` - -Or you can open your browser to `http://localhost/backup` and it will download -automatically. - -If you want to backup to another file you can use the `Tx.CopyFile()` helper -function. - - -### Statistics - -The database keeps a running count of many of the internal operations it -performs so you can better understand what's going on. By grabbing a snapshot -of these stats at two points in time we can see what operations were performed -in that time range. - -For example, we could start a goroutine to log stats every 10 seconds: - -```go -go func() { - // Grab the initial stats. - prev := db.Stats() - - for { - // Wait for 10s. - time.Sleep(10 * time.Second) - - // Grab the current stats and diff them. - stats := db.Stats() - diff := stats.Sub(&prev) - - // Encode stats to JSON and print to STDERR. - json.NewEncoder(os.Stderr).Encode(diff) - - // Save stats for the next loop. - prev = stats - } -}() -``` - -It's also useful to pipe these stats to a service such as statsd for monitoring -or to provide an HTTP endpoint that will perform a fixed-length sample. - - -### Read-Only Mode - -Sometimes it is useful to create a shared, read-only Bolt database. To this, -set the `Options.ReadOnly` flag when opening your database. Read-only mode -uses a shared lock to allow multiple processes to read from the database but -it will block any processes from opening the database in read-write mode. - -```go -db, err := bolt.Open("my.db", 0666, &bolt.Options{ReadOnly: true}) -if err != nil { - log.Fatal(err) -} -``` - -### Mobile Use (iOS/Android) - -Bolt is able to run on mobile devices by leveraging the binding feature of the -[gomobile](https://github.com/golang/mobile) tool. Create a struct that will -contain your database logic and a reference to a `*bolt.DB` with a initializing -constructor that takes in a filepath where the database file will be stored. -Neither Android nor iOS require extra permissions or cleanup from using this method. - -```go -func NewBoltDB(filepath string) *BoltDB { - db, err := bolt.Open(filepath+"/demo.db", 0600, nil) - if err != nil { - log.Fatal(err) - } - - return &BoltDB{db} -} - -type BoltDB struct { - db *bolt.DB - ... -} - -func (b *BoltDB) Path() string { - return b.db.Path() -} - -func (b *BoltDB) Close() { - b.db.Close() -} -``` - -Database logic should be defined as methods on this wrapper struct. - -To initialize this struct from the native language (both platforms now sync -their local storage to the cloud. These snippets disable that functionality for the -database file): - -#### Android - -```java -String path; -if (android.os.Build.VERSION.SDK_INT >=android.os.Build.VERSION_CODES.LOLLIPOP){ - path = getNoBackupFilesDir().getAbsolutePath(); -} else{ - path = getFilesDir().getAbsolutePath(); -} -Boltmobiledemo.BoltDB boltDB = Boltmobiledemo.NewBoltDB(path) -``` - -#### iOS - -```objc -- (void)demo { - NSString* path = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, - NSUserDomainMask, - YES) objectAtIndex:0]; - GoBoltmobiledemoBoltDB * demo = GoBoltmobiledemoNewBoltDB(path); - [self addSkipBackupAttributeToItemAtPath:demo.path]; - //Some DB Logic would go here - [demo close]; -} - -- (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString -{ - NSURL* URL= [NSURL fileURLWithPath: filePathString]; - assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]); - - NSError *error = nil; - BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES] - forKey: NSURLIsExcludedFromBackupKey error: &error]; - if(!success){ - NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); - } - return success; -} - -``` - -## Resources - -For more information on getting started with Bolt, check out the following articles: - -* [Intro to BoltDB: Painless Performant Persistence](http://npf.io/2014/07/intro-to-boltdb-painless-performant-persistence/) by [Nate Finch](https://github.com/natefinch). -* [Bolt -- an embedded key/value database for Go](https://www.progville.com/go/bolt-embedded-db-golang/) by Progville - - -## Comparison with other databases - -### Postgres, MySQL, & other relational databases - -Relational databases structure data into rows and are only accessible through -the use of SQL. This approach provides flexibility in how you store and query -your data but also incurs overhead in parsing and planning SQL statements. Bolt -accesses all data by a byte slice key. This makes Bolt fast to read and write -data by key but provides no built-in support for joining values together. - -Most relational databases (with the exception of SQLite) are standalone servers -that run separately from your application. This gives your systems -flexibility to connect multiple application servers to a single database -server but also adds overhead in serializing and transporting data over the -network. Bolt runs as a library included in your application so all data access -has to go through your application's process. This brings data closer to your -application but limits multi-process access to the data. - - -### LevelDB, RocksDB - -LevelDB and its derivatives (RocksDB, HyperLevelDB) are similar to Bolt in that -they are libraries bundled into the application, however, their underlying -structure is a log-structured merge-tree (LSM tree). An LSM tree optimizes -random writes by using a write ahead log and multi-tiered, sorted files called -SSTables. Bolt uses a B+tree internally and only a single file. Both approaches -have trade-offs. - -If you require a high random write throughput (>10,000 w/sec) or you need to use -spinning disks then LevelDB could be a good choice. If your application is -read-heavy or does a lot of range scans then Bolt could be a good choice. - -One other important consideration is that LevelDB does not have transactions. -It supports batch writing of key/values pairs and it supports read snapshots -but it will not give you the ability to do a compare-and-swap operation safely. -Bolt supports fully serializable ACID transactions. - - -### LMDB - -Bolt was originally a port of LMDB so it is architecturally similar. Both use -a B+tree, have ACID semantics with fully serializable transactions, and support -lock-free MVCC using a single writer and multiple readers. - -The two projects have somewhat diverged. LMDB heavily focuses on raw performance -while Bolt has focused on simplicity and ease of use. For example, LMDB allows -several unsafe actions such as direct writes for the sake of performance. Bolt -opts to disallow actions which can leave the database in a corrupted state. The -only exception to this in Bolt is `DB.NoSync`. - -There are also a few differences in API. LMDB requires a maximum mmap size when -opening an `mdb_env` whereas Bolt will handle incremental mmap resizing -automatically. LMDB overloads the getter and setter functions with multiple -flags whereas Bolt splits these specialized cases into their own functions. - - -## Caveats & Limitations - -It's important to pick the right tool for the job and Bolt is no exception. -Here are a few things to note when evaluating and using Bolt: - -* Bolt is good for read intensive workloads. Sequential write performance is - also fast but random writes can be slow. You can use `DB.Batch()` or add a - write-ahead log to help mitigate this issue. - -* Bolt uses a B+tree internally so there can be a lot of random page access. - SSDs provide a significant performance boost over spinning disks. - -* Try to avoid long running read transactions. Bolt uses copy-on-write so - old pages cannot be reclaimed while an old transaction is using them. - -* Byte slices returned from Bolt are only valid during a transaction. Once the - transaction has been committed or rolled back then the memory they point to - can be reused by a new page or can be unmapped from virtual memory and you'll - see an `unexpected fault address` panic when accessing it. - -* Bolt uses an exclusive write lock on the database file so it cannot be - shared by multiple processes. - -* Be careful when using `Bucket.FillPercent`. Setting a high fill percent for - buckets that have random inserts will cause your database to have very poor - page utilization. - -* Use larger buckets in general. Smaller buckets causes poor page utilization - once they become larger than the page size (typically 4KB). - -* Bulk loading a lot of random writes into a new bucket can be slow as the - page will not split until the transaction is committed. Randomly inserting - more than 100,000 key/value pairs into a single new bucket in a single - transaction is not advised. - -* Bolt uses a memory-mapped file so the underlying operating system handles the - caching of the data. Typically, the OS will cache as much of the file as it - can in memory and will release memory as needed to other processes. This means - that Bolt can show very high memory usage when working with large databases. - However, this is expected and the OS will release memory as needed. Bolt can - handle databases much larger than the available physical RAM, provided its - memory-map fits in the process virtual address space. It may be problematic - on 32-bits systems. - -* The data structures in the Bolt database are memory mapped so the data file - will be endian specific. This means that you cannot copy a Bolt file from a - little endian machine to a big endian machine and have it work. For most - users this is not a concern since most modern CPUs are little endian. - -* Because of the way pages are laid out on disk, Bolt cannot truncate data files - and return free pages back to the disk. Instead, Bolt maintains a free list - of unused pages within its data file. These free pages can be reused by later - transactions. This works well for many use cases as databases generally tend - to grow. However, it's important to note that deleting large chunks of data - will not allow you to reclaim that space on disk. - - For more information on page allocation, [see this comment][page-allocation]. - -[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638 - - -## Reading the Source - -Bolt is a relatively small code base (<3KLOC) for an embedded, serializable, -transactional key/value database so it can be a good starting point for people -interested in how databases work. - -The best places to start are the main entry points into Bolt: - -- `Open()` - Initializes the reference to the database. It's responsible for - creating the database if it doesn't exist, obtaining an exclusive lock on the - file, reading the meta pages, & memory-mapping the file. - -- `DB.Begin()` - Starts a read-only or read-write transaction depending on the - value of the `writable` argument. This requires briefly obtaining the "meta" - lock to keep track of open transactions. Only one read-write transaction can - exist at a time so the "rwlock" is acquired during the life of a read-write - transaction. - -- `Bucket.Put()` - Writes a key/value pair into a bucket. After validating the - arguments, a cursor is used to traverse the B+tree to the page and position - where they key & value will be written. Once the position is found, the bucket - materializes the underlying page and the page's parent pages into memory as - "nodes". These nodes are where mutations occur during read-write transactions. - These changes get flushed to disk during commit. - -- `Bucket.Get()` - Retrieves a key/value pair from a bucket. This uses a cursor - to move to the page & position of a key/value pair. During a read-only - transaction, the key and value data is returned as a direct reference to the - underlying mmap file so there's no allocation overhead. For read-write - transactions, this data may reference the mmap file or one of the in-memory - node values. - -- `Cursor` - This object is simply for traversing the B+tree of on-disk pages - or in-memory nodes. It can seek to a specific key, move to the first or last - value, or it can move forward or backward. The cursor handles the movement up - and down the B+tree transparently to the end user. - -- `Tx.Commit()` - Converts the in-memory dirty nodes and the list of free pages - into pages to be written to disk. Writing to disk then occurs in two phases. - First, the dirty pages are written to disk and an `fsync()` occurs. Second, a - new meta page with an incremented transaction ID is written and another - `fsync()` occurs. This two phase write ensures that partially written data - pages are ignored in the event of a crash since the meta page pointing to them - is never written. Partially written meta pages are invalidated because they - are written with a checksum. - -If you have additional notes that could be helpful for others, please submit -them via pull request. - - -## Other Projects Using Bolt - -Below is a list of public, open source projects that use Bolt: - -* [BoltDbWeb](https://github.com/evnix/boltdbweb) - A web based GUI for BoltDB files. -* [Operation Go: A Routine Mission](http://gocode.io) - An online programming game for Golang using Bolt for user accounts and a leaderboard. -* [Bazil](https://bazil.org/) - A file system that lets your data reside where it is most convenient for it to reside. -* [DVID](https://github.com/janelia-flyem/dvid) - Added Bolt as optional storage engine and testing it against Basho-tuned leveldb. -* [Skybox Analytics](https://github.com/skybox/skybox) - A standalone funnel analysis tool for web analytics. -* [Scuttlebutt](https://github.com/benbjohnson/scuttlebutt) - Uses Bolt to store and process all Twitter mentions of GitHub projects. -* [Wiki](https://github.com/peterhellberg/wiki) - A tiny wiki using Goji, BoltDB and Blackfriday. -* [ChainStore](https://github.com/pressly/chainstore) - Simple key-value interface to a variety of storage engines organized as a chain of operations. -* [MetricBase](https://github.com/msiebuhr/MetricBase) - Single-binary version of Graphite. -* [Gitchain](https://github.com/gitchain/gitchain) - Decentralized, peer-to-peer Git repositories aka "Git meets Bitcoin". -* [event-shuttle](https://github.com/sclasen/event-shuttle) - A Unix system service to collect and reliably deliver messages to Kafka. -* [ipxed](https://github.com/kelseyhightower/ipxed) - Web interface and api for ipxed. -* [BoltStore](https://github.com/yosssi/boltstore) - Session store using Bolt. -* [photosite/session](https://godoc.org/bitbucket.org/kardianos/photosite/session) - Sessions for a photo viewing site. -* [LedisDB](https://github.com/siddontang/ledisdb) - A high performance NoSQL, using Bolt as optional storage. -* [ipLocator](https://github.com/AndreasBriese/ipLocator) - A fast ip-geo-location-server using bolt with bloom filters. -* [cayley](https://github.com/google/cayley) - Cayley is an open-source graph database using Bolt as optional backend. -* [bleve](http://www.blevesearch.com/) - A pure Go search engine similar to ElasticSearch that uses Bolt as the default storage backend. -* [tentacool](https://github.com/optiflows/tentacool) - REST api server to manage system stuff (IP, DNS, Gateway...) on a linux server. -* [Seaweed File System](https://github.com/chrislusf/seaweedfs) - Highly scalable distributed key~file system with O(1) disk read. -* [InfluxDB](https://influxdata.com) - Scalable datastore for metrics, events, and real-time analytics. -* [Freehold](http://tshannon.bitbucket.org/freehold/) - An open, secure, and lightweight platform for your files and data. -* [Prometheus Annotation Server](https://github.com/oliver006/prom_annotation_server) - Annotation server for PromDash & Prometheus service monitoring system. -* [Consul](https://github.com/hashicorp/consul) - Consul is service discovery and configuration made easy. Distributed, highly available, and datacenter-aware. -* [Kala](https://github.com/ajvb/kala) - Kala is a modern job scheduler optimized to run on a single node. It is persistent, JSON over HTTP API, ISO 8601 duration notation, and dependent jobs. -* [drive](https://github.com/odeke-em/drive) - drive is an unofficial Google Drive command line client for \*NIX operating systems. -* [stow](https://github.com/djherbis/stow) - a persistence manager for objects - backed by boltdb. -* [buckets](https://github.com/joyrexus/buckets) - a bolt wrapper streamlining - simple tx and key scans. -* [mbuckets](https://github.com/abhigupta912/mbuckets) - A Bolt wrapper that allows easy operations on multi level (nested) buckets. -* [Request Baskets](https://github.com/darklynx/request-baskets) - A web service to collect arbitrary HTTP requests and inspect them via REST API or simple web UI, similar to [RequestBin](http://requestb.in/) service -* [Go Report Card](https://goreportcard.com/) - Go code quality report cards as a (free and open source) service. -* [Boltdb Boilerplate](https://github.com/bobintornado/boltdb-boilerplate) - Boilerplate wrapper around bolt aiming to make simple calls one-liners. -* [lru](https://github.com/crowdriff/lru) - Easy to use Bolt-backed Least-Recently-Used (LRU) read-through cache with chainable remote stores. -* [Storm](https://github.com/asdine/storm) - Simple and powerful ORM for BoltDB. -* [GoWebApp](https://github.com/josephspurrier/gowebapp) - A basic MVC web application in Go using BoltDB. -* [SimpleBolt](https://github.com/xyproto/simplebolt) - A simple way to use BoltDB. Deals mainly with strings. -* [Algernon](https://github.com/xyproto/algernon) - A HTTP/2 web server with built-in support for Lua. Uses BoltDB as the default database backend. -* [MuLiFS](https://github.com/dankomiocevic/mulifs) - Music Library Filesystem creates a filesystem to organise your music files. -* [GoShort](https://github.com/pankajkhairnar/goShort) - GoShort is a URL shortener written in Golang and BoltDB for persistent key/value storage and for routing it's using high performent HTTPRouter. -* [torrent](https://github.com/anacrolix/torrent) - Full-featured BitTorrent client package and utilities in Go. BoltDB is a storage backend in development. -* [gopherpit](https://github.com/gopherpit/gopherpit) - A web service to manage Go remote import paths with custom domains -* [bolter](https://github.com/hasit/bolter) - Command-line app for viewing BoltDB file in your terminal. -* [btcwallet](https://github.com/btcsuite/btcwallet) - A bitcoin wallet. -* [dcrwallet](https://github.com/decred/dcrwallet) - A wallet for the Decred cryptocurrency. -* [Ironsmith](https://github.com/timshannon/ironsmith) - A simple, script-driven continuous integration (build - > test -> release) tool, with no external dependencies -* [BoltHold](https://github.com/timshannon/bolthold) - An embeddable NoSQL store for Go types built on BoltDB - -If you are using Bolt in a project please send a pull request to add it to the list. diff --git a/vendor/github.com/boltdb/bolt/appveyor.yml b/vendor/github.com/boltdb/bolt/appveyor.yml deleted file mode 100644 index 6e26e941d6..0000000000 --- a/vendor/github.com/boltdb/bolt/appveyor.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: "{build}" - -os: Windows Server 2012 R2 - -clone_folder: c:\gopath\src\github.com\boltdb\bolt - -environment: - GOPATH: c:\gopath - -install: - - echo %PATH% - - echo %GOPATH% - - go version - - go env - - go get -v -t ./... - -build_script: - - go test -v ./... diff --git a/vendor/github.com/boombuler/barcode/README.md b/vendor/github.com/boombuler/barcode/README.md deleted file mode 100644 index 85c34d6390..0000000000 --- a/vendor/github.com/boombuler/barcode/README.md +++ /dev/null @@ -1,18 +0,0 @@ -##Introduction## -This is a package for GO which can be used to create different types of barcodes. - -##Supported Barcode Types## -* Aztec Code -* Codabar -* Code 128 -* Code 39 -* EAN 8 -* EAN 13 -* Datamatrix -* QR Codes -* 2 of 5 - -##Documentation## -See [GoDoc](https://godoc.org/github.com/boombuler/barcode) - -To create a barcode use the Encode function from one of the subpackages. diff --git a/vendor/github.com/chaseadamsio/goorgeous/README.org b/vendor/github.com/chaseadamsio/goorgeous/README.org deleted file mode 100644 index 37e0f2ec73..0000000000 --- a/vendor/github.com/chaseadamsio/goorgeous/README.org +++ /dev/null @@ -1,66 +0,0 @@ -#+TITLE: chaseadamsio/goorgeous - -[[https://travis-ci.org/chaseadamsio/goorgeous.svg?branch=master]] -[[https://coveralls.io/repos/github/chaseadamsio/goorgeous/badge.svg?branch=master]] - -/goorgeous is a Go Org to HTML Parser./ - -[[file:gopher_small.gif]] - -*Pronounced: Go? Org? Yes!* - -#+BEGIN_QUOTE -"Org mode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system." - -- [[orgmode.org]] -#+END_QUOTE - -The purpose of this package is to come as close as possible as parsing an =*.org= document into HTML, the same way one might publish [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html][with org-publish-html from Emacs]]. - -* Installation - -#+BEGIN_SRC sh - go get -u github.com/chaseadamsio/goorgeous -#+END_SRC - -* Usage - -** Org Headers - -To retrieve the headers from a =[]byte=, call =OrgHeaders= and it will return a =map[string]interface{}=: - -#+BEGIN_SRC go - input := "#+title: goorgeous\n* Some Headline\n" - out := goorgeous.OrgHeaders(input) -#+END_SRC - -#+BEGIN_SRC go - map[string]interface{}{ - "title": "goorgeous" - } -#+END_SRC - -** Org Content - -After importing =github.com/chaseadamsio/goorgeous=, you can call =Org= with a =[]byte= and it will return an =html= version of the content as a =[]byte= - -#+BEGIN_SRC go - input := "#+TITLE: goorgeous\n* Some Headline\n" - out := goorgeous.Org(input) -#+END_SRC - -=out= will be: - -#+BEGIN_SRC html -

Some Headline

/n -#+END_SRC - -* Why? - -First off, I've become an unapologetic user of Emacs & ever since finding =org-mode= I use it for anything having to do with writing content, organizing my life and keeping documentation of my days/weeks/months. - -Although I like Emacs & =emacs-lisp=, I publish all of my html sites with [[https://gohugo.io][Hugo Static Site Generator]] and wanted to be able to write my content in =org-mode= in Emacs rather than markdown. - -Hugo's implementation of templating and speed are unmatched, so the only way I knew for sure I could continue to use Hugo and write in =org-mode= seamlessly was to write a golang parser for org content and submit a PR for Hugo to use it. -* Acknowledgements -I leaned heavily on russross' [[https://github.com/russross/blackfriday][blackfriday markdown renderer]] as both an example of how to write a parser (with some updates to leverage the go we know today) and reusing the blackfriday HTML Renderer so I didn't have to write my own! diff --git a/vendor/github.com/chaseadamsio/goorgeous/gopher.gif b/vendor/github.com/chaseadamsio/goorgeous/gopher.gif deleted file mode 100644 index be7567e3cfd666ee40c56b1d808f97116c092053..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15232 zcmeHNRZ|-buuVdM;3+Nvf;$BYMG7>yyA&(Mo#I*~L4yaU6nA&G1}Ow(L!BBLX@(?q_Og4Fw#M8{_u!Xn@> zB+0ANSSUSAfl1hs3(@-)TAk)2AuXPiM(SMDlV40`=4mxt8ASmF%Bjk$8mS*19AIP| z)jT7$H8dkV%>zY@q)hB%n$o=L#)}IJdF9js{rs=4t|mV`C|YW4tgpvSOb|gJ9^OQK zy}flRL2S${&tl&^eIiTG$zRt@E-EB!@yv{jl+-rVNmW%fFd$I!A-A5Rv6G_{2{ADk z3{FqO7^z7=k`1aHZL$g4=wd`FI{Uf(cTxkr-TQ*ejuN| z&a>D$X_a7|{vSM3j8Z}^v%fp=b!nuYpX&Va1L_h|d$a2ggd83~mAylE2SWEp2zd1a zZ3dsbI4|xqb9|i$<3U8fv z&9jb9Ccy>CLA%kmTzSR70&2is?2EsFhzJJ#$4qf>r-044+wc-gG_OU#CINAsq*bDb zDt=Ma6p;2HMSC`{*#FPo>48D4Nl6LMy3fc~nmT#x4yHE%bC`(`TH6oRH|?b&C;&@w z;!VvvALTyQkUEU8$)CCBV_cSR_cC~Qynj=eXh=uVL5aog`xr{=h`gqmxMb@!s$8o#x2cb@8U#P8)cA&DWa{~Hr$x`JNAqa~dE_)-=&D!**vcDzY<@L-XzcS#&txg~JdlOItU-T8|Z^c}qp;XlJ9$somB4=Bm^_ww%=e(e{Ch;&79KK*C2L?qxT9h0}g^!=DHj%@gl zn0S--^lz`HS5r-OD(@$8)y>fG%y7W()P-4V)?FexzV0teS4AS**i2_Bp6-+CqN#VU zCW3cwB)*0nPM+oVd|Prg8_Zv|T#^2e9i#{IUwWmu*SSwsEi+MEy|Zx#d-OTN>x9T$ z{_JLjTlPc2vEIf%*g^We3tq|f(L@kl*zAqeas{~02}NXCglAbUho|V_P4#W&=Xh5a zsgsim0W}mQ3t{}_BNWD&oJQ(OQ|yvSmO&oLdo}H4?1#d)X@!$x zus%2!RpBXcjAHVKX6=0>`2gSJR#(J4DJ2S@o;0mst(@tZSfkW&bu>Hyi}#QI4dXc= z&7Tp?4%CR@*lksdwwffKs1i(v!tH|xqAC1EkcM|91a+kgoc2mF!kh{K5Jr(t&4*=BP+#i`S67ouXB3-;K(PI z730k2@kk)mQWLc*q^l1wPcBiSE9ROGpzGK31y!>6E#Re+hi|ynxL0ff?=cW{B%XU% zH3Ikv%++#JGNJ9{kqZ3~^1i(&YnW4BWxwuu;+YfZ_6Q-#uWvv}RXQ%Nd*bO2G=Ar|u2jjN>SYp6a04DIg_5^i&&8hUP%r?tkMf^vIq^tFr} zF~ejk5TtRn=29I2lE4@Zr1wpnDEzUQRks&K9rszE4~i0_!yX$5u?r?`lVEHhAhHI{ zl|DlWsO_!-$I|UmvEebqA)toEIC{P_a4e~tikin88eOygy%j_DUk;Dro5^>{>iCpw zPRt3G@@89L3g;JKg1BDAA06pO{5&2uYfto5$?Uhz#TzGi=I(tfFfUCgDDz zb)qhM0T}JsDbswr%LY%$HjR%8$;5*xO(v0AuOFH%6J)WC_*9!4CkS`5_xZbfm%+EL zb+ZYqjs(;LO7b&aO7`mh`J(boTKZxa+i{%z63W|-H!Yt*6}Q?X{$X9~)*@yo(_SBX zZE4L|Gv4M`qD==Toqnpkh$TE$9^9=0*uR-X*Y;NVDg+ixF`18aVW8d3%*q8(k<$RAMNsS=;1h;L*Q07 zt|kSTAym)E>}4lzkb`!q=V_t0x$Us97Ru!-KM>YGzW28c#N}mH7YP)vHM#2g>X}ek z0{d^3eInGyAJaNW`zVqJjo;+Fy?Y^A@#}*(`8UOUEoa^H$MgQP?U8&3F2qU}AIVGo zud@yav@J~*Ug%W4>L!_2k7i^O66lEH9RnLZqan>Qc&OfAuwSNly97}XIR|suTb?bA zj~+?Hx~|dNJal;UB(t*z>UjpB-W!&zBBe7d053_sVS5-?7@Dkqt~`wri|rA1)Ysm7 zzx-n(gA+kWtB;h>eDZX&O}vvT{9Mwk3!3G68t9rNp-+VXeGBA<7js{1);J9ZZ9jCB zPn?tK$Q{`#vdt4kUV^Y$<%U_ESYxBJM|7xq-Fu{WDj(_mtB7aY6#BnZsV;$dh+RN0 zQAjC1H?wXQY?{3Z_>Mwz6KQWH5oKKaR2qI0qzeZUK!$;wbk)01i)E;vRC*E&e~DCa zt3Y2Vk!{K@Y>El2jb8zxgh##cOIBRW==9H0VmS4EE|LA$ZN9x9tn}@51H(h_$FmG` zK}}l#CL5`hUEvG%ls_NgRSGM7nZ7M}*APduPNgJ^K(0Hg3%uCS{jWhyaen)F{_#@L zNpL$|W9zSz{!(1`@WqgkXMuX0fCc6U`GRuDA0d7ctkLf!v#eI^#$rjR052QGj-@XSWGVc6b?)!_^b`MFRsIQBv4Ael_r4OSiP|(-QN0EVv zUX8m9KwV-MxMF!i$3*NMaQh>GrkXMFM4Am6UN;Yb!6m+As_IAr*|Fg=^gN)^NH%I1 z;+H84?Q?M`-t)Tn6t6VM$!;6~LHRE-@>R7#VHpB4Np)%%;vD2ofzQ z39Y69PfG%=%{U8e2q52IT--}aliC3E&BA|3K4H-h&PoTAx5xjWg!#}Zl46*MG10H= zTnA{tglJ^gX(;4f41st=urYwXL)!J550wo-2bYjv#S`J8t+FdZjxR5SWRWXN~bf-4gGdi19DVlk_JjM(sL91+ghLp4^zS||eXtxx+>!uO0?w&1oaXV2|Fkt#!LLQ5Co`kYva~H+42bBNZgAq1 z03)j1Oqq};)Vto2w^^Tpq^E$)3hLJVTf(`EkaH{Hr<4W^zNW zdS(vks_5u!1|DiCsO_YPZ-id)Q{H#!Qa5^hg4##lToDZ30G~-TppG%Y+|Mw#gsmgn z;FmiAe^zLoECW0tgt`c0t8%pX;6aIZmUO999Xu*8vDig{sio+vaYz}_8#YX-D0MC# z2b26!daMu{1qo#_F1yWuXk(Cxa=6fSumr2aPv_r2%Z37^?)BUVg zaMDxOPo4dM1{fQZ-P@Tb;zn1ZQB<}DpnwC5J^^gY86_F3Z1byT%;gc%39Y{X9QWR8 zpTE5TBY_r+Kn?)tSw0tyO~s^rncGTvKRCA)2*SOl70-)Q&C5HVG=Pibf>A(hMOF-B z73deHIj<_q7HGi;ENrPS6ag(s05DVaBkM%YKXq5>)gtMc;`!Z0%(bl6X~EE%mDNDu z5WrK$G>;gSlTt?3-HIWXMgnNlK4a5|+FB{bG)iLo*aS5)04PGHVIZF|s}wv;+&mhJ zYE`KA;f%MfiJsJi8}`v&C8&k;0Jmj0VRbcR@Mw@v{z+a=Nicxm61d8r@4gavoS(k8 z+T22waPg_>2XS*r2i|wawx9fsJ;18WM^&&_UOsC8;44~kZ(g3)O%?Y_K$@03l4)l0 zU2Q5%E9O^N*HqOyA@Jj50x2|HsJ=<&38>GlZIqv};1WMe0if^RTz~!5R~lv|&!m91bh9<{K5WfNc7$omrI}A|MOnZVOJJ->Y1_N+6qeN4`dowfjRR zkpwz8@EKEE9vT>*)LHYIYc-+fd4IfpzN!0OOI<0@Nz3^{gF%R1Q3RrHzMh*z(rhdP z%IoP$t50IUb~6j0Mr?b^Ntz9{7+T$%@#;IB7<(PnUv;Su*!BVA)&LwO13xT+7fG76LVF{oA5oX|5AvnB+@pZWF&Q$rHpH2~rVg|DwynU(>q-E*CfC$pUqva19Q{aw=y_S`t zi{&U8MaYi67f+OysVWc|d^S*jY}bhp9IAUTvL`mecsz1sl&B1*H9Q-G5xjGgV0c3lXBVo|xH%QQnRG;zTg2!f z_w$hjTVpMgL)`h~I1emeb{aZ^OTdX@@~$F+zhcCo;yBUi{xr>` ztuMKd7+Gmw-nv=A(JIpE0`z#7@%u*Y_JYf4<|iF)YGdj#rj`$Ykq%E}(BtHJvc9;f z^Mc`%O&p9HEy6U{D69I{s_cz`{~CL=Y&6uuDjXG)w*Kz+(! z&Pr|?H*M^rCeS!NdiJ6Aa6w8=Rm;-=gd5h^nRFLl>gM?Hm3lEzF$jN?ntxz0HVl*P zwD3%5G`e8ApE~@kU^!}YQ8a7J<1Se++}6}bjfdI6#bdglg7GQoikOFR*42DcH6y#w z>Jw7Uz?6^5S|2{yeK1j2B{Y&lFr?7cqkJe66?-S5T$U2IhQ-fTe3Vz7!`6cYo4=k% zd($!^3Q_Tk}g+S`W-&r;hT&N`oOgQvGj4a4uAPexYk5>d^Q z4UH1Qlp7K@r|vSABx&l%_FAKM>uh(6qF1TNhgm&#CKvqZ^!K0qQ4njts4Tsj|IaP??V<03T3tF@r01T7Kuv(Wm`o8Di?9-l(c#at zL&XXVnavS{_A2emD%kgZ`_V%KQC0D+?Jq+6g}iB2+e6putCM(6=Z3BU({I9e)AS!(pQTXAv+nM%ic zY|Ss;KQ$;iB_>*rv+gHs_#|775s>ejm(iz19Nr8zHVtOQRi7x8p&xo~x-lHp3~icN zeqMYfTTK4MP3k0`q-Kn$fGd^D{9|Nd-}-~zJp+Z+_98(U>-o_*Q*6W_D)c0d;9>j| zoCopT4Kr3hLG4(m=OZ~yvd^awv3ljRFMDN}ahCpn#(r%!K(z})hbhbKszSQ)E#%lfLE6>z@>(O+5b!*=0>R+`Z`>^jXo5^i%#>}r)!?AZB21s{x zf4X+{y~~QsAtg723MDT7?7c_bRn69gL)5UL0bL0~_x*wa<3`Ra!hctc> zFGQu(HGBPmT-p{Z?B;gQTk&Z_9rIDv-jBq_by$^|Q4_CR_n02=NB6-uJg%$E1;3#C z9|kYKN9n8zzdcd4YqMfK5~tYSdVSqYr8M6?t22B)Dt~Il%;f)+lS6WIwf^T@^6eSx zZ|^G^xnIdP+%M*{9`*+0&9l5P+&i&I*z03ed_>X7HG5Yd@!OS^XRrD#o4{q~!|$sp zr}#QS2~F@z$z3ox`VH})>ieghq%Utf-~PP$%U%9KbT4ioe3 zghVBkGeQ3Vn8;_+l+`m_3d#}X;O_Y~d8|_)9q{FFZQ(?(M3zgc0B%%;N+U>S?8Lb$ zk33+l)ZOAOJv3<`mJrriqvlYov#q4WSu6`G#q;(yrAQ6$5p+>Km*IpietA9+5-GE) z&L*rvEH24!bJ<-#S`B%Kc07lUnd7)vrM~@MaUU6fJ*j%!Akk>s#14x9%wmOjprIzs zP8U=$qr@dVimUXNUH4;E31q6cnH~k_UBYr-L#Cf%tJ~yHq)w@a6(?qgE6ceeEV*M- zV(%loSK*58mwP4@N6M>x)uiDclx9*e2;Ww=YC=})f{Ux@%YY!?mSFpDw=(Y7QqpDn zPvVe&WjfMVjQ&vG`>Zx{K3#Eb`L$_FtW zzaMK}C@{JYxT119GRcNX9*Mj3kWFZ&KY|MR;i8g5eSIeuU@ceEgv|69stv@OX<58*K?rV!v89d*RCG|I#M{a*CQR^H)1_@D2Ueq@tJ$#7 zz)e+RSh=ukaj!Z3MFem&PoUTFu!-2l-asd6)q@lvdIDP%OlfgA6PLl4NpB?~y+(}d z&3?A&P%`puoymK=DyFZ-wnQVF!VS$9Ab450*jFWmP&aDD2%aw8Tg2v6A`~TpV=SrsO&P^t^Ehq5Z`fjzvPQRd!pHL>Ir~Ai2toJV%l$FWT%{=*ZZ9FCD z!}b(28qfFjLN}*0&0kY?TXQ>vh1Gm^@W6VPpL&eaLq+wena{DAo6%an=;xyihn#Gw zzXh>R#}v71Ep#LPb{Xo5m`*OI2#N&R6N@2?e8jEZyFS7Dm zRE$hx=;uC~{RO8c4$3~nC|Qrh9QjnBEHB|9IF!$o$a(&q;Tx^@Q9O~f;+L#DeV$Dp z$UZI^=yNh0I%-8C!ZGIfS=3*+t z1{(Je4EbEEv=NXQPyr-?z5s@Uy617E?Bc(7V*ARWP9{QrCHV8x!hzp~Pz;4$okf*(7fl{qPrm;D(3H9imvE8AiEjZ0{q zH^_MGgMd$SM3G{fyrZs45VFXQ+EeXxym@tU$98yF3Z)d%_kfAbm+?}^FsB%e{UA#@ zq9o*!wD=joD{Y5TXfn`Dk^SKMrCJk*OK@n4K_^LxXt}5&@q)(6&!Ubnr1#ulJmy^_ z1BnQT$iXjVtL&qd)Vzj+Fj##w^uX#6qT?ci0A;kpvt4p<{?;m*E_UfQeOVtG3Ywf| z3UC~IA#-{z71<MrQh57!^Rc7l; z@n=Ig@H}!=#ir`EX^c6z1dY`izLQceGp0<&dWS;6UyRF1_z~JX3FVUs-d<0cC%s*! z%G~b^lBMJf`Tj)?BHc~jr< z7*TvIPD+4g(@MF^FZ7v45yvHXsjy8z`jm8y7n>Lj1Sp@65e@BA-=k8NPBnSIX^#|P zWT%zOCZi^e<@pdzVzyY|V;jI?)nhOry(i_Yn*rgUYD2QEwKxi8_&2FP3TmL77-`P67O0Thq#8s5Q|mjzs>Q76CWiWTVPb_!e61mjtT zFI$E;5~6{HkfK!N>A`fiW4?SVfQdP+?RvM%q#g`mWFa# zcSQOOiQ%9^k*ha7PJY>;Z3SLXFF*5NDfj=msVv9q%Q-Eea8zBZxcr6jr#cLBrViT$ zlGogE<#~L6@kgTEthio(HV*P$*wBM_DT9M(_eM2bh?d3+?$N2l0TkJSf&6!YQ`_R; zRqcxe@uR}|Z5l%pt2J%kLtqt4Mi*hbevSjSV5ey6-stV|R*TtgGKY=SD65U?i$G2w zn~lUkF8lM)ul(J#&0RhUNYCA11eSR9;WP3%xhTC@AqFG@KjyDI8QKQ#>v50fdcMzd zlkVg8>96>jWL%`)09VfHkO?Ce+BwK3fXGJFo>Cu(2P-+1ctOPDL(X?U*E=iw6#|J6 zW(Gk9Ira)=UZtjf`|hv{sM2Y4TiN!ki#}d@7P*+XFZ=)^zLiFSL6){s0x7btI9MUV z&j=!ZwC+5=;wzoQJN?I%CsdTk9(oKrDGaX=qtE4SD} zGI9r=v3QlcwihK5%>Dk&tq%;cbcVPr zEXoT~A-)jsv*fb1*#6o`17AviL|;&_lD%?~pO7pIW4!J8BUp+B!sh~iF#$jgm6VhX z&pFhp)UXH%kEgd_C7E*#Whgs0VnT6$XnPcimU=l&5K%igQDBS3b;gF3Sg-@TXOjo zuA~x}D;jBF^6=m&#!W1}tPBkT#j%MHL`Pq?gE%3IDP>Tz8--ckq;eS{r=p1RD48-)%%hdk21PwL$}tut zv?|Z$Jt`vzTgg;fZs}JZE0Vw}DKrezAyM+$C^f+XetYF5?=gKV zdfwF`qQfz6Z4`|NidG*;gHedbsL{|3i zKhWAk)j3R6=$8suO4&h{8Z4;Vj~;ZZpcJPc;tp2zCRI~NR()JB;wcWL92@t5z4mi> zz_~gk3RMd!P-EJZ7jT*Qj>#D|oG6)74eLndzf=u{sfTu%pwywRO{D&8`D94 zp#8oDux;2yO+@!otFjpE?RLaQXCGLo-Fqg;736DIFRI+fRwL2@}+EGSlWm}smF zaFW$*Xc!ixmzT-Yd<|Ev*(55w(R^JqRX?NIF@V~O2DLd5wfwjD&y93B5Vb37^&4w} zZKiwu+2XwgdbDdktWIawX!Xx%4lHU7XQBQ7XuZKqj}@RxH={jl+{))&H{*#igR8D6Y(wJ=^UtgO{ztxg~!xfD*!?Bm_U) z^GXo$>!2TF4VVj~1h7$z=O`wODxB*r)%O^Yztf`sp-;#Ej=g>SJ$VR5B)|o}@c^C7 z0OgqF`Ob~dzl?fFjW_=Qw-@xJa9{)uF9S>4U>2hZjZt(Q&8jfg>*=LjlDYkZVygjZ zBEe5>V%p|d8|Khj`Z4N)dIIVuCf{S;fsHxHmZuM67`cd2aVGO9h#51;MPfODepyS% z)b;t2@@!%XhAy3+oM2#iWq8IEe0O~LqNF>Y*4bc_tG_^M|yU*x(n~EB49xKWDOlBfwqq^OE@*_0c!?kuhauFGMLl(6xJYqkeMm%9Ij`%LPYT4 zN9nK4^S^_0#?}Hn%{``w;XrAWh)R~w+}jy*?<3BN@P*=VbP4l(aIH?wpsDMXd4{@$ zC%#2~z0#X%g)<&jv%w!g#wUIoS*p+Qb={S=zXj;109fe)Z6GHdD zTj`FS8XPnov#|Wbw${?QUZOL!AZz7Xi3xpf#p1SE-)J0PGs`W_9v05|_HU-=yUm%- z#TJ;=*x+XFJZrp#S#z(&LagRuwyE*;#@4)KisQt`tn7F|E_Tt`2THaqg1lqOlHx3mP=Fl=15BR*A-)njIstaNL1 zHvCOYQtJ9>AaWa!X(ISPjdr;wFPfEwI_w_xSUAfKPEY??RWz_ zIF>CTsdfUXN!-@ft%G*LP6>i9HI6Urg#YcQlG=-Q*@-#f?l0u*AImQ@ZSOpGIuJir z3r?};DzXpYDf$4}#*io>--dNS# z8GHQG^4vbAx^U`|b@Wy>_lbCxD0DI@WcFP}C&t9tSI)Vn!!bD3Iq;>kP1A{dwsY}} zb2zO*#LG#=JLgx&;AoY7XKojJveQ&!r`Rs-I49hKXwQB8_$=B9=hbxDHQ*94~K2BBOdfV{H?wfN#glqIm=Qq2b zikvhHxm8M8J{JnQslr?;y0o8zKI?g(RuN2&{MD*0`W)Zj)-&MN@K3Fgd^+Ka+wh;y z3tM)rMVf6n&)enCO0?aD07`c9mm9e{!Zpm zHDm3c<2o9lJ{G5mwLVw#@F))Rz%?mNzSNNK-JW_mG5rNszJ0EI?h*ILV=iLUQ=%N- z3_v6z`E>i}yfC+j7{vJ!D|@0Wa03l~@K?}K2F0q)6O-!Igt zN$C+l1`!~YK8gxMtk`}5CFw&`Jvxf>j9(pNR0e8Qyjy?m^fM8Ok9$d{k75u((I9|7 z1HEYBhZpiH!p81`1s@aIQ z>=m`zI1Qm1Ll2gt^(7CbkFGb60i(wB_R46+$D0#Ho|dPPD3m&P86xP*5jobYj|#B@ z`l253P;OJLzT@S&ek5;isL#tOOVsHo%Bg%=b$>n0u<}!&7)dF?(UrW59%sJhL(%bSs6~FG zPWDGcPJt+S!CwAPPQD%A_(yR9EnqJ<_o&1kPRc9$7 vTwbHjFEt;&5pDgN=1cw&96@-xsG_RGKMSARK% z77${pjndjgztQP<&!;*1X!b$Qrqd}4h0dF4h2kdD0lC0*Ip?DeAYmG0%yO*})uNjQ+$%p~IX_n;ER z08bHkG}%96c+`UkyS!)`3$qM}kOmqaOBecUPxZNHu#ICbDwsX72rb1P*;M&!KUScP zzBox_9aob4$SoeIOttyz00~8aqf(DmB$+W9ZMhcdN6fXHS)WDM90HjU-xRXUEhM?J z-ua$gS+pJg_`9j7^OnJhDIXtiUj7wq5=-4HYjP=E?` zeH>D2w2E;0eWAMGdzRI`o9~|9b0B8&rT3z$zR56KbWV7XW{~8eBXp_1ndj%e_U=KZ z$3iM(fB$2@{7n2*HZhycq5rUl zgSBcW^2vQzPV}RifGT$G!k;y&r+ zb^SrmHs8Pea~t`qGvYkx>5p3q_4#Ovdtx)TGos6;@1iK5g1A}2vQXsLO zQ}}AcO!x!`zw;@>qZVh#QAU^jttD~b@6dPD=R(j8wJ4BM!_%bp${9n|qo}P4e+Emz zZytP#KcKSnbvdB{4y900BkW?Y4^XV+mm>NwOfBw4sr&Fu=+9g4Sc;-MzUi6!Eg0^GK52vu{I9>l1Kfl<_bf! zx6eM9$x0-3O=Xu{5!7a;A>hLvn^!@O5C4eNj3`SjJ|ugf(W|CgkRjvKz|5z$sCkq( zb&p7mITU1X90l8SoJuN(z#JV3sU4uJ2=W{WGX1xEqFph>|`aQXF|Eb;FnX? zP6XBOLVZ7G0-kFVJj8y8IrNq!bes{`Y14ltb5)x7;8gkPo}Q0I)5Rd1AvCfs|DtKpU|~>-uln91E-S`PkXobc)Ji14qH1BKZ-E zh6-Z^2u~Ny+{A2BYpNQBqcN?@#Oy!ni*@1>HKw)uMhv0f3w=o34b+2;>zlsnxZDd7 z<7pomH%CNe&V<$LrBP#br?uqdz<9WE6Y(=9Il8Yt(?@tKZrs1N z)<@gT!64}BY-x$!T<(TV?z%bmLkq)}dzftj-q{SJ%dTC8OdV%Nhrvx3#m1w=( zo~;-uczOZiJZK(2eK0kbjl13@lrLiq(ACX$=64WuAX9NSG}c=ESNMXl#qu9xSN|sy zPhFzT749gS?z^Rus23y5r4~Q4L8&6zkL!@_WwgCSFCt{l=0e>$Z+e+%U)xEuU(UMDiLOMz?d=e*NlipyYssSLq@`tS<%-b zJmR}s(I3~|ONBHSX{2*N2004Ya3XZ~ajz*)LptJUKK{gwH-39<)hyY8| zo_R0;kYK@@WKi6?8Zl`O6;JSR&&1y-&*J`785EjW9qLJCV*!pj6y-64UxuZ<0sm=g zFZ3jPNiSkWaJ-D@j{S8prC+c|8WijZ|8ivi>=?ZN{8{%9RzGXzmX<<@DRg^*F`f2H&v_{2gO(mALN za3I|LJkO0H7MZ;v{|8(6`9tP?tFEI!`Q5P#t0d`6Bl7-OZzb>X@J535m+v_;Bcc(3 z+c$rsTA2D47RwP40P-8`D;R$HkE>CW#@mVZnLZc4YuMG$`z$jvnXZM{2ye~iPm zFT(#4@~B&b%dCL;*5fAH1T`$*&@QPG;q!g zH(8`;X48|xLQ(@DP__J%U}YP-K-5#RREZ?IWcua`0K@O$T_Om`FBTqgEa+R|E7S&s zMd5+8B`pX`Yr5poNO>8uNu0OyI~_pU1GsH01sNkM!>0*WcSALhG(%&rG*}M?0iF0Z zGqr3yGmMTt8N|Dr;C#00fSsQ-ln_BAVK7!z=mo?d-mH&=sPEmbek@yi1Nh9`Nme%T zZfE{#>5hJX#ej*gujr=&D`d`ANf`^Oc~csTq_WT?hylEQw+`Cft;*g!oJ2Slumk*A zc(iGqZ)uc0_QBU|*QH2GYXsq<#;#y-j^rtSyBg++?hBMQ~c&PXUepd%kApot*h!e;y33z9?2y97GNPs;U28(k>} z$Ed=VfO0D-B%v%oQ1Jzb9t)hY3x^>fVMwmPLlBPB1qEj0244gF;#@_y~BLa0P; z<=De{Anm{gJhHMu5F!C>={w-Cd%%mk%Dfl^elXWJa{ys5;%O8?5m(icCzFEi?p^jW ze?k$9eC1gwvR4k_PEOz)dd$eUYpsaTy&DH2kU&nXja|N5n^WY#Gt06^;QT_9SfpHSi9Bua3VlxByjVTpr`s3i?iBkP3$&r*hiPR zDVGKsEJz(2PCFSNdSCcZ=1uRgy=!b{z|`@fEi;c9BA&a3P!NkpjdiBv%ZsbcYudwy zf;kwE^C6C1p8Gwww)a;n{9BfeEv_>cTNnqvBpYOu?AuK(hf-hfL5PD4xf|A#}H$@c?A5`z23sC%oU^=fm^u`SNW30e-G-@kyWoe60mv?i>ODMCZnD zZLjR^?k*@Oz%cCHyLU~>bHkB)#>dC4-T4g-4aPR6nS1lfd+S6Z5ueY$efzf8a>41- zr)9$@61Qc9tXW!KUjB7fTPPH|1i6dF;=CipIF9QWvh|HPQ++j7cGd;GlV-LSw&sQ? zik_&*@^GFfD_VWOb9Y?mqRnfj=;i!=B-ZJynI}BS6+N@tZ;>hwz;u*3D>3mZcB)es>jh89oO*Gw~ggt zY%T4Aj2I&>>q0lWcDsaUWfJA;x5&@Kavry+Q0lit;2#_8WbY8RB9d)tnVOPnV90Zg zOguK(fwDQW2Bx8n+58CmMNY5!Wkwc;vaM?t zIrF`I+!G7a)R`)_d{VlY-qPHB(l=*zc2@DO=NJEq^8fgs95DV52?C%NSpTc~cN2g% z3moYjfkNI>MANj48&EV}*^bT)JSb>8)VG7}=&@AZcG$lZ^(f=i4gqqNMc511sx!~~ zVO`hX59YODWQNoF@FRR~*{ueY&JbhZ_;4|40e3)hcAghhQ^gSnZsd+o87G&8Na+!C zT9$6vaE_~aDy*#r74tVc`9}pOkLuY>pT81tVZp1*t4m$XZ+F;#zoYf-%TZ-*z<9!k zyiwjrhmU?o{y+OpBvtEbCCd1pKM2ldwQc%&YL2FC*rdGrJQtdPR2U0_EQC7FUYE-5 zs<{i7!c?F1R3DKD3#_+o$r!ga(Do+rmgKrhG_d|%EDRnPtbl^{KfF$Ln9UXb?!C{1 ze&?87@7$Xk4XQg+rW3ebp1n<1j*mCs)C$(z*T$r-$AZD*k}e(P@f@!0w-M?BL_~W4C>vVs4U5k zCipU#ojTn^QmgoSuVh8!v{dK&O|HNIUCH0Boh6XmkEim{9*WLVf@2nJ!tbG~nh`!a zsx)ywO_Dxz7t!q!Vkx=v2#5}sxFtvFa^<6l=7x%R*7AHl79}2&7a=k?thX-RKuAz4 ze%3xB=`e(cLGms6fKKi1CWN`8mD0PfRwyKz*=J{6HObs)`Kuaj1~)Y-)`E3BL3@Le z!W0~pJ%TyWD!pU_27iP?$uD6^nAQpmpmS5j<+K-dCiC&dk0P)-6R5PY{H_K zG?~rA!2GpeFeGM$4^GW{pB5L(@}*G=28w!&Nn|KuV>?t)oK_Dtgaj z5d1?3Gk0_PWi9(5tgF#^s4xL8!3$yiert%Nin$-HMVE5gDGRa~J*3KQH#jhJK(BhJ ziN&-Z*6M$Kwok)HXt{pIBja2jI`U{QB2p1Knjs@Dl{AYS-%r<*?Yw&Kh8m&J!=@EV z=uwouayl7$#>|OQWzPq}d)Gbi;j?J249F;T47T33P_q+VN3Addc9q>-zp4+-C~MNc?j!Suj8z2j zsk1&M7(EWoQ4!))O@Gir7iDOlZ6rAXH!_Y2t-J|XV8+_>rYxqZHlF0+4`5+if$k>! z3xC_iyTciIiF%-F*+v$n0))Gd1XBh5*Scznl2XUUb`~chn98Jz)A+O-TqUZ{_G52CSfVs5_E`u+j|?Y>mA-pRUOiC%!TzTtn#i4t61N zpF)8@#q-P6+1N2lA%vznNY0Kmy}oy+l9qZBnMyQ(*1Caj6PXZ_O3Y|X6;dqPof7^W z(AIv6(>Nd3KGs@FrOaHYpaV)&%C2ZyW*p)Ub(LVwzV+g3`rm2vB#F+*<;#te8gYTT7QI2MZi`{}8 z9dMGa5WVA#6`~HVCzkXbtAxiwj@?*u1>Fg7R3RrdSoNqZ|8=`;Pg(@{t3|n;)esmN zv5Mvu(Q*B5tAiKK?ULnU?s|4b1x_7qqb1R7MjqN$X zLSCP9T3q58wM$8}AWf*JZ~S}JxR>;@?K1mFwp5fz6#J8U)z?~VH3W^3;HrognQJ}H zv3l4#prmGVy?G2t>DHK?>M3Xu`Vw6>JZp=eZF(MigNqBgU!32rCwZJ@-`2a!H!ZQ( zpw*}O+n;^5@|6CJ)$4Uti8D)bPIvgU>Ms(nczv|mB>CnWgaMp255Cu6$^Tx}{Kwct z!X&IWs@dp-9o$m3?~?BOhRw|>)}b~ZE|1sIe7^=M`IKlA#8x22N_~HBG;n+@-%Wo8$7YA3OJ7zje>jmpV<0gxwLK|+~y3vid;B%Zp<-+3#*tA&|#aa;qym(=*xwO`Qi(Q z5Rqp@C=Mga0AmfYC$sY*Y*!F78xfz}t{QwnU)QOzIpepFF)SQ*@BhqYM?2O(J~d_k zIj`9gV04{uTysQuD>ejbR9zwSc8NS;8(jj62r261OtKR99GTa`)|7LHLwtMHnQ)<| zmNVH_1j++i{*3k$kU!${5?mY3Kl-^P^FZkX*AIOzI`hRTr(Tz7=+9lBk?m`z zOem>|ewY|2@oC+afutPS^Y~WwIV0&rW}3dq^K0jK+f6FP{j32U)|rdrhmxT3WTwmb30ivbz$BwBx6@p-I!V`k zPrJC9s^@JC;Xqwj9I2IXt_=(0qA z6(T&xu4`_HRvvO|Crf;~>$%}D93ZQ@0p00Uww|0B;g>kIW|I%~=AkDw%j z0BGgzMA9b>9+j(q-bJyt9OahxW`mK~aPa+d9+)~jcsun6-Z7OlUHq0{!=ZbSR5|JK zrgm~5D%JcXe`;cktH#yAeAE0M+9;vo&cw}bT;MS*pp%ds*7~RHnog&*`2nY}`bhn! zxR4%gY-0j7AJb@_vQ$-j!Xl4?uPex(Rlkupjep+*ZNYxN&cLeRBLK|n^oWYh0t_?- zQh%Ivm}&-)XG|Zsdi*c7t6fEs{n2DgF8pDmjg85m05oiGC(j2(mPXIMH29H#0)Bg6 zY>ub(rX;s|Li)~gVI|;^Q@o9VK5oMyK+=9XSpomm4_} v3 - -Version 3 adds several new, frequently requested features. To do so, it introduces a few breaking changes. We've worked to keep these as minimal as possible. This guide explains the breaking changes and how you can quickly update your code. - -### `Token.Claims` is now an interface type - -The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`. We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`. - -`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior. It is the default claims type when using `Parse`. The usage is unchanged except you must type cast the claims property. - -The old example for parsing a token looked like this.. - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is now directly mapped to... - -```go - if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -`StandardClaims` is designed to be embedded in your custom type. You can supply a custom claims type with the new `ParseWithClaims` function. Here's an example of using a custom claims type. - -```go - type MyCustomClaims struct { - User string - *StandardClaims - } - - if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil { - claims := token.Claims.(*MyCustomClaims) - fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt) - } -``` - -### `ParseFromRequest` has been moved - -To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`. The method signatues have also been augmented to receive a new argument: `Extractor`. - -`Extractors` do the work of picking the token string out of a request. The interface is simple and composable. - -This simple parsing example: - -```go - if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil { - fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) - } -``` - -is directly mapped to: - -```go - if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil { - claims := token.Claims.(jwt.MapClaims) - fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) - } -``` - -There are several concrete `Extractor` types provided for your convenience: - -* `HeaderExtractor` will search a list of headers until one contains content. -* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content. -* `MultiExtractor` will try a list of `Extractors` in order until one returns content. -* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token. -* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument -* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed. A simple example is stripping the `Bearer ` text from a header - - -### RSA signing methods no longer accept `[]byte` keys - -Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse. - -To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`. These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types. - -```go - func keyLookupFunc(*Token) (interface{}, error) { - // Don't forget to validate the alg is what you expect: - if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { - return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) - } - - // Look up key - key, err := lookupPublicKey(token.Header["kid"]) - if err != nil { - return nil, err - } - - // Unpack key from PEM encoded PKCS8 - return jwt.ParseRSAPublicKeyFromPEM(key) - } -``` diff --git a/vendor/github.com/dgrijalva/jwt-go/README.md b/vendor/github.com/dgrijalva/jwt-go/README.md deleted file mode 100644 index f48365fafb..0000000000 --- a/vendor/github.com/dgrijalva/jwt-go/README.md +++ /dev/null @@ -1,85 +0,0 @@ -A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) - -[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go) - -**BREAKING CHANGES:*** Version 3.0.0 is here. It includes _a lot_ of changes including a few that break the API. We've tried to break as few things as possible, so there should just be a few type signature changes. A full list of breaking changes is available in `VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating your code. - -**NOTICE:** A vulnerability in JWT was [recently published](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/). As this library doesn't force users to validate the `alg` is what they expected, it's possible your usage is effected. There will be an update soon to remedy this, and it will likey require backwards-incompatible changes to the API. In the short term, please make sure your implementation verifies the `alg` is what you expect. - - -## What the heck is a JWT? - -JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens. - -In short, it's a signed JSON object that does something useful (for example, authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is made of three parts, separated by `.`'s. The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded. The last part is the signature, encoded the same way. - -The first part is called the header. It contains the necessary information for verifying the last part, the signature. For example, which encryption method was used for signing and what key was used. - -The part in the middle is the interesting bit. It's called the Claims and contains the actual stuff you care about. Refer to [the RFC](http://self-issued.info/docs/draft-jones-json-web-token.html) for information about reserved keys and the proper way to add your own. - -## What's in the box? - -This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. - -## Examples - -See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage: - -* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) -* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac) -* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples) - -## Extensions - -This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. - -Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go - -## Compliance - -This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences: - -* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key. - -## Project Status & Versioning - -This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason). - -This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases). - -While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users. You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v2`. It will do the right thing WRT semantic versioning. - -## Usage Tips - -### Signing vs Encryption - -A token is simply a JSON object that is signed by its author. this tells you exactly two things about the data: - -* The author of the token was in the possession of the signing secret -* The data has not been modified since it was signed - -It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. - -### Choosing a Signing Method - -There are several signing methods available, and you should probably take the time to learn about the various options before choosing one. The principal design decision is most likely going to be symmetric vs asymmetric. - -Symmetric signing methods, such as HSA, use only a single secret. This is probably the simplest signing method to use since any `[]byte` can be used as a valid secret. They are also slightly computationally faster to use, though this rarely is enough to matter. Symmetric signing methods work the best when both producers and consumers of tokens are trusted, or even the same system. Since the same secret is used to both sign and validate tokens, you can't easily distribute the key for validation. - -Asymmetric signing methods, such as RSA, use different keys for signing and verifying tokens. This makes it possible to produce tokens with a private key, and allow any consumer to access the public key for verification. - -### JWT and OAuth - -It's worth mentioning that OAuth and JWT are not the same thing. A JWT token is simply a signed JSON object. It can be used anywhere such a thing is useful. There is some confusion, though, as JWT is the most common type of bearer token used in OAuth2 authentication. - -Without going too far down the rabbit hole, here's a description of the interaction of these technologies: - -* OAuth is a protocol for allowing an identity provider to be separate from the service a user is logging in to. For example, whenever you use Facebook to log into a different service (Yelp, Spotify, etc), you are using OAuth. -* OAuth defines several options for passing around authentication data. One popular method is called a "bearer token". A bearer token is simply a string that _should_ only be held by an authenticated user. Thus, simply presenting this token proves your identity. You can probably derive from here why a JWT might make a good bearer token. -* Because bearer tokens are used for authentication, it's important they're kept secret. This is why transactions that use bearer tokens typically happen over SSL. - -## More - -Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go). - -The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in to documentation. diff --git a/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md b/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md deleted file mode 100644 index b605b45093..0000000000 --- a/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md +++ /dev/null @@ -1,105 +0,0 @@ -## `jwt-go` Version History - -#### 3.0.0 - -* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code - * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods. - * `ParseFromRequest` has been moved to `request` subpackage and usage has changed - * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims. -* Other Additions and Changes - * Added `Claims` interface type to allow users to decode the claims into a custom type - * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into. - * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage - * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims` - * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`. - * Added several new, more specific, validation errors to error type bitmask - * Moved examples from README to executable example files - * Signing method registry is now thread safe - * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser) - -#### 2.7.0 - -This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes. - -* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying -* Error text for expired tokens includes how long it's been expired -* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM` -* Documentation updates - -#### 2.6.0 - -* Exposed inner error within ValidationError -* Fixed validation errors when using UseJSONNumber flag -* Added several unit tests - -#### 2.5.0 - -* Added support for signing method none. You shouldn't use this. The API tries to make this clear. -* Updated/fixed some documentation -* Added more helpful error message when trying to parse tokens that begin with `BEARER ` - -#### 2.4.0 - -* Added new type, Parser, to allow for configuration of various parsing parameters - * You can now specify a list of valid signing methods. Anything outside this set will be rejected. - * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON -* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go) -* Fixed some bugs with ECDSA parsing - -#### 2.3.0 - -* Added support for ECDSA signing methods -* Added support for RSA PSS signing methods (requires go v1.4) - -#### 2.2.0 - -* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic. - -#### 2.1.0 - -Backwards compatible API change that was missed in 2.0.0. - -* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte` - -#### 2.0.0 - -There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change. - -The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`. - -It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`. - -* **Compatibility Breaking Changes** - * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct` - * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct` - * `KeyFunc` now returns `interface{}` instead of `[]byte` - * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key - * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key -* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodHS256` - * Added public package global `SigningMethodHS384` - * Added public package global `SigningMethodHS512` -* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type. - * Added public package global `SigningMethodRS256` - * Added public package global `SigningMethodRS384` - * Added public package global `SigningMethodRS512` -* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged. -* Refactored the RSA implementation to be easier to read -* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM` - -#### 1.0.2 - -* Fixed bug in parsing public keys from certificates -* Added more tests around the parsing of keys for RS256 -* Code refactoring in RS256 implementation. No functional changes - -#### 1.0.1 - -* Fixed panic if RS256 signing method was passed an invalid key - -#### 1.0.0 - -* First versioned release -* API stabilized -* Supports creating, signing, parsing, and validating JWT tokens -* Supports RS256 and HS256 signing methods \ No newline at end of file diff --git a/vendor/github.com/edsrzf/mmap-go/README.md b/vendor/github.com/edsrzf/mmap-go/README.md deleted file mode 100644 index 4cc2bfe1c8..0000000000 --- a/vendor/github.com/edsrzf/mmap-go/README.md +++ /dev/null @@ -1,12 +0,0 @@ -mmap-go -======= - -mmap-go is a portable mmap package for the [Go programming language](http://golang.org). -It has been tested on Linux (386, amd64), OS X, and Windows (386). It should also -work on other Unix-like platforms, but hasn't been tested with them. I'm interested -to hear about the results. - -I haven't been able to add more features without adding significant complexity, -so mmap-go doesn't support mprotect, mincore, and maybe a few other things. -If you're running on a Unix-like platform and need some of these features, -I suggest Gustavo Niemeyer's [gommap](http://labix.org/gommap). diff --git a/vendor/github.com/elazarl/go-bindata-assetfs/README.md b/vendor/github.com/elazarl/go-bindata-assetfs/README.md deleted file mode 100644 index 27ee48f09d..0000000000 --- a/vendor/github.com/elazarl/go-bindata-assetfs/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# go-bindata-assetfs - -Serve embedded files from [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) with `net/http`. - -[GoDoc](http://godoc.org/github.com/elazarl/go-bindata-assetfs) - -### Installation - -Install with - - $ go get github.com/jteeuwen/go-bindata/... - $ go get github.com/elazarl/go-bindata-assetfs/... - -### Creating embedded data - -Usage is identical to [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) usage, -instead of running `go-bindata` run `go-bindata-assetfs`. - -The tool will create a `bindata_assetfs.go` file, which contains the embedded data. - -A typical use case is - - $ go-bindata-assetfs data/... - -### Using assetFS in your code - -The generated file provides an `assetFS()` function that returns a `http.Filesystem` -wrapping the embedded files. What you usually want to do is: - - http.Handle("/", http.FileServer(assetFS())) - -This would run an HTTP server serving the embedded files. - -## Without running binary tool - -You can always just run the `go-bindata` tool, and then - -use - - import "github.com/elazarl/go-bindata-assetfs" - ... - http.Handle("/", - http.FileServer( - &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: "data"})) - -to serve files embedded from the `data` directory. diff --git a/vendor/github.com/ethantkoenig/rupture/Gopkg.lock b/vendor/github.com/ethantkoenig/rupture/Gopkg.lock deleted file mode 100644 index 86e495e783..0000000000 --- a/vendor/github.com/ethantkoenig/rupture/Gopkg.lock +++ /dev/null @@ -1,173 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/RoaringBitmap/roaring" - packages = ["."] - revision = "84551f0e309d6f9bafa428ef39b31ab7f16ff7b8" - version = "v0.4.1" - -[[projects]] - branch = "master" - name = "github.com/Smerity/govarint" - packages = ["."] - revision = "7265e41f48f15fd61751e16da866af3c704bb3ab" - -[[projects]] - name = "github.com/blevesearch/bleve" - packages = [ - ".", - "analysis", - "analysis/analyzer/standard", - "analysis/datetime/flexible", - "analysis/datetime/optional", - "analysis/lang/en", - "analysis/token/lowercase", - "analysis/token/porter", - "analysis/token/stop", - "analysis/tokenizer/unicode", - "document", - "geo", - "index", - "index/scorch", - "index/scorch/mergeplan", - "index/scorch/segment", - "index/scorch/segment/mem", - "index/scorch/segment/zap", - "index/store", - "index/store/boltdb", - "index/store/gtreap", - "index/upsidedown", - "mapping", - "numeric", - "registry", - "search", - "search/collector", - "search/facet", - "search/highlight", - "search/highlight/format/html", - "search/highlight/fragmenter/simple", - "search/highlight/highlighter/html", - "search/highlight/highlighter/simple", - "search/query", - "search/scorer", - "search/searcher" - ] - revision = "a3b125508b4443344b596888ca58467b6c9310b9" - -[[projects]] - branch = "master" - name = "github.com/blevesearch/go-porterstemmer" - packages = ["."] - revision = "23a2c8e5cf1f380f27722c6d2ae8896431dc7d0e" - -[[projects]] - branch = "master" - name = "github.com/blevesearch/segment" - packages = ["."] - revision = "762005e7a34fd909a84586299f1dd457371d36ee" - -[[projects]] - branch = "master" - name = "github.com/boltdb/bolt" - packages = ["."] - revision = "9da31745363232bc1e27dbab3569e77383a51585" - -[[projects]] - branch = "master" - name = "github.com/couchbase/vellum" - packages = [ - ".", - "regexp", - "utf8" - ] - revision = "ed84a675e24ed0a0bf6859b1ddec7e7c858354bd" - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/edsrzf/mmap-go" - packages = ["."] - revision = "0bce6a6887123b67a60366d2c9fe2dfb74289d2e" - -[[projects]] - branch = "master" - name = "github.com/glycerine/go-unsnap-stream" - packages = ["."] - revision = "62a9a9eb44fd8932157b1a8ace2149eff5971af6" - -[[projects]] - name = "github.com/golang/protobuf" - packages = ["proto"] - revision = "925541529c1fa6821df4e44ce2723319eb2be768" - version = "v1.0.0" - -[[projects]] - branch = "master" - name = "github.com/golang/snappy" - packages = ["."] - revision = "553a641470496b2327abcac10b36396bd98e45c9" - -[[projects]] - branch = "master" - name = "github.com/mschoch/smat" - packages = ["."] - revision = "90eadee771aeab36e8bf796039b8c261bebebe4f" - -[[projects]] - name = "github.com/philhofer/fwd" - packages = ["."] - revision = "bb6d471dc95d4fe11e432687f8b70ff496cf3136" - version = "v1.0.0" - -[[projects]] - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - branch = "master" - name = "github.com/steveyen/gtreap" - packages = ["."] - revision = "0abe01ef9be25c4aedc174758ec2d917314d6d70" - -[[projects]] - name = "github.com/stretchr/testify" - packages = ["assert"] - revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" - version = "v1.2.1" - -[[projects]] - branch = "master" - name = "github.com/tinylib/msgp" - packages = ["msgp"] - revision = "03a79185462ad029a6e7e05b2f3f3e0498d0a6c0" - -[[projects]] - branch = "master" - name = "github.com/willf/bitset" - packages = ["."] - revision = "1a37ad96e8c1a11b20900a232874843b5174221f" - -[[projects]] - name = "golang.org/x/net" - packages = ["context"] - revision = "309822c5b9b9f80db67f016069a12628d94fad34" - -[[projects]] - name = "golang.org/x/sys" - packages = ["unix"] - revision = "3dbebcf8efb6a5011a60c2b4591c1022a759af8a" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "61c759f0c1136cadf86ae8a30bb78edf33fc844cdcb2316469b4ae14a8d051b0" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/ethantkoenig/rupture/Gopkg.toml b/vendor/github.com/ethantkoenig/rupture/Gopkg.toml deleted file mode 100644 index 55dbd3b239..0000000000 --- a/vendor/github.com/ethantkoenig/rupture/Gopkg.toml +++ /dev/null @@ -1,34 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.2.1" - -[prune] - go-tests = true - unused-packages = true diff --git a/vendor/github.com/ethantkoenig/rupture/README.md b/vendor/github.com/ethantkoenig/rupture/README.md deleted file mode 100644 index da76681e38..0000000000 --- a/vendor/github.com/ethantkoenig/rupture/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# rupture - -[![Build Status](https://travis-ci.org/ethantkoenig/rupture.svg?branch=master)](https://travis-ci.org/ethantkoenig/rupture) [![GoDoc](https://godoc.org/github.com/ethantkoenig/rupture?status.svg)](https://godoc.org/github.com/ethantkoenig/rupture) [![Go Report Card](https://goreportcard.com/badge/blevesearch/bleve)](https://goreportcard.com/report/blevesearch/bleve) - -An explosive companion to the [bleve indexing library](https://www.github.com/blevesearch/bleve) - -## Features - -`rupture` includes the following additions to `bleve`: - -- __Flushing batches__: Batches of operation which automatically flush to the underlying bleve index. -- __Sharded indices__: An index-like abstraction built on top of several underlying indices. Sharded indices provide lower write latencies for indices with large amounts of data. -- __Index metadata__: Track index version for easily managing migrations and schema changes. diff --git a/vendor/github.com/facebookgo/clock/README.md b/vendor/github.com/facebookgo/clock/README.md deleted file mode 100644 index 5d4f4fe72e..0000000000 --- a/vendor/github.com/facebookgo/clock/README.md +++ /dev/null @@ -1,104 +0,0 @@ -clock [![Build Status](https://drone.io/github.com/benbjohnson/clock/status.png)](https://drone.io/github.com/benbjohnson/clock/latest) [![Coverage Status](https://coveralls.io/repos/benbjohnson/clock/badge.png?branch=master)](https://coveralls.io/r/benbjohnson/clock?branch=master) [![GoDoc](https://godoc.org/github.com/benbjohnson/clock?status.png)](https://godoc.org/github.com/benbjohnson/clock) ![Project status](http://img.shields.io/status/experimental.png?color=red) -===== - -Clock is a small library for mocking time in Go. It provides an interface -around the standard library's [`time`][time] package so that the application -can use the realtime clock while tests can use the mock clock. - -[time]: http://golang.org/pkg/time/ - - -## Usage - -### Realtime Clock - -Your application can maintain a `Clock` variable that will allow realtime and -mock clocks to be interchangable. For example, if you had an `Application` type: - -```go -import "github.com/benbjohnson/clock" - -type Application struct { - Clock clock.Clock -} -``` - -You could initialize it to use the realtime clock like this: - -```go -var app Application -app.Clock = clock.New() -... -``` - -Then all timers and time-related functionality should be performed from the -`Clock` variable. - - -### Mocking time - -In your tests, you will want to use a `Mock` clock: - -```go -import ( - "testing" - - "github.com/benbjohnson/clock" -) - -func TestApplication_DoSomething(t *testing.T) { - mock := clock.NewMock() - app := Application{Clock: mock} - ... -} -``` - -Now that you've initialized your application to use the mock clock, you can -adjust the time programmatically. The mock clock always starts from the Unix -epoch (midnight, Jan 1, 1970 UTC). - - -### Controlling time - -The mock clock provides the same functions that the standard library's `time` -package provides. For example, to find the current time, you use the `Now()` -function: - -```go -mock := clock.NewMock() - -// Find the current time. -mock.Now().UTC() // 1970-01-01 00:00:00 +0000 UTC - -// Move the clock forward. -mock.Add(2 * time.Hour) - -// Check the time again. It's 2 hours later! -mock.Now().UTC() // 1970-01-01 02:00:00 +0000 UTC -``` - -Timers and Tickers are also controlled by this same mock clock. They will only -execute when the clock is moved forward: - -``` -mock := clock.NewMock() -count := 0 - -// Kick off a timer to increment every 1 mock second. -go func() { - ticker := clock.Ticker(1 * time.Second) - for { - <-ticker.C - count++ - } -}() -runtime.Gosched() - -// Move the clock forward 10 second. -mock.Add(10 * time.Second) - -// This prints 10. -fmt.Println(count) -``` - - diff --git a/vendor/github.com/facebookgo/httpdown/readme.md b/vendor/github.com/facebookgo/httpdown/readme.md deleted file mode 100644 index d5fa245dbc..0000000000 --- a/vendor/github.com/facebookgo/httpdown/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -httpdown [![Build Status](https://secure.travis-ci.org/facebookgo/httpdown.png)](https://travis-ci.org/facebookgo/httpdown) -======== - -Documentation: https://godoc.org/github.com/facebookgo/httpdown - -Package httpdown provides a library that makes it easy to build a HTTP server -that can be shutdown gracefully (that is, without dropping any connections). - -If you want graceful restart and not just graceful shutdown, look at the -[grace](https://github.com/facebookgo/grace) package which uses this package -underneath but also provides graceful restart. - -Usage ------ - -Demo HTTP Server with graceful termination: -https://github.com/facebookgo/httpdown/blob/master/httpdown_example/main.go - -1. Install the demo application - - go get github.com/facebookgo/httpdown/httpdown_example - -1. Start it in the first terminal - - httpdown_example - - This will output something like: - - 2014/11/18 21:57:50 serving on http://127.0.0.1:8080/ with pid 17 - -1. In a second terminal start a slow HTTP request - - curl 'http://localhost:8080/?duration=20s' - -1. In a third terminal trigger a graceful shutdown (using the pid from your output): - - kill -TERM 17 - -This will demonstrate that the slow request was served before the server was -shutdown. You could also have used `Ctrl-C` instead of `kill` as the example -application triggers graceful shutdown on TERM or INT signals. diff --git a/vendor/github.com/facebookgo/stats/readme.md b/vendor/github.com/facebookgo/stats/readme.md deleted file mode 100644 index f268ed307b..0000000000 --- a/vendor/github.com/facebookgo/stats/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -stats [![Build Status](https://secure.travis-ci.org/facebookgo/stats.png)](https://travis-ci.org/facebookgo/stats) -===== - -Documentation: https://godoc.org/github.com/facebookgo/stats diff --git a/vendor/github.com/glycerine/go-unsnap-stream/README.md b/vendor/github.com/glycerine/go-unsnap-stream/README.md deleted file mode 100644 index b1b8c74751..0000000000 --- a/vendor/github.com/glycerine/go-unsnap-stream/README.md +++ /dev/null @@ -1,20 +0,0 @@ -go-unsnap-stream -================ - -This is a small golang library for decoding and encoding the snappy *streaming* format, specified here: https://github.com/google/snappy/blob/master/framing_format.txt - -Note that the *streaming or framing format* for snappy is different from snappy itself. Think of it as a train of boxcars: the streaming format breaks your data in chunks, applies snappy to each chunk alone, then puts a thin wrapper around the chunk, and sends it along in turn. You can begin decoding before receiving everything. And memory requirements for decoding are sane. - -Strangely, though the streaming format was first proposed in Go[1][2], it was never upated, and I could not locate any other library for Go that would handle the streaming/framed snappy format. Hence this implementation of the spec. There is a command line tool[3] that has a C implementation, but this is the only Go implementation that I am aware of. The reference for the framing/streaming spec seems to be the python implementation[4]. - -For binary compatibility with the python implementation, one could use the C-snappy compressor/decompressor code directly; using github.com/dgryski/go-csnappy. In fact we did this for a while to verify byte-for-byte compatiblity, as the native Go implementation produces slightly different binary compression (still conformant with the standard of course), which made test-diffs harder, and some have complained about it being slower than the C. - -However, while the c-snappy was useful for checking compatibility, it introduced dependencies on external C libraries (both the c-snappy library and the C standard library). Our go binary executable that used the go-unsnap-stream library was no longer standalone, and deployment was painful if not impossible if the target had a different C standard library. So we've gone back to using the snappy-go implementation (entirely in Go) for ease of deployment. See the comments at the top of unsnap.go if you wish to use c-snappy instead. - -[1] https://groups.google.com/forum/#!msg/snappy-compression/qvLNe2cSH9s/R19oBC-p7g4J - -[2] https://codereview.appspot.com/5167058 - -[3] https://github.com/kubo/snzip - -[4] https://pypi.python.org/pypi/python-snappy \ No newline at end of file diff --git a/vendor/github.com/glycerine/go-unsnap-stream/binary.dat b/vendor/github.com/glycerine/go-unsnap-stream/binary.dat deleted file mode 100644 index f31eee2e24025b5f68a8b4c0fdad4af60b6db461..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5592 zcmV;}6({N+iwFSa!qHLy1MOUUciP6b@4x0#OzBDjjv|cXJPs$$DZx15)&?KIO>$nK)qMB>Upt2QA1exc(KSUItT1Wl zfon@Yk}YxA8=E|NKL|xAXEKz&Ee+xNwwE|E0#HW^D;DuwifItX!9oNxzM8onzCzrf ztL0@p4}5~;E|#8LNI$k>7t3O_BLT(rPkA7ryS&6iYeBbWLAbDDQ;ej7*dh?7X*Mk1 zvIF0-8m6lE$ zP&#fDhwe0C<`cC^1Qz%r3X;&4d}r$VR(Q#*j|_3)#&ZGb)88P80b~Jb&43_*FoYF? zoibdwaSWC%!{FR?@FSjUt(XO#7hI4mNnS2Zig?mO#w|_W<_cmFsfEUfWwd}fgOu0; zrUcZQ2In#tTgD|nh+Wdpcn+z0fJlIf>-x?LQdrjZEO#M8^IBxEXn`jwG9cASfZ(5n zk5IH`u$;h7a=XFI2BZ>TL?~b)GIT93%K6V?BhW=sauWN}<(V|Xw-z$BS}TE+!w86n zrNwCsOT~@JTzmzRMlP&NF_ol7ASDpecW_sd#sHT^5KEyL6-PNGKo%;QdIzv33TE*I zDTUTD5y2Kn$uQX^&LsW>(2;@TlE?Bf38w4ZEX}7z{=4 z@aUiiaDYE-_s6~N$Pm4L=iqp+*MDgUfDrw`SRC}=DKTt3Flbr8x;jw|_Qhd$*m;G^ z_KV&@Z~TT=-0zM1wAwzFYm1}yaNO%0AGC+!=y-TE7!fccZm&1$9JG6f-8~Z+U{%rm zvD+Vu(W~~s0RaNa;&3qR_J(coq6?JTFAlm2Drnm44ZEGOL74URZz2S|0yYPR7#(#x zJ^Io8sSDKG!#4)e4^EA`|2)PZJQREF!}iPW2taBdVFKjPIUaTo2}965I({)4_r}NL zu6Q{Z>@jOc-QkbDPIvTofIAqBm_Ns(u7Op?ZC)Hez?{+F>GzA{QIFZw>yNv`;qlS9 zH|W3@C zU$pmr>=E*MIAlKRY5icah9XG|<1Ql{zN_Bfi?F za4hUl!ubeGIAO4S;Q9~X7(EI|@KlY95Ch?5;5Ol~#AXngG)o1CIb4_rr{V-@>{rRk zG7Byu@IBWDaCjMnQ;O7BP5TWuu2kYn#LpZX0Z#`ITF@5Kr#c*A2XwgZ;qTMr>CI85Yari07=Aec;YE97FA}6Z;RSYZ03xpi@jvA ztksDV&;s)aT!?42s-_xp7oPM_5h3n49D~TCLts(sXa7$0vtKpnd2ME@3FZr;u2!!b znxR*p)XNKLu6+7JYQnmOR-V*}Q)@{cLN#hj@%DsdQ5Q9z*a%65A^i(N=0>C819KW` z2p^!^j>F=_pw_N9W(6Ghav$lZ#Nwv^Cp@mrdq3EVO?7~K1f>C7Jx<*6zTmcX4oj#67_AD2G`{ajVV*)r2QIHe50 z6-D?^V7Ke>97cqcj3(dBm!P4nO)ZtL8FWp`hifc{E5)#u*!1N^t?05~aA1=1D4ct% zDolGhtq~jA*?sDK0MI;50ptv%0c9SpnsdhsA_*79EF(7PncARC{ha1&Pic|GBOX!c zAtWrWBDp+;14c^C#bX{pD8uHAm9?lQGi{0xCcTt+O5T$wOO)$ceUOkA0~TkqoFg+# zMA|(?IzZB@JU{jN!fy#bSxgnLm^THqXe8DSFPBtMDXbKWR$NO+%1N$_bXsG-S(J)V z#$)y2tgNx*7zz8wJIXbtzgHdT#x&Dhl~FJbC^>87m+<_G0^?rEci|dR+u#LZ-uOk! z(Jy+YSdlELnt1%^(Zk1@Lsw;HkZ57W5ec}^I6!>&Lw4~Qo+cIW{aQK?)H7&yfl4f> zc`ibfE4-MtGscj79zk1YnflId$xXB4WFm6smAXH9t$WMO9E&Om6ub}nALYuVhw=*U zYfj!vu?Cf5N?8h@YA!a4yQ4FLOuUPX(zW|-)Rytsw-`q*>afX}T0y;$2!a7B9*?g)QXxVmC_Zl5#zZ^J<~sLV{zY6Y{-_l*e+;EuWe>5!;$WeLF!OgfhYc z6ix$BME#aRQs(AHnnmvwW$a3e=H)2DxhwYtNp1bD$I_^`gIB5FscS9hke1TpEgl~#NBv9-u8?N&=%Ra>g1j?j zl?71u@8dFC_wBK57@`e?5Oi{rp z(}&IJcbC1;$p$9+B0H)`9wS;}n4)&~ECAGlGwf13U197LPRz7>Ze~ zt5{L=@hd8M8pH)i8njwR`?z=1-<+ZFHld>RLhw;2r>tGa*_LAMii=q{Qo&6F?79(Z zNgbWiXtP#3wzhKZfZth$2qbV)jul&}q|=C^SwaliUn-6u{T{_w5#p|yI#Qfli2cfh9X4SAsp)xjqhNdwc2eHyP>VS95tC7jO=DQAmPNDsX%MTQD4>zF zxkHjE`ns`Y02;*;g^ok%MZjT2za3GDVvVZ|4ZfbT4+9HXk4hXaK$};lm zwnZsxIasK-LtyAKpteRjJ2=}_qgoJI7$!^jT7Q}31Bj78Qu(m-ZqbxTh9fP*D#Ewt zP`f?Neo8je68G*z_teWB7#4=?>V5>!(4LsHVIy0Xm{YG;GIUO5ET)!yMp>zCd7e~n zM4%#|PqBh6D?r8)UYpP9yeUiON&zT1)A0-8MHpF-q1%K}szxGOx-n(;S#=e|$kK;? zmh@hjuc=63YLv09=EJp8d0=Qy*q0ZoLg1O13an(ltJz*k6E_X0Z9&CDE#>B_7tF<_ z3MnvD+t+IGRB}KZ?YIY#k_)?bXP2C>u+|HBMpnW+6;lHRFG>A3%Z?MQcgZ4U&5X&> zQV`O@L>je(0dQmJT+&;ZAUT~=$1w#K&6xmx?~!K8pjdiv?V-bOGDy3i4HyC(VGF2I zOf`Q~v0?#iInYOE(wQ*!cCBQ1#7r6mc9QSVEL^MpOuGVwrCiTVLTP4nP`bf!1u9Cv zp;ee+5O6Kvm5@==%b)#}nUUfXgM(RW%gI1#Nc?BBkuqyRug1V)A6lwIjM5aJ-C@y3 z6aI#J^O$++c1ApIjm#1cxZnXuTRKgqLLKdbx%_lMlzqz zru!~nR4K`N5C;!9*-~7<1lpEVY=XjBmfD{ebiw{OtczN?WqD)2@~Uqtzh${?V12;` z*7R-b+m6uJ*%7*ul&@>Vltli;+aEXdK0dz$$@)*f zzvxIY9uM{gt&g`V{*g_%u4FD7$+h|QXIaXp6un=So?eyms&0OMvH2xS%|A<0UqgBL zN67k%YO}2FQhWaIMJp!|3{IJ|vkk3EMJ3&n&a31850k_8PoS5x!t}vtJnXg)C*wi- z>&3yK^TTA+``<2x=JQs@^H$s5ey=;ksDDL$>uCArU)f@VL*8@T-Ba_0iel;Gq z&2&HxyzqE7OCMuqclaab9`{E-^p1{bYw(r=vCT1(85~;vsZ^Wu-|`8M2$d+T?Y;h4 zzX@DZC=I(ZW@W*fMl@5jD`}PE`tBlG(7tb5@9I%zmpUr)B)lI#vXsl5(&iabTZigo zD~SW-{H|SLujrdn@&r zUFEmTL!{C?u%@m%7E-WNKk!`MXTrT^K5Y_0&yk4HP(!s;Wt0a7+qBiG2i{XZy-W|! zq&ua`9b@v-*`~*Yy)jVZVkwg9bVB(sO}4k5)gQI0A~v0y64TL9i5D<5JL;KT)oMhf zc>Y{8AJxULg0G%E6U`^}I^4n5du#jYHr&HgwL@#OVtZB;36;`OVxi<0gtcJ$4&122 z@aSwnwOSn$pVaWoR26%i!n_9&vh?)W0+QBcK-^M0$QV+YYBKW#?!k)HI`sKM1#a

R1|b+(rkd40(SX+5gG>UbC-rT*F#m=%5oirhF;w~S1>z6lz>fx zz^m&=sU_+UNX)^Cdj#X2q4%GWs#hc)k8VF{IwPkpqIHmC#Zl)ARy2sWU9|Sv1g(U?n`P}^4g?glo1s{ zmURklQ;S@Tg8bAGzxh=t>f=PqtncjlMR05;KGj}o_dDB(N5`KE8`sPgo`1aM!7pE? z^v;Elz@1Vmj44+(yk6;w(Db@^CU#WnsNG}{PQE)^WkXq8jHVVIerC_)i#AP=pHm}l zSJaBR<8$$JWzO9+P&57CmJA@>16df3Ec!*vYt9eqIh3h0-H)r?&Sl(X9 zdo?Np=iGk9x~T!A`%}Q{nr!IVZV}^^Jo&nur?BlY#ZPze9oik7<=SxRKE3JIl2Z+BV>#)+Y?`HFM$vQ&20Nu?w`7TneRb)8t~tcUBLTb}FO zD4If1a77-!LmI2HxC(wn4X-59W!N-iO}1T>^EB7u-gN+(j)Gn|cj%%-KNzipU986JPo^m19*(=ZdLY z{>V&^v2H9b6>NS^5a|`O;*~<)>@a4vYVmZb%8vQ$IF_SeDo`y#SR|W6i65WMY>*D+vQw2d_jZqZADnTt^j8Tr+`HEo5B~T z#&1tlf$)JCYlw77j&BQQC&`-LXf064)vApo3hBsk!*OR+rrD8cngn|qWfWkdIpEr% zb`9#~T_?1q6eTI@n3&G>0h^W}@ZwG+^r2BZLbA$#nyRf_dXd0uWp6(9Nz!SgHlD1W zQ6XWE0^X^JA%KZX7IgRj5(}|(i(^!N?6j<+olI~y=%&ia*%?o$zA*81RZZ88x>;kl mzl6%(D(ru)!v57k==O8_x&7RJZa@F=&%XhQj8LQiPyhgD2T9!5@nV0Oi8bQUC+(Tzhxg#Q!kE?2BTO=Ts`c#X}|mV?LDIx#!k|vr@3dDwSti}vuD3w znn~hEzO^(@gKz%4&lWz9AMeoL=95QT#lQGGe6s!I(KpTQ?Z-P0ceZwRaKG7n(%kt* zZ2gHiWuGL9tx$+>-dVBqZy5Kn=l@SXOUpj9PNhg#4=R;LL)gLcGIUSpv8dT~vAxxN z_yAu!hWH;V3VhKuMH{RzY3PA#OFxn=ao8K1Jb6C|MJQ)7l)fzu;rh0hI5GlIM+z$z z@mz{&5XZqn1T(&xxgNek+@P!FWjqgjg5)lio?J*jwqh5{VzeUx#r02lAfdaw#6)XB zw`M`Ouwqk;q=MKY5TSH55>Dc}cU! z89EAkH!85k@*UwR>K$Q4SZ=fOUFAE`S!G_+5N+QH!Ggmelx}E=XBJ<7ul_95UDFO0 z&oRIJQSYPFOkc)pr*1=JV=?fYNIZKNe;^G-2iwwMhgP_#z6D(3X5>>iSlA$*hkIapA^u z0qN7uILPo-VA#$Uya49!NFd4I1=st9`5$X!`_SI@c=if?Ga{H z$!zeb-G3vxKOGIbqmdX4Mep$Fpa*b(KWz8Mz3#{my?*E5c(2!gX$XK2{lQoq^x!Em zY&l`1nhvMjXcr+Lh zFd}ZRH|iX;dxzaU6BuAs(fzU8AB)ke_Q3%G0?OiWFzoh*ZSkTDl-e&2x(X_2+UpIw zov}ff_4RKe1iS(^2Zk6Obvr%!(fz3l)Z4>12GI{rjk^Cl#vnWtd+o#a%kBt3Y9C<& zt-d$D^)+RmN>z96-RF z(ckI!i{nv`+0^TgyTjq}(YQD0*CEx{U<2@MV=75+56}jECK-Yl4Brq~;srC@5U*c# zaeqiGWG!eDBSz4M&bT-XD?&NOB}zrV`|_aovfJ-;>G^=*yzY&`=n_2unC&uzcY958xO*3P|u&jf)Ti;bq`9;jqMJ z5ScVf1&29YmHS$fHAGQR`>_ zPV}>1HRyS5W~vG13!<)8uN#`7SD)0&3u&%=`a){Lx`kGr)QMATNghHqYD@94iVt~h1|9Qbk{>8HfvtT%?Zo6^fa6-I`@ zW70B^J~6~Z0r~wf+!+J-c31eWC+^-&uiU`w!VLiTjiu$gb`AG2{I|-+G@?wE@LuIo zWy1$1l#bM}vKmJcN{98Klr_Ijit2>OsUnf7vGA2HR~RE-JQrKMwo=Udzz!EmeFd^V z;L5mQ>{>yJ-CYgf<`JNGt;Xf^Av*F0KoCYyyO<*z(CQ4gAQ#K{vMy{mnF}dSkzHuM znR;fMEYS)*SB3^FB8GX=Iwzk2JA&(Zpe^xRnxP5YGBg<6`;F<$9}wlKDh`&wojs0H zTWBAbKL!0ge%48Rpd_)uWC>+u{$gp`aX-_4hxp{z|Um9H6eP0ELBEQc$_ zu$I{LU;puJWT=Q45R^N9BO3lS%9ziI>=8ToKs3tRQiV!Bflz2+s zlPF7+>soz~kQM_LXS19mGfYIkZ2|rm(6|a~#1+-`+)($V1R8T3b z6pL0|OGwH|u8eeAW4~FHic!X6_2I0nvE&#D`^P)VHKxB;9q7h1(_EENFb*g=Yvh;k z{E7nOUdeai8dBTf1!3O!Ma$7IdZt*BEUB7!{OHlc$C^V|WoD3QVZ{*%xX?I2eD_0k z@fn^b74ZF9IuFz{Xm){0EU0-dLX<1Kn6@*v& z0Vs(Q)Szn3mMF1wPNoP+9l$EAN*P{J$jV`|KxdxCog6CWXt7ga&lCSlMD8!JPR~8{ z*<@io5w&Y78|N~d!n!%Mp{kVt12iFKCFD^Iq!zDO^GCk`o#s|LV4mOHN$+uno8AIC zMApJOMRD1Dsu^h6c90+~VJr)6sEAi0j1}O#V0S};Ok_lw4$5xk(msol1urv?<7KPS zxGt@3sQyM{8U`1UY#?*>&lp+NP3nJ&W^dq2NM-W26)Ey^EB` za?UNEnmG~MnnQg%K^}xM!U7ad15iZ$mO@hI=0=)D?-gb2N{i;@D8jib_XSC9{jJH+ z5JrgFg>@!tDw|8Km9Z=(nz`GYagd!7_As>89o+&sx4Z-a@y>VWS++Ta51-aQ4$4mA zPl1MEbv0VySAuC>Xbq#j4{OUW)cgVn1!4NO*=#j;PH5^3TvCHqso$woXc1;Z~4ClcPzW-TJ( z1G#Hulfrf2Gbr+g6?RNf!71cxwAOiylhh+`kuO(4u@fwo5KOHI#?ZyY2SUIA8e5O~ zdn^Bb@{qoFBz-?_()S~EpT8gd?YDaB-IZ^wa$Y#MoYV!zR>&Ta)r;1F`g7wHfgsRs z>WVXhkB$R7@PrnRH4PYwS*@#BQS|XEDtQ{j1xOmST1Wf1chujUq3|}LqV+=XQ7EUZ zUB}s$V(p5HSvOL_O#|$@5o$>toziHtRy($~a_xZMS%wHCa8iyHTdAbeh@x3S4B1~Q zjv)OW#aI#IuBMs|vxmuxi#bV47v(xqoLh+f%7h&@VF0P=d3B>;d=GX~-sw<_IP?*d zQH)JvSgV#rv-@cftDh*Kk+iu(k}3MSv1I@n#S?{&L+M4pVMV_kQHf%Ws|*dkp0W=E z3t5j!94_R&b8hZVttrYf^6IulDQh`csJBC4=rW+TMmjq<+f}1l5Lp-|OZZxUndAeA zkw8-Uu=H-xlt_jnEyF6px93p1JWO&3(8U=Qe@6aqEBGU{-NUa;(5p}2b#FF9EZFAoR&pr z?ov6TRS?e!#8d917VbV{z)r5%VyHI+FsLO$w}zt1`?B4;ezt$$%5ZMJ5V>gprQh{G z&e>}?cpbyboUKq|GqVyeZsq-mlBZ1k5ITD5qp)=vi613PdY6`#w1Sy-C#o6+Ce~Fq zqXHjE?HBlUR9+wG#+nGveWON0KT$;V>shN)w<<5@fv2~~fQtc&b?Qy3_M|PTeU01> zDhvTwX~C1V3iTcc{dO+T;LUT)+g{mQ-wl!daHupBHq&{y40Q zTDfI;W54pMZz{iKxou#5!3Ng!ZR_MK>NMRpnm)bJblY3H?Ja#3y`|fZ(AU`!x{{Qy zYs8d9{>9rLH}pO}zXZwpPrtwDNHHD{_6Dtww<`XTO}MUPE*r_U`SoX6%BK{)UzMI- zmGY`?etxm}B}>geOHyA$dH6@j`ip9_tnN~K{_jOAClCxynX|JEtx82D-ILC%t#I+unY!JH)7eMSbgN`Q~5Q zVuM58bKKoi^M#6H>Eq-6`T@;!Kn}d{cs5HPV`g{wBjz6WM?dtAj%aJ}mIATOF_IY^ zTK=h2oAclD36BVsD6H+h{#m~XTvI3wyE0~F!J9@jQ?x5-mE-#EB3aPBZ(Hx`QD&Dq zD)J<}A3w5`%be2Y8B$w^>SQa41LXX!U16{4$W?y#2K~wS6@Jn7aI9`Nw;!pUnD7KK zirh{12YYl!DOP(c^_X4dx6DJN(mb%Ht~(Y|uv0(qT;6BGy=Fdb5<<_Bh|y3( zwNz!42L{`;)u{*GQ$M{-56`4KrOF*+^3&O-$ArBxP~&1LlInCq`7lkkx1QA>wW=aE zotqNV(NT#PFf=>rnO)UtM5K8BTr?lm#jk>|o;?%IC-pkq!Pa|g`{_2^!&9|GYqMf| zRul=9(otfeJz=8H&`m~$qEMlFlT6M=B$iQ8xT|m>fvT8dBv^CB=UkdnoOXJ zZ>tkj>2Uegi3&CoW>58`qIogHa5Bir1RU^YP@_~7bZOFTfSCez`F;@^2JCZ}hBntj zRoTjN9fgKo-8@$?J42L!O@qLz>qn_2>JLcF!HRnX59+FaYKrpfud3^( zi><49QksS9BwROV_yAbmUdVejDg)=-e#N?}0i^p=!0Vc9=-F-&nq zckmtB9h~LR)OZ0jKe+G}+-jx;W>z`Ym>)a@sLQ!x<9=}5xtFpKXenkzhB+_NrG-OS-U6k`Q?Xd9- zEy#@xehpqOkYJywt?pdI|Me@SU?#cfbq}eMJ-(q?qld2V)LbcPO8^SmsT53ev7B`3 z7I1N6LJAhwuux8OGS-w7n2v<`PEJm-azn0&82ncsp8qfSsFMj3xQh5s`%fTl{{J7g z9&T-A|Nlet;r63%wwl{d9zMSP{~!JnpD+6VKNQZJmd=z0k@{}P_tK`Hq;3e!lyKSS zqI!xdAenMa1&0vEmlP^w95qe@xao6w*-(G@Tq!5rV*tnx0Ua0IMu*%*Ef$-44Rg%d zK>&)#304zd`ZkqgRZ8cIsayWYOpmc{EG`vneoheS6|>@%Lf-5!X0>YZbg9aY`SqQS zaD|olB}*x7R8E{;%9to%r~=hn@F~a3nwWg_E1$&<9@rF5hjsXjZ7oH*URm4aTseF} zgYs=fSiG(PX9uT%ME0A)7pKN=PgH^Mff#FubV-hH3uY(Dn%-zFP{`G)jU)=`$Z^AQ zXH=%yk!hL)dm3dFV4^wT+M#w0>g8Q0w51d!De9P*&h-JCmLTxrP9*f9Q9DAi%72=w ztz3GMz-wi1KJ`h`X{0uute#OJVUGgdsfZzfiAxrA_x} -Default: none -``` - -Sets the charset used for client-server interaction (`"SET NAMES "`). If multiple charsets are set (separated by a comma), the following charset is used if setting the charset failes. This enables for example support for `utf8mb4` ([introduced in MySQL 5.5.3](http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)) with fallback to `utf8` for older servers (`charset=utf8mb4,utf8`). - -Usage of the `charset` parameter is discouraged because it issues additional queries to the server. -Unless you need the fallback behavior, please use `collation` instead. - -##### `collation` - -``` -Type: string -Valid Values: -Default: utf8_general_ci -``` - -Sets the collation used for client-server interaction on connection. In contrast to `charset`, `collation` does not issue additional queries. If the specified collation is unavailable on the target server, the connection will fail. - -A list of valid charsets for a server is retrievable with `SHOW COLLATION`. - -##### `clientFoundRows` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -`clientFoundRows=true` causes an UPDATE to return the number of matching rows instead of the number of rows changed. - -##### `columnsWithAlias` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -When `columnsWithAlias` is true, calls to `sql.Rows.Columns()` will return the table alias and the column name separated by a dot. For example: - -``` -SELECT u.id FROM users as u -``` - -will return `u.id` instead of just `id` if `columnsWithAlias=true`. - -##### `interpolateParams` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`. - -*This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are blacklisted as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!* - -##### `loc` - -``` -Type: string -Valid Values: -Default: UTC -``` - -Sets the location for time.Time values (when using `parseTime=true`). *"Local"* sets the system's location. See [time.LoadLocation](http://golang.org/pkg/time/#LoadLocation) for details. - -Note that this sets the location for time.Time values but does not change MySQL's [time_zone setting](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html). For that see the [time_zone system variable](#system-variables), which can also be set as a DSN parameter. - -Please keep in mind, that param values must be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`. - -##### `maxAllowedPacket` -``` -Type: decimal number -Default: 0 -``` - -Max packet size allowed in bytes. Use `maxAllowedPacket=0` to automatically fetch the `max_allowed_packet` variable from server. - -##### `multiStatements` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -Allow multiple statements in one query. While this allows batch queries, it also greatly increases the risk of SQL injections. Only the result of the first query is returned, all other results are silently discarded. - -When `multiStatements` is used, `?` parameters must only be used in the first statement. - -##### `parseTime` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -`parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string` - - -##### `readTimeout` - -``` -Type: decimal number -Default: 0 -``` - -I/O read timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. - -##### `strict` - -``` -Type: bool -Valid Values: true, false -Default: false -``` - -`strict=true` enables a driver-side strict mode in which MySQL warnings are treated as errors. This mode should not be used in production as it may lead to data corruption in certain situations. - -A server-side strict mode, which is safe for production use, can be set via the [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) system variable. - -By default MySQL also treats notes as warnings. Use [`sql_notes=false`](http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_notes) to ignore notes. - -##### `timeout` - -``` -Type: decimal number -Default: OS default -``` - -*Driver* side connection timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout). - -##### `tls` - -``` -Type: bool / string -Valid Values: true, false, skip-verify, -Default: false -``` - -`tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom value registered with [`mysql.RegisterTLSConfig`](http://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig). - -##### `writeTimeout` - -``` -Type: decimal number -Default: 0 -``` - -I/O write timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. - - -##### System Variables - -All other parameters are interpreted as system variables: - * `autocommit`: `"SET autocommit="` - * [`time_zone`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `"SET time_zone="` - * [`tx_isolation`](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tx_isolation): `"SET tx_isolation="` - * `param`: `"SET ="` - -*The values must be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed!* - -#### Examples -``` -user@unix(/path/to/socket)/dbname -``` - -``` -root:pw@unix(/tmp/mysql.sock)/myDatabase?loc=Local -``` - -``` -user:password@tcp(localhost:5555)/dbname?tls=skip-verify&autocommit=true -``` - -Treat warnings as errors by setting the system variable [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html): -``` -user:password@/dbname?sql_mode=TRADITIONAL -``` - -TCP via IPv6: -``` -user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname?timeout=90s&collation=utf8mb4_unicode_ci -``` - -TCP on a remote host, e.g. Amazon RDS: -``` -id:password@tcp(your-amazonaws-uri.com:3306)/dbname -``` - -Google Cloud SQL on App Engine (First Generation MySQL Server): -``` -user@cloudsql(project-id:instance-name)/dbname -``` - -Google Cloud SQL on App Engine (Second Generation MySQL Server): -``` -user@cloudsql(project-id:regionname:instance-name)/dbname -``` - -TCP using default port (3306) on localhost: -``` -user:password@tcp/dbname?charset=utf8mb4,utf8&sys_var=esc%40ped -``` - -Use the default protocol (tcp) and host (localhost:3306): -``` -user:password@/dbname -``` - -No Database preselected: -``` -user:password@/ -``` - -### `LOAD DATA LOCAL INFILE` support -For this feature you need direct access to the package. Therefore you must change the import path (no `_`): -```go -import "github.com/go-sql-driver/mysql" -``` - -Files must be whitelisted by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the Whitelist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)). - -To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore. - -See the [godoc of Go-MySQL-Driver](http://godoc.org/github.com/go-sql-driver/mysql "golang mysql driver documentation") for details. - - -### `time.Time` support -The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your programm. - -However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](http://golang.org/pkg/time/#Location) with the `loc` DSN parameter. - -**Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes). - -Alternatively you can use the [`NullTime`](http://godoc.org/github.com/go-sql-driver/mysql#NullTime) type as the scan destination, which works with both `time.Time` and `string` / `[]byte`. - - -### Unicode support -Since version 1.1 Go-MySQL-Driver automatically uses the collation `utf8_general_ci` by default. - -Other collations / charsets can be set using the [`collation`](#collation) DSN parameter. - -Version 1.0 of the driver recommended adding `&charset=utf8` (alias for `SET NAMES utf8`) to the DSN to enable proper UTF-8 support. This is not necessary anymore. The [`collation`](#collation) parameter should be preferred to set another collation / charset than the default. - -See http://dev.mysql.com/doc/refman/5.7/en/charset-unicode.html for more details on MySQL's Unicode support. - - -## Testing / Development -To run the driver tests you may need to adjust the configuration. See the [Testing Wiki-Page](https://github.com/go-sql-driver/mysql/wiki/Testing "Testing") for details. - -Go-MySQL-Driver is not feature-complete yet. Your help is very appreciated. -If you want to contribute, you can work on an [open issue](https://github.com/go-sql-driver/mysql/issues?state=open) or review a [pull request](https://github.com/go-sql-driver/mysql/pulls). - -See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/CONTRIBUTING.md) for details. - ---------------------------------------- - -## License -Go-MySQL-Driver is licensed under the [Mozilla Public License Version 2.0](https://raw.github.com/go-sql-driver/mysql/master/LICENSE) - -Mozilla summarizes the license scope as follows: -> MPL: The copyleft applies to any files containing MPLed code. - - -That means: - * You can **use** the **unchanged** source code both in private and commercially - * When distributing, you **must publish** the source code of any **changed files** licensed under the MPL 2.0 under a) the MPL 2.0 itself or b) a compatible license (e.g. GPL 3.0 or Apache License 2.0) - * You **needn't publish** the source code of your library as long as the files licensed under the MPL 2.0 are **unchanged** - -Please read the [MPL 2.0 FAQ](http://www.mozilla.org/MPL/2.0/FAQ.html) if you have further questions regarding the license. - -You can read the full terms here: [LICENSE](https://raw.github.com/go-sql-driver/mysql/master/LICENSE) - -![Go Gopher and MySQL Dolphin](https://raw.github.com/wiki/go-sql-driver/mysql/go-mysql-driver_m.jpg "Golang Gopher transporting the MySQL Dolphin in a wheelbarrow") - diff --git a/vendor/github.com/go-xorm/builder/README.md b/vendor/github.com/go-xorm/builder/README.md deleted file mode 100644 index 1628736374..0000000000 --- a/vendor/github.com/go-xorm/builder/README.md +++ /dev/null @@ -1,175 +0,0 @@ -# SQL builder - -[![CircleCI](https://circleci.com/gh/go-xorm/builder/tree/master.svg?style=svg)](https://circleci.com/gh/go-xorm/builder/tree/master) - -Package builder is a lightweight and fast SQL builder for Go and XORM. - -Make sure you have installed Go 1.1+ and then: - - go get github.com/go-xorm/builder - -# Insert - -```Go -sql, args, err := Insert(Eq{"c": 1, "d": 2}).Into("table1").ToSQL() -``` - -# Select - -```Go -sql, args, err := Select("c, d").From("table1").Where(Eq{"a": 1}).ToSQL() - -sql, args, err = Select("c, d").From("table1").LeftJoin("table2", Eq{"table1.id": 1}.And(Lt{"table2.id": 3})). - RightJoin("table3", "table2.id = table3.tid").Where(Eq{"a": 1}).ToSQL() -``` - -# Update - -```Go -sql, args, err := Update(Eq{"a": 2}).From("table1").Where(Eq{"a": 1}).ToSQL() -``` - -# Delete - -```Go -sql, args, err := Delete(Eq{"a": 1}).From("table1").ToSQL() -``` - -# Conditions - -* `Eq` is a redefine of a map, you can give one or more conditions to `Eq` - -```Go -import . "github.com/go-xorm/builder" - -sql, args, _ := ToSQL(Eq{"a":1}) -// a=? [1] -sql, args, _ := ToSQL(Eq{"b":"c"}.And(Eq{"c": 0})) -// b=? AND c=? ["c", 0] -sql, args, _ := ToSQL(Eq{"b":"c", "c":0}) -// b=? AND c=? ["c", 0] -sql, args, _ := ToSQL(Eq{"b":"c"}.Or(Eq{"b":"d"})) -// b=? OR b=? ["c", "d"] -sql, args, _ := ToSQL(Eq{"b": []string{"c", "d"}}) -// b IN (?,?) ["c", "d"] -sql, args, _ := ToSQL(Eq{"b": 1, "c":[]int{2, 3}}) -// b=? AND c IN (?,?) [1, 2, 3] -``` - -* `Neq` is the same to `Eq` - -```Go -import . "github.com/go-xorm/builder" - -sql, args, _ := ToSQL(Neq{"a":1}) -// a<>? [1] -sql, args, _ := ToSQL(Neq{"b":"c"}.And(Neq{"c": 0})) -// b<>? AND c<>? ["c", 0] -sql, args, _ := ToSQL(Neq{"b":"c", "c":0}) -// b<>? AND c<>? ["c", 0] -sql, args, _ := ToSQL(Neq{"b":"c"}.Or(Neq{"b":"d"})) -// b<>? OR b<>? ["c", "d"] -sql, args, _ := ToSQL(Neq{"b": []string{"c", "d"}}) -// b NOT IN (?,?) ["c", "d"] -sql, args, _ := ToSQL(Neq{"b": 1, "c":[]int{2, 3}}) -// b<>? AND c NOT IN (?,?) [1, 2, 3] -``` - -* `Gt`, `Gte`, `Lt`, `Lte` - -```Go -import . "github.com/go-xorm/builder" - -sql, args, _ := ToSQL(Gt{"a", 1}.And(Gte{"b", 2})) -// a>? AND b>=? [1, 2] -sql, args, _ := ToSQL(Lt{"a", 1}.Or(Lte{"b", 2})) -// a? [1, %c%, 2] -``` - -* `Or(conds ...Cond)`, Or can connect one or more conditions via Or - -```Go -import . "github.com/go-xorm/builder" - -sql, args, _ := ToSQL(Or(Eq{"a":1}, Like{"b", "c"}, Neq{"d", 2})) -// a=? OR b LIKE ? OR d<>? [1, %c%, 2] -sql, args, _ := ToSQL(Or(Eq{"a":1}, And(Like{"b", "c"}, Neq{"d", 2}))) -// a=? OR (b LIKE ? AND d<>?) [1, %c%, 2] -``` - -* `Between` - -```Go -import . "github.com/go-xorm/builder" - -sql, args, _ := ToSQL(Between{"a", 1, 2}) -// a BETWEEN 1 AND 2 -``` - -* Define yourself conditions - -Since `Cond` is an interface. - -```Go -type Cond interface { - WriteTo(Writer) error - And(...Cond) Cond - Or(...Cond) Cond - IsValid() bool -} -``` - -You can define yourself conditions and compose with other `Cond`. \ No newline at end of file diff --git a/vendor/github.com/go-xorm/builder/circle.yml b/vendor/github.com/go-xorm/builder/circle.yml deleted file mode 100644 index b2a8bfc9ef..0000000000 --- a/vendor/github.com/go-xorm/builder/circle.yml +++ /dev/null @@ -1,12 +0,0 @@ -dependencies: - override: - # './...' is a relative pattern which means all subdirectories - - go get -t -d -v ./... - - go build -v - - go get -u github.com/golang/lint/golint - -test: - override: - # './...' is a relative pattern which means all subdirectories - - golint ./... - - go test -v -race \ No newline at end of file diff --git a/vendor/github.com/go-xorm/core/README.md b/vendor/github.com/go-xorm/core/README.md deleted file mode 100644 index 09b72c74b3..0000000000 --- a/vendor/github.com/go-xorm/core/README.md +++ /dev/null @@ -1,116 +0,0 @@ -Core is a lightweight wrapper of sql.DB. - -[![CircleCI](https://circleci.com/gh/go-xorm/core/tree/master.svg?style=svg)](https://circleci.com/gh/go-xorm/core/tree/master) - -# Open -```Go -db, _ := core.Open(db, connstr) -``` - -# SetMapper -```Go -db.SetMapper(SameMapper()) -``` - -## Scan usage - -### Scan -```Go -rows, _ := db.Query() -for rows.Next() { - rows.Scan() -} -``` - -### ScanMap -```Go -rows, _ := db.Query() -for rows.Next() { - rows.ScanMap() -``` - -### ScanSlice - -You can use `[]string`, `[][]byte`, `[]interface{}`, `[]*string`, `[]sql.NullString` to ScanSclice. Notice, slice's length should be equal or less than select columns. - -```Go -rows, _ := db.Query() -cols, _ := rows.Columns() -for rows.Next() { - var s = make([]string, len(cols)) - rows.ScanSlice(&s) -} -``` - -```Go -rows, _ := db.Query() -cols, _ := rows.Columns() -for rows.Next() { - var s = make([]*string, len(cols)) - rows.ScanSlice(&s) -} -``` - -### ScanStruct -```Go -rows, _ := db.Query() -for rows.Next() { - rows.ScanStructByName() - rows.ScanStructByIndex() -} -``` - -## Query usage -```Go -rows, err := db.Query("select * from table where name = ?", name) - -user = User{ - Name:"lunny", -} -rows, err := db.QueryStruct("select * from table where name = ?Name", - &user) - -var user = map[string]interface{}{ - "name": "lunny", -} -rows, err = db.QueryMap("select * from table where name = ?name", - &user) -``` - -## QueryRow usage -```Go -row := db.QueryRow("select * from table where name = ?", name) - -user = User{ - Name:"lunny", -} -row := db.QueryRowStruct("select * from table where name = ?Name", - &user) - -var user = map[string]interface{}{ - "name": "lunny", -} -row = db.QueryRowMap("select * from table where name = ?name", - &user) -``` - -## Exec usage -```Go -db.Exec("insert into user (`name`, title, age, alias, nick_name,created) values (?,?,?,?,?,?)", name, title, age, alias...) - -user = User{ - Name:"lunny", - Title:"test", - Age: 18, -} -result, err = db.ExecStruct("insert into user (`name`, title, age, alias, nick_name,created) values (?Name,?Title,?Age,?Alias,?NickName,?Created)", - &user) - -var user = map[string]interface{}{ - "Name": "lunny", - "Title": "test", - "Age": 18, -} -result, err = db.ExecMap("insert into user (`name`, title, age, alias, nick_name,created) values (?Name,?Title,?Age,?Alias,?NickName,?Created)", - &user) -``` \ No newline at end of file diff --git a/vendor/github.com/go-xorm/core/benchmark.sh b/vendor/github.com/go-xorm/core/benchmark.sh deleted file mode 100755 index eab9e57e9f..0000000000 --- a/vendor/github.com/go-xorm/core/benchmark.sh +++ /dev/null @@ -1 +0,0 @@ -go test -v -bench=. -run=XXX diff --git a/vendor/github.com/go-xorm/core/circle.yml b/vendor/github.com/go-xorm/core/circle.yml deleted file mode 100644 index e6a05be272..0000000000 --- a/vendor/github.com/go-xorm/core/circle.yml +++ /dev/null @@ -1,15 +0,0 @@ -dependencies: - override: - # './...' is a relative pattern which means all subdirectories - - go get -t -d -v ./... - - go build -v - -database: - override: - - mysql -u root -e "CREATE DATABASE core_test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" - -test: - override: - # './...' is a relative pattern which means all subdirectories - - go test -v -race - - go test -v -race --dbtype=sqlite3 diff --git a/vendor/github.com/go-xorm/tidb/README.md b/vendor/github.com/go-xorm/tidb/README.md deleted file mode 100644 index 261ebe340b..0000000000 --- a/vendor/github.com/go-xorm/tidb/README.md +++ /dev/null @@ -1,24 +0,0 @@ -tidb driver and dialect for github.com/go-xorm/xorm -======== - -Currently, we can support tidb for allmost all the operations. - -# How to use - -Just like other supports of xorm, but you should import the three packages: - -```Go -import ( - _ "github.com/pingcap/tidb" - _ "github.com/go-xorm/tidb" - "github.com/go-xorm/xorm" -) - -//The formate of DataSource name is store://uri/dbname -// for goleveldb as store -xorm.NewEngine("tidb", "goleveldb://./tidb/tidb") -// for memory as store -xorm.NewEngine("tidb", "memory://tidb/tidb") -// for boltdb as store -xorm.NewEngine("tidb", "boltdb://./tidb/tidb") -``` diff --git a/vendor/github.com/go-xorm/xorm/CONTRIBUTING.md b/vendor/github.com/go-xorm/xorm/CONTRIBUTING.md deleted file mode 100644 index 37f4bc5fa8..0000000000 --- a/vendor/github.com/go-xorm/xorm/CONTRIBUTING.md +++ /dev/null @@ -1,46 +0,0 @@ -## Contributing to xorm - -`xorm` has a backlog of [pull requests](https://help.github.com/articles/using-pull-requests), but contributions are still very -much welcome. You can help with patch review, submitting bug reports, -or adding new functionality. There is no formal style guide, but -please conform to the style of existing code and general Go formatting -conventions when submitting patches. - -* [fork a repo](https://help.github.com/articles/fork-a-repo) -* [creating a pull request ](https://help.github.com/articles/creating-a-pull-request) - -### Language - -Since `xorm` is a world-wide open source project, please describe your issues or code changes in English as soon as possible. - -### Sign your codes with comments -``` -// !! your comments - -e.g., - -// !lunny! this is comments made by lunny -``` - -### Patch review - -Help review existing open [pull requests](https://help.github.com/articles/using-pull-requests) by commenting on the code or -proposed functionality. - -### Bug reports - -We appreciate any bug reports, but especially ones with self-contained -(doesn't depend on code outside of xorm), minimal (can't be simplified -further) test cases. It's especially helpful if you can submit a pull -request with just the failing test case(you can find some example test file like [session_get_test.go](https://github.com/go-xorm/xorm/blob/master/session_get_test.go)). - -If you implements a new database interface, you maybe need to add a test_.sh file. -For example, [mysql_test.go](https://github.com/go-xorm/xorm/blob/master/test_mysql.sh) - -### New functionality - -There are a number of pending patches for new functionality, so -additional feature patches will take a while to merge. Still, patches -are generally reviewed based on usefulness and complexity in addition -to time-in-queue, so if you have a knockout idea, take a shot. Feel -free to open an issue discussion your proposed patch beforehand. diff --git a/vendor/github.com/go-xorm/xorm/README.md b/vendor/github.com/go-xorm/xorm/README.md deleted file mode 100644 index 9f6c20cbda..0000000000 --- a/vendor/github.com/go-xorm/xorm/README.md +++ /dev/null @@ -1,430 +0,0 @@ -[中文](https://github.com/go-xorm/xorm/blob/master/README_CN.md) - -Xorm is a simple and powerful ORM for Go. - -[![CircleCI](https://circleci.com/gh/go-xorm/xorm.svg?style=shield)](https://circleci.com/gh/go-xorm/xorm) [![codecov](https://codecov.io/gh/go-xorm/xorm/branch/master/graph/badge.svg)](https://codecov.io/gh/go-xorm/xorm) -[![](https://goreportcard.com/badge/github.com/go-xorm/xorm)](https://goreportcard.com/report/github.com/go-xorm/xorm) -[![Join the chat at https://img.shields.io/discord/323460943201959939.svg](https://img.shields.io/discord/323460943201959939.svg)](https://discord.gg/HuR2CF3) - -# Features - -* Struct <-> Table Mapping Support - -* Chainable APIs - -* Transaction Support - -* Both ORM and raw SQL operation Support - -* Sync database schema Support - -* Query Cache speed up - -* Database Reverse support, See [Xorm Tool README](https://github.com/go-xorm/cmd/blob/master/README.md) - -* Simple cascade loading support - -* Optimistic Locking support - -* SQL Builder support via [github.com/go-xorm/builder](https://github.com/go-xorm/builder) - -* Automatical Read/Write seperatelly - -# Drivers Support - -Drivers for Go's sql package which currently support database/sql includes: - -* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - -* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/tree/master/godrv) - -* Postgres: [github.com/lib/pq](https://github.com/lib/pq) - -* Tidb: [github.com/pingcap/tidb](https://github.com/pingcap/tidb) - -* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - -* MsSql: [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -* Oracle: [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (experiment) - -# Changelog - -* **v0.6.4** - * Automatical Read/Write seperatelly - * Query/QueryString/QueryInterface and action with Where/And - * Get support non-struct variables - * BufferSize on Iterate - * fix some other bugs. - -* **v0.6.3** - * merge tests to main project - * add `Exist` function - * add `SumInt` function - * Mysql now support read and create column comment. - * fix time related bugs. - * fix some other bugs. - -* **v0.6.2** - * refactor tag parse methods - * add Scan features to Get - * add QueryString method - -[More changes ...](https://github.com/go-xorm/manual-en-US/tree/master/chapter-16) - -# Installation - - go get github.com/go-xorm/xorm - -# Documents - -* [Manual](http://xorm.io/docs) - -* [GoDoc](http://godoc.org/github.com/go-xorm/xorm) - -* [GoWalker](http://gowalker.org/github.com/go-xorm/xorm) - -# Quick Start - -* Create Engine - -```Go -engine, err := xorm.NewEngine(driverName, dataSourceName) -``` - -* Define a struct and Sync2 table struct to database - -```Go -type User struct { - Id int64 - Name string - Salt string - Age int - Passwd string `xorm:"varchar(200)"` - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` -} - -err := engine.Sync2(new(User)) -``` - -* Create Engine Group - -```Go -dataSourceNameSlice := []string{masterDataSourceName, slave1DataSourceName, slave2DataSourceName} -engineGroup, err := xorm.NewEngineGroup(driverName, dataSourceNameSlice) -``` - -```Go -masterEngine, err := xorm.NewEngine(driverName, masterDataSourceName) -slave1Engine, err := xorm.NewEngine(driverName, slave1DataSourceName) -slave2Engine, err := xorm.NewEngine(driverName, slave2DataSourceName) -engineGroup, err := xorm.NewEngineGroup(masterEngine, []*Engine{slave1Engine, slave2Engine}) -``` - -Then all place where `engine` you can just use `engineGroup`. - -* `Query` runs a SQL string, the returned results is `[]map[string][]byte`, `QueryString` returns `[]map[string]string`, `QueryInterface` returns `[]map[string]interface{}`. - -```Go -results, err := engine.Query("select * from user") -results, err := engine.Where("a = 1").Query() - -results, err := engine.QueryString("select * from user") -results, err := engine.Where("a = 1").QueryString() - -results, err := engine.QueryInterface("select * from user") -results, err := engine.Where("a = 1").QueryInterface() -``` - -* `Exec` runs a SQL string, it returns `affected` and `error` - -```Go -affected, err := engine.Exec("update user set age = ? where name = ?", age, name) -``` - -* `Insert` one or multiple records to database - -```Go -affected, err := engine.Insert(&user) -// INSERT INTO struct () values () - -affected, err := engine.Insert(&user1, &user2) -// INSERT INTO struct1 () values () -// INSERT INTO struct2 () values () - -affected, err := engine.Insert(&users) -// INSERT INTO struct () values (),(),() - -affected, err := engine.Insert(&user1, &users) -// INSERT INTO struct1 () values () -// INSERT INTO struct2 () values (),(),() -``` - -* `Get` query one record from database - -```Go -has, err := engine.Get(&user) -// SELECT * FROM user LIMIT 1 - -has, err := engine.Where("name = ?", name).Desc("id").Get(&user) -// SELECT * FROM user WHERE name = ? ORDER BY id DESC LIMIT 1 - -var name string -has, err := engine.Where("id = ?", id).Cols("name").Get(&name) -// SELECT name FROM user WHERE id = ? - -var id int64 -has, err := engine.Where("name = ?", name).Cols("id").Get(&id) -has, err := engine.SQL("select id from user").Get(&id) -// SELECT id FROM user WHERE name = ? - -var valuesMap = make(map[string]string) -has, err := engine.Where("id = ?", id).Get(&valuesMap) -// SELECT * FROM user WHERE id = ? - -var valuesSlice = make([]interface{}, len(cols)) -has, err := engine.Where("id = ?", id).Cols(cols...).Get(&valuesSlice) -// SELECT col1, col2, col3 FROM user WHERE id = ? -``` - -* `Exist` check if one record exist on table - -```Go -has, err := testEngine.Exist(new(RecordExist)) -// SELECT * FROM record_exist LIMIT 1 - -has, err = testEngine.Exist(&RecordExist{ - Name: "test1", - }) -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 - -has, err = testEngine.Where("name = ?", "test1").Exist(&RecordExist{}) -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 - -has, err = testEngine.SQL("select * from record_exist where name = ?", "test1").Exist() -// select * from record_exist where name = ? - -has, err = testEngine.Table("record_exist").Exist() -// SELECT * FROM record_exist LIMIT 1 - -has, err = testEngine.Table("record_exist").Where("name = ?", "test1").Exist() -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 -``` - -* `Find` query multiple records from database, also you can use join and extends - -```Go -var users []User -err := engine.Where("name = ?", name).And("age > 10").Limit(10, 0).Find(&users) -// SELECT * FROM user WHERE name = ? AND age > 10 limit 10 offset 0 - -type Detail struct { - Id int64 - UserId int64 `xorm:"index"` -} - -type UserDetail struct { - User `xorm:"extends"` - Detail `xorm:"extends"` -} - -var users []UserDetail -err := engine.Table("user").Select("user.*, detail.*"). - Join("INNER", "detail", "detail.user_id = user.id"). - Where("user.name = ?", name).Limit(10, 0). - Find(&users) -// SELECT user.*, detail.* FROM user INNER JOIN detail WHERE user.name = ? limit 10 offset 0 -``` - -* `Iterate` and `Rows` query multiple records and record by record handle, there are two methods Iterate and Rows - -```Go -err := engine.Iterate(&User{Name:name}, func(idx int, bean interface{}) error { - user := bean.(*User) - return nil -}) -// SELECT * FROM user - -err := engine.BufferSize(100).Iterate(&User{Name:name}, func(idx int, bean interface{}) error { - user := bean.(*User) - return nil -}) -// SELECT * FROM user Limit 0, 100 -// SELECT * FROM user Limit 101, 100 - -rows, err := engine.Rows(&User{Name:name}) -// SELECT * FROM user -defer rows.Close() -bean := new(Struct) -for rows.Next() { - err = rows.Scan(bean) -} -``` - -* `Update` update one or more records, default will update non-empty and non-zero fields except when you use Cols, AllCols and so on. - -```Go -affected, err := engine.Id(1).Update(&user) -// UPDATE user SET ... Where id = ? - -affected, err := engine.Update(&user, &User{Name:name}) -// UPDATE user SET ... Where name = ? - -var ids = []int64{1, 2, 3} -affected, err := engine.In("id", ids).Update(&user) -// UPDATE user SET ... Where id IN (?, ?, ?) - -// force update indicated columns by Cols -affected, err := engine.Id(1).Cols("age").Update(&User{Name:name, Age: 12}) -// UPDATE user SET age = ?, updated=? Where id = ? - -// force NOT update indicated columns by Omit -affected, err := engine.Id(1).Omit("name").Update(&User{Name:name, Age: 12}) -// UPDATE user SET age = ?, updated=? Where id = ? - -affected, err := engine.Id(1).AllCols().Update(&user) -// UPDATE user SET name=?,age=?,salt=?,passwd=?,updated=? Where id = ? -``` - -* `Delete` delete one or more records, Delete MUST have condition - -```Go -affected, err := engine.Where(...).Delete(&user) -// DELETE FROM user Where ... - -affected, err := engine.ID(2).Delete(&user) -// DELETE FROM user Where id = ? -``` - -* `Count` count records - -```Go -counts, err := engine.Count(&user) -// SELECT count(*) AS total FROM user -``` - -* `Sum` sum functions - -```Go -agesFloat64, err := engine.Sum(&user, "age") -// SELECT sum(age) AS total FROM user - -agesInt64, err := engine.SumInt(&user, "age") -// SELECT sum(age) AS total FROM user - -sumFloat64Slice, err := engine.Sums(&user, "age", "score") -// SELECT sum(age), sum(score) FROM user - -sumInt64Slice, err := engine.SumsInt(&user, "age", "score") -// SELECT sum(age), sum(score) FROM user -``` - -* Query conditions builder - -```Go -err := engine.Where(builder.NotIn("a", 1, 2).And(builder.In("b", "c", "d", "e"))).Find(&users) -// SELECT id, name ... FROM user WHERE a NOT IN (?, ?) AND b IN (?, ?, ?) -``` - -* Multiple operations in one go routine, no transation here but resue session memory - -```Go -session := engine.NewSession() -defer session.Close() - -user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()} -if _, err := session.Insert(&user1); err != nil { - return err -} - -user2 := Userinfo{Username: "yyy"} -if _, err := session.Where("id = ?", 2).Update(&user2); err != nil { - return err -} - -if _, err := session.Exec("delete from userinfo where username = ?", user2.Username); err != nil { - return err -} - -return nil -``` - -* Transation should on one go routine. There is transaction and resue session memory - -```Go -session := engine.NewSession() -defer session.Close() - -// add Begin() before any action -if err := session.Begin(); err != nil { - // if returned then will rollback automatically - return err -} - -user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()} -if _, err := session.Insert(&user1); err != nil { - return err -} - -user2 := Userinfo{Username: "yyy"} -if _, err := session.Where("id = ?", 2).Update(&user2); err != nil { - return err -} - -if _, err := session.Exec("delete from userinfo where username = ?", user2.Username); err != nil { - return err -} - -// add Commit() after all actions -return session.Commit() -``` - -# Cases - -* [studygolang](http://studygolang.com/) - [github.com/studygolang/studygolang](https://github.com/studygolang/studygolang) - -* [Gitea](http://gitea.io) - [github.com/go-gitea/gitea](http://github.com/go-gitea/gitea) - -* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs) - -* [grafana](https://grafana.com/) - [github.com/grafana/grafana](http://github.com/grafana/grafana) - -* [github.com/m3ng9i/qreader](https://github.com/m3ng9i/qreader) - -* [Wego](http://github.com/go-tango/wego) - -* [Docker.cn](https://docker.cn/) - -* [Xorm Adapter](https://github.com/casbin/xorm-adapter) for [Casbin](https://github.com/casbin/casbin) - [github.com/casbin/xorm-adapter](https://github.com/casbin/xorm-adapter) - -* [Gorevel](http://gorevel.cn/) - [github.com/goofcc/gorevel](http://github.com/goofcc/gorevel) - -* [Gowalker](http://gowalker.org) - [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) - -* [Gobuild.io](http://gobuild.io) - [github.com/shxsun/gobuild](http://github.com/shxsun/gobuild) - -* [Sudo China](http://sudochina.com) - [github.com/insionng/toropress](http://github.com/insionng/toropress) - -* [Godaily](http://godaily.org) - [github.com/govc/godaily](http://github.com/govc/godaily) - -* [YouGam](http://www.yougam.com/) - -* [GoCMS - github.com/zzboy/GoCMS](https://github.com/zzdboy/GoCMS) - -* [GoBBS - gobbs.domolo.com](http://gobbs.domolo.com/) - -* [go-blog](http://wangcheng.me) - [github.com/easykoo/go-blog](https://github.com/easykoo/go-blog) - -# Discuss - -Please visit [Xorm on Google Groups](https://groups.google.com/forum/#!forum/xorm) - -# Contributing - -If you want to pull request, please see [CONTRIBUTING](https://github.com/go-xorm/xorm/blob/master/CONTRIBUTING.md) - -# LICENSE - - BSD License - [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) diff --git a/vendor/github.com/go-xorm/xorm/README_CN.md b/vendor/github.com/go-xorm/xorm/README_CN.md deleted file mode 100644 index b4258d5405..0000000000 --- a/vendor/github.com/go-xorm/xorm/README_CN.md +++ /dev/null @@ -1,435 +0,0 @@ -# xorm - -[English](https://github.com/go-xorm/xorm/blob/master/README.md) - -xorm是一个简单而强大的Go语言ORM库. 通过它可以使数据库操作非常简便。 - -[![CircleCI](https://circleci.com/gh/go-xorm/xorm.svg?style=shield)](https://circleci.com/gh/go-xorm/xorm) [![codecov](https://codecov.io/gh/go-xorm/xorm/branch/master/graph/badge.svg)](https://codecov.io/gh/go-xorm/xorm) -[![](https://goreportcard.com/badge/github.com/go-xorm/xorm)](https://goreportcard.com/report/github.com/go-xorm/xorm) -[![Join the chat at https://img.shields.io/discord/323460943201959939.svg](https://img.shields.io/discord/323460943201959939.svg)](https://discord.gg/HuR2CF3) - -## 特性 - -* 支持Struct和数据库表之间的灵活映射,并支持自动同步 - -* 事务支持 - -* 同时支持原始SQL语句和ORM操作的混合执行 - -* 使用连写来简化调用 - -* 支持使用Id, In, Where, Limit, Join, Having, Table, Sql, Cols等函数和结构体等方式作为条件 - -* 支持级联加载Struct - -* 支持缓存 - -* 支持根据数据库自动生成xorm的结构体 - -* 支持记录版本(即乐观锁) - -* 内置SQL Builder支持 - -## 驱动支持 - -目前支持的Go数据库驱动和对应的数据库如下: - -* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - -* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv) - -* Postgres: [github.com/lib/pq](https://github.com/lib/pq) - -* Tidb: [github.com/pingcap/tidb](https://github.com/pingcap/tidb) - -* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) - -* MsSql: [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) - -* MsSql: [github.com/lunny/godbc](https://github.com/lunny/godbc) - -* Oracle: [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (试验性支持) - -## 更新日志 - -* **v0.6.3** - * 合并单元测试到主工程 - * 新增`Exist`方法 - * 新增`SumInt`方法 - * Mysql新增读取和创建字段注释支持 - * 新增`SetConnMaxLifetime`方法 - * 修正了时间相关的Bug - * 修复了一些其它Bug - -* **v0.6.2** - * 重构Tag解析方式 - * Get方法新增类似Scan的特性 - * 新增 QueryString 方法 - -* **v0.6.0** - * 去除对 ql 的支持 - * 新增条件查询分析器 [github.com/go-xorm/builder](https://github.com/go-xorm/builder), 从因此 `Where, And, Or` 函数 -将可以用 `builder.Cond` 作为条件组合 - * 新增 Sum, SumInt, SumInt64 和 NotIn 函数 - * Bug修正 - -* **v0.5.0** - * logging接口进行不兼容改变 - * Bug修正 - -[更多更新日志...](https://github.com/go-xorm/manual-zh-CN/tree/master/chapter-16) - -## 安装 - - go get github.com/go-xorm/xorm - -## 文档 - -* [操作指南](http://xorm.io/docs) - -* [GoWalker代码文档](http://gowalker.org/github.com/go-xorm/xorm) - -* [Godoc代码文档](http://godoc.org/github.com/go-xorm/xorm) - -# 快速开始 - -* 第一步创建引擎,driverName, dataSourceName和database/sql接口相同 - -```Go -engine, err := xorm.NewEngine(driverName, dataSourceName) -``` - -* 定义一个和表同步的结构体,并且自动同步结构体到数据库 - -```Go -type User struct { - Id int64 - Name string - Salt string - Age int - Passwd string `xorm:"varchar(200)"` - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` -} - -err := engine.Sync2(new(User)) -``` - -* 创建Engine组 - -```Go -dataSourceNameSlice := []string{masterDataSourceName, slave1DataSourceName, slave2DataSourceName} -engineGroup, err := xorm.NewEngineGroup(driverName, dataSourceNameSlice) -``` - -```Go -masterEngine, err := xorm.NewEngine(driverName, masterDataSourceName) -slave1Engine, err := xorm.NewEngine(driverName, slave1DataSourceName) -slave2Engine, err := xorm.NewEngine(driverName, slave2DataSourceName) -engineGroup, err := xorm.NewEngineGroup(masterEngine, []*Engine{slave1Engine, slave2Engine}) -``` - -所有使用 `engine` 都可以简单的用 `engineGroup` 来替换。 - -* `Query` 最原始的也支持SQL语句查询,返回的结果类型为 []map[string][]byte。`QueryString` 返回 []map[string]string, `QueryInterface` 返回 `[]map[string]interface{}`. - -```Go -results, err := engine.Query("select * from user") -results, err := engine.Where("a = 1").Query() - -results, err := engine.QueryString("select * from user") -results, err := engine.Where("a = 1").QueryString() - -results, err := engine.QueryInterface("select * from user") -results, err := engine.Where("a = 1").QueryInterface() -``` - -* `Exec` 执行一个SQL语句 - -```Go -affected, err := engine.Exec("update user set age = ? where name = ?", age, name) -``` - -* `Insert` 插入一条或者多条记录 - -```Go -affected, err := engine.Insert(&user) -// INSERT INTO struct () values () - -affected, err := engine.Insert(&user1, &user2) -// INSERT INTO struct1 () values () -// INSERT INTO struct2 () values () - -affected, err := engine.Insert(&users) -// INSERT INTO struct () values (),(),() - -affected, err := engine.Insert(&user1, &users) -// INSERT INTO struct1 () values () -// INSERT INTO struct2 () values (),(),() -``` - -* `Get` 查询单条记录 - -```Go -has, err := engine.Get(&user) -// SELECT * FROM user LIMIT 1 - -has, err := engine.Where("name = ?", name).Desc("id").Get(&user) -// SELECT * FROM user WHERE name = ? ORDER BY id DESC LIMIT 1 - -var name string -has, err := engine.Where("id = ?", id).Cols("name").Get(&name) -// SELECT name FROM user WHERE id = ? - -var id int64 -has, err := engine.Where("name = ?", name).Cols("id").Get(&id) -has, err := engine.SQL("select id from user").Get(&id) -// SELECT id FROM user WHERE name = ? - -var valuesMap = make(map[string]string) -has, err := engine.Where("id = ?", id).Get(&valuesMap) -// SELECT * FROM user WHERE id = ? - -var valuesSlice = make([]interface{}, len(cols)) -has, err := engine.Where("id = ?", id).Cols(cols...).Get(&valuesSlice) -// SELECT col1, col2, col3 FROM user WHERE id = ? -``` - -* `Exist` 检测记录是否存在 - -```Go -has, err := testEngine.Exist(new(RecordExist)) -// SELECT * FROM record_exist LIMIT 1 - -has, err = testEngine.Exist(&RecordExist{ - Name: "test1", - }) -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 - -has, err = testEngine.Where("name = ?", "test1").Exist(&RecordExist{}) -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 - -has, err = testEngine.SQL("select * from record_exist where name = ?", "test1").Exist() -// select * from record_exist where name = ? - -has, err = testEngine.Table("record_exist").Exist() -// SELECT * FROM record_exist LIMIT 1 - -has, err = testEngine.Table("record_exist").Where("name = ?", "test1").Exist() -// SELECT * FROM record_exist WHERE name = ? LIMIT 1 -``` - -* `Find` 查询多条记录,当然可以使用Join和extends来组合使用 - -```Go -var users []User -err := engine.Where("name = ?", name).And("age > 10").Limit(10, 0).Find(&users) -// SELECT * FROM user WHERE name = ? AND age > 10 limit 10 offset 0 - -type Detail struct { - Id int64 - UserId int64 `xorm:"index"` -} - -type UserDetail struct { - User `xorm:"extends"` - Detail `xorm:"extends"` -} - -var users []UserDetail -err := engine.Table("user").Select("user.*, detail.*") - Join("INNER", "detail", "detail.user_id = user.id"). - Where("user.name = ?", name).Limit(10, 0). - Find(&users) -// SELECT user.*, detail.* FROM user INNER JOIN detail WHERE user.name = ? limit 10 offset 0 -``` - -* `Iterate` 和 `Rows` 根据条件遍历数据库,可以有两种方式: Iterate and Rows - -```Go -err := engine.Iterate(&User{Name:name}, func(idx int, bean interface{}) error { - user := bean.(*User) - return nil -}) -// SELECT * FROM user - -err := engine.BufferSize(100).Iterate(&User{Name:name}, func(idx int, bean interface{}) error { - user := bean.(*User) - return nil -}) -// SELECT * FROM user Limit 0, 100 -// SELECT * FROM user Limit 101, 100 - -rows, err := engine.Rows(&User{Name:name}) -// SELECT * FROM user -defer rows.Close() -bean := new(Struct) -for rows.Next() { - err = rows.Scan(bean) -} -``` - -* `Update` 更新数据,除非使用Cols,AllCols函数指明,默认只更新非空和非0的字段 - -```Go -affected, err := engine.Id(1).Update(&user) -// UPDATE user SET ... Where id = ? - -affected, err := engine.Update(&user, &User{Name:name}) -// UPDATE user SET ... Where name = ? - -var ids = []int64{1, 2, 3} -affected, err := engine.In(ids).Update(&user) -// UPDATE user SET ... Where id IN (?, ?, ?) - -// force update indicated columns by Cols -affected, err := engine.Id(1).Cols("age").Update(&User{Name:name, Age: 12}) -// UPDATE user SET age = ?, updated=? Where id = ? - -// force NOT update indicated columns by Omit -affected, err := engine.Id(1).Omit("name").Update(&User{Name:name, Age: 12}) -// UPDATE user SET age = ?, updated=? Where id = ? - -affected, err := engine.Id(1).AllCols().Update(&user) -// UPDATE user SET name=?,age=?,salt=?,passwd=?,updated=? Where id = ? -``` - -* `Delete` 删除记录,需要注意,删除必须至少有一个条件,否则会报错。要清空数据库可以用EmptyTable - -```Go -affected, err := engine.Where(...).Delete(&user) -// DELETE FROM user Where ... - -affected, err := engine.ID(2).Delete(&user) -// DELETE FROM user Where id = ? -``` - -* `Count` 获取记录条数 - -```Go -counts, err := engine.Count(&user) -// SELECT count(*) AS total FROM user -``` - -* `Sum` 求和函数 - -```Go -agesFloat64, err := engine.Sum(&user, "age") -// SELECT sum(age) AS total FROM user - -agesInt64, err := engine.SumInt(&user, "age") -// SELECT sum(age) AS total FROM user - -sumFloat64Slice, err := engine.Sums(&user, "age", "score") -// SELECT sum(age), sum(score) FROM user - -sumInt64Slice, err := engine.SumsInt(&user, "age", "score") -// SELECT sum(age), sum(score) FROM user -``` - -* 条件编辑器 - -```Go -err := engine.Where(builder.NotIn("a", 1, 2).And(builder.In("b", "c", "d", "e"))).Find(&users) -// SELECT id, name ... FROM user WHERE a NOT IN (?, ?) AND b IN (?, ?, ?) -``` - -* 在一个Go程中多次操作数据库,但没有事务 - -```Go -session := engine.NewSession() -defer session.Close() - -user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()} -if _, err := session.Insert(&user1); err != nil { - return err -} - -user2 := Userinfo{Username: "yyy"} -if _, err := session.Where("id = ?", 2).Update(&user2); err != nil { - return err -} - -if _, err := session.Exec("delete from userinfo where username = ?", user2.Username); err != nil { - return err -} - -return nil -``` - -* 在一个Go程中有事务 - -```Go -session := engine.NewSession() -defer session.Close() - -// add Begin() before any action -if err := session.Begin(); err != nil { - // if returned then will rollback automatically - return err -} - -user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()} -if _, err := session.Insert(&user1); err != nil { - return err -} - -user2 := Userinfo{Username: "yyy"} -if _, err := session.Where("id = ?", 2).Update(&user2); err != nil { - return err -} - -if _, err := session.Exec("delete from userinfo where username = ?", user2.Username); err != nil { - return err -} - -// add Commit() after all actions -return session.Commit() -``` - -# 案例 - -* [Go语言中文网](http://studygolang.com/) - [github.com/studygolang/studygolang](https://github.com/studygolang/studygolang) - -* [Gitea](http://gitea.io) - [github.com/go-gitea/gitea](http://github.com/go-gitea/gitea) - -* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs) - -* [grafana](https://grafana.com/) - [github.com/grafana/grafana](http://github.com/grafana/grafana) - -* [github.com/m3ng9i/qreader](https://github.com/m3ng9i/qreader) - -* [Wego](http://github.com/go-tango/wego) - -* [Docker.cn](https://docker.cn/) - -* [Xorm Adapter](https://github.com/casbin/xorm-adapter) for [Casbin](https://github.com/casbin/casbin) - [github.com/casbin/xorm-adapter](https://github.com/casbin/xorm-adapter) - -* [Gowalker](http://gowalker.org) - [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) - -* [Gobuild.io](http://gobuild.io) - [github.com/shxsun/gobuild](http://github.com/shxsun/gobuild) - -* [Sudo China](http://sudochina.com) - [github.com/insionng/toropress](http://github.com/insionng/toropress) - -* [Godaily](http://godaily.org) - [github.com/govc/godaily](http://github.com/govc/godaily) - -* [YouGam](http://www.yougam.com/) - -* [GoCMS - github.com/zzboy/GoCMS](https://github.com/zzdboy/GoCMS) - -* [GoBBS - gobbs.domolo.com](http://gobbs.domolo.com/) - -* [go-blog](http://wangcheng.me) - [github.com/easykoo/go-blog](https://github.com/easykoo/go-blog) - -## 讨论 - -请加入QQ群:280360085 进行讨论。 - -## 贡献 - -如果您也想为Xorm贡献您的力量,请查看 [CONTRIBUTING](https://github.com/go-xorm/xorm/blob/master/CONTRIBUTING.md) - -## LICENSE - -BSD License -[http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) diff --git a/vendor/github.com/go-xorm/xorm/circle.yml b/vendor/github.com/go-xorm/xorm/circle.yml deleted file mode 100644 index 69fc7164ba..0000000000 --- a/vendor/github.com/go-xorm/xorm/circle.yml +++ /dev/null @@ -1,38 +0,0 @@ -dependencies: - override: - # './...' is a relative pattern which means all subdirectories - - go get -t -d -v ./... - - go get -t -d -v github.com/go-xorm/tests - - go get -u github.com/go-xorm/core - - go get -u github.com/go-xorm/builder - - go build -v - -database: - override: - - mysql -u root -e "CREATE DATABASE xorm_test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" - - mysql -u root -e "CREATE DATABASE xorm_test1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" - - mysql -u root -e "CREATE DATABASE xorm_test2 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" - - mysql -u root -e "CREATE DATABASE xorm_test3 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci" - - createdb -p 5432 -e -U postgres xorm_test - - createdb -p 5432 -e -U postgres xorm_test1 - - createdb -p 5432 -e -U postgres xorm_test2 - - createdb -p 5432 -e -U postgres xorm_test3 - -test: - override: - # './...' is a relative pattern which means all subdirectories - - go get -u github.com/wadey/gocovmerge; - - go test -v -race -db="sqlite3" -conn_str="./test.db" -coverprofile=coverage1-1.txt -covermode=atomic - - go test -v -race -db="sqlite3" -conn_str="./test.db" -cache=true -coverprofile=coverage1-2.txt -covermode=atomic - - go test -v -race -db="mysql" -conn_str="root:@/xorm_test" -coverprofile=coverage2-1.txt -covermode=atomic - - go test -v -race -db="mysql" -conn_str="root:@/xorm_test" -cache=true -coverprofile=coverage2-2.txt -covermode=atomic - - go test -v -race -db="mymysql" -conn_str="xorm_test/root/" -coverprofile=coverage3-1.txt -covermode=atomic - - go test -v -race -db="mymysql" -conn_str="xorm_test/root/" -cache=true -coverprofile=coverage3-2.txt -covermode=atomic - - go test -v -race -db="postgres" -conn_str="dbname=xorm_test sslmode=disable" -coverprofile=coverage4-1.txt -covermode=atomic - - go test -v -race -db="postgres" -conn_str="dbname=xorm_test sslmode=disable" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic - - gocovmerge coverage1-1.txt coverage1-2.txt coverage2-1.txt coverage2-2.txt coverage3-1.txt coverage3-2.txt coverage4-1.txt coverage4-2.txt > coverage.txt - - cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./sqlite3.sh - - cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./mysql.sh - - cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./postgres.sh - post: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/gen_reserved.sh b/vendor/github.com/go-xorm/xorm/gen_reserved.sh deleted file mode 100755 index 434a1bfcb0..0000000000 --- a/vendor/github.com/go-xorm/xorm/gen_reserved.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -if [ -f $1 ];then - cat $1| awk '{printf("\""$1"\":true,\n")}' -else - echo "argument $1 if not a file!" -fi diff --git a/vendor/github.com/go-xorm/xorm/pg_reserved.txt b/vendor/github.com/go-xorm/xorm/pg_reserved.txt deleted file mode 100644 index 720ed377ba..0000000000 --- a/vendor/github.com/go-xorm/xorm/pg_reserved.txt +++ /dev/null @@ -1,746 +0,0 @@ -A non-reserved non-reserved -ABORT non-reserved -ABS reserved reserved -ABSENT non-reserved non-reserved -ABSOLUTE non-reserved non-reserved non-reserved reserved -ACCESS non-reserved -ACCORDING non-reserved non-reserved -ACTION non-reserved non-reserved non-reserved reserved -ADA non-reserved non-reserved non-reserved -ADD non-reserved non-reserved non-reserved reserved -ADMIN non-reserved non-reserved non-reserved -AFTER non-reserved non-reserved non-reserved -AGGREGATE non-reserved -ALL reserved reserved reserved reserved -ALLOCATE reserved reserved reserved -ALSO non-reserved -ALTER non-reserved reserved reserved reserved -ALWAYS non-reserved non-reserved non-reserved -ANALYSE reserved -ANALYZE reserved -AND reserved reserved reserved reserved -ANY reserved reserved reserved reserved -ARE reserved reserved reserved -ARRAY reserved reserved reserved -ARRAY_AGG reserved reserved -ARRAY_MAX_CARDINALITY reserved -AS reserved reserved reserved reserved -ASC reserved non-reserved non-reserved reserved -ASENSITIVE reserved reserved -ASSERTION non-reserved non-reserved non-reserved reserved -ASSIGNMENT non-reserved non-reserved non-reserved -ASYMMETRIC reserved reserved reserved -AT non-reserved reserved reserved reserved -ATOMIC reserved reserved -ATTRIBUTE non-reserved non-reserved non-reserved -ATTRIBUTES non-reserved non-reserved -AUTHORIZATION reserved (can be function or type) reserved reserved reserved -AVG reserved reserved reserved -BACKWARD non-reserved -BASE64 non-reserved non-reserved -BEFORE non-reserved non-reserved non-reserved -BEGIN non-reserved reserved reserved reserved -BEGIN_FRAME reserved -BEGIN_PARTITION reserved -BERNOULLI non-reserved non-reserved -BETWEEN non-reserved (cannot be function or type) reserved reserved reserved -BIGINT non-reserved (cannot be function or type) reserved reserved -BINARY reserved (can be function or type) reserved reserved -BIT non-reserved (cannot be function or type) reserved -BIT_LENGTH reserved -BLOB reserved reserved -BLOCKED non-reserved non-reserved -BOM non-reserved non-reserved -BOOLEAN non-reserved (cannot be function or type) reserved reserved -BOTH reserved reserved reserved reserved -BREADTH non-reserved non-reserved -BY non-reserved reserved reserved reserved -C non-reserved non-reserved non-reserved -CACHE non-reserved -CALL reserved reserved -CALLED non-reserved reserved reserved -CARDINALITY reserved reserved -CASCADE non-reserved non-reserved non-reserved reserved -CASCADED non-reserved reserved reserved reserved -CASE reserved reserved reserved reserved -CAST reserved reserved reserved reserved -CATALOG non-reserved non-reserved non-reserved reserved -CATALOG_NAME non-reserved non-reserved non-reserved -CEIL reserved reserved -CEILING reserved reserved -CHAIN non-reserved non-reserved non-reserved -CHAR non-reserved (cannot be function or type) reserved reserved reserved -CHARACTER non-reserved (cannot be function or type) reserved reserved reserved -CHARACTERISTICS non-reserved non-reserved non-reserved -CHARACTERS non-reserved non-reserved -CHARACTER_LENGTH reserved reserved reserved -CHARACTER_SET_CATALOG non-reserved non-reserved non-reserved -CHARACTER_SET_NAME non-reserved non-reserved non-reserved -CHARACTER_SET_SCHEMA non-reserved non-reserved non-reserved -CHAR_LENGTH reserved reserved reserved -CHECK reserved reserved reserved reserved -CHECKPOINT non-reserved -CLASS non-reserved -CLASS_ORIGIN non-reserved non-reserved non-reserved -CLOB reserved reserved -CLOSE non-reserved reserved reserved reserved -CLUSTER non-reserved -COALESCE non-reserved (cannot be function or type) reserved reserved reserved -COBOL non-reserved non-reserved non-reserved -COLLATE reserved reserved reserved reserved -COLLATION reserved (can be function or type) non-reserved non-reserved reserved -COLLATION_CATALOG non-reserved non-reserved non-reserved -COLLATION_NAME non-reserved non-reserved non-reserved -COLLATION_SCHEMA non-reserved non-reserved non-reserved -COLLECT reserved reserved -COLUMN reserved reserved reserved reserved -COLUMNS non-reserved non-reserved -COLUMN_NAME non-reserved non-reserved non-reserved -COMMAND_FUNCTION non-reserved non-reserved non-reserved -COMMAND_FUNCTION_CODE non-reserved non-reserved -COMMENT non-reserved -COMMENTS non-reserved -COMMIT non-reserved reserved reserved reserved -COMMITTED non-reserved non-reserved non-reserved non-reserved -CONCURRENTLY reserved (can be function or type) -CONDITION reserved reserved -CONDITION_NUMBER non-reserved non-reserved non-reserved -CONFIGURATION non-reserved -CONNECT reserved reserved reserved -CONNECTION non-reserved non-reserved non-reserved reserved -CONNECTION_NAME non-reserved non-reserved non-reserved -CONSTRAINT reserved reserved reserved reserved -CONSTRAINTS non-reserved non-reserved non-reserved reserved -CONSTRAINT_CATALOG non-reserved non-reserved non-reserved -CONSTRAINT_NAME non-reserved non-reserved non-reserved -CONSTRAINT_SCHEMA non-reserved non-reserved non-reserved -CONSTRUCTOR non-reserved non-reserved -CONTAINS reserved non-reserved -CONTENT non-reserved non-reserved non-reserved -CONTINUE non-reserved non-reserved non-reserved reserved -CONTROL non-reserved non-reserved -CONVERSION non-reserved -CONVERT reserved reserved reserved -COPY non-reserved -CORR reserved reserved -CORRESPONDING reserved reserved reserved -COST non-reserved -COUNT reserved reserved reserved -COVAR_POP reserved reserved -COVAR_SAMP reserved reserved -CREATE reserved reserved reserved reserved -CROSS reserved (can be function or type) reserved reserved reserved -CSV non-reserved -CUBE reserved reserved -CUME_DIST reserved reserved -CURRENT non-reserved reserved reserved reserved -CURRENT_CATALOG reserved reserved reserved -CURRENT_DATE reserved reserved reserved reserved -CURRENT_DEFAULT_TRANSFORM_GROUP reserved reserved -CURRENT_PATH reserved reserved -CURRENT_ROLE reserved reserved reserved -CURRENT_ROW reserved -CURRENT_SCHEMA reserved (can be function or type) reserved reserved -CURRENT_TIME reserved reserved reserved reserved -CURRENT_TIMESTAMP reserved reserved reserved reserved -CURRENT_TRANSFORM_GROUP_FOR_TYPE reserved reserved -CURRENT_USER reserved reserved reserved reserved -CURSOR non-reserved reserved reserved reserved -CURSOR_NAME non-reserved non-reserved non-reserved -CYCLE non-reserved reserved reserved -DATA non-reserved non-reserved non-reserved non-reserved -DATABASE non-reserved -DATALINK reserved reserved -DATE reserved reserved reserved -DATETIME_INTERVAL_CODE non-reserved non-reserved non-reserved -DATETIME_INTERVAL_PRECISION non-reserved non-reserved non-reserved -DAY non-reserved reserved reserved reserved -DB non-reserved non-reserved -DEALLOCATE non-reserved reserved reserved reserved -DEC non-reserved (cannot be function or type) reserved reserved reserved -DECIMAL non-reserved (cannot be function or type) reserved reserved reserved -DECLARE non-reserved reserved reserved reserved -DEFAULT reserved reserved reserved reserved -DEFAULTS non-reserved non-reserved non-reserved -DEFERRABLE reserved non-reserved non-reserved reserved -DEFERRED non-reserved non-reserved non-reserved reserved -DEFINED non-reserved non-reserved -DEFINER non-reserved non-reserved non-reserved -DEGREE non-reserved non-reserved -DELETE non-reserved reserved reserved reserved -DELIMITER non-reserved -DELIMITERS non-reserved -DENSE_RANK reserved reserved -DEPTH non-reserved non-reserved -DEREF reserved reserved -DERIVED non-reserved non-reserved -DESC reserved non-reserved non-reserved reserved -DESCRIBE reserved reserved reserved -DESCRIPTOR non-reserved non-reserved reserved -DETERMINISTIC reserved reserved -DIAGNOSTICS non-reserved non-reserved reserved -DICTIONARY non-reserved -DISABLE non-reserved -DISCARD non-reserved -DISCONNECT reserved reserved reserved -DISPATCH non-reserved non-reserved -DISTINCT reserved reserved reserved reserved -DLNEWCOPY reserved reserved -DLPREVIOUSCOPY reserved reserved -DLURLCOMPLETE reserved reserved -DLURLCOMPLETEONLY reserved reserved -DLURLCOMPLETEWRITE reserved reserved -DLURLPATH reserved reserved -DLURLPATHONLY reserved reserved -DLURLPATHWRITE reserved reserved -DLURLSCHEME reserved reserved -DLURLSERVER reserved reserved -DLVALUE reserved reserved -DO reserved -DOCUMENT non-reserved non-reserved non-reserved -DOMAIN non-reserved non-reserved non-reserved reserved -DOUBLE non-reserved reserved reserved reserved -DROP non-reserved reserved reserved reserved -DYNAMIC reserved reserved -DYNAMIC_FUNCTION non-reserved non-reserved non-reserved -DYNAMIC_FUNCTION_CODE non-reserved non-reserved -EACH non-reserved reserved reserved -ELEMENT reserved reserved -ELSE reserved reserved reserved reserved -EMPTY non-reserved non-reserved -ENABLE non-reserved -ENCODING non-reserved non-reserved non-reserved -ENCRYPTED non-reserved -END reserved reserved reserved reserved -END-EXEC reserved reserved reserved -END_FRAME reserved -END_PARTITION reserved -ENFORCED non-reserved -ENUM non-reserved -EQUALS reserved non-reserved -ESCAPE non-reserved reserved reserved reserved -EVENT non-reserved -EVERY reserved reserved -EXCEPT reserved reserved reserved reserved -EXCEPTION reserved -EXCLUDE non-reserved non-reserved non-reserved -EXCLUDING non-reserved non-reserved non-reserved -EXCLUSIVE non-reserved -EXEC reserved reserved reserved -EXECUTE non-reserved reserved reserved reserved -EXISTS non-reserved (cannot be function or type) reserved reserved reserved -EXP reserved reserved -EXPLAIN non-reserved -EXPRESSION non-reserved -EXTENSION non-reserved -EXTERNAL non-reserved reserved reserved reserved -EXTRACT non-reserved (cannot be function or type) reserved reserved reserved -FALSE reserved reserved reserved reserved -FAMILY non-reserved -FETCH reserved reserved reserved reserved -FILE non-reserved non-reserved -FILTER reserved reserved -FINAL non-reserved non-reserved -FIRST non-reserved non-reserved non-reserved reserved -FIRST_VALUE reserved reserved -FLAG non-reserved non-reserved -FLOAT non-reserved (cannot be function or type) reserved reserved reserved -FLOOR reserved reserved -FOLLOWING non-reserved non-reserved non-reserved -FOR reserved reserved reserved reserved -FORCE non-reserved -FOREIGN reserved reserved reserved reserved -FORTRAN non-reserved non-reserved non-reserved -FORWARD non-reserved -FOUND non-reserved non-reserved reserved -FRAME_ROW reserved -FREE reserved reserved -FREEZE reserved (can be function or type) -FROM reserved reserved reserved reserved -FS non-reserved non-reserved -FULL reserved (can be function or type) reserved reserved reserved -FUNCTION non-reserved reserved reserved -FUNCTIONS non-reserved -FUSION reserved reserved -G non-reserved non-reserved -GENERAL non-reserved non-reserved -GENERATED non-reserved non-reserved -GET reserved reserved reserved -GLOBAL non-reserved reserved reserved reserved -GO non-reserved non-reserved reserved -GOTO non-reserved non-reserved reserved -GRANT reserved reserved reserved reserved -GRANTED non-reserved non-reserved non-reserved -GREATEST non-reserved (cannot be function or type) -GROUP reserved reserved reserved reserved -GROUPING reserved reserved -GROUPS reserved -HANDLER non-reserved -HAVING reserved reserved reserved reserved -HEADER non-reserved -HEX non-reserved non-reserved -HIERARCHY non-reserved non-reserved -HOLD non-reserved reserved reserved -HOUR non-reserved reserved reserved reserved -ID non-reserved non-reserved -IDENTITY non-reserved reserved reserved reserved -IF non-reserved -IGNORE non-reserved non-reserved -ILIKE reserved (can be function or type) -IMMEDIATE non-reserved non-reserved non-reserved reserved -IMMEDIATELY non-reserved -IMMUTABLE non-reserved -IMPLEMENTATION non-reserved non-reserved -IMPLICIT non-reserved -IMPORT reserved reserved -IN reserved reserved reserved reserved -INCLUDING non-reserved non-reserved non-reserved -INCREMENT non-reserved non-reserved non-reserved -INDENT non-reserved non-reserved -INDEX non-reserved -INDEXES non-reserved -INDICATOR reserved reserved reserved -INHERIT non-reserved -INHERITS non-reserved -INITIALLY reserved non-reserved non-reserved reserved -INLINE non-reserved -INNER reserved (can be function or type) reserved reserved reserved -INOUT non-reserved (cannot be function or type) reserved reserved -INPUT non-reserved non-reserved non-reserved reserved -INSENSITIVE non-reserved reserved reserved reserved -INSERT non-reserved reserved reserved reserved -INSTANCE non-reserved non-reserved -INSTANTIABLE non-reserved non-reserved -INSTEAD non-reserved non-reserved non-reserved -INT non-reserved (cannot be function or type) reserved reserved reserved -INTEGER non-reserved (cannot be function or type) reserved reserved reserved -INTEGRITY non-reserved non-reserved -INTERSECT reserved reserved reserved reserved -INTERSECTION reserved reserved -INTERVAL non-reserved (cannot be function or type) reserved reserved reserved -INTO reserved reserved reserved reserved -INVOKER non-reserved non-reserved non-reserved -IS reserved (can be function or type) reserved reserved reserved -ISNULL reserved (can be function or type) -ISOLATION non-reserved non-reserved non-reserved reserved -JOIN reserved (can be function or type) reserved reserved reserved -K non-reserved non-reserved -KEY non-reserved non-reserved non-reserved reserved -KEY_MEMBER non-reserved non-reserved -KEY_TYPE non-reserved non-reserved -LABEL non-reserved -LAG reserved reserved -LANGUAGE non-reserved reserved reserved reserved -LARGE non-reserved reserved reserved -LAST non-reserved non-reserved non-reserved reserved -LAST_VALUE reserved reserved -LATERAL reserved reserved reserved -LC_COLLATE non-reserved -LC_CTYPE non-reserved -LEAD reserved reserved -LEADING reserved reserved reserved reserved -LEAKPROOF non-reserved -LEAST non-reserved (cannot be function or type) -LEFT reserved (can be function or type) reserved reserved reserved -LENGTH non-reserved non-reserved non-reserved -LEVEL non-reserved non-reserved non-reserved reserved -LIBRARY non-reserved non-reserved -LIKE reserved (can be function or type) reserved reserved reserved -LIKE_REGEX reserved reserved -LIMIT reserved non-reserved non-reserved -LINK non-reserved non-reserved -LISTEN non-reserved -LN reserved reserved -LOAD non-reserved -LOCAL non-reserved reserved reserved reserved -LOCALTIME reserved reserved reserved -LOCALTIMESTAMP reserved reserved reserved -LOCATION non-reserved non-reserved non-reserved -LOCATOR non-reserved non-reserved -LOCK non-reserved -LOWER reserved reserved reserved -M non-reserved non-reserved -MAP non-reserved non-reserved -MAPPING non-reserved non-reserved non-reserved -MATCH non-reserved reserved reserved reserved -MATCHED non-reserved non-reserved -MATERIALIZED non-reserved -MAX reserved reserved reserved -MAXVALUE non-reserved non-reserved non-reserved -MAX_CARDINALITY reserved -MEMBER reserved reserved -MERGE reserved reserved -MESSAGE_LENGTH non-reserved non-reserved non-reserved -MESSAGE_OCTET_LENGTH non-reserved non-reserved non-reserved -MESSAGE_TEXT non-reserved non-reserved non-reserved -METHOD reserved reserved -MIN reserved reserved reserved -MINUTE non-reserved reserved reserved reserved -MINVALUE non-reserved non-reserved non-reserved -MOD reserved reserved -MODE non-reserved -MODIFIES reserved reserved -MODULE reserved reserved reserved -MONTH non-reserved reserved reserved reserved -MORE non-reserved non-reserved non-reserved -MOVE non-reserved -MULTISET reserved reserved -MUMPS non-reserved non-reserved non-reserved -NAME non-reserved non-reserved non-reserved non-reserved -NAMES non-reserved non-reserved non-reserved reserved -NAMESPACE non-reserved non-reserved -NATIONAL non-reserved (cannot be function or type) reserved reserved reserved -NATURAL reserved (can be function or type) reserved reserved reserved -NCHAR non-reserved (cannot be function or type) reserved reserved reserved -NCLOB reserved reserved -NESTING non-reserved non-reserved -NEW reserved reserved -NEXT non-reserved non-reserved non-reserved reserved -NFC non-reserved non-reserved -NFD non-reserved non-reserved -NFKC non-reserved non-reserved -NFKD non-reserved non-reserved -NIL non-reserved non-reserved -NO non-reserved reserved reserved reserved -NONE non-reserved (cannot be function or type) reserved reserved -NORMALIZE reserved reserved -NORMALIZED non-reserved non-reserved -NOT reserved reserved reserved reserved -NOTHING non-reserved -NOTIFY non-reserved -NOTNULL reserved (can be function or type) -NOWAIT non-reserved -NTH_VALUE reserved reserved -NTILE reserved reserved -NULL reserved reserved reserved reserved -NULLABLE non-reserved non-reserved non-reserved -NULLIF non-reserved (cannot be function or type) reserved reserved reserved -NULLS non-reserved non-reserved non-reserved -NUMBER non-reserved non-reserved non-reserved -NUMERIC non-reserved (cannot be function or type) reserved reserved reserved -OBJECT non-reserved non-reserved non-reserved -OCCURRENCES_REGEX reserved reserved -OCTETS non-reserved non-reserved -OCTET_LENGTH reserved reserved reserved -OF non-reserved reserved reserved reserved -OFF non-reserved non-reserved non-reserved -OFFSET reserved reserved reserved -OIDS non-reserved -OLD reserved reserved -ON reserved reserved reserved reserved -ONLY reserved reserved reserved reserved -OPEN reserved reserved reserved -OPERATOR non-reserved -OPTION non-reserved non-reserved non-reserved reserved -OPTIONS non-reserved non-reserved non-reserved -OR reserved reserved reserved reserved -ORDER reserved reserved reserved reserved -ORDERING non-reserved non-reserved -ORDINALITY non-reserved non-reserved -OTHERS non-reserved non-reserved -OUT non-reserved (cannot be function or type) reserved reserved -OUTER reserved (can be function or type) reserved reserved reserved -OUTPUT non-reserved non-reserved reserved -OVER reserved (can be function or type) reserved reserved -OVERLAPS reserved (can be function or type) reserved reserved reserved -OVERLAY non-reserved (cannot be function or type) reserved reserved -OVERRIDING non-reserved non-reserved -OWNED non-reserved -OWNER non-reserved -P non-reserved non-reserved -PAD non-reserved non-reserved reserved -PARAMETER reserved reserved -PARAMETER_MODE non-reserved non-reserved -PARAMETER_NAME non-reserved non-reserved -PARAMETER_ORDINAL_POSITION non-reserved non-reserved -PARAMETER_SPECIFIC_CATALOG non-reserved non-reserved -PARAMETER_SPECIFIC_NAME non-reserved non-reserved -PARAMETER_SPECIFIC_SCHEMA non-reserved non-reserved -PARSER non-reserved -PARTIAL non-reserved non-reserved non-reserved reserved -PARTITION non-reserved reserved reserved -PASCAL non-reserved non-reserved non-reserved -PASSING non-reserved non-reserved non-reserved -PASSTHROUGH non-reserved non-reserved -PASSWORD non-reserved -PATH non-reserved non-reserved -PERCENT reserved -PERCENTILE_CONT reserved reserved -PERCENTILE_DISC reserved reserved -PERCENT_RANK reserved reserved -PERIOD reserved -PERMISSION non-reserved non-reserved -PLACING reserved non-reserved non-reserved -PLANS non-reserved -PLI non-reserved non-reserved non-reserved -PORTION reserved -POSITION non-reserved (cannot be function or type) reserved reserved reserved -POSITION_REGEX reserved reserved -POWER reserved reserved -PRECEDES reserved -PRECEDING non-reserved non-reserved non-reserved -PRECISION non-reserved (cannot be function or type) reserved reserved reserved -PREPARE non-reserved reserved reserved reserved -PREPARED non-reserved -PRESERVE non-reserved non-reserved non-reserved reserved -PRIMARY reserved reserved reserved reserved -PRIOR non-reserved non-reserved non-reserved reserved -PRIVILEGES non-reserved non-reserved non-reserved reserved -PROCEDURAL non-reserved -PROCEDURE non-reserved reserved reserved reserved -PROGRAM non-reserved -PUBLIC non-reserved non-reserved reserved -QUOTE non-reserved -RANGE non-reserved reserved reserved -RANK reserved reserved -READ non-reserved non-reserved non-reserved reserved -READS reserved reserved -REAL non-reserved (cannot be function or type) reserved reserved reserved -REASSIGN non-reserved -RECHECK non-reserved -RECOVERY non-reserved non-reserved -RECURSIVE non-reserved reserved reserved -REF non-reserved reserved reserved -REFERENCES reserved reserved reserved reserved -REFERENCING reserved reserved -REFRESH non-reserved -REGR_AVGX reserved reserved -REGR_AVGY reserved reserved -REGR_COUNT reserved reserved -REGR_INTERCEPT reserved reserved -REGR_R2 reserved reserved -REGR_SLOPE reserved reserved -REGR_SXX reserved reserved -REGR_SXY reserved reserved -REGR_SYY reserved reserved -REINDEX non-reserved -RELATIVE non-reserved non-reserved non-reserved reserved -RELEASE non-reserved reserved reserved -RENAME non-reserved -REPEATABLE non-reserved non-reserved non-reserved non-reserved -REPLACE non-reserved -REPLICA non-reserved -REQUIRING non-reserved non-reserved -RESET non-reserved -RESPECT non-reserved non-reserved -RESTART non-reserved non-reserved non-reserved -RESTORE non-reserved non-reserved -RESTRICT non-reserved non-reserved non-reserved reserved -RESULT reserved reserved -RETURN reserved reserved -RETURNED_CARDINALITY non-reserved non-reserved -RETURNED_LENGTH non-reserved non-reserved non-reserved -RETURNED_OCTET_LENGTH non-reserved non-reserved non-reserved -RETURNED_SQLSTATE non-reserved non-reserved non-reserved -RETURNING reserved non-reserved non-reserved -RETURNS non-reserved reserved reserved -REVOKE non-reserved reserved reserved reserved -RIGHT reserved (can be function or type) reserved reserved reserved -ROLE non-reserved non-reserved non-reserved -ROLLBACK non-reserved reserved reserved reserved -ROLLUP reserved reserved -ROUTINE non-reserved non-reserved -ROUTINE_CATALOG non-reserved non-reserved -ROUTINE_NAME non-reserved non-reserved -ROUTINE_SCHEMA non-reserved non-reserved -ROW non-reserved (cannot be function or type) reserved reserved -ROWS non-reserved reserved reserved reserved -ROW_COUNT non-reserved non-reserved non-reserved -ROW_NUMBER reserved reserved -RULE non-reserved -SAVEPOINT non-reserved reserved reserved -SCALE non-reserved non-reserved non-reserved -SCHEMA non-reserved non-reserved non-reserved reserved -SCHEMA_NAME non-reserved non-reserved non-reserved -SCOPE reserved reserved -SCOPE_CATALOG non-reserved non-reserved -SCOPE_NAME non-reserved non-reserved -SCOPE_SCHEMA non-reserved non-reserved -SCROLL non-reserved reserved reserved reserved -SEARCH non-reserved reserved reserved -SECOND non-reserved reserved reserved reserved -SECTION non-reserved non-reserved reserved -SECURITY non-reserved non-reserved non-reserved -SELECT reserved reserved reserved reserved -SELECTIVE non-reserved non-reserved -SELF non-reserved non-reserved -SENSITIVE reserved reserved -SEQUENCE non-reserved non-reserved non-reserved -SEQUENCES non-reserved -SERIALIZABLE non-reserved non-reserved non-reserved non-reserved -SERVER non-reserved non-reserved non-reserved -SERVER_NAME non-reserved non-reserved non-reserved -SESSION non-reserved non-reserved non-reserved reserved -SESSION_USER reserved reserved reserved reserved -SET non-reserved reserved reserved reserved -SETOF non-reserved (cannot be function or type) -SETS non-reserved non-reserved -SHARE non-reserved -SHOW non-reserved -SIMILAR reserved (can be function or type) reserved reserved -SIMPLE non-reserved non-reserved non-reserved -SIZE non-reserved non-reserved reserved -SMALLINT non-reserved (cannot be function or type) reserved reserved reserved -SNAPSHOT non-reserved -SOME reserved reserved reserved reserved -SOURCE non-reserved non-reserved -SPACE non-reserved non-reserved reserved -SPECIFIC reserved reserved -SPECIFICTYPE reserved reserved -SPECIFIC_NAME non-reserved non-reserved -SQL reserved reserved reserved -SQLCODE reserved -SQLERROR reserved -SQLEXCEPTION reserved reserved -SQLSTATE reserved reserved reserved -SQLWARNING reserved reserved -SQRT reserved reserved -STABLE non-reserved -STANDALONE non-reserved non-reserved non-reserved -START non-reserved reserved reserved -STATE non-reserved non-reserved -STATEMENT non-reserved non-reserved non-reserved -STATIC reserved reserved -STATISTICS non-reserved -STDDEV_POP reserved reserved -STDDEV_SAMP reserved reserved -STDIN non-reserved -STDOUT non-reserved -STORAGE non-reserved -STRICT non-reserved -STRIP non-reserved non-reserved non-reserved -STRUCTURE non-reserved non-reserved -STYLE non-reserved non-reserved -SUBCLASS_ORIGIN non-reserved non-reserved non-reserved -SUBMULTISET reserved reserved -SUBSTRING non-reserved (cannot be function or type) reserved reserved reserved -SUBSTRING_REGEX reserved reserved -SUCCEEDS reserved -SUM reserved reserved reserved -SYMMETRIC reserved reserved reserved -SYSID non-reserved -SYSTEM non-reserved reserved reserved -SYSTEM_TIME reserved -SYSTEM_USER reserved reserved reserved -T non-reserved non-reserved -TABLE reserved reserved reserved reserved -TABLES non-reserved -TABLESAMPLE reserved reserved -TABLESPACE non-reserved -TABLE_NAME non-reserved non-reserved non-reserved -TEMP non-reserved -TEMPLATE non-reserved -TEMPORARY non-reserved non-reserved non-reserved reserved -TEXT non-reserved -THEN reserved reserved reserved reserved -TIES non-reserved non-reserved -TIME non-reserved (cannot be function or type) reserved reserved reserved -TIMESTAMP non-reserved (cannot be function or type) reserved reserved reserved -TIMEZONE_HOUR reserved reserved reserved -TIMEZONE_MINUTE reserved reserved reserved -TO reserved reserved reserved reserved -TOKEN non-reserved non-reserved -TOP_LEVEL_COUNT non-reserved non-reserved -TRAILING reserved reserved reserved reserved -TRANSACTION non-reserved non-reserved non-reserved reserved -TRANSACTIONS_COMMITTED non-reserved non-reserved -TRANSACTIONS_ROLLED_BACK non-reserved non-reserved -TRANSACTION_ACTIVE non-reserved non-reserved -TRANSFORM non-reserved non-reserved -TRANSFORMS non-reserved non-reserved -TRANSLATE reserved reserved reserved -TRANSLATE_REGEX reserved reserved -TRANSLATION reserved reserved reserved -TREAT non-reserved (cannot be function or type) reserved reserved -TRIGGER non-reserved reserved reserved -TRIGGER_CATALOG non-reserved non-reserved -TRIGGER_NAME non-reserved non-reserved -TRIGGER_SCHEMA non-reserved non-reserved -TRIM non-reserved (cannot be function or type) reserved reserved reserved -TRIM_ARRAY reserved reserved -TRUE reserved reserved reserved reserved -TRUNCATE non-reserved reserved reserved -TRUSTED non-reserved -TYPE non-reserved non-reserved non-reserved non-reserved -TYPES non-reserved -UESCAPE reserved reserved -UNBOUNDED non-reserved non-reserved non-reserved -UNCOMMITTED non-reserved non-reserved non-reserved non-reserved -UNDER non-reserved non-reserved -UNENCRYPTED non-reserved -UNION reserved reserved reserved reserved -UNIQUE reserved reserved reserved reserved -UNKNOWN non-reserved reserved reserved reserved -UNLINK non-reserved non-reserved -UNLISTEN non-reserved -UNLOGGED non-reserved -UNNAMED non-reserved non-reserved non-reserved -UNNEST reserved reserved -UNTIL non-reserved -UNTYPED non-reserved non-reserved -UPDATE non-reserved reserved reserved reserved -UPPER reserved reserved reserved -URI non-reserved non-reserved -USAGE non-reserved non-reserved reserved -USER reserved reserved reserved reserved -USER_DEFINED_TYPE_CATALOG non-reserved non-reserved -USER_DEFINED_TYPE_CODE non-reserved non-reserved -USER_DEFINED_TYPE_NAME non-reserved non-reserved -USER_DEFINED_TYPE_SCHEMA non-reserved non-reserved -USING reserved reserved reserved reserved -VACUUM non-reserved -VALID non-reserved non-reserved non-reserved -VALIDATE non-reserved -VALIDATOR non-reserved -VALUE non-reserved reserved reserved reserved -VALUES non-reserved (cannot be function or type) reserved reserved reserved -VALUE_OF reserved -VARBINARY reserved reserved -VARCHAR non-reserved (cannot be function or type) reserved reserved reserved -VARIADIC reserved -VARYING non-reserved reserved reserved reserved -VAR_POP reserved reserved -VAR_SAMP reserved reserved -VERBOSE reserved (can be function or type) -VERSION non-reserved non-reserved non-reserved -VERSIONING reserved -VIEW non-reserved non-reserved non-reserved reserved -VOLATILE non-reserved -WHEN reserved reserved reserved reserved -WHENEVER reserved reserved reserved -WHERE reserved reserved reserved reserved -WHITESPACE non-reserved non-reserved non-reserved -WIDTH_BUCKET reserved reserved -WINDOW reserved reserved reserved -WITH reserved reserved reserved reserved -WITHIN reserved reserved -WITHOUT non-reserved reserved reserved -WORK non-reserved non-reserved non-reserved reserved -WRAPPER non-reserved non-reserved non-reserved -WRITE non-reserved non-reserved non-reserved reserved -XML non-reserved reserved reserved -XMLAGG reserved reserved -XMLATTRIBUTES non-reserved (cannot be function or type) reserved reserved -XMLBINARY reserved reserved -XMLCAST reserved reserved -XMLCOMMENT reserved reserved -XMLCONCAT non-reserved (cannot be function or type) reserved reserved -XMLDECLARATION non-reserved non-reserved -XMLDOCUMENT reserved reserved -XMLELEMENT non-reserved (cannot be function or type) reserved reserved -XMLEXISTS non-reserved (cannot be function or type) reserved reserved -XMLFOREST non-reserved (cannot be function or type) reserved reserved -XMLITERATE reserved reserved -XMLNAMESPACES reserved reserved -XMLPARSE non-reserved (cannot be function or type) reserved reserved -XMLPI non-reserved (cannot be function or type) reserved reserved -XMLQUERY reserved reserved -XMLROOT non-reserved (cannot be function or type) -XMLSCHEMA non-reserved non-reserved -XMLSERIALIZE non-reserved (cannot be function or type) reserved reserved -XMLTABLE reserved reserved -XMLTEXT reserved reserved -XMLVALIDATE reserved reserved -YEAR non-reserved reserved reserved reserved -YES non-reserved non-reserved non-reserved -ZONE non-reserved non-reserved non-reserved reserved \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mssql.sh b/vendor/github.com/go-xorm/xorm/test_mssql.sh deleted file mode 100755 index 6f9cf7295f..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mssql.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mssql -conn_str="server=192.168.1.58;user id=sa;password=123456;database=xorm_test" \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mssql_cache.sh b/vendor/github.com/go-xorm/xorm/test_mssql_cache.sh deleted file mode 100755 index 76efd6ca0a..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mssql_cache.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mssql -conn_str="server=192.168.1.58;user id=sa;password=123456;database=xorm_test" -cache=true \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mymysql.sh b/vendor/github.com/go-xorm/xorm/test_mymysql.sh deleted file mode 100755 index f7780d14fa..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mymysql.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mymysql -conn_str="xorm_test/root/" \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mymysql_cache.sh b/vendor/github.com/go-xorm/xorm/test_mymysql_cache.sh deleted file mode 100755 index 0100286d65..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mymysql_cache.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mymysql -conn_str="xorm_test/root/" -cache=true \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mysql.sh b/vendor/github.com/go-xorm/xorm/test_mysql.sh deleted file mode 100755 index 650e4ee170..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mysql.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mysql -conn_str="root:@/xorm_test" \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_mysql_cache.sh b/vendor/github.com/go-xorm/xorm/test_mysql_cache.sh deleted file mode 100755 index c542e73594..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_mysql_cache.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=mysql -conn_str="root:@/xorm_test" -cache=true \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_postgres.sh b/vendor/github.com/go-xorm/xorm/test_postgres.sh deleted file mode 100755 index dc1152e0a6..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_postgres.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=postgres -conn_str="dbname=xorm_test sslmode=disable" \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_postgres_cache.sh b/vendor/github.com/go-xorm/xorm/test_postgres_cache.sh deleted file mode 100755 index 462fc948cb..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_postgres_cache.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=postgres -conn_str="dbname=xorm_test sslmode=disable" -cache=true \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_sqlite.sh b/vendor/github.com/go-xorm/xorm/test_sqlite.sh deleted file mode 100755 index 6352b5cb5f..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_sqlite.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" \ No newline at end of file diff --git a/vendor/github.com/go-xorm/xorm/test_sqlite_cache.sh b/vendor/github.com/go-xorm/xorm/test_sqlite_cache.sh deleted file mode 100755 index 75a054c3f1..0000000000 --- a/vendor/github.com/go-xorm/xorm/test_sqlite_cache.sh +++ /dev/null @@ -1 +0,0 @@ -go test -db=sqlite3 -conn_str="./test.db?cache=shared&mode=rwc" -cache=true \ No newline at end of file diff --git a/vendor/github.com/gogits/chardet/README.md b/vendor/github.com/gogits/chardet/README.md deleted file mode 100644 index bbde23fb73..0000000000 --- a/vendor/github.com/gogits/chardet/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# chardet - -chardet is library to automatically detect -[charset](http://en.wikipedia.org/wiki/Character_encoding) of texts for [Go -programming language](http://golang.org/). It's based on the algorithm and data -in [ICU](http://icu-project.org/)'s implementation. - -The project was created by [saintfish](http://github.com/saintfish/chardet). In January 2015 it was forked by the gogits project in order to incorporate bugfixes and new features. - -## Documentation and Usage - -See [pkgdoc](http://godoc.org/github.com/gogits/chardet) diff --git a/vendor/github.com/gogits/chardet/icu-license.html b/vendor/github.com/gogits/chardet/icu-license.html deleted file mode 100644 index d078d0575b..0000000000 --- a/vendor/github.com/gogits/chardet/icu-license.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - -ICU License - ICU 1.8.1 and later -

- - -

ICU License - ICU 1.8.1 and later

- -

COPYRIGHT AND PERMISSION NOTICE

- -

-Copyright (c) 1995-2012 International Business Machines Corporation and others -

-

-All rights reserved. -

-

-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, and/or sell -copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies -of the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. -

-

-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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL -THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, -OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. -

-

-Except as contained in this notice, the name of a copyright holder shall not be -used in advertising or otherwise to promote the sale, use or other dealings in -this Software without prior written authorization of the copyright holder. -

- -
-

-All trademarks and registered trademarks mentioned herein are the property of their respective owners. -

- - diff --git a/vendor/github.com/gogits/cron/README.md b/vendor/github.com/gogits/cron/README.md deleted file mode 100644 index 157ed082d4..0000000000 --- a/vendor/github.com/gogits/cron/README.md +++ /dev/null @@ -1,2 +0,0 @@ -[![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron) -[![Build Status](https://travis-ci.org/robfig/cron.svg?branch=master)](https://travis-ci.org/robfig/cron) diff --git a/vendor/github.com/golang/protobuf/AUTHORS b/vendor/github.com/golang/protobuf/AUTHORS new file mode 100644 index 0000000000..15167cd746 --- /dev/null +++ b/vendor/github.com/golang/protobuf/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/golang/protobuf/CONTRIBUTORS b/vendor/github.com/golang/protobuf/CONTRIBUTORS new file mode 100644 index 0000000000..1c4577e968 --- /dev/null +++ b/vendor/github.com/golang/protobuf/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/golang/protobuf/proto/Makefile b/vendor/github.com/golang/protobuf/proto/Makefile deleted file mode 100644 index e2e0651a93..0000000000 --- a/vendor/github.com/golang/protobuf/proto/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# Go support for Protocol Buffers - Google's data interchange format -# -# Copyright 2010 The Go Authors. All rights reserved. -# https://github.com/golang/protobuf -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * 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. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# 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 -# OWNER 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. - -install: - go install - -test: install generate-test-pbs - go test - - -generate-test-pbs: - make install - make -C testdata - 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 - make diff --git a/vendor/github.com/golang/snappy/README b/vendor/github.com/golang/snappy/README deleted file mode 100644 index 5074bbab8d..0000000000 --- a/vendor/github.com/golang/snappy/README +++ /dev/null @@ -1,7 +0,0 @@ -The Snappy compression format in the Go programming language. - -To download and install from source: -$ go get github.com/golang/snappy - -Unless otherwise noted, the Snappy-Go source files are distributed -under the BSD-style license found in the LICENSE file. diff --git a/vendor/github.com/gorilla/context/README.md b/vendor/github.com/gorilla/context/README.md deleted file mode 100644 index 08f86693bc..0000000000 --- a/vendor/github.com/gorilla/context/README.md +++ /dev/null @@ -1,10 +0,0 @@ -context -======= -[![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) - -gorilla/context is a general purpose registry for global request variables. - -> Note: gorilla/context, having been born well before `context.Context` existed, does not play well -> with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`. - -Read the full documentation here: http://www.gorillatoolkit.org/pkg/context diff --git a/vendor/github.com/gorilla/mux/README.md b/vendor/github.com/gorilla/mux/README.md deleted file mode 100644 index fa79a6bc3a..0000000000 --- a/vendor/github.com/gorilla/mux/README.md +++ /dev/null @@ -1,299 +0,0 @@ -gorilla/mux -=== -[![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux) -[![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux) - -![Gorilla Logo](http://www.gorillatoolkit.org/static/images/gorilla-icon-64.png) - -http://www.gorillatoolkit.org/pkg/mux - -Package `gorilla/mux` implements a request router and dispatcher for matching incoming requests to -their respective handler. - -The name mux stands for "HTTP request multiplexer". Like the standard `http.ServeMux`, `mux.Router` matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions. The main features are: - -* It implements the `http.Handler` interface so it is compatible with the standard `http.ServeMux`. -* Requests can be matched based on URL host, path, path prefix, schemes, header and query values, HTTP methods or using custom matchers. -* URL hosts and paths can have variables with an optional regular expression. -* Registered URLs can be built, or "reversed", which helps maintaining references to resources. -* Routes can be used as subrouters: nested routes are only tested if the parent route matches. This is useful to define groups of routes that share common conditions like a host, a path prefix or other repeated attributes. As a bonus, this optimizes request matching. - ---- - -* [Install](#install) -* [Examples](#examples) -* [Matching Routes](#matching-routes) -* [Static Files](#static-files) -* [Registered URLs](#registered-urls) -* [Full Example](#full-example) - ---- - -## Install - -With a [correctly configured](https://golang.org/doc/install#testing) Go toolchain: - -```sh -go get -u github.com/gorilla/mux -``` - -## Examples - -Let's start registering a couple of URL paths and handlers: - -```go -func main() { - r := mux.NewRouter() - r.HandleFunc("/", HomeHandler) - r.HandleFunc("/products", ProductsHandler) - r.HandleFunc("/articles", ArticlesHandler) - http.Handle("/", r) -} -``` - -Here we register three routes mapping URL paths to handlers. This is equivalent to how `http.HandleFunc()` works: if an incoming request URL matches one of the paths, the corresponding handler is called passing (`http.ResponseWriter`, `*http.Request`) as parameters. - -Paths can have variables. They are defined using the format `{name}` or `{name:pattern}`. If a regular expression pattern is not defined, the matched variable will be anything until the next slash. For example: - -```go -r := mux.NewRouter() -r.HandleFunc("/products/{key}", ProductHandler) -r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler) -r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) -``` - -The names are used to create a map of route variables which can be retrieved calling `mux.Vars()`: - -```go -vars := mux.Vars(request) -category := vars["category"] -``` - -And this is all you need to know about the basic usage. More advanced options are explained below. - -### Matching Routes - -Routes can also be restricted to a domain or subdomain. Just define a host pattern to be matched. They can also have variables: - -```go -r := mux.NewRouter() -// Only matches if domain is "www.example.com". -r.Host("www.example.com") -// Matches a dynamic subdomain. -r.Host("{subdomain:[a-z]+}.domain.com") -``` - -There are several other matchers that can be added. To match path prefixes: - -```go -r.PathPrefix("/products/") -``` - -...or HTTP methods: - -```go -r.Methods("GET", "POST") -``` - -...or URL schemes: - -```go -r.Schemes("https") -``` - -...or header values: - -```go -r.Headers("X-Requested-With", "XMLHttpRequest") -``` - -...or query values: - -```go -r.Queries("key", "value") -``` - -...or to use a custom matcher function: - -```go -r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool { - return r.ProtoMajor == 0 -}) -``` - -...and finally, it is possible to combine several matchers in a single route: - -```go -r.HandleFunc("/products", ProductsHandler). - Host("www.example.com"). - Methods("GET"). - Schemes("http") -``` - -Setting the same matching conditions again and again can be boring, so we have a way to group several routes that share the same requirements. We call it "subrouting". - -For example, let's say we have several URLs that should only match when the host is `www.example.com`. Create a route for that host and get a "subrouter" from it: - -```go -r := mux.NewRouter() -s := r.Host("www.example.com").Subrouter() -``` - -Then register routes in the subrouter: - -```go -s.HandleFunc("/products/", ProductsHandler) -s.HandleFunc("/products/{key}", ProductHandler) -s.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) -``` - -The three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route. - -Subrouters can be used to create domain or path "namespaces": you define subrouters in a central place and then parts of the app can register its paths relatively to a given subrouter. - -There's one more thing about subroutes. When a subrouter has a path prefix, the inner routes use it as base for their paths: - -```go -r := mux.NewRouter() -s := r.PathPrefix("/products").Subrouter() -// "/products/" -s.HandleFunc("/", ProductsHandler) -// "/products/{key}/" -s.HandleFunc("/{key}/", ProductHandler) -// "/products/{key}/details" -s.HandleFunc("/{key}/details", ProductDetailsHandler) -``` - -### Static Files - -Note that the path provided to `PathPrefix()` represents a "wildcard": calling -`PathPrefix("/static/").Handler(...)` means that the handler will be passed any -request that matches "/static/*". This makes it easy to serve static files with mux: - -```go -func main() { - var dir string - - flag.StringVar(&dir, "dir", ".", "the directory to serve files from. Defaults to the current dir") - flag.Parse() - r := mux.NewRouter() - - // This will serve files under http://localhost:8000/static/ - r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(dir)))) - - srv := &http.Server{ - Handler: r, - Addr: "127.0.0.1:8000", - // Good practice: enforce timeouts for servers you create! - WriteTimeout: 15 * time.Second, - ReadTimeout: 15 * time.Second, - } - - log.Fatal(srv.ListenAndServe()) -} -``` - -### Registered URLs - -Now let's see how to build registered URLs. - -Routes can be named. All routes that define a name can have their URLs built, or "reversed". We define a name calling `Name()` on a route. For example: - -```go -r := mux.NewRouter() -r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). - Name("article") -``` - -To build a URL, get the route and call the `URL()` method, passing a sequence of key/value pairs for the route variables. For the previous route, we would do: - -```go -url, err := r.Get("article").URL("category", "technology", "id", "42") -``` - -...and the result will be a `url.URL` with the following path: - -``` -"/articles/technology/42" -``` - -This also works for host variables: - -```go -r := mux.NewRouter() -r.Host("{subdomain}.domain.com"). - Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - -// url.String() will be "http://news.domain.com/articles/technology/42" -url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") -``` - -All variables defined in the route are required, and their values must conform to the corresponding patterns. These requirements guarantee that a generated URL will always match a registered route -- the only exception is for explicitly defined "build-only" routes which never match. - -Regex support also exists for matching Headers within a route. For example, we could do: - -```go -r.HeadersRegexp("Content-Type", "application/(text|json)") -``` - -...and the route will match both requests with a Content-Type of `application/json` as well as `application/text` - -There's also a way to build only the URL host or path for a route: use the methods `URLHost()` or `URLPath()` instead. For the previous route, we would do: - -```go -// "http://news.domain.com/" -host, err := r.Get("article").URLHost("subdomain", "news") - -// "/articles/technology/42" -path, err := r.Get("article").URLPath("category", "technology", "id", "42") -``` - -And if you use subrouters, host and path defined separately can be built as well: - -```go -r := mux.NewRouter() -s := r.Host("{subdomain}.domain.com").Subrouter() -s.Path("/articles/{category}/{id:[0-9]+}"). - HandlerFunc(ArticleHandler). - Name("article") - -// "http://news.domain.com/articles/technology/42" -url, err := r.Get("article").URL("subdomain", "news", - "category", "technology", - "id", "42") -``` - -## Full Example - -Here's a complete, runnable example of a small `mux` based server: - -```go -package main - -import ( - "net/http" - "log" - "github.com/gorilla/mux" -) - -func YourHandler(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("Gorilla!\n")) -} - -func main() { - r := mux.NewRouter() - // Routes consist of a path and a handler function. - r.HandleFunc("/", YourHandler) - - // Bind to a port and pass our router in - log.Fatal(http.ListenAndServe(":8000", r)) -} -``` - -## License - -BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/gorilla/securecookie/README.md b/vendor/github.com/gorilla/securecookie/README.md deleted file mode 100644 index da112e4d08..0000000000 --- a/vendor/github.com/gorilla/securecookie/README.md +++ /dev/null @@ -1,78 +0,0 @@ -securecookie -============ -[![GoDoc](https://godoc.org/github.com/gorilla/securecookie?status.svg)](https://godoc.org/github.com/gorilla/securecookie) [![Build Status](https://travis-ci.org/gorilla/securecookie.png?branch=master)](https://travis-ci.org/gorilla/securecookie) - -securecookie encodes and decodes authenticated and optionally encrypted -cookie values. - -Secure cookies can't be forged, because their values are validated using HMAC. -When encrypted, the content is also inaccessible to malicious eyes. It is still -recommended that sensitive data not be stored in cookies, and that HTTPS be used -to prevent cookie [replay attacks](https://en.wikipedia.org/wiki/Replay_attack). - -## Examples - -To use it, first create a new SecureCookie instance: - -```go -// Hash keys should be at least 32 bytes long -var hashKey = []byte("very-secret") -// Block keys should be 16 bytes (AES-128) or 32 bytes (AES-256) long. -// Shorter keys may weaken the encryption used. -var blockKey = []byte("a-lot-secret") -var s = securecookie.New(hashKey, blockKey) -``` - -The hashKey is required, used to authenticate the cookie value using HMAC. -It is recommended to use a key with 32 or 64 bytes. - -The blockKey is optional, used to encrypt the cookie value -- set it to nil -to not use encryption. If set, the length must correspond to the block size -of the encryption algorithm. For AES, used by default, valid lengths are -16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. - -Strong keys can be created using the convenience function GenerateRandomKey(). - -Once a SecureCookie instance is set, use it to encode a cookie value: - -```go -func SetCookieHandler(w http.ResponseWriter, r *http.Request) { - value := map[string]string{ - "foo": "bar", - } - if encoded, err := s.Encode("cookie-name", value); err == nil { - cookie := &http.Cookie{ - Name: "cookie-name", - Value: encoded, - Path: "/", - Secure: true, - HttpOnly: true, - } - http.SetCookie(w, cookie) - } -} -``` - -Later, use the same SecureCookie instance to decode and validate a cookie -value: - -```go -func ReadCookieHandler(w http.ResponseWriter, r *http.Request) { - if cookie, err := r.Cookie("cookie-name"); err == nil { - value := make(map[string]string) - if err = s2.Decode("cookie-name", cookie.Value, &value); err == nil { - fmt.Fprintf(w, "The value of foo is %q", value["foo"]) - } - } -} -``` - -We stored a map[string]string, but secure cookies can hold any value that -can be encoded using `encoding/gob`. To store custom types, they must be -registered first using gob.Register(). For basic types this is not needed; -it works out of the box. An optional JSON encoder that uses `encoding/json` is -available for types compatible with JSON. - -## License - -BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/gorilla/sessions/README.md b/vendor/github.com/gorilla/sessions/README.md deleted file mode 100644 index 5bb3107041..0000000000 --- a/vendor/github.com/gorilla/sessions/README.md +++ /dev/null @@ -1,81 +0,0 @@ -sessions -======== -[![GoDoc](https://godoc.org/github.com/gorilla/sessions?status.svg)](https://godoc.org/github.com/gorilla/sessions) [![Build Status](https://travis-ci.org/gorilla/sessions.png?branch=master)](https://travis-ci.org/gorilla/sessions) - -gorilla/sessions provides cookie and filesystem sessions and infrastructure for -custom session backends. - -The key features are: - -* Simple API: use it as an easy way to set signed (and optionally - encrypted) cookies. -* Built-in backends to store sessions in cookies or the filesystem. -* Flash messages: session values that last until read. -* Convenient way to switch session persistency (aka "remember me") and set - other attributes. -* Mechanism to rotate authentication and encryption keys. -* Multiple sessions per request, even using different backends. -* Interfaces and infrastructure for custom session backends: sessions from - different stores can be retrieved and batch-saved using a common API. - -Let's start with an example that shows the sessions API in a nutshell: - -```go - import ( - "net/http" - "github.com/gorilla/sessions" - ) - - var store = sessions.NewCookieStore([]byte("something-very-secret")) - - func MyHandler(w http.ResponseWriter, r *http.Request) { - // Get a session. We're ignoring the error resulted from decoding an - // existing session: Get() always returns a session, even if empty. - session, _ := store.Get(r, "session-name") - // Set some session values. - session.Values["foo"] = "bar" - session.Values[42] = 43 - // Save it before we write to the response/return from the handler. - session.Save(r, w) - } -``` - -First we initialize a session store calling `NewCookieStore()` and passing a -secret key used to authenticate the session. Inside the handler, we call -`store.Get()` to retrieve an existing session or a new one. Then we set some -session values in session.Values, which is a `map[interface{}]interface{}`. -And finally we call `session.Save()` to save the session in the response. - -Important Note: If you aren't using gorilla/mux, you need to wrap your handlers -with -[`context.ClearHandler`](http://www.gorillatoolkit.org/pkg/context#ClearHandler) -as or else you will leak memory! An easy way to do this is to wrap the top-level -mux when calling http.ListenAndServe: - -More examples are available [on the Gorilla -website](http://www.gorillatoolkit.org/pkg/sessions). - -## Store Implementations - -Other implementations of the `sessions.Store` interface: - -* [github.com/starJammer/gorilla-sessions-arangodb](https://github.com/starJammer/gorilla-sessions-arangodb) - ArangoDB -* [github.com/yosssi/boltstore](https://github.com/yosssi/boltstore) - Bolt -* [github.com/srinathgs/couchbasestore](https://github.com/srinathgs/couchbasestore) - Couchbase -* [github.com/denizeren/dynamostore](https://github.com/denizeren/dynamostore) - Dynamodb on AWS -* [github.com/bradleypeabody/gorilla-sessions-memcache](https://github.com/bradleypeabody/gorilla-sessions-memcache) - Memcache -* [github.com/dsoprea/go-appengine-sessioncascade](https://github.com/dsoprea/go-appengine-sessioncascade) - Memcache/Datastore/Context in AppEngine -* [github.com/kidstuff/mongostore](https://github.com/kidstuff/mongostore) - MongoDB -* [github.com/srinathgs/mysqlstore](https://github.com/srinathgs/mysqlstore) - MySQL -* [github.com/EnumApps/clustersqlstore](https://github.com/EnumApps/clustersqlstore) - MySQL Cluster -* [github.com/antonlindstrom/pgstore](https://github.com/antonlindstrom/pgstore) - PostgreSQL -* [github.com/boj/redistore](https://github.com/boj/redistore) - Redis -* [github.com/boj/rethinkstore](https://github.com/boj/rethinkstore) - RethinkDB -* [github.com/boj/riakstore](https://github.com/boj/riakstore) - Riak -* [github.com/michaeljs1990/sqlitestore](https://github.com/michaeljs1990/sqlitestore) - SQLite -* [github.com/wader/gormstore](https://github.com/wader/gormstore) - GORM (MySQL, PostgreSQL, SQLite) -* [github.com/gernest/qlstore](https://github.com/gernest/qlstore) - ql - -## License - -BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/issue9/identicon/README.md b/vendor/github.com/issue9/identicon/README.md deleted file mode 100644 index a68c73bc4e..0000000000 --- a/vendor/github.com/issue9/identicon/README.md +++ /dev/null @@ -1,40 +0,0 @@ -identicon [![Build Status](https://travis-ci.org/issue9/identicon.svg?branch=master)](https://travis-ci.org/issue9/identicon) -====== - -根据用户的IP、邮箱名等任意数据为用户产生漂亮的随机头像。 - -![screenhost.1](https://raw.github.com/issue9/identicon/master/screenshot/1.png) -![screenhost.4](https://raw.github.com/issue9/identicon/master/screenshot/4.png) -![screenhost.5](https://raw.github.com/issue9/identicon/master/screenshot/5.png) -![screenhost.6](https://raw.github.com/issue9/identicon/master/screenshot/6.png) -![screenhost.7](https://raw.github.com/issue9/identicon/master/screenshot/7.png) - -```go -// 根据用户访问的IP,为其生成一张头像 -img, _ := identicon.Make(128, color.NRGBA{},color.NRGBA{}, []byte("192.168.1.1")) -fi, _ := os.Create("/tmp/u1.png") -png.Encode(fi, img) -fi.Close() - -// 或者 -ii, _ := identicon.New(128, color.NRGBA{}, color.NRGBA{}, color.NRGBA{}, color.NRGBA{}) -img := ii.Make([]byte("192.168.1.1")) -img = ii.Make([]byte("192.168.1.2")) -``` - -### 安装 - -```shell -go get github.com/issue9/identicon -``` - - -### 文档 - -[![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/issue9/identicon) -[![GoDoc](https://godoc.org/github.com/issue9/identicon?status.svg)](https://godoc.org/github.com/issue9/identicon) - - -### 版权 - -本项目采用[MIT](http://opensource.org/licenses/MIT)开源授权许可证,完整的授权说明可在[LICENSE](LICENSE)文件中找到。 diff --git a/vendor/github.com/jaytaylor/html2text/README.md b/vendor/github.com/jaytaylor/html2text/README.md deleted file mode 100644 index 6e67dbcc6a..0000000000 --- a/vendor/github.com/jaytaylor/html2text/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# html2text - -[![Documentation](https://godoc.org/github.com/jaytaylor/html2text?status.svg)](https://godoc.org/github.com/jaytaylor/html2text) -[![Build Status](https://travis-ci.org/jaytaylor/html2text.svg?branch=master)](https://travis-ci.org/jaytaylor/html2text) -[![Report Card](https://goreportcard.com/badge/github.com/jaytaylor/html2text)](https://goreportcard.com/report/github.com/jaytaylor/html2text) - -### Converts HTML into text - - -## Introduction - -html2text is a simple golang package for rendering HTML into plaintext. - -There are still lots of improvements to be had, but FWIW this has worked fine for my [basic] HTML-2-text needs. - -It requires go 1.x or newer ;) - - -## Download the package - -```bash -go get github.com/jaytaylor/html2text -``` - -## Example usage - -```go -package main - -import ( - "fmt" - - "github.com/jaytaylor/html2text" -) - -func main() { - inputHtml := ` - - - My Mega Service - - - - - - - -

Welcome to your new account on my service!

- -

- Here is some more information: - -

-

- - - ` - - text, err := html2text.FromString(inputHtml) - if err != nil { - panic(err) - } - fmt.Println(text) -} -``` - -Output: -``` -Mega Service ( http://mymegaservice.com/ ) - -****************************************** -Welcome to your new account on my service! -****************************************** - -Here is some more information: - -* Link 1: Example.com ( https://example.com ) -* Link 2: Example2.com ( https://example2.com ) -* Something else -``` - - -## Unit-tests - -Running the unit-tests is straightforward and standard: - -```bash -go test -``` - - -# License - -Permissive MIT license. - - -## Contact - -You are more than welcome to open issues and send pull requests if you find a bug or want a new feature. - -If you appreciate this library please feel free to drop me a line and tell me! It's always nice to hear from people who have benefitted from my work. - -Email: jay at (my github username).com - -Twitter: [@jtaylor](https://twitter.com/jtaylor) - diff --git a/vendor/github.com/juju/errors/Makefile b/vendor/github.com/juju/errors/Makefile deleted file mode 100644 index ab7c2e6cf2..0000000000 --- a/vendor/github.com/juju/errors/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -default: check - -check: - go test && go test -compiler gccgo - -docs: - godoc2md github.com/juju/errors > README.md - sed -i 's|\[godoc-link-here\]|[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)|' README.md - - -.PHONY: default check docs diff --git a/vendor/github.com/juju/errors/README.md b/vendor/github.com/juju/errors/README.md deleted file mode 100644 index ee248911f2..0000000000 --- a/vendor/github.com/juju/errors/README.md +++ /dev/null @@ -1,536 +0,0 @@ - -# errors - import "github.com/juju/errors" - -[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors) - -The juju/errors provides an easy way to annotate errors without losing the -orginal error context. - -The exported `New` and `Errorf` functions are designed to replace the -`errors.New` and `fmt.Errorf` functions respectively. The same underlying -error is there, but the package also records the location at which the error -was created. - -A primary use case for this library is to add extra context any time an -error is returned from a function. - - - if err := SomeFunc(); err != nil { - return err - } - -This instead becomes: - - - if err := SomeFunc(); err != nil { - return errors.Trace(err) - } - -which just records the file and line number of the Trace call, or - - - if err := SomeFunc(); err != nil { - return errors.Annotate(err, "more context") - } - -which also adds an annotation to the error. - -When you want to check to see if an error is of a particular type, a helper -function is normally exported by the package that returned the error, like the -`os` package does. The underlying cause of the error is available using the -`Cause` function. - - - os.IsNotExist(errors.Cause(err)) - -The result of the `Error()` call on an annotated error is the annotations joined -with colons, then the result of the `Error()` method for the underlying error -that was the cause. - - - err := errors.Errorf("original") - err = errors.Annotatef(err, "context") - err = errors.Annotatef(err, "more context") - err.Error() -> "more context: context: original" - -Obviously recording the file, line and functions is not very useful if you -cannot get them back out again. - - - errors.ErrorStack(err) - -will return something like: - - - first error - github.com/juju/errors/annotation_test.go:193: - github.com/juju/errors/annotation_test.go:194: annotation - github.com/juju/errors/annotation_test.go:195: - github.com/juju/errors/annotation_test.go:196: more context - github.com/juju/errors/annotation_test.go:197: - -The first error was generated by an external system, so there was no location -associated. The second, fourth, and last lines were generated with Trace calls, -and the other two through Annotate. - -Sometimes when responding to an error you want to return a more specific error -for the situation. - - - if err := FindField(field); err != nil { - return errors.Wrap(err, errors.NotFoundf(field)) - } - -This returns an error where the complete error stack is still available, and -`errors.Cause()` will return the `NotFound` error. - - - - - - -## func AlreadyExistsf -``` go -func AlreadyExistsf(format string, args ...interface{}) error -``` -AlreadyExistsf returns an error which satisfies IsAlreadyExists(). - - -## func Annotate -``` go -func Annotate(other error, message string) error -``` -Annotate is used to add extra context to an existing error. The location of -the Annotate call is recorded with the annotations. The file, line and -function are also recorded. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Annotate(err, "failed to frombulate") - } - - -## func Annotatef -``` go -func Annotatef(other error, format string, args ...interface{}) error -``` -Annotatef is used to add extra context to an existing error. The location of -the Annotate call is recorded with the annotations. The file, line and -function are also recorded. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Annotatef(err, "failed to frombulate the %s", arg) - } - - -## func Cause -``` go -func Cause(err error) error -``` -Cause returns the cause of the given error. This will be either the -original error, or the result of a Wrap or Mask call. - -Cause is the usual way to diagnose errors that may have been wrapped by -the other errors functions. - - -## func DeferredAnnotatef -``` go -func DeferredAnnotatef(err *error, format string, args ...interface{}) -``` -DeferredAnnotatef annotates the given error (when it is not nil) with the given -format string and arguments (like fmt.Sprintf). If *err is nil, DeferredAnnotatef -does nothing. This method is used in a defer statement in order to annotate any -resulting error with the same message. - -For example: - - - defer DeferredAnnotatef(&err, "failed to frombulate the %s", arg) - - -## func Details -``` go -func Details(err error) string -``` -Details returns information about the stack of errors wrapped by err, in -the format: - - - [{filename:99: error one} {otherfile:55: cause of error one}] - -This is a terse alternative to ErrorStack as it returns a single line. - - -## func ErrorStack -``` go -func ErrorStack(err error) string -``` -ErrorStack returns a string representation of the annotated error. If the -error passed as the parameter is not an annotated error, the result is -simply the result of the Error() method on that error. - -If the error is an annotated error, a multi-line string is returned where -each line represents one entry in the annotation stack. The full filename -from the call stack is used in the output. - - - first error - github.com/juju/errors/annotation_test.go:193: - github.com/juju/errors/annotation_test.go:194: annotation - github.com/juju/errors/annotation_test.go:195: - github.com/juju/errors/annotation_test.go:196: more context - github.com/juju/errors/annotation_test.go:197: - - -## func Errorf -``` go -func Errorf(format string, args ...interface{}) error -``` -Errorf creates a new annotated error and records the location that the -error is created. This should be a drop in replacement for fmt.Errorf. - -For example: - - - return errors.Errorf("validation failed: %s", message) - - -## func IsAlreadyExists -``` go -func IsAlreadyExists(err error) bool -``` -IsAlreadyExists reports whether the error was created with -AlreadyExistsf() or NewAlreadyExists(). - - -## func IsNotFound -``` go -func IsNotFound(err error) bool -``` -IsNotFound reports whether err was created with NotFoundf() or -NewNotFound(). - - -## func IsNotImplemented -``` go -func IsNotImplemented(err error) bool -``` -IsNotImplemented reports whether err was created with -NotImplementedf() or NewNotImplemented(). - - -## func IsNotSupported -``` go -func IsNotSupported(err error) bool -``` -IsNotSupported reports whether the error was created with -NotSupportedf() or NewNotSupported(). - - -## func IsNotValid -``` go -func IsNotValid(err error) bool -``` -IsNotValid reports whether the error was created with NotValidf() or -NewNotValid(). - - -## func IsUnauthorized -``` go -func IsUnauthorized(err error) bool -``` -IsUnauthorized reports whether err was created with Unauthorizedf() or -NewUnauthorized(). - - -## func Mask -``` go -func Mask(other error) error -``` -Mask hides the underlying error type, and records the location of the masking. - - -## func Maskf -``` go -func Maskf(other error, format string, args ...interface{}) error -``` -Mask masks the given error with the given format string and arguments (like -fmt.Sprintf), returning a new error that maintains the error stack, but -hides the underlying error type. The error string still contains the full -annotations. If you want to hide the annotations, call Wrap. - - -## func New -``` go -func New(message string) error -``` -New is a drop in replacement for the standard libary errors module that records -the location that the error is created. - -For example: - - - return errors.New("validation failed") - - -## func NewAlreadyExists -``` go -func NewAlreadyExists(err error, msg string) error -``` -NewAlreadyExists returns an error which wraps err and satisfies -IsAlreadyExists(). - - -## func NewNotFound -``` go -func NewNotFound(err error, msg string) error -``` -NewNotFound returns an error which wraps err that satisfies -IsNotFound(). - - -## func NewNotImplemented -``` go -func NewNotImplemented(err error, msg string) error -``` -NewNotImplemented returns an error which wraps err and satisfies -IsNotImplemented(). - - -## func NewNotSupported -``` go -func NewNotSupported(err error, msg string) error -``` -NewNotSupported returns an error which wraps err and satisfies -IsNotSupported(). - - -## func NewNotValid -``` go -func NewNotValid(err error, msg string) error -``` -NewNotValid returns an error which wraps err and satisfies IsNotValid(). - - -## func NewUnauthorized -``` go -func NewUnauthorized(err error, msg string) error -``` -NewUnauthorized returns an error which wraps err and satisfies -IsUnauthorized(). - - -## func NotFoundf -``` go -func NotFoundf(format string, args ...interface{}) error -``` -NotFoundf returns an error which satisfies IsNotFound(). - - -## func NotImplementedf -``` go -func NotImplementedf(format string, args ...interface{}) error -``` -NotImplementedf returns an error which satisfies IsNotImplemented(). - - -## func NotSupportedf -``` go -func NotSupportedf(format string, args ...interface{}) error -``` -NotSupportedf returns an error which satisfies IsNotSupported(). - - -## func NotValidf -``` go -func NotValidf(format string, args ...interface{}) error -``` -NotValidf returns an error which satisfies IsNotValid(). - - -## func Trace -``` go -func Trace(other error) error -``` -Trace adds the location of the Trace call to the stack. The Cause of the -resulting error is the same as the error parameter. If the other error is -nil, the result will be nil. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Trace(err) - } - - -## func Unauthorizedf -``` go -func Unauthorizedf(format string, args ...interface{}) error -``` -Unauthorizedf returns an error which satisfies IsUnauthorized(). - - -## func Wrap -``` go -func Wrap(other, newDescriptive error) error -``` -Wrap changes the Cause of the error. The location of the Wrap call is also -stored in the error stack. - -For example: - - - if err := SomeFunc(); err != nil { - newErr := &packageError{"more context", private_value} - return errors.Wrap(err, newErr) - } - - -## func Wrapf -``` go -func Wrapf(other, newDescriptive error, format string, args ...interface{}) error -``` -Wrapf changes the Cause of the error, and adds an annotation. The location -of the Wrap call is also stored in the error stack. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Wrapf(err, simpleErrorType, "invalid value %q", value) - } - - - -## type Err -``` go -type Err struct { - // contains filtered or unexported fields -} -``` -Err holds a description of an error along with information about -where the error was created. - -It may be embedded in custom error types to add extra information that -this errors package can understand. - - - - - - - - - -### func NewErr -``` go -func NewErr(format string, args ...interface{}) Err -``` -NewErr is used to return an Err for the purpose of embedding in other -structures. The location is not specified, and needs to be set with a call -to SetLocation. - -For example: - - - type FooError struct { - errors.Err - code int - } - - func NewFooError(code int) error { - err := &FooError{errors.NewErr("foo"), code} - err.SetLocation(1) - return err - } - - - - -### func (\*Err) Cause -``` go -func (e *Err) Cause() error -``` -The Cause of an error is the most recent error in the error stack that -meets one of these criteria: the original error that was raised; the new -error that was passed into the Wrap function; the most recently masked -error; or nil if the error itself is considered the Cause. Normally this -method is not invoked directly, but instead through the Cause stand alone -function. - - - -### func (\*Err) Error -``` go -func (e *Err) Error() string -``` -Error implements error.Error. - - - -### func (\*Err) Location -``` go -func (e *Err) Location() (filename string, line int) -``` -Location is the file and line of where the error was most recently -created or annotated. - - - -### func (\*Err) Message -``` go -func (e *Err) Message() string -``` -Message returns the message stored with the most recent location. This is -the empty string if the most recent call was Trace, or the message stored -with Annotate or Mask. - - - -### func (\*Err) SetLocation -``` go -func (e *Err) SetLocation(callDepth int) -``` -SetLocation records the source location of the error at callDepth stack -frames above the call. - - - -### func (\*Err) StackTrace -``` go -func (e *Err) StackTrace() []string -``` -StackTrace returns one string for each location recorded in the stack of -errors. The first value is the originating error, with a line for each -other annotation or tracing of the error. - - - -### func (\*Err) Underlying -``` go -func (e *Err) Underlying() error -``` -Underlying returns the previous error in the error stack, if any. A client -should not ever really call this method. It is used to build the error -stack and should not be introspected by client calls. Or more -specifically, clients should not depend on anything but the `Cause` of an -error. - - - - - - - - - -- - - -Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) \ No newline at end of file diff --git a/vendor/github.com/kballard/go-shellquote/README b/vendor/github.com/kballard/go-shellquote/README deleted file mode 100644 index 4d34e87afc..0000000000 --- a/vendor/github.com/kballard/go-shellquote/README +++ /dev/null @@ -1,36 +0,0 @@ -PACKAGE - -package shellquote - import "github.com/kballard/go-shellquote" - - Shellquote provides utilities for joining/splitting strings using sh's - word-splitting rules. - -VARIABLES - -var ( - UnterminatedSingleQuoteError = errors.New("Unterminated single-quoted string") - UnterminatedDoubleQuoteError = errors.New("Unterminated double-quoted string") - UnterminatedEscapeError = errors.New("Unterminated backslash-escape") -) - - -FUNCTIONS - -func Join(args ...string) string - Join quotes each argument and joins them with a space. If passed to - /bin/sh, the resulting string will be split back into the original - arguments. - -func Split(input string) (words []string, err error) - Split splits a string according to /bin/sh's word-splitting rules. It - supports backslash-escapes, single-quotes, and double-quotes. Notably it - does not support the $'' style of quoting. It also doesn't attempt to - perform any other sort of expansion, including brace expansion, shell - expansion, or pathname expansion. - - If the given input has an unterminated quoted string or ends in a - backslash-escape, one of UnterminatedSingleQuoteError, - UnterminatedDoubleQuoteError, or UnterminatedEscapeError is returned. - - diff --git a/vendor/github.com/keybase/go-crypto/AUTHORS b/vendor/github.com/keybase/go-crypto/AUTHORS new file mode 100644 index 0000000000..15167cd746 --- /dev/null +++ b/vendor/github.com/keybase/go-crypto/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/keybase/go-crypto/CONTRIBUTORS b/vendor/github.com/keybase/go-crypto/CONTRIBUTORS new file mode 100644 index 0000000000..1c4577e968 --- /dev/null +++ b/vendor/github.com/keybase/go-crypto/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/keybase/go-crypto/openpgp/patch.sh b/vendor/github.com/keybase/go-crypto/openpgp/patch.sh deleted file mode 100644 index 23cacc83d9..0000000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/patch.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -patch < sig-v3.patch -patch < s2k-gnu-dummy.patch -find . -type f -name '*.go' -exec sed -i'' -e 's/golang.org\/x\/crypto\/openpgp/github.com\/keybase\/go-crypto\/openpgp/' {} \; -find . -type f -name '*.go-e' -exec rm {} \; -go test ./... diff --git a/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch b/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch deleted file mode 100644 index bfd764afe0..0000000000 --- a/vendor/github.com/keybase/go-crypto/openpgp/sig-v3.patch +++ /dev/null @@ -1,135 +0,0 @@ -diff --git a/openpgp/read.go b/openpgp/read.go -index a6cecc5..0c9397b 100644 ---- a/openpgp/read.go -+++ b/openpgp/read.go -@@ -56,8 +56,9 @@ type MessageDetails struct { - // been consumed. Once EOF has been seen, the following fields are - // valid. (An authentication code failure is reported as a - // SignatureError error when reading from UnverifiedBody.) -- SignatureError error // nil if the signature is good. -- Signature *packet.Signature // the signature packet itself. -+ SignatureError error // nil if the signature is good. -+ Signature *packet.Signature // the signature packet itself, if v4 (default) -+ SignatureV3 *packet.SignatureV3 // the signature packet if it is a v2 or v3 signature - - decrypted io.ReadCloser - } -@@ -334,13 +335,15 @@ func (scr *signatureCheckReader) Read(buf []byte) (n int, err error) { - } - - var ok bool -- if scr.md.Signature, ok = p.(*packet.Signature); !ok { -+ if scr.md.Signature, ok = p.(*packet.Signature); ok { -+ scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) -+ } else if scr.md.SignatureV3, ok = p.(*packet.SignatureV3); ok { -+ scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignatureV3(scr.h, scr.md.SignatureV3) -+ } else { - scr.md.SignatureError = errors.StructuralError("LiteralData not followed by Signature") - return - } - -- scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) -- - // The SymmetricallyEncrypted packet, if any, might have an - // unsigned hash of its own. In order to check this we need to - // close that Reader. -diff --git a/openpgp/read_test.go b/openpgp/read_test.go -index 52f942c..abe8d7b 100644 ---- a/openpgp/read_test.go -+++ b/openpgp/read_test.go -@@ -13,6 +13,7 @@ import ( - "strings" - "testing" - -+ "golang.org/x/crypto/openpgp/armor" - "golang.org/x/crypto/openpgp/errors" - ) - -@@ -411,6 +412,50 @@ func TestIssue11504(t *testing.T) { - testReadMessageError(t, "9303000130303030303030303030983002303030303030030000000130") - } - -+// TestSignatureV3Message tests the verification of V3 signature, generated -+// with a modern V4-style key. Some people have their clients set to generate -+// V3 signatures, so it's useful to be able to verify them. -+func TestSignatureV3Message(t *testing.T) { -+ sig, err := armor.Decode(strings.NewReader(signedMessageV3)) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ key, err := ReadArmoredKeyRing(strings.NewReader(keyV4forVerifyingSignedMessageV3)) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ md, err := ReadMessage(sig.Body, key, nil, nil) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ -+ _, err = ioutil.ReadAll(md.UnverifiedBody) -+ if err != nil { -+ t.Error(err) -+ return -+ } -+ -+ // We'll see a sig error here after reading in the UnverifiedBody above, -+ // if there was one to see. -+ if err = md.SignatureError; err != nil { -+ t.Error(err) -+ return -+ } -+ -+ if md.SignatureV3 == nil { -+ t.Errorf("No available signature after checking signature") -+ return -+ } -+ if md.Signature != nil { -+ t.Errorf("Did not expect a signature V4 back") -+ return -+ } -+ return -+} -+ - const testKey1KeyId = 0xA34D7E18C20C31BB - const testKey3KeyId = 0x338934250CCC0360 - -@@ -504,3 +549,36 @@ const unknownHashFunctionHex = `8a00000040040001990006050253863c24000a09103b4fe6 - const missingHashFunctionHex = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101` - - const campbellQuine = `a0b001000300fcffa0b001000d00f2ff000300fcffa0b001000d00f2ff8270a01c00000500faff8270a01c00000500faff000500faff001400ebff8270a01c00000500faff000500faff001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400000000ffff000000ffff000b00f4ff428821c400000000ffff000000ffff000b00f4ff0233214c40000100feff000233214c40000100feff0000` -+ -+const keyV4forVerifyingSignedMessageV3 = `-----BEGIN PGP PUBLIC KEY BLOCK----- -+Comment: GPGTools - https://gpgtools.org -+ -+mI0EVfxoFQEEAMBIqmbDfYygcvP6Phr1wr1XI41IF7Qixqybs/foBF8qqblD9gIY -+BKpXjnBOtbkcVOJ0nljd3/sQIfH4E0vQwK5/4YRQSI59eKOqd6Fx+fWQOLG+uu6z -+tewpeCj9LLHvibx/Sc7VWRnrznia6ftrXxJ/wHMezSab3tnGC0YPVdGNABEBAAG0 -+JEdvY3J5cHRvIFRlc3QgS2V5IDx0aGVtYXhAZ21haWwuY29tPoi5BBMBCgAjBQJV -+/GgVAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQeXnQmhdGW9PFVAP+ -+K7TU0qX5ArvIONIxh/WAweyOk884c5cE8f+3NOPOOCRGyVy0FId5A7MmD5GOQh4H -+JseOZVEVCqlmngEvtHZb3U1VYtVGE5WZ+6rQhGsMcWP5qaT4soYwMBlSYxgYwQcx -+YhN9qOr292f9j2Y//TTIJmZT4Oa+lMxhWdqTfX+qMgG4jQRV/GgVAQQArhFSiij1 -+b+hT3dnapbEU+23Z1yTu1DfF6zsxQ4XQWEV3eR8v+8mEDDNcz8oyyF56k6UQ3rXi -+UMTIwRDg4V6SbZmaFbZYCOwp/EmXJ3rfhm7z7yzXj2OFN22luuqbyVhuL7LRdB0M -+pxgmjXb4tTvfgKd26x34S+QqUJ7W6uprY4sAEQEAAYifBBgBCgAJBQJV/GgVAhsM -+AAoJEHl50JoXRlvT7y8D/02ckx4OMkKBZo7viyrBw0MLG92i+DC2bs35PooHR6zz -+786mitjOp5z2QWNLBvxC70S0qVfCIz8jKupO1J6rq6Z8CcbLF3qjm6h1omUBf8Nd -+EfXKD2/2HV6zMKVknnKzIEzauh+eCKS2CeJUSSSryap/QLVAjRnckaES/OsEWhNB -+=RZia -+-----END PGP PUBLIC KEY BLOCK----- -+` -+ -+const signedMessageV3 = `-----BEGIN PGP MESSAGE----- -+Comment: GPGTools - https://gpgtools.org -+ -+owGbwMvMwMVYWXlhlrhb9GXG03JJDKF/MtxDMjKLFYAoUaEktbhEITe1uDgxPVWP -+q5NhKjMrWAVcC9evD8z/bF/uWNjqtk/X3y5/38XGRQHm/57rrDRYuGnTw597Xqka -+uM3137/hH3Os+Jf2dc0fXOITKwJvXJvecPVs0ta+Vg7ZO1MLn8w58Xx+6L58mbka -+DGHyU9yTueZE8D+QF/Tz28Y78dqtF56R1VPn9Xw4uJqrWYdd7b3vIZ1V6R4Nh05d -+iT57d/OhWwA= -+=hG7R -+-----END PGP MESSAGE----- -+` diff --git a/vendor/github.com/klauspost/compress/snappy/AUTHORS b/vendor/github.com/klauspost/compress/snappy/AUTHORS new file mode 100644 index 0000000000..fd1c6f67b3 --- /dev/null +++ b/vendor/github.com/klauspost/compress/snappy/AUTHORS @@ -0,0 +1,15 @@ +# This is the official list of Snappy-Go authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +Damian Gryski +Google Inc. +Jan Mercl <0xjnml@gmail.com> +Rodolfo Carvalho +Sebastien Binet diff --git a/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS b/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS new file mode 100644 index 0000000000..a29b133988 --- /dev/null +++ b/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS @@ -0,0 +1,37 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the Snappy-Go repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name + +# Please keep the list sorted. + +Damian Gryski +Jan Mercl <0xjnml@gmail.com> +Kai Backman +Marc-Antoine Ruel +Nigel Tao +Rob Pike +Rodolfo Carvalho +Russ Cox +Sebastien Binet diff --git a/vendor/github.com/ngaut/sync2/vitess_license b/vendor/github.com/klauspost/compress/snappy/LICENSE similarity index 81% rename from vendor/github.com/ngaut/sync2/vitess_license rename to vendor/github.com/klauspost/compress/snappy/LICENSE index 989d02e4cd..7e69e1a2f6 100644 --- a/vendor/github.com/ngaut/sync2/vitess_license +++ b/vendor/github.com/klauspost/compress/snappy/LICENSE @@ -1,28 +1,27 @@ -Copyright 2012, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * 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. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -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 -OWNER 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. +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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 +OWNER 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. diff --git a/vendor/github.com/klauspost/cpuid/README.md b/vendor/github.com/klauspost/cpuid/README.md deleted file mode 100644 index b2b6bee879..0000000000 --- a/vendor/github.com/klauspost/cpuid/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# cpuid -Package cpuid provides information about the CPU running the current program. - -CPU features are detected on startup, and kept for fast access through the life of the application. -Currently x86 / x64 (AMD64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. - -You can access the CPU information by accessing the shared CPU variable of the cpuid library. - -Package home: https://github.com/klauspost/cpuid - -[![GoDoc][1]][2] [![Build Status][3]][4] - -[1]: https://godoc.org/github.com/klauspost/cpuid?status.svg -[2]: https://godoc.org/github.com/klauspost/cpuid -[3]: https://travis-ci.org/klauspost/cpuid.svg -[4]: https://travis-ci.org/klauspost/cpuid - -# features -## CPU Instructions -* **CMOV** (i686 CMOV) -* **NX** (NX (No-Execute) bit) -* **AMD3DNOW** (AMD 3DNOW) -* **AMD3DNOWEXT** (AMD 3DNowExt) -* **MMX** (standard MMX) -* **MMXEXT** (SSE integer functions or AMD MMX ext) -* **SSE** (SSE functions) -* **SSE2** (P4 SSE functions) -* **SSE3** (Prescott SSE3 functions) -* **SSSE3** (Conroe SSSE3 functions) -* **SSE4** (Penryn SSE4.1 functions) -* **SSE4A** (AMD Barcelona microarchitecture SSE4a instructions) -* **SSE42** (Nehalem SSE4.2 functions) -* **AVX** (AVX functions) -* **AVX2** (AVX2 functions) -* **FMA3** (Intel FMA 3) -* **FMA4** (Bulldozer FMA4 functions) -* **XOP** (Bulldozer XOP functions) -* **F16C** (Half-precision floating-point conversion) -* **BMI1** (Bit Manipulation Instruction Set 1) -* **BMI2** (Bit Manipulation Instruction Set 2) -* **TBM** (AMD Trailing Bit Manipulation) -* **LZCNT** (LZCNT instruction) -* **POPCNT** (POPCNT instruction) -* **AESNI** (Advanced Encryption Standard New Instructions) -* **CLMUL** (Carry-less Multiplication) -* **HTT** (Hyperthreading (enabled)) -* **HLE** (Hardware Lock Elision) -* **RTM** (Restricted Transactional Memory) -* **RDRAND** (RDRAND instruction is available) -* **RDSEED** (RDSEED instruction is available) -* **ADX** (Intel ADX (Multi-Precision Add-Carry Instruction Extensions)) -* **SHA** (Intel SHA Extensions) -* **AVX512F** (AVX-512 Foundation) -* **AVX512DQ** (AVX-512 Doubleword and Quadword Instructions) -* **AVX512IFMA** (AVX-512 Integer Fused Multiply-Add Instructions) -* **AVX512PF** (AVX-512 Prefetch Instructions) -* **AVX512ER** (AVX-512 Exponential and Reciprocal Instructions) -* **AVX512CD** (AVX-512 Conflict Detection Instructions) -* **AVX512BW** (AVX-512 Byte and Word Instructions) -* **AVX512VL** (AVX-512 Vector Length Extensions) -* **AVX512VBMI** (AVX-512 Vector Bit Manipulation Instructions) -* **MPX** (Intel MPX (Memory Protection Extensions)) -* **ERMS** (Enhanced REP MOVSB/STOSB) -* **RDTSCP** (RDTSCP Instruction) -* **CX16** (CMPXCHG16B Instruction) -* **SGX** (Software Guard Extensions, with activation details) - -## Performance -* **RDTSCP()** Returns current cycle count. Can be used for benchmarking. -* **SSE2SLOW** (SSE2 is supported, but usually not faster) -* **SSE3SLOW** (SSE3 is supported, but usually not faster) -* **ATOM** (Atom processor, some SSSE3 instructions are slower) -* **Cache line** (Probable size of a cache line). -* **L1, L2, L3 Cache size** on newer Intel/AMD CPUs. - -## Cpu Vendor/VM -* **Intel** -* **AMD** -* **VIA** -* **Transmeta** -* **NSC** -* **KVM** (Kernel-based Virtual Machine) -* **MSVM** (Microsoft Hyper-V or Windows Virtual PC) -* **VMware** -* **XenHVM** - -# installing - -```go get github.com/klauspost/cpuid``` - -# example - -```Go -package main - -import ( - "fmt" - "github.com/klauspost/cpuid" -) - -func main() { - // Print basic CPU information: - fmt.Println("Name:", cpuid.CPU.BrandName) - fmt.Println("PhysicalCores:", cpuid.CPU.PhysicalCores) - fmt.Println("ThreadsPerCore:", cpuid.CPU.ThreadsPerCore) - fmt.Println("LogicalCores:", cpuid.CPU.LogicalCores) - fmt.Println("Family", cpuid.CPU.Family, "Model:", cpuid.CPU.Model) - fmt.Println("Features:", cpuid.CPU.Features) - fmt.Println("Cacheline bytes:", cpuid.CPU.CacheLine) - fmt.Println("L1 Data Cache:", cpuid.CPU.Cache.L1D, "bytes") - fmt.Println("L1 Instruction Cache:", cpuid.CPU.Cache.L1D, "bytes") - fmt.Println("L2 Cache:", cpuid.CPU.Cache.L2, "bytes") - fmt.Println("L3 Cache:", cpuid.CPU.Cache.L3, "bytes") - - // Test if we have a specific feature: - if cpuid.CPU.SSE() { - fmt.Println("We have Streaming SIMD Extensions") - } -} -``` - -Sample output: -``` ->go run main.go -Name: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz -PhysicalCores: 2 -ThreadsPerCore: 2 -LogicalCores: 4 -Family 6 Model: 42 -Features: CMOV,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,AESNI,CLMUL -Cacheline bytes: 64 -We have Streaming SIMD Extensions -``` - -# private package - -In the "private" folder you can find an autogenerated version of the library you can include in your own packages. - -For this purpose all exports are removed, and functions and constants are lowercased. - -This is not a recommended way of using the library, but provided for convenience, if it is difficult for you to use external packages. - -# license - -This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/klauspost/crc32/README.md b/vendor/github.com/klauspost/crc32/README.md deleted file mode 100644 index 029625d360..0000000000 --- a/vendor/github.com/klauspost/crc32/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# crc32 -CRC32 hash with x64 optimizations - -This package is a drop-in replacement for the standard library `hash/crc32` package, that features SSE 4.2 optimizations on x64 platforms, for a 10x speedup. - -[![Build Status](https://travis-ci.org/klauspost/crc32.svg?branch=master)](https://travis-ci.org/klauspost/crc32) - -# usage - -Install using `go get github.com/klauspost/crc32`. This library is based on Go 1.5 code and requires Go 1.3 or newer. - -Replace `import "hash/crc32"` with `import "github.com/klauspost/crc32"` and you are good to go. - -# changes -* Oct 20, 2016: Changes have been merged to upstream Go. Package updated to match. -* Dec 4, 2015: Uses the "slice-by-8" trick more extensively, which gives a 1.5 to 2.5x speedup if assembler is unavailable. - - -# performance - -For *Go 1.7* performance is equivalent to the standard library. So if you use this package for Go 1.7 you can switch back. - - -For IEEE tables (the most common), there is approximately a factor 10 speedup with "CLMUL" (Carryless multiplication) instruction: -``` -benchmark old ns/op new ns/op delta -BenchmarkCrc32KB 99955 10258 -89.74% - -benchmark old MB/s new MB/s speedup -BenchmarkCrc32KB 327.83 3194.20 9.74x -``` - -For other tables and "CLMUL" capable machines the performance is the same as the standard library. - -Here are some detailed benchmarks, comparing to go 1.5 standard library with and without assembler enabled. - -``` -Std: Standard Go 1.5 library -Crc: Indicates IEEE type CRC. -40B: Size of each slice encoded. -NoAsm: Assembler was disabled (ie. not an AMD64 or SSE 4.2+ capable machine). -Castagnoli: Castagnoli CRC type. - -BenchmarkStdCrc40B-4 10000000 158 ns/op 252.88 MB/s -BenchmarkCrc40BNoAsm-4 20000000 105 ns/op 377.38 MB/s (slice8) -BenchmarkCrc40B-4 20000000 105 ns/op 378.77 MB/s (slice8) - -BenchmarkStdCrc1KB-4 500000 3604 ns/op 284.10 MB/s -BenchmarkCrc1KBNoAsm-4 1000000 1463 ns/op 699.79 MB/s (slice8) -BenchmarkCrc1KB-4 3000000 396 ns/op 2583.69 MB/s (asm) - -BenchmarkStdCrc8KB-4 200000 11417 ns/op 717.48 MB/s (slice8) -BenchmarkCrc8KBNoAsm-4 200000 11317 ns/op 723.85 MB/s (slice8) -BenchmarkCrc8KB-4 500000 2919 ns/op 2805.73 MB/s (asm) - -BenchmarkStdCrc32KB-4 30000 45749 ns/op 716.24 MB/s (slice8) -BenchmarkCrc32KBNoAsm-4 30000 45109 ns/op 726.42 MB/s (slice8) -BenchmarkCrc32KB-4 100000 11497 ns/op 2850.09 MB/s (asm) - -BenchmarkStdNoAsmCastagnol40B-4 10000000 161 ns/op 246.94 MB/s -BenchmarkStdCastagnoli40B-4 50000000 28.4 ns/op 1410.69 MB/s (asm) -BenchmarkCastagnoli40BNoAsm-4 20000000 100 ns/op 398.01 MB/s (slice8) -BenchmarkCastagnoli40B-4 50000000 28.2 ns/op 1419.54 MB/s (asm) - -BenchmarkStdNoAsmCastagnoli1KB-4 500000 3622 ns/op 282.67 MB/s -BenchmarkStdCastagnoli1KB-4 10000000 144 ns/op 7099.78 MB/s (asm) -BenchmarkCastagnoli1KBNoAsm-4 1000000 1475 ns/op 694.14 MB/s (slice8) -BenchmarkCastagnoli1KB-4 10000000 146 ns/op 6993.35 MB/s (asm) - -BenchmarkStdNoAsmCastagnoli8KB-4 50000 28781 ns/op 284.63 MB/s -BenchmarkStdCastagnoli8KB-4 1000000 1029 ns/op 7957.89 MB/s (asm) -BenchmarkCastagnoli8KBNoAsm-4 200000 11410 ns/op 717.94 MB/s (slice8) -BenchmarkCastagnoli8KB-4 1000000 1000 ns/op 8188.71 MB/s (asm) - -BenchmarkStdNoAsmCastagnoli32KB-4 10000 115426 ns/op 283.89 MB/s -BenchmarkStdCastagnoli32KB-4 300000 4065 ns/op 8059.13 MB/s (asm) -BenchmarkCastagnoli32KBNoAsm-4 30000 45171 ns/op 725.41 MB/s (slice8) -BenchmarkCastagnoli32KB-4 500000 4077 ns/op 8035.89 MB/s (asm) -``` - -The IEEE assembler optimizations has been submitted and will be part of the Go 1.6 standard library. - -However, the improved use of slice-by-8 has not, but will probably be submitted for Go 1.7. - -# license - -Standard Go license. Changes are Copyright (c) 2015 Klaus Post under same conditions. diff --git a/vendor/github.com/lafriks/xormstore/Gopkg.lock b/vendor/github.com/lafriks/xormstore/Gopkg.lock deleted file mode 100644 index 0d2cf03cba..0000000000 --- a/vendor/github.com/lafriks/xormstore/Gopkg.lock +++ /dev/null @@ -1,75 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - branch = "master" - name = "github.com/denisenkom/go-mssqldb" - packages = ["."] - revision = "ee492709d4324cdcb051d2ac266b77ddc380f5c5" - -[[projects]] - name = "github.com/go-sql-driver/mysql" - packages = ["."] - revision = "a0583e0143b1624142adab07e0e97fe106d99561" - version = "v1.3" - -[[projects]] - branch = "master" - name = "github.com/go-xorm/builder" - packages = ["."] - revision = "488224409dd8aa2ce7a5baf8d10d55764a913738" - -[[projects]] - name = "github.com/go-xorm/core" - packages = ["."] - revision = "da1adaf7a28ca792961721a34e6e04945200c890" - version = "v0.5.7" - -[[projects]] - name = "github.com/go-xorm/xorm" - packages = ["."] - revision = "1933dd69e294c0a26c0266637067f24dbb25770c" - version = "v0.6.4" - -[[projects]] - name = "github.com/gorilla/context" - packages = ["."] - revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" - version = "v1.1" - -[[projects]] - name = "github.com/gorilla/securecookie" - packages = ["."] - revision = "e59506cc896acb7f7bf732d4fdf5e25f7ccd8983" - version = "v1.1.1" - -[[projects]] - name = "github.com/gorilla/sessions" - packages = ["."] - revision = "ca9ada44574153444b00d3fd9c8559e4cc95f896" - version = "v1.1" - -[[projects]] - branch = "master" - name = "github.com/lib/pq" - packages = [".","oid"] - revision = "88edab0803230a3898347e77b474f8c1820a1f20" - -[[projects]] - name = "github.com/mattn/go-sqlite3" - packages = ["."] - revision = "6c771bb9887719704b210e87e934f08be014bdb1" - version = "v1.6.0" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = ["md4"] - revision = "c7dcf104e3a7a1417abc0230cb0d5240d764159d" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "bba98a94e8c6668ae9556b4978bbffdfc5d4d535d522c8865465335bfaa2fc70" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/lafriks/xormstore/Gopkg.toml b/vendor/github.com/lafriks/xormstore/Gopkg.toml deleted file mode 100644 index ea71d50eaf..0000000000 --- a/vendor/github.com/lafriks/xormstore/Gopkg.toml +++ /dev/null @@ -1,50 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/go-sql-driver/mysql" - version = "1.3.0" - -[[constraint]] - name = "github.com/go-xorm/xorm" - version = "0.6.4" - -[[constraint]] - name = "github.com/gorilla/context" - version = "1.1.0" - -[[constraint]] - name = "github.com/gorilla/securecookie" - version = "1.1.1" - -[[constraint]] - name = "github.com/gorilla/sessions" - version = "1.1.0" - -[[constraint]] - branch = "master" - name = "github.com/lib/pq" - -[[constraint]] - name = "github.com/mattn/go-sqlite3" - version = "1.6.0" diff --git a/vendor/github.com/lafriks/xormstore/README.md b/vendor/github.com/lafriks/xormstore/README.md deleted file mode 100644 index 361c5871fc..0000000000 --- a/vendor/github.com/lafriks/xormstore/README.md +++ /dev/null @@ -1,48 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/lafriks/xormstore?status.svg)](https://godoc.org/github.com/lafriks/xormstore) -[![Build Status](https://travis-ci.org/lafriks/xormstore.svg?branch=master)](https://travis-ci.org/lafriks/xormstore) -[![codecov](https://codecov.io/gh/lafriks/xormstore/branch/master/graph/badge.svg)](https://codecov.io/gh/lafriks/xormstore) - -#### XORM backend for gorilla sessions - - go get github.com/lafriks/xormstore - -#### Example - -```go -// initialize and setup cleanup -store := xormstore.New(engine, []byte("secret")) -// db cleanup every hour -// close quit channel to stop cleanup -quit := make(chan struct{}) -go store.PeriodicCleanup(1*time.Hour, quit) -``` - -```go -// in HTTP handler -func handlerFunc(w http.ResponseWriter, r *http.Request) { - session, err := store.Get(r, "session") - session.Values["user_id"] = 123 - store.Save(r, w, session) - http.Error(w, "", http.StatusOK) -} -``` - -For more details see [xormstore godoc documentation](https://godoc.org/github.com/lafriks/xormstore). - -#### Testing - -Just sqlite3 tests: - - go test - -All databases using docker: - - ./test - -If docker is not local (docker-machine etc): - - DOCKER_IP=$(docker-machine ip dev) ./test - -#### License - -xormstore is licensed under the MIT license. See [LICENSE](LICENSE) for the full license text. diff --git a/vendor/github.com/lafriks/xormstore/test b/vendor/github.com/lafriks/xormstore/test deleted file mode 100755 index 4b06eae4e7..0000000000 --- a/vendor/github.com/lafriks/xormstore/test +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -DOCKER_IP=${DOCKER_IP:-127.0.0.1} - -sqlite3() { - DATABASE_URI="sqlite3://file:dummy?mode=memory&cache=shared" go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic - return $? -} - -postgres10() { - ID=$(docker run -p 5432 -d postgres:10-alpine) - PORT=$(docker port "$ID" 5432 | cut -d : -f 2) - DATABASE_URI="postgres://user=postgres password=postgres dbname=postgres host=$DOCKER_IP port=$PORT sslmode=disable" go test -v -race -cover - S=$? - docker rm -vf "$ID" > /dev/null - return $S -} - -postgres96() { - ID=$(docker run -p 5432 -d postgres:9.6-alpine) - PORT=$(docker port "$ID" 5432 | cut -d : -f 2) - DATABASE_URI="postgres://user=postgres password=postgres dbname=postgres host=$DOCKER_IP port=$PORT sslmode=disable" go test -v -race -cover - S=$? - docker rm -vf "$ID" > /dev/null - return $S -} - -postgres94() { - ID=$(docker run -p 5432 -d postgres:9.4-alpine) - PORT=$(docker port "$ID" 5432 | cut -d : -f 2) - DATABASE_URI="postgres://user=postgres password=postgres dbname=postgres host=$DOCKER_IP port=$PORT sslmode=disable" go test -v -race -cover - S=$? - docker rm -vf "$ID" > /dev/null - return $S -} - -mysql57() { - ID=$(docker run \ - -e MYSQL_ROOT_PASSWORD=root \ - -e MYSQL_USER=mysql \ - -e MYSQL_PASSWORD=mysql \ - -e MYSQL_DATABASE=mysql \ - -p 3306 -d mysql:5.7) - PORT=$(docker port "$ID" 3306 | cut -d : -f 2) - DATABASE_URI="mysql://mysql:mysql@tcp($DOCKER_IP:$PORT)/mysql?charset=utf8&parseTime=True" go test -v -race -cover - S=$? - docker rm -vf "$ID" > /dev/null - return $S -} - -mariadb10() { - ID=$(docker run \ - -e MYSQL_ROOT_PASSWORD=root \ - -e MYSQL_USER=mysql \ - -e MYSQL_PASSWORD=mysql \ - -e MYSQL_DATABASE=mysql \ - -p 3306 -d mariadb:10) - PORT=$(docker port "$ID" 3306 | cut -d : -f 2) - DATABASE_URI="mysql://mysql:mysql@tcp($DOCKER_IP:$PORT)/mysql?charset=utf8&parseTime=True" go test -v -race -cover - S=$? - docker rm -vf "$ID" > /dev/null - return $S -} - -sqlite3 || exit 1 -postgres94 || exit 1 -postgres96 || exit 1 -postgres10 || exit 1 -mysql57 || exit 1 -mariadb10 || exit 1 diff --git a/vendor/github.com/lib/pq/CONTRIBUTING.md b/vendor/github.com/lib/pq/CONTRIBUTING.md deleted file mode 100644 index 84c937f156..0000000000 --- a/vendor/github.com/lib/pq/CONTRIBUTING.md +++ /dev/null @@ -1,29 +0,0 @@ -## Contributing to pq - -`pq` has a backlog of pull requests, but contributions are still very -much welcome. You can help with patch review, submitting bug reports, -or adding new functionality. There is no formal style guide, but -please conform to the style of existing code and general Go formatting -conventions when submitting patches. - -### Patch review - -Help review existing open pull requests by commenting on the code or -proposed functionality. - -### Bug reports - -We appreciate any bug reports, but especially ones with self-contained -(doesn't depend on code outside of pq), minimal (can't be simplified -further) test cases. It's especially helpful if you can submit a pull -request with just the failing test case (you'll probably want to -pattern it after the tests in -[conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). - -### New functionality - -There are a number of pending patches for new functionality, so -additional feature patches will take a while to merge. Still, patches -are generally reviewed based on usefulness and complexity in addition -to time-in-queue, so if you have a knockout idea, take a shot. Feel -free to open an issue discussion your proposed patch beforehand. diff --git a/vendor/github.com/lib/pq/README.md b/vendor/github.com/lib/pq/README.md deleted file mode 100644 index 7670fc87a5..0000000000 --- a/vendor/github.com/lib/pq/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# pq - A pure Go postgres driver for Go's database/sql package - -[![Build Status](https://travis-ci.org/lib/pq.svg?branch=master)](https://travis-ci.org/lib/pq) - -## Install - - go get github.com/lib/pq - -## Docs - -For detailed documentation and basic usage examples, please see the package -documentation at . - -## Tests - -`go test` is used for testing. A running PostgreSQL server is -required, with the ability to log in. The default database to connect -to test with is "pqgotest," but it can be overridden using environment -variables. - -Example: - - PGHOST=/run/postgresql go test github.com/lib/pq - -Optionally, a benchmark suite can be run as part of the tests: - - PGHOST=/run/postgresql go test -bench . - -## Features - -* SSL -* Handles bad connections for `database/sql` -* Scan `time.Time` correctly (i.e. `timestamp[tz]`, `time[tz]`, `date`) -* Scan binary blobs correctly (i.e. `bytea`) -* Package for `hstore` support -* COPY FROM support -* pq.ParseURL for converting urls to connection strings for sql.Open. -* Many libpq compatible environment variables -* Unix socket support -* Notifications: `LISTEN`/`NOTIFY` -* pgpass support - -## Future / Things you can help with - -* Better COPY FROM / COPY TO (see discussion in #181) - -## Thank you (alphabetical) - -Some of these contributors are from the original library `bmizerany/pq.go` whose -code still exists in here. - -* Andy Balholm (andybalholm) -* Ben Berkert (benburkert) -* Benjamin Heatwole (bheatwole) -* Bill Mill (llimllib) -* Bjørn Madsen (aeons) -* Blake Gentry (bgentry) -* Brad Fitzpatrick (bradfitz) -* Charlie Melbye (cmelbye) -* Chris Bandy (cbandy) -* Chris Gilling (cgilling) -* Chris Walsh (cwds) -* Dan Sosedoff (sosedoff) -* Daniel Farina (fdr) -* Eric Chlebek (echlebek) -* Eric Garrido (minusnine) -* Eric Urban (hydrogen18) -* Everyone at The Go Team -* Evan Shaw (edsrzf) -* Ewan Chou (coocood) -* Fazal Majid (fazalmajid) -* Federico Romero (federomero) -* Fumin (fumin) -* Gary Burd (garyburd) -* Heroku (heroku) -* James Pozdena (jpoz) -* Jason McVetta (jmcvetta) -* Jeremy Jay (pbnjay) -* Joakim Sernbrant (serbaut) -* John Gallagher (jgallagher) -* Jonathan Rudenberg (titanous) -* Joël Stemmer (jstemmer) -* Kamil Kisiel (kisielk) -* Kelly Dunn (kellydunn) -* Keith Rarick (kr) -* Kir Shatrov (kirs) -* Lann Martin (lann) -* Maciek Sakrejda (uhoh-itsmaciek) -* Marc Brinkmann (mbr) -* Marko Tiikkaja (johto) -* Matt Newberry (MattNewberry) -* Matt Robenolt (mattrobenolt) -* Martin Olsen (martinolsen) -* Mike Lewis (mikelikespie) -* Nicolas Patry (Narsil) -* Oliver Tonnhofer (olt) -* Patrick Hayes (phayes) -* Paul Hammond (paulhammond) -* Ryan Smith (ryandotsmith) -* Samuel Stauffer (samuel) -* Timothée Peignier (cyberdelia) -* Travis Cline (tmc) -* TruongSinh Tran-Nguyen (truongsinh) -* Yaismel Miranda (ympons) -* notedit (notedit) diff --git a/vendor/github.com/lib/pq/oid/gen.go b/vendor/github.com/lib/pq/oid/gen.go new file mode 100644 index 0000000000..7c634cdc5c --- /dev/null +++ b/vendor/github.com/lib/pq/oid/gen.go @@ -0,0 +1,93 @@ +// +build ignore + +// Generate the table of OID values +// Run with 'go run gen.go'. +package main + +import ( + "database/sql" + "fmt" + "log" + "os" + "os/exec" + "strings" + + _ "github.com/lib/pq" +) + +// OID represent a postgres Object Identifier Type. +type OID struct { + ID int + Type string +} + +// Name returns an upper case version of the oid type. +func (o OID) Name() string { + return strings.ToUpper(o.Type) +} + +func main() { + datname := os.Getenv("PGDATABASE") + sslmode := os.Getenv("PGSSLMODE") + + if datname == "" { + os.Setenv("PGDATABASE", "pqgotest") + } + + if sslmode == "" { + os.Setenv("PGSSLMODE", "disable") + } + + db, err := sql.Open("postgres", "") + if err != nil { + log.Fatal(err) + } + rows, err := db.Query(` + SELECT typname, oid + FROM pg_type WHERE oid < 10000 + ORDER BY oid; + `) + if err != nil { + log.Fatal(err) + } + oids := make([]*OID, 0) + for rows.Next() { + var oid OID + if err = rows.Scan(&oid.Type, &oid.ID); err != nil { + log.Fatal(err) + } + oids = append(oids, &oid) + } + if err = rows.Err(); err != nil { + log.Fatal(err) + } + cmd := exec.Command("gofmt") + cmd.Stderr = os.Stderr + w, err := cmd.StdinPipe() + if err != nil { + log.Fatal(err) + } + f, err := os.Create("types.go") + if err != nil { + log.Fatal(err) + } + cmd.Stdout = f + err = cmd.Start() + if err != nil { + log.Fatal(err) + } + fmt.Fprintln(w, "// Code generated by gen.go. DO NOT EDIT.") + fmt.Fprintln(w, "\npackage oid") + fmt.Fprintln(w, "const (") + for _, oid := range oids { + fmt.Fprintf(w, "T_%s Oid = %d\n", oid.Type, oid.ID) + } + fmt.Fprintln(w, ")") + fmt.Fprintln(w, "var TypeName = map[Oid]string{") + for _, oid := range oids { + fmt.Fprintf(w, "T_%s: \"%s\",\n", oid.Type, oid.Name()) + } + fmt.Fprintln(w, "}") + w.Close() + cmd.Wait() +} diff --git a/vendor/github.com/lunny/dingtalk_webhook/README.md b/vendor/github.com/lunny/dingtalk_webhook/README.md deleted file mode 100644 index 5625d36e23..0000000000 --- a/vendor/github.com/lunny/dingtalk_webhook/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# 非官方 Dingtalk webhook Golang SDK - -## 此工程仅封装了 Dingtalk 的 webhook 部分的请求 - -## 使用 - -首先在dingtalk中创建一个机器人,将accessToken拷贝出来,然后执行下面方法即可 - -```Go -webhook := dingtalk.Webhook(accessToken) -webhook.SendTextMsg("这是一个没有AT的文本消息", false) -``` - -## License - -This project is licensed under the MIT License. -See the [LICENSE](https://github.com/lunny/webhook_dingtalk/blob/master/LICENSE) file -for the full license text. \ No newline at end of file diff --git a/vendor/github.com/markbates/goth/README.md b/vendor/github.com/markbates/goth/README.md deleted file mode 100644 index 737d9ecff4..0000000000 --- a/vendor/github.com/markbates/goth/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Goth: Multi-Provider Authentication for Go [![GoDoc](https://godoc.org/github.com/markbates/goth?status.svg)](https://godoc.org/github.com/markbates/goth) [![Build Status](https://travis-ci.org/markbates/goth.svg)](https://travis-ci.org/markbates/goth) - -Package goth provides a simple, clean, and idiomatic way to write authentication -packages for Go web applications. - -Unlike other similar packages, Goth, lets you write OAuth, OAuth2, or any other -protocol providers, as long as they implement the `Provider` and `Session` interfaces. - -This package was inspired by [https://github.com/intridea/omniauth](https://github.com/intridea/omniauth). - -## Goth Needs a New Maintainer - -[https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b](https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b) - TL;DR: I, @markbates, won't be responding to any more issues, PRs, etc... for this package. A new maintainer needs to be found ASAP. Is this you? - -## Installation - -```text -$ go get github.com/markbates/goth -``` - -## Supported Providers - -* Amazon -* Auth0 -* Azure AD -* Battle.net -* Bitbucket -* Box -* Cloud Foundry -* Dailymotion -* Deezer -* Digital Ocean -* Discord -* Dropbox -* Eve Online -* Facebook -* Fitbit -* GitHub -* Gitlab -* Google+ -* Heroku -* InfluxCloud -* Instagram -* Intercom -* Lastfm -* Linkedin -* Meetup -* MicrosoftOnline -* Naver -* OneDrive -* OpenID Connect (auto discovery) -* Paypal -* SalesForce -* Slack -* Soundcloud -* Spotify -* Steam -* Stripe -* Twitch -* Twitter -* Uber -* VK -* Wepay -* Xero -* Yahoo -* Yammer - -## Examples - -See the [examples](examples) folder for a working application that lets users authenticate -through Twitter, Facebook, Google Plus etc. - -To run the example either clone the source from GitHub - -```text -$ git clone git@github.com:markbates/goth.git -``` -or use -```text -$ go get github.com/markbates/goth -``` -```text -$ cd goth/examples -$ go get -v -$ go build -$ ./examples -``` - -Now open up your browser and go to [http://localhost:3000](http://localhost:3000) to see the example. - -To actually use the different providers, please make sure you set environment variables. Example given in the examples/main.go file - -## Security Notes - -By default, gothic uses a `CookieStore` from the `gorilla/sessions` package to store session data. - -As configured, this default store (`gothic.Store`) will generate cookies with `Options`: - -```go -&Options{ - Path: "/", - Domain: "", - MaxAge: 86400 * 30, - HttpOnly: true, - Secure: false, - } -``` - -To tailor these fields for your application, you can override the `gothic.Store` variable at startup. - -The follow snippet show one way to do this: - -```go -key := "" // Replace with your SESSION_SECRET or similar -maxAge := 86400 * 30 // 30 days -isProd := false // Set to true when serving over https - -store := sessions.NewCookieStore([]byte(key)) -store.MaxAge(maxAge) -store.Options.Path = "/" -store.Options.HttpOnly = true // HttpOnly should always be enabled -store.Options.Secure = isProd - -gothic.Store = store -``` - -## Issues - -Issues always stand a significantly better chance of getting fixed if they are accompanied by a -pull request. - -## Contributing - -Would I love to see more providers? Certainly! Would you love to contribute one? Hopefully, yes! - -1. Fork it -2. Create your feature branch (git checkout -b my-new-feature) -3. Write Tests! -4. Commit your changes (git commit -am 'Add some feature') -5. Push to the branch (git push origin my-new-feature) -6. Create new Pull Request diff --git a/vendor/github.com/mattn/go-sqlite3/README.md b/vendor/github.com/mattn/go-sqlite3/README.md deleted file mode 100644 index 01d28a204f..0000000000 --- a/vendor/github.com/mattn/go-sqlite3/README.md +++ /dev/null @@ -1,97 +0,0 @@ -go-sqlite3 -========== - -[![GoDoc Reference](https://godoc.org/github.com/mattn/go-sqlite3?status.svg)](http://godoc.org/github.com/mattn/go-sqlite3) -[![Build Status](https://travis-ci.org/mattn/go-sqlite3.svg?branch=master)](https://travis-ci.org/mattn/go-sqlite3) -[![Coverage Status](https://coveralls.io/repos/mattn/go-sqlite3/badge.svg?branch=master)](https://coveralls.io/r/mattn/go-sqlite3?branch=master) -[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-sqlite3)](https://goreportcard.com/report/github.com/mattn/go-sqlite3) - -Description ------------ - -sqlite3 driver conforming to the built-in database/sql interface - -Installation ------------- - -This package can be installed with the go get command: - - go get github.com/mattn/go-sqlite3 - -_go-sqlite3_ is *cgo* package. -If you want to build your app using go-sqlite3, you need gcc. -However, if you install _go-sqlite3_ with `go install github.com/mattn/go-sqlite3`, you don't need gcc to build your app anymore. - -Documentation -------------- - -API documentation can be found here: http://godoc.org/github.com/mattn/go-sqlite3 - -Examples can be found under the `./_example` directory - -FAQ ---- - -* Want to build go-sqlite3 with libsqlite3 on my linux. - - Use `go build --tags "libsqlite3 linux"` - -* Want to build go-sqlite3 with libsqlite3 on OS X. - - Install sqlite3 from homebrew: `brew install sqlite3` - - Use `go build --tags "libsqlite3 darwin"` - -* Want to build go-sqlite3 with icu extension. - - Use `go build --tags "icu"` - - Available extensions: `json1`, `fts5`, `icu` - -* Can't build go-sqlite3 on windows 64bit. - - > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit. - > See: [#27](https://github.com/mattn/go-sqlite3/issues/27) - -* Getting insert error while query is opened. - - > You can pass some arguments into the connection string, for example, a URI. - > See: [#39](https://github.com/mattn/go-sqlite3/issues/39) - -* Do you want to cross compile? mingw on Linux or Mac? - - > See: [#106](https://github.com/mattn/go-sqlite3/issues/106) - > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html - -* Want to get time.Time with current locale - - Use `loc=auto` in SQLite3 filename schema like `file:foo.db?loc=auto`. - -* Can I use this in multiple routines concurrently? - - Yes for readonly. But, No for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209). - -* Why is it racy if I use a `sql.Open("sqlite3", ":memory:")` database? - - Each connection to :memory: opens a brand new in-memory sql database, so if - the stdlib's sql engine happens to open another connection and you've only - specified ":memory:", that connection will see a brand new database. A - workaround is to use "file::memory:?mode=memory&cache=shared". Every - connection to this string will point to the same in-memory database. See - [#204](https://github.com/mattn/go-sqlite3/issues/204) for more info. - -License -------- - -MIT: http://mattn.mit-license.org/2012 - -sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h - -The -binding suffix was added to avoid build failures under gccgo. - -In this repository, those files are an amalgamation of code that was copied from SQLite3. The license of that code is the same as the license of SQLite3. - -Author ------- - -Yasuhiro Matsumoto (a.k.a mattn) diff --git a/vendor/github.com/mcuadros/go-version/README.md b/vendor/github.com/mcuadros/go-version/README.md deleted file mode 100644 index a64c0a68d9..0000000000 --- a/vendor/github.com/mcuadros/go-version/README.md +++ /dev/null @@ -1,80 +0,0 @@ -go-version [![Build Status](https://travis-ci.org/mcuadros/go-version.svg?branch=master)](https://travis-ci.org/mcuadros/go-version) [![GoDoc](https://godoc.org/github.com/mcuadros/go-version?status.svg)](http://godoc.org/github.com/mcuadros/go-version) -============================== - -Version normalizer and comparison library for go, heavy based on PHP version_compare function and Version comparsion libs from [Composer](https://github.com/composer/composer) PHP project - -Installation ------------- - -The recommended way to install go-version - -``` -go get github.com/mcuadros/go-version -``` - -Examples --------- - -How import the package - -```go -import ( - "github.com/mcuadros/go-version" -) -``` - -`version.Normalize()`: Normalizes a version string to be able to perform comparisons on it - -```go -version.Normalize("10.4.13-b") -//Returns: 10.4.13.0-beta -``` - - -`version.CompareSimple()`: Compares two normalizated version number strings - -```go -version.CompareSimple("1.2", "1.0.1") -//Returns: 1 - -version.CompareSimple("1.0rc1", "1.0") -//Returns: -1 -``` - - -`version.Compare()`: Compares two normalizated version number strings, for a particular relationship - -```go -version.Compare("1.0-dev", "1.0", "<") -//Returns: true - -version.Compare("1.0rc1", "1.0", ">=") -//Returns: false - -version.Compare("2.3.4", "v3.1.2", "<") -//Returns: true -``` - -`version.ConstrainGroup.Match()`: Match a given version againts a group of constrains, read about constraint string format at [Composer documentation](http://getcomposer.org/doc/01-basic-usage.md#package-versions) - -```go -c := version.NewConstrainGroupFromString(">2.0,<=3.0") -c.Match("2.5.0beta") -//Returns: true - -c := version.NewConstrainGroupFromString("~1.2.3") -c.Match("1.2.3.5") -//Returns: true -``` - -`version.Sort()`: Sorts a string slice of version number strings using version.CompareSimple() - -```go -version.Sort([]string{"1.10-dev", "1.0rc1", "1.0", "1.0-dev"}) -//Returns []string{"1.0-dev", "1.0rc1", "1.0", "1.10-dev"} -``` - -License -------- - -MIT, see [LICENSE](LICENSE) diff --git a/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md b/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md deleted file mode 100644 index e0e0c815f6..0000000000 --- a/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md +++ /dev/null @@ -1,47 +0,0 @@ -# Contributing to bluemonday - -Third-party patches are essential for keeping bluemonday secure and offering the features developers want. However there are a few guidelines that we need contributors to follow so that we can maintain the quality of work that developers who use bluemonday expect. - -## Getting Started - -* Make sure you have a [Github account](https://github.com/signup/free) - -## Submitting an Issue - -* Submit a ticket for your issue, assuming one does not already exist -* Clearly describe the issue including the steps to reproduce (with sample input and output) if it is a bug - -If you are reporting a security flaw, you may expect that we will provide the code to fix it for you. Otherwise you may want to submit a pull request to ensure the resolution is applied sooner rather than later: - -* Fork the repository on Github -* Issue a pull request containing code to resolve the issue - -## Submitting a Pull Request - -* Submit a ticket for your issue, assuming one does not already exist -* Describe the reason for the pull request and if applicable show some example inputs and outputs to demonstrate what the patch does -* Fork the repository on Github -* Before submitting the pull request you should - 1. Include tests for your patch, 1 test should encapsulate the entire patch and should refer to the Github issue - 1. If you have added new exposed/public functionality, you should ensure it is documented appropriately - 1. If you have added new exposed/public functionality, you should consider demonstrating how to use it within one of the helpers or shipped policies if appropriate or within a test if modifying a helper or policy is not appropriate - 1. Run all of the tests `go test -v ./...` or `make test` and ensure all tests pass - 1. Run gofmt `gofmt -w ./$*` or `make fmt` - 1. Run vet `go tool vet *.go` or `make vet` and resolve any issues - 1. Install golint using `go get -u github.com/golang/lint/golint` and run vet `golint *.go` or `make lint` and resolve every warning -* When submitting the pull request you should - 1. Note the issue(s) it resolves, i.e. `Closes #6` in the pull request comment to close issue #6 when the pull request is accepted - -Once you have submitted a pull request, we *may* merge it without changes. If we have any comments or feedback, or need you to make changes to your pull request we will update the Github pull request or the associated issue. We expect responses from you within two weeks, and we may close the pull request is there is no activity. - -### Contributor Licence Agreement - -We haven't gone for the formal "Sign a Contributor Licence Agreement" thing that projects like [puppet](https://cla.puppetlabs.com/), [Mojito](https://developer.yahoo.com/cocktails/mojito/cla/) and companies like [Google](http://code.google.com/legal/individual-cla-v1.0.html) are using. - -But we do need to know that we can accept and merge your contributions, so for now the act of contributing a pull request should be considered equivalent to agreeing to a contributor licence agreement, specifically: - -You accept that the act of submitting code to the bluemonday project is to grant a copyright licence to the project that is perpetual, worldwide, non-exclusive, no-charge, royalty free and irrevocable. - -You accept that all who comply with the licence of the project (BSD 3-clause) are permitted to use your contributions to the project. - -You accept, and by submitting code do declare, that you have the legal right to grant such a licence to the project and that each of the contributions is your own original creation. diff --git a/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md b/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md deleted file mode 100644 index 4422905a3f..0000000000 --- a/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md +++ /dev/null @@ -1,6 +0,0 @@ - -1. John Graham-Cumming http://jgc.org/ -1. Mike Samuel mikesamuel@gmail.com -1. Dmitri Shuralyov shurcooL@gmail.com -1. https://github.com/opennota -1. https://github.com/Gufran \ No newline at end of file diff --git a/vendor/github.com/microcosm-cc/bluemonday/Makefile b/vendor/github.com/microcosm-cc/bluemonday/Makefile deleted file mode 100644 index b15dc74f37..0000000000 --- a/vendor/github.com/microcosm-cc/bluemonday/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# Targets: -# -# all: Builds the code locally after testing -# -# fmt: Formats the source files -# build: Builds the code locally -# vet: Vets the code -# lint: Runs lint over the code (you do not need to fix everything) -# test: Runs the tests -# cover: Gives you the URL to a nice test coverage report -# -# install: Builds, tests and installs the code locally - -.PHONY: all fmt build vet lint test cover install - -# The first target is always the default action if `make` is called without -# args we build and install into $GOPATH so that it can just be run - -all: fmt vet test install - -fmt: - @gofmt -s -w ./$* - -build: - @go build - -vet: - @go vet *.go - -lint: - @golint *.go - -test: - @go test -v ./... - -cover: COVERAGE_FILE := coverage.out -cover: - @go test -coverprofile=$(COVERAGE_FILE) && \ - cover -html=$(COVERAGE_FILE) && rm $(COVERAGE_FILE) - -install: - @go install ./... diff --git a/vendor/github.com/microcosm-cc/bluemonday/README.md b/vendor/github.com/microcosm-cc/bluemonday/README.md deleted file mode 100644 index b8508ff04a..0000000000 --- a/vendor/github.com/microcosm-cc/bluemonday/README.md +++ /dev/null @@ -1,346 +0,0 @@ -# bluemonday [![Build Status](https://travis-ci.org/microcosm-cc/bluemonday.svg?branch=master)](https://travis-ci.org/microcosm-cc/bluemonday) [![GoDoc](https://godoc.org/github.com/microcosm-cc/bluemonday?status.png)](https://godoc.org/github.com/microcosm-cc/bluemonday) - -bluemonday is a HTML sanitizer implemented in Go. It is fast and highly configurable. - -bluemonday takes untrusted user generated content as an input, and will return HTML that has been sanitised against a whitelist of approved HTML elements and attributes so that you can safely include the content in your web page. - -If you accept user generated content, and your server uses Go, you **need** bluemonday. - -The default policy for user generated content (`bluemonday.UGCPolicy().Sanitize()`) turns this: -```html -Hello World -``` - -Into a harmless: -```html -Hello World -``` - -And it turns this: -```html -XSS -``` - -Into this: -```html -XSS -``` - -Whilst still allowing this: -```html - - - -``` - -To pass through mostly unaltered (it gained a rel="nofollow" which is a good thing for user generated content): -```html - - - -``` - -It protects sites from [XSS](http://en.wikipedia.org/wiki/Cross-site_scripting) attacks. There are many [vectors for an XSS attack](https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet) and the best way to mitigate the risk is to sanitize user input against a known safe list of HTML elements and attributes. - -You should **always** run bluemonday **after** any other processing. - -If you use [blackfriday](https://github.com/russross/blackfriday) or [Pandoc](http://johnmacfarlane.net/pandoc/) then bluemonday should be run after these steps. This ensures that no insecure HTML is introduced later in your process. - -bluemonday is heavily inspired by both the [OWASP Java HTML Sanitizer](https://code.google.com/p/owasp-java-html-sanitizer/) and the [HTML Purifier](http://htmlpurifier.org/). - -## Technical Summary - -Whitelist based, you need to either build a policy describing the HTML elements and attributes to permit (and the `regexp` patterns of attributes), or use one of the supplied policies representing good defaults. - -The policy containing the whitelist is applied using a fast non-validating, forward only, token-based parser implemented in the [Go net/html library](https://godoc.org/golang.org/x/net/html) by the core Go team. - -We expect to be supplied with well-formatted HTML (closing elements for every applicable open element, nested correctly) and so we do not focus on repairing badly nested or incomplete HTML. We focus on simply ensuring that whatever elements do exist are described in the policy whitelist and that attributes and links are safe for use on your web page. [GIGO](http://en.wikipedia.org/wiki/Garbage_in,_garbage_out) does apply and if you feed it bad HTML bluemonday is not tasked with figuring out how to make it good again. - -### Supported Go Versions - -bluemonday is regularly tested against Go 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 and tip. - -We do not support Go 1.0 as we depend on `golang.org/x/net/html` which includes a reference to `io.ErrNoProgress` which did not exist in Go 1.0. - -## Is it production ready? - -*Yes* - -We are using bluemonday in production having migrated from the widely used and heavily field tested OWASP Java HTML Sanitizer. - -We are passing our extensive test suite (including AntiSamy tests as well as tests for any issues raised). Check for any [unresolved issues](https://github.com/microcosm-cc/bluemonday/issues?page=1&state=open) to see whether anything may be a blocker for you. - -We invite pull requests and issues to help us ensure we are offering comprehensive protection against various attacks via user generated content. - -## Usage - -Install in your `${GOPATH}` using `go get -u github.com/microcosm-cc/bluemonday` - -Then call it: -```go -package main - -import ( - "fmt" - - "github.com/microcosm-cc/bluemonday" -) - -func main() { - p := bluemonday.UGCPolicy() - html := p.Sanitize( - `Google`, - ) - - // Output: - // Google - fmt.Println(html) -} -``` - -We offer three ways to call Sanitize: -```go -p.Sanitize(string) string -p.SanitizeBytes([]byte) []byte -p.SanitizeReader(io.Reader) bytes.Buffer -``` - -If you are obsessed about performance, `p.SanitizeReader(r).Bytes()` will return a `[]byte` without performing any unnecessary casting of the inputs or outputs. Though the difference is so negligible you should never need to care. - -You can build your own policies: -```go -package main - -import ( - "fmt" - - "github.com/microcosm-cc/bluemonday" -) - -func main() { - p := bluemonday.NewPolicy() - - // Require URLs to be parseable by net/url.Parse and either: - // mailto: http:// or https:// - p.AllowStandardURLs() - - // We only allow

and - p.AllowAttrs("href").OnElements("a") - p.AllowElements("p") - - html := p.Sanitize( - `Google`, - ) - - // Output: - // Google - fmt.Println(html) -} -``` - -We ship two default policies: - -1. `bluemonday.StrictPolicy()` which can be thought of as equivalent to stripping all HTML elements and their attributes as it has nothing on it's whitelist. An example usage scenario would be blog post titles where HTML tags are not expected at all and if they are then the elements *and* the content of the elements should be stripped. This is a *very* strict policy. -2. `bluemonday.UGCPolicy()` which allows a broad selection of HTML elements and attributes that are safe for user generated content. Note that this policy does *not* whitelist iframes, object, embed, styles, script, etc. An example usage scenario would be blog post bodies where a variety of formatting is expected along with the potential for TABLEs and IMGs. - -## Policy Building - -The essence of building a policy is to determine which HTML elements and attributes are considered safe for your scenario. OWASP provide an [XSS prevention cheat sheet](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet) to help explain the risks, but essentially: - -1. Avoid anything other than the standard HTML elements -1. Avoid `script`, `style`, `iframe`, `object`, `embed`, `base` elements that allow code to be executed by the client or third party content to be included that can execute code -1. Avoid anything other than plain HTML attributes with values matched to a regexp - -Basically, you should be able to describe what HTML is fine for your scenario. If you do not have confidence that you can describe your policy please consider using one of the shipped policies such as `bluemonday.UGCPolicy()`. - -To create a new policy: -```go -p := bluemonday.NewPolicy() -``` - -To add elements to a policy either add just the elements: -```go -p.AllowElements("b", "strong") -``` - -Or add elements as a virtue of adding an attribute: -```go -// Not the recommended pattern, see the recommendation on using .Matching() below -p.AllowAttrs("nowrap").OnElements("td", "th") -``` - -Attributes can either be added to all elements: -```go -p.AllowAttrs("dir").Matching(regexp.MustCompile("(?i)rtl|ltr")).Globally() -``` - -Or attributes can be added to specific elements: -```go -// Not the recommended pattern, see the recommendation on using .Matching() below -p.AllowAttrs("value").OnElements("li") -``` - -It is **always** recommended that an attribute be made to match a pattern. XSS in HTML attributes is very easy otherwise: -```go -// \p{L} matches unicode letters, \p{N} matches unicode numbers -p.AllowAttrs("title").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).Globally() -``` - -You can stop at any time and call .Sanitize(): -```go -// string htmlIn passed in from a HTTP POST -htmlOut := p.Sanitize(htmlIn) -``` - -And you can take any existing policy and extend it: -```go -p := bluemonday.UGCPolicy() -p.AllowElements("fieldset", "select", "option") -``` - -### Links - -Links are difficult beasts to sanitise safely and also one of the biggest attack vectors for malicious content. - -It is possible to do this: -```go -p.AllowAttrs("href").Matching(regexp.MustCompile(`(?i)mailto|https?`)).OnElements("a") -``` - -But that will not protect you as the regular expression is insufficient in this case to have prevented a malformed value doing something unexpected. - -We provide some additional global options for safely working with links. - -`RequireParseableURLs` will ensure that URLs are parseable by Go's `net/url` package: -```go -p.RequireParseableURLs(true) -``` - -If you have enabled parseable URLs then the following option will `AllowRelativeURLs`. By default this is disabled (bluemonday is a whitelist tool... you need to explicitly tell us to permit things) and when disabled it will prevent all local and scheme relative URLs (i.e. `href="localpage.html"`, `href="../home.html"` and even `href="//www.google.com"` are relative): -```go -p.AllowRelativeURLs(true) -``` - -If you have enabled parseable URLs then you can whitelist the schemes (commonly called protocol when thinking of `http` and `https`) that are permitted. Bear in mind that allowing relative URLs in the above option will allow for a blank scheme: -```go -p.AllowURLSchemes("mailto", "http", "https") -``` - -Regardless of whether you have enabled parseable URLs, you can force all URLs to have a rel="nofollow" attribute. This will be added if it does not exist, but only when the `href` is valid: -```go -// This applies to "a" "area" "link" elements that have a "href" attribute -p.RequireNoFollowOnLinks(true) -``` - -We provide a convenience method that applies all of the above, but you will still need to whitelist the linkable elements for the URL rules to be applied to: -```go -p.AllowStandardURLs() -p.AllowAttrs("cite").OnElements("blockquote", "q") -p.AllowAttrs("href").OnElements("a", "area") -p.AllowAttrs("src").OnElements("img") -``` - -An additional complexity regarding links is the data URI as defined in [RFC2397](http://tools.ietf.org/html/rfc2397). The data URI allows for images to be served inline using this format: - -```html - -``` - -We have provided a helper to verify the mimetype followed by base64 content of data URIs links: - -```go -p.AllowDataURIImages() -``` - -That helper will enable GIF, JPEG, PNG and WEBP images. - -It should be noted that there is a potential [security](http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/) [risk](https://capec.mitre.org/data/definitions/244.html) with the use of data URI links. You should only enable data URI links if you already trust the content. - -We also have some features to help deal with user generated content: -```go -p.AddTargetBlankToFullyQualifiedLinks(true) -``` - -This will ensure that anchor `` links that are fully qualified (the href destination includes a host name) will get `target="_blank"` added to them. - -Additionally any link that has `target="_blank"` after the policy has been applied will also have the `rel` attribute adjusted to add `noopener`. This means a link may start like `` and will end up as ``. It is important to note that the addition of `noopener` is a security feature and not an issue. There is an unfortunate feature to browsers that a browser window opened as a result of `target="_blank"` can still control the opener (your web page) and this protects against that. The background to this can be found here: [https://dev.to/ben/the-targetblank-vulnerability-by-example](https://dev.to/ben/the-targetblank-vulnerability-by-example) - -### Policy Building Helpers - -We also bundle some helpers to simplify policy building: -```go - -// Permits the "dir", "id", "lang", "title" attributes globally -p.AllowStandardAttributes() - -// Permits the "img" element and it's standard attributes -p.AllowImages() - -// Permits ordered and unordered lists, and also definition lists -p.AllowLists() - -// Permits HTML tables and all applicable elements and non-styling attributes -p.AllowTables() -``` - -### Invalid Instructions - -The following are invalid: -```go -// This does not say where the attributes are allowed, you need to add -// .Globally() or .OnElements(...) -// This will be ignored without error. -p.AllowAttrs("value") - -// This does not say where the attributes are allowed, you need to add -// .Globally() or .OnElements(...) -// This will be ignored without error. -p.AllowAttrs( - "type", -).Matching( - regexp.MustCompile("(?i)^(circle|disc|square|a|A|i|I|1)$"), -) -``` - -Both examples exhibit the same issue, they declare attributes but do not then specify whether they are whitelisted globally or only on specific elements (and which elements). Attributes belong to one or more elements, and the policy needs to declare this. - -## Limitations - -We are not yet including any tools to help whitelist and sanitize CSS. Which means that unless you wish to do the heavy lifting in a single regular expression (inadvisable), **you should not allow the "style" attribute anywhere**. - -It is not the job of bluemonday to fix your bad HTML, it is merely the job of bluemonday to prevent malicious HTML getting through. If you have mismatched HTML elements, or non-conforming nesting of elements, those will remain. But if you have well-structured HTML bluemonday will not break it. - -## TODO - -* Add support for CSS sanitisation to allow some CSS properties based on a whitelist, possibly using the [Gorilla CSS3 scanner](http://www.gorillatoolkit.org/pkg/css/scanner) -* Investigate whether devs want to blacklist elements and attributes. This would allow devs to take an existing policy (such as the `bluemonday.UGCPolicy()` ) that encapsulates 90% of what they're looking for but does more than they need, and to remove the extra things they do not want to make it 100% what they want -* Investigate whether devs want a validating HTML mode, in which the HTML elements are not just transformed into a balanced tree (every start tag has a closing tag at the correct depth) but also that elements and character data appear only in their allowed context (i.e. that a `table` element isn't a descendent of a `caption`, that `colgroup`, `thead`, `tbody`, `tfoot` and `tr` are permitted, and that character data is not permitted) - -## Development - -If you have cloned this repo you will probably need the dependency: - -`go get golang.org/x/net/html` - -Gophers can use their familiar tools: - -`go build` - -`go test` - -I personally use a Makefile as it spares typing the same args over and over whilst providing consistency for those of us who jump from language to language and enjoy just typing `make` in a project directory and watch magic happen. - -`make` will build, vet, test and install the library. - -`make clean` will remove the library from a *single* `${GOPATH}/pkg` directory tree - -`make test` will run the tests - -`make cover` will run the tests and *open a browser window* with the coverage report - -`make lint` will run golint (install via `go get github.com/golang/lint/golint`) - -## Long term goals - -1. Open the code to adversarial peer review similar to the [Attack Review Ground Rules](https://code.google.com/p/owasp-java-html-sanitizer/wiki/AttackReviewGroundRules) -1. Raise funds and pay for an external security review diff --git a/vendor/github.com/mrjones/oauth/MIT-LICENSE.txt b/vendor/github.com/mrjones/oauth/MIT-LICENSE.txt deleted file mode 100644 index 6c9461e6c6..0000000000 --- a/vendor/github.com/mrjones/oauth/MIT-LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (C) 2013 Matthew R. Jones - -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: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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. diff --git a/vendor/github.com/mrjones/oauth/README.md b/vendor/github.com/mrjones/oauth/README.md deleted file mode 100644 index c0f7eb5479..0000000000 --- a/vendor/github.com/mrjones/oauth/README.md +++ /dev/null @@ -1,51 +0,0 @@ -OAuth 1.0 Library for [Go](http://golang.org) -======================== - -[![GoDoc](http://godoc.org/github.com/mrjones/oauth?status.png)](http://godoc.org/github.com/mrjones/oauth) - -[![CircleCI](https://circleci.com/gh/mrjones/oauth/tree/master.svg?style=svg)](https://circleci.com/gh/mrjones/oauth/tree/master) - -(If you need an OAuth 2.0 library, check out: https://godoc.org/golang.org/x/oauth2) - -Developing your own apps, with this library -------------------------------------------- - -* First, install the library - - go get github.com/mrjones/oauth - -* Then, check out the comments in oauth.go - -* Or, have a look at the examples: - - * Netflix - - go run examples/netflix/netflix.go --consumerkey [key] --consumersecret [secret] --appname [appname] - - * Twitter - - Command line: - - go run examples/twitter/twitter.go --consumerkey [key] --consumersecret [secret] - - Or, in the browser (using an HTTP server): - - go run examples/twitterserver/twitterserver.go --consumerkey [key] --consumersecret [secret] --port 8888 - - * The Google Latitude example is broken, now that Google uses OAuth 2.0 - -Contributing to this library ----------------------------- - -* Please install the pre-commit hook, which will run tests, and go-fmt before committing. - - ln -s $PWD/pre-commit.sh .git/hooks/pre-commit - -* Running tests and building is as you'd expect: - - go test *.go - go build *.go - - - - diff --git a/vendor/github.com/mrjones/oauth/pre-commit.sh b/vendor/github.com/mrjones/oauth/pre-commit.sh deleted file mode 100755 index 91b9e88236..0000000000 --- a/vendor/github.com/mrjones/oauth/pre-commit.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# ln -s $PWD/pre-commit.sh .git/hooks/pre-commit -go test *.go -RESULT=$? -if [[ $RESULT != 0 ]]; then - echo "REJECTING COMMIT (test failed with status: $RESULT)" - exit 1; -fi - -go fmt *.go -for e in $(ls examples); do - go build examples/$e/*.go - RESULT=$? - if [[ $RESULT != 0 ]]; then - echo "REJECTING COMMIT (Examples failed to compile)" - exit $RESULT; - fi - go fmt examples/$e/*.go -done - -exit 0 diff --git a/vendor/github.com/mschoch/smat/README.md b/vendor/github.com/mschoch/smat/README.md deleted file mode 100644 index f5ca1c5440..0000000000 --- a/vendor/github.com/mschoch/smat/README.md +++ /dev/null @@ -1,166 +0,0 @@ -# smat – State Machine Assisted Testing - -The concept is simple, describe valid uses of your library as states and actions. States describe which actions are possible, and with what probability they should occur. Actions mutate the context and transition to another state. - -By doing this, two things are possible: - -1. Use [go-fuzz](https://github.com/dvyukov/go-fuzz) to find/test interesting sequences of operations on your library. - -2. Automate longevity testing of your application by performing long sequences of valid operations. - -**NOTE**: both of these can also incorporate validation logic (not just failure detection by building validation into the state machine) - -## Status - -The API is still not stable. This is brand new and we'll probably change things we don't like... - -[![Build Status](https://travis-ci.org/mschoch/smat.svg?branch=master)](https://travis-ci.org/mschoch/smat) -[![Coverage Status](https://coveralls.io/repos/github/mschoch/smat/badge.svg?branch=master)](https://coveralls.io/github/mschoch/smat?branch=master) -[![GoDoc](https://godoc.org/github.com/mschoch/smat?status.svg)](https://godoc.org/github.com/mschoch/smat) -[![codebeat badge](https://codebeat.co/badges/c3ff6180-a241-4128-97f0-fa6bf6f48752)](https://codebeat.co/projects/github-com-mschoch-smat) -[![Go Report Card](https://goreportcard.com/badge/github.com/mschoch/smat)](https://goreportcard.com/report/github.com/mschoch/smat) - -## License - -Apache 2.0 - -## How do I use it? - -### smat.Context - -Choose a structure to keep track of any state. You pass in an instance of this when you start, and it will be passed to every action when it executes. The actions may mutate this context. - -For example, consider a database library, once you open a database handle, you need to use it inside of the other actions. So you might use a structure like: - -``` -type context struct { - db *DB -} -``` - -### smat.State - -A state represents a state that your application/library can be in, and the probabilities thats certain actions should be taken. - -For example, consider a database library, in a state where the database is open, there many things you can do. Let's consider just two right now, you can set a value, or you can delete a value. - -``` -func dbOpen(next byte) smat.ActionID { - return smat.PercentExecute(next, - smat.PercentAction{50, setValue}, - smat.PercentAction{50, deleteValue}, - ) -} -``` - -This says that in the open state, there are two valid actions, 50% of the time you should set a value and 50% of the time you should delete a value. **NOTE**: these percentages are just for characterizing the test workload. - -### smat.Action - -Actions are functions that do some work, optionally mutate the context, and indicate the next state to transition to. Below we see an example action to set value in a database. - -``` -func setValueFunc(ctx smat.Context) (next smat.State, err error) { - // type assert to our custom context type - context := ctx.(*context) - // perform the operation - err = context.db.Set("k", "v") - if err != nil { - return nil, err - } - // return the new state - return dbOpen, nil -} -``` - -### smat.ActionID and smat.ActionMap - -Actions are just functions, and since we can't compare functions in Go, we need to introduce an external identifier for them. This allows us to build a bi-directional mapping which we'll take advantage of later. - -``` -const ( - setup smat.ActionID = iota - teardown - setValue - deleteValue -) - -var actionMap = smat.ActionMap{ - setup: setupFunc, - teardown: teardownFunc, - setValue: setValueFunc, - deleteValue: deleteValueFunc, -} -``` - -### smat.ActionSeq - -A common way that many users think about a library is as a sequence of actions to be performed. Using the ActionID's that we've already seen we can build up sequences of operations. - -``` - actionSeq := smat.ActionSeq{ - open, - setValue, - setValue, - setValue, - } -``` - -Notice that we build these actions using the constants we defined above, and because of this we can have a bi-directional mapping between a stream of bytes (driving the state machine) and a sequence of actions to be performed. - -## Fuzzing - -We've built a lot of pieces, lets wire it up to go-fuzz. - -``` -func Fuzz(data []byte) int { - return smat.Fuzz(&context{}, setup, teardown, actionMap, data) -} -``` - -* The first argument is an instance of context structure. -* The second argument is the ActionID of our setup function. The setup function does not consume any of the input stream and is used to initialize the context and determine the start state. -* The third argument is the teardown function. This will be called unconditionally to clean up any resources associated with the test. -* The fourth argument is the actionMap which maps all ActionIDs to Actions. -* The fifth argument is the data passed in from the go-fuzz application. - -### Generating Initial go-fuzz Corpus - -Earlier we mentioned the bi-directional mapping between Actions and the byte stream driving the state machine. We can now leverage this to build the inital go-fuzz corpus. - -Using the `ActinSeq`s we learned about earlier we can build up a list of them as: - - var actionSeqs = []smat.ActionSeq{...} - -Then, we can write them out to disk using: - -``` -for i, actionSeq := range actionSeqs { - byteSequence, err := actionSeq.ByteEncoding(&context{}, setup, teardown, actionMap) - if err != nil { - // handle error - } - os.MkdirAll("workdir/corpus", 0700) - ioutil.WriteFile(fmt.Sprintf("workdir/corpus/%d", i), byteSequence, 0600) -} -``` - -You can then either put this into a test case or a main application depending on your needs. - -## Longevity Testing - -Fuzzing is great, but most of your corpus is likely to be shorter meaningful sequences. And go-fuzz works to find shortest sequences that cause problems, but sometimes you actually want to explore longer sequences that appear to go-fuzz as not triggering additional code coverage. - -For these cases we have another helper you can use: - -``` - Longevity(ctx, setup, teardown, actionMap, 0, closeChan) -``` - -The first four arguments are the same, the last two are: -* random seed used to ensure repeatable tests -* closeChan (chan struct{}) - close this channel if you want the function to stop and return ErrClosed, otherwise it will run forever - -## Examples - -See the examples directory for a working example that tests some BoltDB functionality. diff --git a/vendor/github.com/msteinert/pam/README.md b/vendor/github.com/msteinert/pam/README.md deleted file mode 100644 index 66b3820662..0000000000 --- a/vendor/github.com/msteinert/pam/README.md +++ /dev/null @@ -1,30 +0,0 @@ -[![Build Status](https://travis-ci.org/msteinert/pam.svg?branch=master)](https://travis-ci.org/msteinert/pam) -[![GoDoc](https://godoc.org/github.com/msteinert/pam?status.svg)](http://godoc.org/github.com/msteinert/pam) -[![Coverage Status](https://coveralls.io/repos/msteinert/pam/badge.svg?branch=master)](https://coveralls.io/r/msteinert/pam?branch=master) -[![Go Report Card](http://goreportcard.com/badge/msteinert/pam)](http://goreportcard.com/report/msteinert/pam) - -# Go PAM - -This is a Go wrapper for the PAM application API. - -## Testing - -To run the full suite, the tests must be run as the root user. To setup your -system for testing, create a user named "test" with the password "secret". For -example: - -``` -$ sudo useradd test \ - -d /tmp/test \ - -p '$1$Qd8H95T5$RYSZQeoFbEB.gS19zS99A0' \ - -s /bin/false -``` - -Then execute the tests: - -``` -$ sudo GOPATH=$GOPATH $(which go) test -v -``` - -[1]: http://godoc.org/github.com/msteinert/pam -[2]: http://www.linux-pam.org/Linux-PAM-html/Linux-PAM_ADG.html diff --git a/vendor/github.com/nfnt/resize/README.md b/vendor/github.com/nfnt/resize/README.md deleted file mode 100644 index 2aefa75c94..0000000000 --- a/vendor/github.com/nfnt/resize/README.md +++ /dev/null @@ -1,149 +0,0 @@ -Resize -====== - -Image resizing for the [Go programming language](http://golang.org) with common interpolation methods. - -[![Build Status](https://travis-ci.org/nfnt/resize.svg)](https://travis-ci.org/nfnt/resize) - -Installation ------------- - -```bash -$ go get github.com/nfnt/resize -``` - -It's that easy! - -Usage ------ - -This package needs at least Go 1.1. Import package with - -```go -import "github.com/nfnt/resize" -``` - -The resize package provides 2 functions: - -* `resize.Resize` creates a scaled image with new dimensions (`width`, `height`) using the interpolation function `interp`. - If either `width` or `height` is set to 0, it will be set to an aspect ratio preserving value. -* `resize.Thumbnail` downscales an image preserving its aspect ratio to the maximum dimensions (`maxWidth`, `maxHeight`). - It will return the original image if original sizes are smaller than the provided dimensions. - -```go -resize.Resize(width, height uint, img image.Image, interp resize.InterpolationFunction) image.Image -resize.Thumbnail(maxWidth, maxHeight uint, img image.Image, interp resize.InterpolationFunction) image.Image -``` - -The provided interpolation functions are (from fast to slow execution time) - -- `NearestNeighbor`: [Nearest-neighbor interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation) -- `Bilinear`: [Bilinear interpolation](http://en.wikipedia.org/wiki/Bilinear_interpolation) -- `Bicubic`: [Bicubic interpolation](http://en.wikipedia.org/wiki/Bicubic_interpolation) -- `MitchellNetravali`: [Mitchell-Netravali interpolation](http://dl.acm.org/citation.cfm?id=378514) -- `Lanczos2`: [Lanczos resampling](http://en.wikipedia.org/wiki/Lanczos_resampling) with a=2 -- `Lanczos3`: [Lanczos resampling](http://en.wikipedia.org/wiki/Lanczos_resampling) with a=3 - -Which of these methods gives the best results depends on your use case. - -Sample usage: - -```go -package main - -import ( - "github.com/nfnt/resize" - "image/jpeg" - "log" - "os" -) - -func main() { - // open "test.jpg" - file, err := os.Open("test.jpg") - if err != nil { - log.Fatal(err) - } - - // decode jpeg into image.Image - img, err := jpeg.Decode(file) - if err != nil { - log.Fatal(err) - } - file.Close() - - // resize to width 1000 using Lanczos resampling - // and preserve aspect ratio - m := resize.Resize(1000, 0, img, resize.Lanczos3) - - out, err := os.Create("test_resized.jpg") - if err != nil { - log.Fatal(err) - } - defer out.Close() - - // write new image to file - jpeg.Encode(out, m, nil) -} -``` - -Caveats -------- - -* Optimized access routines are used for `image.RGBA`, `image.NRGBA`, `image.RGBA64`, `image.NRGBA64`, `image.YCbCr`, `image.Gray`, and `image.Gray16` types. All other image types are accessed in a generic way that will result in slow processing speed. -* JPEG images are stored in `image.YCbCr`. This image format stores data in a way that will decrease processing speed. A resize may be up to 2 times slower than with `image.RGBA`. - - -Downsizing Samples -------- - -Downsizing is not as simple as it might look like. Images have to be filtered before they are scaled down, otherwise aliasing might occur. -Filtering is highly subjective: Applying too much will blur the whole image, too little will make aliasing become apparent. -Resize tries to provide sane defaults that should suffice in most cases. - -### Artificial sample - -Original image -![Rings](http://nfnt.github.com/img/rings_lg_orig.png) - - - - - - - - - - - - - - -

Nearest-Neighbor

Bilinear

Bicubic

Mitchell-Netravali

Lanczos2

Lanczos3
- -### Real-Life sample - -Original image -![Original](http://nfnt.github.com/img/IMG_3694_720.jpg) - - - - - - - - - - - - - - -

Nearest-Neighbor

Bilinear

Bicubic

Mitchell-Netravali

Lanczos2

Lanczos3
- - -License -------- - -Copyright (c) 2012 Jan Schlicht -Resize is released under a MIT style license. diff --git a/vendor/github.com/ngaut/log/README.md b/vendor/github.com/ngaut/log/README.md deleted file mode 100644 index e0e857e7f2..0000000000 --- a/vendor/github.com/ngaut/log/README.md +++ /dev/null @@ -1,2 +0,0 @@ -logging -======= diff --git a/vendor/github.com/ngaut/zkhelper/README.md b/vendor/github.com/ngaut/zkhelper/README.md deleted file mode 100644 index 3ce45069d2..0000000000 --- a/vendor/github.com/ngaut/zkhelper/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Coordinator -======== - -Support both zookeeper and etcd diff --git a/vendor/github.com/petar/GoLLRB/AUTHORS b/vendor/github.com/petar/GoLLRB/AUTHORS new file mode 100644 index 0000000000..78d1de4956 --- /dev/null +++ b/vendor/github.com/petar/GoLLRB/AUTHORS @@ -0,0 +1,4 @@ +Petar Maymounkov +Vadim Vygonets +Ian Smith +Martin Bruse diff --git a/vendor/github.com/philhofer/fwd/README.md b/vendor/github.com/philhofer/fwd/README.md deleted file mode 100644 index 38349af34d..0000000000 --- a/vendor/github.com/philhofer/fwd/README.md +++ /dev/null @@ -1,315 +0,0 @@ - -# fwd - import "github.com/philhofer/fwd" - -The `fwd` package provides a buffered reader -and writer. Each has methods that help improve -the encoding/decoding performance of some binary -protocols. - -The `fwd.Writer` and `fwd.Reader` type provide similar -functionality to their counterparts in `bufio`, plus -a few extra utility methods that simplify read-ahead -and write-ahead. I wrote this package to improve serialization -performance for
http://github.com/tinylib/msgp, -where it provided about a 2x speedup over `bufio` for certain -workloads. However, care must be taken to understand the semantics of the -extra methods provided by this package, as they allow -the user to access and manipulate the buffer memory -directly. - -The extra methods for `fwd.Reader` are `Peek`, `Skip` -and `Next`. `(*fwd.Reader).Peek`, unlike `(*bufio.Reader).Peek`, -will re-allocate the read buffer in order to accommodate arbitrarily -large read-ahead. `(*fwd.Reader).Skip` skips the next `n` bytes -in the stream, and uses the `io.Seeker` interface if the underlying -stream implements it. `(*fwd.Reader).Next` returns a slice pointing -to the next `n` bytes in the read buffer (like `Peek`), but also -increments the read position. This allows users to process streams -in arbitrary block sizes without having to manage appropriately-sized -slices. Additionally, obviating the need to copy the data from the -buffer to another location in memory can improve performance dramatically -in CPU-bound applications. - -`fwd.Writer` only has one extra method, which is `(*fwd.Writer).Next`, which -returns a slice pointing to the next `n` bytes of the writer, and increments -the write position by the length of the returned slice. This allows users -to write directly to the end of the buffer. - - - - -## Constants -``` go -const ( - // DefaultReaderSize is the default size of the read buffer - DefaultReaderSize = 2048 -) -``` -``` go -const ( - // DefaultWriterSize is the - // default write buffer size. - DefaultWriterSize = 2048 -) -``` - - - -## type Reader -``` go -type Reader struct { - // contains filtered or unexported fields -} -``` -Reader is a buffered look-ahead reader - - - - - - - - - -### func NewReader -``` go -func NewReader(r io.Reader) *Reader -``` -NewReader returns a new *Reader that reads from 'r' - - -### func NewReaderSize -``` go -func NewReaderSize(r io.Reader, n int) *Reader -``` -NewReaderSize returns a new *Reader that -reads from 'r' and has a buffer size 'n' - - - - -### func (\*Reader) BufferSize -``` go -func (r *Reader) BufferSize() int -``` -BufferSize returns the total size of the buffer - - - -### func (\*Reader) Buffered -``` go -func (r *Reader) Buffered() int -``` -Buffered returns the number of bytes currently in the buffer - - - -### func (\*Reader) Next -``` go -func (r *Reader) Next(n int) ([]byte, error) -``` -Next returns the next 'n' bytes in the stream. -Unlike Peek, Next advances the reader position. -The returned bytes point to the same -data as the buffer, so the slice is -only valid until the next reader method call. -An EOF is considered an unexpected error. -If an the returned slice is less than the -length asked for, an error will be returned, -and the reader position will not be incremented. - - - -### func (\*Reader) Peek -``` go -func (r *Reader) Peek(n int) ([]byte, error) -``` -Peek returns the next 'n' buffered bytes, -reading from the underlying reader if necessary. -It will only return a slice shorter than 'n' bytes -if it also returns an error. Peek does not advance -the reader. EOF errors are *not* returned as -io.ErrUnexpectedEOF. - - - -### func (\*Reader) Read -``` go -func (r *Reader) Read(b []byte) (int, error) -``` -Read implements `io.Reader` - - - -### func (\*Reader) ReadByte -``` go -func (r *Reader) ReadByte() (byte, error) -``` -ReadByte implements `io.ByteReader` - - - -### func (\*Reader) ReadFull -``` go -func (r *Reader) ReadFull(b []byte) (int, error) -``` -ReadFull attempts to read len(b) bytes into -'b'. It returns the number of bytes read into -'b', and an error if it does not return len(b). -EOF is considered an unexpected error. - - - -### func (\*Reader) Reset -``` go -func (r *Reader) Reset(rd io.Reader) -``` -Reset resets the underlying reader -and the read buffer. - - - -### func (\*Reader) Skip -``` go -func (r *Reader) Skip(n int) (int, error) -``` -Skip moves the reader forward 'n' bytes. -Returns the number of bytes skipped and any -errors encountered. It is analogous to Seek(n, 1). -If the underlying reader implements io.Seeker, then -that method will be used to skip forward. - -If the reader encounters -an EOF before skipping 'n' bytes, it -returns io.ErrUnexpectedEOF. If the -underlying reader implements io.Seeker, then -those rules apply instead. (Many implementations -will not return `io.EOF` until the next call -to Read.) - - - -### func (\*Reader) WriteTo -``` go -func (r *Reader) WriteTo(w io.Writer) (int64, error) -``` -WriteTo implements `io.WriterTo` - - - -## type Writer -``` go -type Writer struct { - // contains filtered or unexported fields -} -``` -Writer is a buffered writer - - - - - - - - - -### func NewWriter -``` go -func NewWriter(w io.Writer) *Writer -``` -NewWriter returns a new writer -that writes to 'w' and has a buffer -that is `DefaultWriterSize` bytes. - - -### func NewWriterSize -``` go -func NewWriterSize(w io.Writer, size int) *Writer -``` -NewWriterSize returns a new writer -that writes to 'w' and has a buffer -that is 'size' bytes. - - - - -### func (\*Writer) BufferSize -``` go -func (w *Writer) BufferSize() int -``` -BufferSize returns the maximum size of the buffer. - - - -### func (\*Writer) Buffered -``` go -func (w *Writer) Buffered() int -``` -Buffered returns the number of buffered bytes -in the reader. - - - -### func (\*Writer) Flush -``` go -func (w *Writer) Flush() error -``` -Flush flushes any buffered bytes -to the underlying writer. - - - -### func (\*Writer) Next -``` go -func (w *Writer) Next(n int) ([]byte, error) -``` -Next returns the next 'n' free bytes -in the write buffer, flushing the writer -as necessary. Next will return `io.ErrShortBuffer` -if 'n' is greater than the size of the write buffer. -Calls to 'next' increment the write position by -the size of the returned buffer. - - - -### func (\*Writer) ReadFrom -``` go -func (w *Writer) ReadFrom(r io.Reader) (int64, error) -``` -ReadFrom implements `io.ReaderFrom` - - - -### func (\*Writer) Write -``` go -func (w *Writer) Write(p []byte) (int, error) -``` -Write implements `io.Writer` - - - -### func (\*Writer) WriteByte -``` go -func (w *Writer) WriteByte(b byte) error -``` -WriteByte implements `io.ByteWriter` - - - -### func (\*Writer) WriteString -``` go -func (w *Writer) WriteString(s string) (int, error) -``` -WriteString is analogous to Write, but it takes a string. - - - - - - - - - -- - - -Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) \ No newline at end of file diff --git a/vendor/github.com/philhofer/fwd/writer_appengine.go b/vendor/github.com/philhofer/fwd/writer_appengine.go new file mode 100644 index 0000000000..e367f39317 --- /dev/null +++ b/vendor/github.com/philhofer/fwd/writer_appengine.go @@ -0,0 +1,5 @@ +// +build appengine + +package fwd + +func unsafestr(s string) []byte { return []byte(s) } diff --git a/vendor/github.com/pingcap/go-hbase/README.md b/vendor/github.com/pingcap/go-hbase/README.md deleted file mode 100644 index 1cfc1837fe..0000000000 --- a/vendor/github.com/pingcap/go-hbase/README.md +++ /dev/null @@ -1,14 +0,0 @@ -#go-hbase - -[![Build Status](https://travis-ci.org/pingcap/go-hbase.svg)](https://travis-ci.org/pingcap/go-hbase) - -Derived from [Lazyshot/go-hbase](https://github.com/Lazyshot/go-hbase). Add some new features and fix some bugs. - -## New Features - -1. Coprocessor EndPoint call. -2. Goroutine-safe. -3. Admin commands: Create/Disable/Drop table. -4. Pipelined RPC. - -Support HBase >= 0.98.5 diff --git a/vendor/github.com/pingcap/go-themis/README.md b/vendor/github.com/pingcap/go-themis/README.md deleted file mode 100644 index e7e45684c4..0000000000 --- a/vendor/github.com/pingcap/go-themis/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# go-themis -[![Build Status](https://travis-ci.org/pingcap/go-themis.svg?branch=master)](https://travis-ci.org/pingcap/go-themis) - -go-themis is a Go client for [pingcap/themis](https://github.com/pingcap/themis). - -Themis provides cross-row/cross-table transaction on HBase based on [google's Percolator](http://research.google.com/pubs/pub36726.html). - -go-themis is depends on [pingcap/go-hbase](https://github.com/pingcap/go-hbase). - -Install: - -``` -go get -u github.com/pingcap/go-themis -``` - -Example: - -``` -tx := themis.NewTxn(c, oracles.NewLocalOracle()) -put := hbase.NewPut([]byte("Row1")) -put.AddValue([]byte("cf"), []byte("q"), []byte("value")) - -put2 := hbase.NewPut([]byte("Row2")) -put2.AddValue([]byte("cf"), []byte("q"), []byte("value")) - -tx.Put(tblName, put) -tx.Put(tblName, put2) - -tx.Commit() -``` diff --git a/vendor/github.com/pingcap/tidb/CONTRIBUTING.md b/vendor/github.com/pingcap/tidb/CONTRIBUTING.md deleted file mode 100644 index d8d3b60ecc..0000000000 --- a/vendor/github.com/pingcap/tidb/CONTRIBUTING.md +++ /dev/null @@ -1,65 +0,0 @@ -# How to contribute - -This document outlines some of the conventions on development workflow, commit message formatting, contact points and other -resources to make it easier to get your contribution accepted. - -## Getting started - -- Fork the repository on GitHub. -- Read the README.md for build instructions. -- Play with the project, submit bugs, submit patches! - -## Contribution flow - -This is a rough outline of what a contributor's workflow looks like: - -- Create a topic branch from where you want to base your work. This is usually master. -- Make commits of logical units and add test case if the change fixes a bug or adds new functionality. -- Run tests and make sure all the tests are passed. -- Make sure your commit messages are in the proper format (see below). -- Push your changes to a topic branch in your fork of the repository. -- Submit a pull request to pingcap/tidb. -- Your PR must receive LGTMs from two maintainers found in the [MAINTAINERS](./docs/MAINTAINERS.md) file. - -Thanks for your contributions! - -### Code style - -The coding style suggested by the Golang community is used in TiDB. See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details. - -Please follow this style to make TiDB easy to review, maintain and develop. - -### Format of the Commit Message - -We follow a rough convention for commit messages that is designed to answer two -questions: what changed and why. The subject line should feature the what and -the body of the commit should describe the why. - -``` -store/localstore: add comment for variable declaration. - -Improve documentation. -``` - -The format can be described more formally as follows: - -``` -: - - - -