├── .gitignore ├── vendor ├── golang.org │ └── x │ │ └── sys │ │ ├── unix │ │ ├── .gitignore │ │ ├── asm.s │ │ ├── export_test.go │ │ ├── constants.go │ │ ├── syscall_no_getwd.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── env_unset.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── flock_linux_32bit.go │ │ ├── asm_solaris_amd64.s │ │ ├── gccgo_linux_sparc64.go │ │ ├── gccgo_linux_amd64.go │ │ ├── race0.go │ │ ├── mmap_unix_test.go │ │ ├── syscall_freebsd_test.go │ │ ├── env_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── asm_linux_arm64.s │ │ ├── str.go │ │ ├── race.go │ │ ├── asm_linux_s390x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── bluetooth_linux.go │ │ ├── asm_darwin_arm64.s │ │ ├── asm_linux_mipsx.s │ │ ├── flock.go │ │ ├── mksysnum_darwin.pl │ │ ├── asm_linux_386.s │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_openbsd_386.go │ │ ├── gccgo_c.c │ │ ├── sockcmsg_linux.go │ │ └── mksysnum_dragonfly.pl │ │ ├── codereview.cfg │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── README │ │ ├── plan9 │ │ ├── asm.s │ │ ├── env_unset.go │ │ ├── pwd_go15_plan9.go │ │ ├── pwd_plan9.go │ │ ├── race0.go │ │ ├── mksysnum_plan9.sh │ │ ├── str.go │ │ ├── env_plan9.go │ │ ├── race.go │ │ ├── asm_plan9_386.s │ │ ├── asm_plan9_amd64.s │ │ └── syscall_test.go │ │ ├── windows │ │ ├── svc │ │ │ ├── go12.go │ │ │ ├── example │ │ │ │ └── beep.go │ │ │ ├── go12.c │ │ │ ├── go13.go │ │ │ ├── sys_amd64.s │ │ │ ├── event.go │ │ │ └── debug │ │ │ │ └── service.go │ │ ├── registry │ │ │ ├── mksyscall.go │ │ │ └── export_test.go │ │ ├── mksyscall.go │ │ ├── env_unset.go │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── race0.go │ │ ├── ztypes_windows_386.go │ │ ├── ztypes_windows_amd64.go │ │ ├── str.go │ │ ├── env_windows.go │ │ ├── race.go │ │ ├── eventlog.go │ │ └── syscall_test.go │ │ ├── .gitattributes │ │ └── CONTRIBUTING.md ├── github.com │ ├── Sirupsen │ │ └── logrus │ │ │ ├── .gitignore │ │ │ ├── terminal_appengine.go │ │ │ ├── .travis.yml │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_linux.go │ │ │ ├── hooks │ │ │ ├── syslog │ │ │ │ ├── syslog_test.go │ │ │ │ └── README.md │ │ │ └── test │ │ │ │ └── test_test.go │ │ │ ├── doc.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── examples │ │ │ ├── hook │ │ │ │ └── hook.go │ │ │ └── basic │ │ │ │ └── basic.go │ │ │ ├── terminal_windows.go │ │ │ ├── json_formatter.go │ │ │ ├── LICENSE │ │ │ └── hooks.go │ ├── jinzhu │ │ ├── gorm │ │ │ ├── .gitignore │ │ │ ├── dialects │ │ │ │ ├── mysql │ │ │ │ │ └── mysql.go │ │ │ │ ├── sqlite │ │ │ │ │ └── sqlite.go │ │ │ │ └── postgres │ │ │ │ │ └── postgres.go │ │ │ ├── test_all.sh │ │ │ ├── .codeclimate.yml │ │ │ ├── model.go │ │ │ ├── errors_test.go │ │ │ ├── interface.go │ │ │ ├── search_test.go │ │ │ ├── utils_test.go │ │ │ ├── License │ │ │ └── scope_test.go │ │ └── inflection │ │ │ └── LICENSE │ ├── mattes │ │ └── migrate │ │ │ ├── .gitignore │ │ │ ├── version.go │ │ │ ├── Dockerfile │ │ │ ├── driver │ │ │ ├── bash │ │ │ │ ├── bash_test.go │ │ │ │ ├── README.md │ │ │ │ └── bash.go │ │ │ ├── cassandra │ │ │ │ └── README.md │ │ │ ├── sqlite3 │ │ │ │ └── README.md │ │ │ ├── postgres │ │ │ │ └── README.md │ │ │ ├── mysql │ │ │ │ └── README.md │ │ │ └── registry.go │ │ │ ├── migrate │ │ │ └── direction │ │ │ │ └── direction.go │ │ │ ├── Makefile │ │ │ ├── .travis.yml │ │ │ ├── docker-compose.yml │ │ │ └── LICENSE │ ├── lib │ │ └── pq │ │ │ ├── .gitignore │ │ │ ├── oid │ │ │ └── doc.go │ │ │ ├── certs │ │ │ ├── README │ │ │ ├── postgresql.key │ │ │ └── bogus_root.crt │ │ │ ├── user_posix.go │ │ │ ├── issues_test.go │ │ │ ├── user_windows.go │ │ │ ├── .travis.yml │ │ │ └── LICENSE.md │ ├── fatih │ │ └── color │ │ │ ├── .travis.yml │ │ │ └── LICENSE.md │ ├── pmezard │ │ └── go-difflib │ │ │ └── .travis.yml │ ├── mattn │ │ ├── go-isatty │ │ │ ├── doc.go │ │ │ ├── isatty_appengine.go │ │ │ ├── _example │ │ │ │ └── example.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_solaris.go │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_windows.go │ │ │ ├── README.md │ │ │ └── LICENSE │ │ └── go-colorable │ │ │ ├── .travis.yml │ │ │ ├── _example2 │ │ │ └── main.go │ │ │ ├── _example │ │ │ └── main.go │ │ │ ├── colorable_others.go │ │ │ ├── colorable_test.go │ │ │ ├── README.md │ │ │ └── LICENSE │ ├── stretchr │ │ └── testify │ │ │ ├── http │ │ │ ├── doc.go │ │ │ └── test_round_tripper.go │ │ │ ├── vendor │ │ │ └── github.com │ │ │ │ ├── stretchr │ │ │ │ └── objx │ │ │ │ │ ├── README.md │ │ │ │ │ ├── security.go │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── value.go │ │ │ │ │ ├── constants.go │ │ │ │ │ ├── codegen │ │ │ │ │ ├── array-access.txt │ │ │ │ │ └── types_list.txt │ │ │ │ │ ├── tests.go │ │ │ │ │ └── LICENSE.md │ │ │ │ └── davecgh │ │ │ │ └── go-spew │ │ │ │ └── LICENSE │ │ │ ├── Godeps │ │ │ ├── Readme │ │ │ └── Godeps.json │ │ │ ├── require │ │ │ ├── require_forward.go.tmpl │ │ │ ├── require.go.tmpl │ │ │ ├── requirements.go │ │ │ ├── forward_requirements.go │ │ │ └── doc.go │ │ │ ├── assert │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── errors.go │ │ │ └── forward_assertions.go │ │ │ ├── .travis.yml │ │ │ ├── package_test.go │ │ │ ├── .gitignore │ │ │ ├── doc.go │ │ │ ├── LICENSE │ │ │ └── LICENCE.txt │ ├── go-yaml │ │ └── yaml │ │ │ ├── .travis.yml │ │ │ ├── suite_test.go │ │ │ └── LICENSE │ ├── docopt │ │ └── docopt-go │ │ │ ├── test_golang.docopt │ │ │ ├── .gitignore │ │ │ ├── examples │ │ │ ├── odd_even │ │ │ │ └── odd_even_example.go │ │ │ ├── quick │ │ │ │ └── quick_example.go │ │ │ ├── counted │ │ │ │ └── counted_example.go │ │ │ ├── calculator │ │ │ │ └── calculator_example.go │ │ │ ├── type_assert │ │ │ │ └── type_assert_example.go │ │ │ ├── options_shortcut │ │ │ │ └── options_shortcut_example.go │ │ │ ├── naval_fate │ │ │ │ └── naval_fate.go │ │ │ ├── arguments │ │ │ │ └── arguments_example.go │ │ │ └── git │ │ │ │ ├── remote │ │ │ │ └── git_remote.go │ │ │ │ ├── push │ │ │ │ └── git_push.go │ │ │ │ └── checkout │ │ │ │ └── git_checkout.go │ │ │ ├── .travis.yml │ │ │ ├── example_test.go │ │ │ └── LICENSE │ ├── davecgh │ │ └── go-spew │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── cov_report.sh │ │ │ └── LICENSE │ └── o1egl │ │ └── gormrus │ │ ├── .gitignore │ │ ├── README.md │ │ └── LICENSE └── gopkg.in │ ├── redis.v5 │ ├── .gitignore │ ├── doc.go │ ├── testdata │ │ └── redis.conf │ ├── internal │ │ ├── log.go │ │ ├── proto │ │ │ └── proto_test.go │ │ ├── util.go │ │ └── pool │ │ │ ├── main_test.go │ │ │ └── pool_single.go │ ├── CHANGELOG.md │ ├── .travis.yml │ ├── Makefile │ └── export_test.go │ └── bsm │ └── ratelimit.v1 │ ├── Makefile │ └── .travis.yml ├── account ├── pingrequest.go ├── quitnotification.go ├── authenticationrequest.go ├── accountserver.go ├── charserverdefintion.go ├── config.go ├── charserverstore.go ├── charserverinstance.go ├── charserver.go └── main.go ├── inter ├── helloresponse.go ├── pingrequest.go ├── goodbytenotification.go ├── hellorequest.go ├── servertype.go ├── config.go ├── servertype_string.go ├── main.go └── interclient.go ├── net ├── rpchandler.go ├── handler.go ├── handlerfunc.go ├── packethandler.go └── server.go ├── config ├── inter.yml ├── char.yml ├── account.yml └── database.yml ├── utils ├── ticker.go ├── config.go └── timer.go ├── packets ├── incomingpacket.go ├── outgoingpacket.go ├── definition.go ├── charblockcharacter.go ├── zonenotifyactorinit.go ├── ping.go ├── zoneaid.go ├── charselectchar.go ├── zonenamerequest.go ├── zonenotifyban.go ├── zonenotifytime.go ├── charrefuseenter.go ├── zonerefuseenter.go ├── zonerequesttime.go ├── zonerestartack.go ├── charrefusemakechar.go ├── zonerequestmove.go ├── chardeletechar3cancel.go ├── chardeletechar3reserved.go ├── characceptmakechar.go ├── zoneacknamerequest.go ├── zonenotifyplayermove.go ├── chardeletechar3cancelack.go ├── nullpacket.go ├── secondpasswordlogin.go ├── accountlogin.go ├── chardeletechar3reservedack.go ├── charnotifyzoneserver.go ├── zoneenter.go ├── charenter.go ├── characceptenter.go ├── position2.go ├── charmakechar.go ├── zoneacceptenter.go ├── charslotsinfo.go ├── position.go ├── incomingtypemap.go ├── accountacceptlogin.go ├── zonenotifynewentry.go └── outgoingtypemap.go ├── Dockerfile ├── char ├── config.go ├── accountinterconfig.go └── main.go ├── glide.yaml ├── zone ├── timemanager.go └── main.go ├── .travis.yml ├── database ├── authcookie.go └── config.go ├── rpc └── LICENSE └── docker-compose.yml /.gitignore: -------------------------------------------------------------------------------- 1 | zeus-server 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/.gitignore: -------------------------------------------------------------------------------- 1 | *.rdb 2 | testdata/*/ 3 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/.gitignore: -------------------------------------------------------------------------------- 1 | documents 2 | _book 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | test.db -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /account/pingrequest.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | type PingRequest struct { 4 | } 5 | -------------------------------------------------------------------------------- /inter/helloresponse.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type HelloResponse struct { 4 | } 5 | -------------------------------------------------------------------------------- /inter/pingrequest.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type PingRequest struct { 4 | } 5 | -------------------------------------------------------------------------------- /account/quitnotification.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | type QuitNotification struct { 4 | } 5 | -------------------------------------------------------------------------------- /inter/goodbytenotification.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type GoodbyeNotification struct { 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6 4 | - tip 5 | 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/version.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const Version string = "1.2.0" 4 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | - tip 5 | 6 | -------------------------------------------------------------------------------- /net/rpchandler.go: -------------------------------------------------------------------------------- 1 | package net 2 | 3 | type RpcHandler interface { 4 | OnDisconnect(err error) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package redis implements a Redis client. 3 | */ 4 | package redis 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | ADD migrate /migrate 3 | ENTRYPOINT ["/migrate"] 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /config/inter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | endpoint: :4000 4 | secret: deadbeefsupersecret 5 | packer_version: 20151104 6 | 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/doc.go: -------------------------------------------------------------------------------- 1 | // Package http DEPRECATED USE net/http/httptest 2 | package http 3 | -------------------------------------------------------------------------------- /inter/hellorequest.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type HelloRequest struct { 4 | Secret string 5 | Type ServerType 6 | } 7 | -------------------------------------------------------------------------------- /net/handler.go: -------------------------------------------------------------------------------- 1 | package net 2 | 3 | import "net" 4 | 5 | type Handler interface { 6 | Accept(conn net.Conn) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/dialects/mysql/mysql.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import _ "github.com/go-sql-driver/mysql" 4 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/dialects/sqlite/sqlite.go: -------------------------------------------------------------------------------- 1 | package sqlite 2 | 3 | import _ "github.com/mattn/go-sqlite3" 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /utils/ticker.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "time" 4 | 5 | type Ticker struct { 6 | *time.Ticker 7 | Duration time.Duration 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | 5 | sudo: false 6 | 7 | script: 8 | - go test -v 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/bash/bash_test.go: -------------------------------------------------------------------------------- 1 | package bash 2 | 3 | import "testing" 4 | 5 | func TestMigrate(t *testing.T) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /packets/incomingpacket.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type IncomingPacket interface { 4 | Parse(db *PacketDatabase, d *Definition, r *RawPacket) error 5 | } 6 | -------------------------------------------------------------------------------- /packets/outgoingpacket.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type OutgoingPacket interface { 4 | Write(db *PacketDatabase, d *Definition, r *RawPacket) error 5 | } 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.7 2 | 3 | ADD . /go/src/github.com/zeusproject/zeus-server 4 | 5 | WORKDIR /go/src/github.com/zeusproject/zeus-server 6 | 7 | RUN go build 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/README.md: -------------------------------------------------------------------------------- 1 | # objx 2 | 3 | * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) 4 | -------------------------------------------------------------------------------- /inter/servertype.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type ServerType int 4 | 5 | const ( 6 | _ ServerType = iota 7 | 8 | AccountServer 9 | CharServer 10 | ZoneServer 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-yaml/yaml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - tip 8 | 9 | go_import_path: gopkg.in/yaml.v2 10 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/test_all.sh: -------------------------------------------------------------------------------- 1 | dialects=("postgres" "mysql" "sqlite") 2 | 3 | for dialect in "${dialects[@]}" ; do 4 | GORM_DIALECT=${dialect} go test 5 | done 6 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /packets/definition.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type Definition struct { 4 | Name string 5 | ID uint16 6 | Size int 7 | Parser IncomingPacket 8 | Writer OutgoingPacket 9 | } 10 | -------------------------------------------------------------------------------- /inter/config.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | type Config struct { 4 | Endpoint string `yaml:"endpoint"` 5 | Secret string `yaml:"secret"` 6 | PacketVersion uint32 `yaml:"packet_version"` 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /net/handlerfunc.go: -------------------------------------------------------------------------------- 1 | package net 2 | 3 | import "net" 4 | 5 | type HandlerFn struct { 6 | Fn func(conn net.Conn) 7 | } 8 | 9 | func (h HandlerFn) Accept(conn net.Conn) { 10 | h.Fn(conn) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /account/authenticationrequest.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import "net" 4 | 5 | type AuthenticationRequest struct { 6 | ID string 7 | Key string 8 | 9 | PublicIP net.IP 10 | PublicPort int 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /packets/charblockcharacter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharBlockCharacter struct { 4 | } 5 | 6 | func (r *CharBlockCharacter) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /packets/zonenotifyactorinit.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneNotifyActorInit struct { 4 | } 5 | 6 | func (r *ZoneNotifyActorInit) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/README: -------------------------------------------------------------------------------- 1 | This directory contains certificates and private keys for testing some 2 | SSL-related functionality in Travis. Do NOT use these certificates for 3 | anything other than testing. 4 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/testdata/redis.conf: -------------------------------------------------------------------------------- 1 | # Minimal redis.conf 2 | 3 | port 6379 4 | daemonize no 5 | dir . 6 | save "" 7 | appendonly yes 8 | cluster-config-file nodes.conf 9 | cluster-node-timeout 30000 10 | -------------------------------------------------------------------------------- /char/config.go: -------------------------------------------------------------------------------- 1 | package char 2 | 3 | type Config struct { 4 | Endpoint string `yaml:"endpoint"` 5 | PacketVersion uint32 `yaml:"packet_version"` 6 | 7 | AccountInter AccountInterConfig `yaml:"account_inter"` 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/test_golang.docopt: -------------------------------------------------------------------------------- 1 | r"""usage: prog [NAME_-2]...""" 2 | $ prog 10 20 3 | {"NAME_-2": ["10", "20"]} 4 | 5 | $ prog 10 6 | {"NAME_-2": ["10"]} 7 | 8 | $ prog 9 | {"NAME_-2": []} 10 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | gofmt: 4 | enabled: true 5 | govet: 6 | enabled: true 7 | golint: 8 | enabled: true 9 | ratings: 10 | paths: 11 | - "**.go" 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README: -------------------------------------------------------------------------------- 1 | This repository holds supplemental Go packages for low-level interactions with the operating system. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /account/accountserver.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import "github.com/zeusproject/zeus-server/packets" 4 | 5 | type AccountServer interface { 6 | CharServerStore() CharServerStore 7 | PacketDB() *packets.PacketDatabase 8 | } 9 | -------------------------------------------------------------------------------- /config/char.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | endpoint: :7000 4 | packet_version: 20151104 5 | 6 | account_inter: 7 | endpoint: account:6901 8 | id: test 9 | key: test 10 | public_ip: 127.0.0.1 11 | public_port: 7000 12 | 13 | -------------------------------------------------------------------------------- /account/charserverdefintion.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | type CharServerDefinition struct { 4 | ID string `yaml:"id"` 5 | Key string `yaml:"key"` 6 | Name string `yaml:"name"` 7 | Enabled bool `yaml:"enabled"` 8 | } 9 | -------------------------------------------------------------------------------- /config/account.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | endpoint: :6900 4 | inter_endpoint: :6901 5 | 6 | packet_version: 20151104 7 | 8 | char_servers: 9 | - id: test 10 | key: test 11 | name: Test Server 12 | enabled: true 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/zeusproject/zeus-server 2 | import: 3 | - package: github.com/Sirupsen/logrus 4 | version: ^0.11.0 5 | - package: github.com/docopt/docopt-go 6 | version: ^0.6.2 7 | - package: github.com/go-yaml/yaml 8 | -------------------------------------------------------------------------------- /net/packethandler.go: -------------------------------------------------------------------------------- 1 | package net 2 | 3 | import "github.com/zeusproject/zeus-server/packets" 4 | 5 | type PacketHandler interface { 6 | HandlePacket(d *packets.Definition, p packets.IncomingPacket) 7 | OnDisconnect(err error) 8 | } 9 | -------------------------------------------------------------------------------- /packets/ping.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type Ping struct { 4 | AccountID uint32 5 | } 6 | 7 | func (r *Ping) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.AccountID) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-yaml/yaml/suite_test.go: -------------------------------------------------------------------------------- 1 | package yaml_test 2 | 3 | import ( 4 | . "gopkg.in/check.v1" 5 | "testing" 6 | ) 7 | 8 | func Test(t *testing.T) { TestingT(t) } 9 | 10 | type S struct{} 11 | 12 | var _ = Suite(&S{}) 13 | -------------------------------------------------------------------------------- /packets/zoneaid.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneAid struct { 4 | AccountID uint32 5 | } 6 | 7 | func (r *ZoneAid) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.AccountID) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - tip 8 | install: 9 | - go get -t ./... 10 | script: GOMAXPROCS=4 GORACE="halt_on_error=1" go test -race -v ./... 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.1 7 | - 1.2 8 | - 1.3 9 | - 1.4 10 | - 1.5 11 | - 1.6 12 | - 1.7 13 | - tip 14 | 15 | script: 16 | - go test -v ./... 17 | -------------------------------------------------------------------------------- /packets/charselectchar.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharSelectChar struct { 4 | Slot byte 5 | } 6 | 7 | func (r *CharSelectChar) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.Slot) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonenamerequest.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneNameRequest struct { 4 | ID uint32 5 | } 6 | 7 | func (r *ZoneNameRequest) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.ID) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonenotifyban.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneNotifyBan struct { 4 | Reason byte 5 | } 6 | 7 | func (r *ZoneNotifyBan) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.Reason) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonenotifytime.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneNotifyTime struct { 4 | Tick uint32 5 | } 6 | 7 | func (r *ZoneNotifyTime) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.Tick) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/charrefuseenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharRefuseEnter struct { 4 | Reason byte 5 | } 6 | 7 | func (r *CharRefuseEnter) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.Reason) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonerefuseenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneRefuseEnter struct { 4 | Reason byte 5 | } 6 | 7 | func (r *ZoneRefuseEnter) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.Reason) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonerequesttime.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneRequestTime struct { 4 | Tick uint32 5 | } 6 | 7 | func (r *ZoneRequestTime) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.Tick) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonerestartack.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneRestartAck struct { 4 | Reason byte 5 | } 6 | 7 | func (r *ZoneRestartAck) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.Reason) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | redis: 4 | address: redis:6379 5 | database: 0 6 | 7 | postgres: 8 | host: postgres 9 | port: 5432 10 | user: postgres 11 | password: zeus 12 | database: postgres 13 | options: 14 | sslmode: disable 15 | 16 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /packets/charrefusemakechar.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharRefuseMakeChar struct { 4 | ErrorCode byte 5 | } 6 | 7 | func (r *CharRefuseMakeChar) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Write(r.ErrorCode) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/zonerequestmove.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneRequestMove struct { 4 | Position Position 5 | } 6 | 7 | func (r *ZoneRequestMove) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | r.Position.Parse(db, d, p) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/migrate/direction/direction.go: -------------------------------------------------------------------------------- 1 | // Package direction just holds convenience constants for Up and Down migrations. 2 | package direction 3 | 4 | type Direction int 5 | 6 | const ( 7 | Up Direction = +1 8 | Down = -1 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·use(SB),NOSPLIT,$0 8 | RET 9 | -------------------------------------------------------------------------------- /packets/chardeletechar3cancel.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharDeleteChar3Cancel struct { 4 | CharID uint 5 | } 6 | 7 | func (r *CharDeleteChar3Cancel) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.CharID) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /packets/chardeletechar3reserved.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharDeleteChar3Reserved struct { 4 | CharID uint 5 | } 6 | 7 | func (r *CharDeleteChar3Reserved) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | p.Read(&r.CharID) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /account/config.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | type Config struct { 4 | Endpoint string `yaml:"endpoint"` 5 | InterEndpoint string `yaml:"inter_endpoint"` 6 | PacketVersion uint32 `yaml:"packet_version"` 7 | 8 | CharServers []*CharServerDefinition `yaml:"char_servers"` 9 | } 10 | -------------------------------------------------------------------------------- /packets/characceptmakechar.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharAcceptMakeChar struct { 4 | CharInfo *CharacterInfo 5 | } 6 | 7 | func (r *CharAcceptMakeChar) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | r.CharInfo.Write(db, d, p) 9 | 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/package_test.go: -------------------------------------------------------------------------------- 1 | package testify 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestImports(t *testing.T) { 9 | if assert.Equal(t, 1, 1) != true { 10 | t.Error("Something is wrong.") 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /char/accountinterconfig.go: -------------------------------------------------------------------------------- 1 | package char 2 | 3 | type AccountInterConfig struct { 4 | Endpoint string `yaml:"endpoint"` 5 | ID string `yaml:"id"` 6 | Key string `yaml:"key"` 7 | PublicIP string `yaml:"public_ip"` 8 | PublicPort int `yaml:"public_port"` 9 | } 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/internal/log.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | ) 7 | 8 | var Logger *log.Logger 9 | 10 | func Logf(s string, args ...interface{}) { 11 | if Logger == nil { 12 | return 13 | } 14 | Logger.Output(2, fmt.Sprintf(s, args...)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/internal/proto/proto_test.go: -------------------------------------------------------------------------------- 1 | package proto_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestGinkgoSuite(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "proto") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /account/charserverstore.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | type CharServerStore interface { 4 | Servers() ([]*CharServer, error) 5 | RegisterInstance(id string, instance *CharServerInstance) error 6 | UpdateOnlineCount(id string, count int) error 7 | DeregisterInstance(id string, instance *CharServerInstance) error 8 | } 9 | -------------------------------------------------------------------------------- /packets/zoneacknamerequest.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneAckNameRequest struct { 4 | ID uint32 5 | Name string 6 | } 7 | 8 | func (r *ZoneAckNameRequest) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 9 | p.Write(r.ID) 10 | p.WriteString(24, r.Name) 11 | 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/_example/example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/mattn/go-isatty" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | if isatty.IsTerminal(os.Stdout.Fd()) { 11 | fmt.Println("Is Terminal") 12 | } else { 13 | fmt.Println("Is Not Terminal") 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /account/charserverinstance.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import "net" 4 | 5 | type CharServerInstance struct { 6 | PublicIP net.IP 7 | PublicPort int 8 | } 9 | 10 | func (i *CharServerInstance) Equal(other *CharServerInstance) bool { 11 | return i.PublicIP.Equal(other.PublicIP) && i.PublicPort == other.PublicPort 12 | } 13 | -------------------------------------------------------------------------------- /packets/zonenotifyplayermove.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneNotifyPlayerMove struct { 4 | Tick uint32 5 | Position Position2 6 | } 7 | 8 | func (r *ZoneNotifyPlayerMove) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 9 | p.Write(r.Tick) 10 | r.Position.Write(db, d, p) 11 | 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/bash/README.md: -------------------------------------------------------------------------------- 1 | # Bash Driver 2 | 3 | * Runs bash scripts. What you do in the scripts is up to you. 4 | 5 | ## Usage 6 | 7 | ```bash 8 | migrate -url bash://xxx -path ./migrations create increment_xyz 9 | migrate -url bash://xxx -path ./migrations up 10 | migrate help # for more info 11 | ``` -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # v5 2 | 3 | - *Important*. ClusterClient and Ring now chose random node/shard when command does not have any keys or command info is not fully available. Also clients use EVAL and EVALSHA keys to pick the right node. 4 | - Tx is refactored using Pipeline API so it implements Cmdable interface. 5 | -------------------------------------------------------------------------------- /packets/chardeletechar3cancelack.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharDeleteChar3CancelAck struct { 4 | CharID uint 5 | Result int 6 | } 7 | 8 | func (r *CharDeleteChar3CancelAck) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 9 | p.Write(uint32(r.CharID)) 10 | p.Write(r.Result) 11 | 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | var Itoa = itoa 10 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bsm/ratelimit.v1/Makefile: -------------------------------------------------------------------------------- 1 | default: test 2 | 3 | testdeps: 4 | @go get github.com/onsi/ginkgo 5 | @go get github.com/onsi/gomega 6 | 7 | test: testdeps 8 | @go test ./... 9 | 10 | testrace: testdeps 11 | @go test ./... -race 12 | 13 | testall: test testrace 14 | 15 | bench: 16 | @go test ./... -run=NONE -bench=. 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build !go1.3 7 | 8 | package svc 9 | 10 | // from go12.c 11 | func getServiceMain(r *uintptr) 12 | -------------------------------------------------------------------------------- /packets/nullpacket.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type NullPacket struct { 4 | Raw *RawPacket 5 | } 6 | 7 | func (r *NullPacket) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 8 | r.Raw = p 9 | return nil 10 | } 11 | 12 | func (r *NullPacket) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package registry 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall.go 8 | -------------------------------------------------------------------------------- /utils/config.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "github.com/go-yaml/yaml" 5 | "io/ioutil" 6 | "path" 7 | ) 8 | 9 | func LoadConfig(name string, config interface{}) error { 10 | file, err := ioutil.ReadFile(path.Join("./config", name+".yml")) 11 | 12 | if err != nil { 13 | return err 14 | } 15 | 16 | return yaml.Unmarshal(file, config) 17 | } 18 | -------------------------------------------------------------------------------- /zone/timemanager.go: -------------------------------------------------------------------------------- 1 | package zone 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type TimeManager struct { 8 | start time.Time 9 | } 10 | 11 | func NewTimeManager() *TimeManager { 12 | return &TimeManager{ 13 | start: time.Now(), 14 | } 15 | } 16 | 17 | func (t *TimeManager) GetTick() uint32 { 18 | return uint32(time.Now().Sub(t.start).Seconds()) 19 | } 20 | -------------------------------------------------------------------------------- /utils/timer.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "time" 4 | 5 | type Timer struct { 6 | *time.Timer 7 | Duration time.Duration 8 | 9 | bag *TimerBag 10 | prev, next *Timer 11 | } 12 | 13 | func (t *Timer) Reset() { 14 | t.Timer.Stop() 15 | t.Timer.Reset(t.Duration) 16 | } 17 | 18 | func (t *Timer) Close() { 19 | t.Stop() 20 | t.bag.remove(t) 21 | } 22 | -------------------------------------------------------------------------------- /packets/secondpasswordlogin.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharSecondPasswordLogin struct { 4 | Seed uint32 5 | AccountID uint32 6 | Result uint16 7 | } 8 | 9 | func (r *CharSecondPasswordLogin) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 10 | p.Write(r.Seed) 11 | p.Write(r.AccountID) 12 | p.Write(r.Result) 13 | 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/_example2/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | 7 | "github.com/mattn/go-colorable" 8 | ) 9 | 10 | func main() { 11 | stdOut := bufio.NewWriter(colorable.NewColorableStdout()) 12 | 13 | fmt.Fprint(stdOut, "\x1B[3GMove to 3rd Column\n") 14 | fmt.Fprint(stdOut, "\x1B[1;2HMove to 2nd Column on 1st Line\n") 15 | stdOut.Flush() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security 9 | // key. 10 | func HashWithKey(data, key string) string { 11 | hash := sha1.New() 12 | hash.Write([]byte(data + ":" + key)) 13 | return hex.EncodeToString(hash.Sum(nil)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package plan9 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package registry 8 | 9 | func (k Key) SetValue(name string, valtype uint32, data []byte) error { 10 | return k.setValue(name, valtype, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bsm/ratelimit.v1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | script: make testall 3 | sudo: false 4 | go: 5 | - 1.5 6 | - 1.4 7 | - 1.3 8 | - 1.2 9 | install: 10 | - go get github.com/onsi/ginkgo github.com/onsi/gomega 11 | - mkdir -p $GOPATH/src/gopkg.in/bsm 12 | - mv $GOPATH/src/github.com/bsm/ratelimit $GOPATH/src/gopkg.in/bsm/ratelimit.v1 13 | - cd $GOPATH/src/gopkg.in/bsm/ratelimit.v1 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/o1egl/gormrus/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /account/charserver.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import "math/rand" 4 | 5 | type CharServer struct { 6 | *CharServerDefinition 7 | 8 | OnlinePlayers int 9 | Instances []*CharServerInstance 10 | } 11 | 12 | func (cs *CharServer) RandomInstance() *CharServerInstance { 13 | if len(cs.Instances) == 0 { 14 | return nil 15 | } 16 | 17 | i := rand.Int() % len(cs.Instances) 18 | 19 | return cs.Instances[i] 20 | } 21 | -------------------------------------------------------------------------------- /packets/accountlogin.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type AccountLogin struct { 4 | Version uint32 5 | Username string 6 | Password string 7 | ClientType byte 8 | } 9 | 10 | func (r *AccountLogin) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 11 | p.Read(&r.Version) 12 | p.ReadString(24, &r.Username) 13 | p.ReadString(24, &r.Password) 14 | p.Read(&r.ClientType) 15 | 16 | return nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /packets/chardeletechar3reservedack.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharDeleteChar3ReservedAck struct { 4 | CharID uint 5 | Result int 6 | DeleteReservedDate uint32 7 | } 8 | 9 | func (r *CharDeleteChar3ReservedAck) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 10 | p.Write(uint32(r.CharID)) 11 | p.Write(r.Result) 12 | p.Write(r.DeleteReservedDate) 13 | 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/value.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Value provides methods for extracting interface{} data in various 4 | // types. 5 | type Value struct { 6 | // data contains the raw data being managed by this Value 7 | data interface{} 8 | } 9 | 10 | // Data returns the raw data contained by this Value 11 | func (v *Value) Data() interface{} { 12 | return v.data 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | # coverage droppings 25 | profile.cov 26 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/odd_even/odd_even_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Usage: odd_even_example [-h | --help] (ODD EVEN)... 10 | 11 | Example, try: 12 | odd_even_example 1 2 3 4 13 | 14 | Options: 15 | -h, --help` 16 | 17 | arguments, _ := docopt.Parse(usage, nil, true, "", false) 18 | fmt.Println(arguments) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/model.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "time" 4 | 5 | // Model base model definition, including fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`, which could be embedded in your models 6 | // type User struct { 7 | // gorm.Model 8 | // } 9 | type Model struct { 10 | ID uint `gorm:"primary_key"` 11 | CreatedAt time.Time 12 | UpdatedAt time.Time 13 | DeletedAt *time.Time `sql:"index"` 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/_example/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "github.com/mattn/go-colorable" 6 | ) 7 | 8 | func main() { 9 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 10 | logrus.SetOutput(colorable.NewColorableStdout()) 11 | 12 | logrus.Info("succeeded") 13 | logrus.Warn("not correct") 14 | logrus.Error("something error") 15 | logrus.Fatal("panic") 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/constants.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | const ( 4 | // PathSeparator is the character used to separate the elements 5 | // of the keypath. 6 | // 7 | // For example, `location.address.city` 8 | PathSeparator string = "." 9 | 10 | // SignatureSeparator is the character that is used to 11 | // separate the Base64 string from the security signature. 12 | SignatureSeparator = "_" 13 | ) 14 | -------------------------------------------------------------------------------- /packets/charnotifyzoneserver.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | import "net" 4 | 5 | type CharNotifyZoneServer struct { 6 | CharID uint 7 | MapName string 8 | Address net.IP 9 | Port uint16 10 | } 11 | 12 | func (r *CharNotifyZoneServer) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 13 | p.Write(uint32(r.CharID)) 14 | p.WriteString(16, r.MapName) 15 | p.Write(r.Address.To4()) 16 | p.Write(uint16(r.Port)) 17 | 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE=mattes/migrate 2 | DCR=docker-compose run --rm 3 | .PHONY: clean test build release docker-build docker-push run 4 | 5 | all: release 6 | 7 | clean: 8 | rm -f migrate 9 | 10 | test: 11 | $(DCR) go-test 12 | 13 | build: 14 | $(DCR) go-build 15 | 16 | release: test build docker-build docker-push 17 | 18 | docker-build: 19 | docker build --rm -t $(IMAGE) . 20 | 21 | docker-push: 22 | docker push $(IMAGE) 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /packets/zoneenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneEnter struct { 4 | AccountID uint32 5 | CharID uint32 6 | AuthenticationCode uint32 7 | Tick uint32 8 | Sex bool 9 | } 10 | 11 | func (r *ZoneEnter) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 12 | p.Read(&r.AccountID) 13 | p.Read(&r.CharID) 14 | p.Read(&r.AuthenticationCode) 15 | p.Read(&r.Tick) 16 | p.Read(&r.Sex) 17 | 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/quick/quick_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Usage: 10 | quick_example tcp [--timeout=] 11 | quick_example serial [--baud=9600] [--timeout=] 12 | quick_example -h | --help | --version` 13 | 14 | arguments, _ := docopt.Parse(usage, nil, true, "0.1.1rc", false) 15 | fmt.Println(arguments) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | services: 5 | - redis-server 6 | 7 | go: 8 | - 1.4 9 | - 1.6 10 | - 1.7 11 | - tip 12 | 13 | matrix: 14 | allow_failures: 15 | - go: 1.4 16 | - go: tip 17 | 18 | install: 19 | - go get gopkg.in/bsm/ratelimit.v1 20 | - go get github.com/onsi/ginkgo 21 | - go get github.com/onsi/gomega 22 | - mkdir -p $HOME/gopath/src/gopkg.in 23 | - mv `pwd` $HOME/gopath/src/gopkg.in/redis.v5 24 | -------------------------------------------------------------------------------- /packets/charenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharEnter struct { 4 | AccountID uint32 5 | AuthenticationCode uint32 6 | UserLevel uint32 7 | ClientType uint16 8 | Sex byte 9 | } 10 | 11 | func (r *CharEnter) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 12 | p.Read(&r.AccountID) 13 | p.Read(&r.AuthenticationCode) 14 | p.Read(&r.UserLevel) 15 | p.Read(&r.ClientType) 16 | p.Read(&r.Sex) 17 | 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5.4 4 | - 1.6.3 5 | - 1.7 6 | install: 7 | - go get -v golang.org/x/tools/cmd/cover 8 | script: 9 | - go test -v -tags=safe ./spew 10 | - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov 11 | after_success: 12 | - go get -v github.com/mattn/goveralls 13 | - export PATH=$PATH:$HOME/gopath/bin 14 | - goveralls -coverprofile=profile.cov -service=travis-ci 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/cassandra/README.md: -------------------------------------------------------------------------------- 1 | # Cassandra Driver 2 | 3 | ## Usage 4 | 5 | ```bash 6 | migrate -url cassandra://host:port/keyspace -path ./db/migrations create add_field_to_table 7 | migrate -url cassandra://host:port/keyspace -path ./db/migrations up 8 | migrate help # for more info 9 | ``` 10 | 11 | ## Authors 12 | 13 | * Paul Bergeron, https://github.com/dinedal 14 | * Johnny Bergström, https://github.com/balboah 15 | * pateld982, http://github.com/pateld982 -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/array-access.txt: -------------------------------------------------------------------------------- 1 | case []{1}: 2 | a := object.([]{1}) 3 | if isSet { 4 | a[index] = value.({1}) 5 | } else { 6 | if index >= len(a) { 7 | if panics { 8 | panic(fmt.Sprintf("objx: Index %d is out of range because the []{1} only contains %d items.", index, len(a))) 9 | } 10 | return nil 11 | } else { 12 | return a[index] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: required 3 | 4 | go: 5 | - 1.4 6 | - 1.5 7 | 8 | services: 9 | - docker 10 | 11 | before_install: 12 | - curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` > docker-compose 13 | - chmod +x docker-compose 14 | - sudo mv docker-compose /usr/local/bin 15 | - sed -i -e 's/golang/golang:'"$TRAVIS_GO_VERSION"'/' docker-compose.yml 16 | 17 | script: make test 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/test_round_tripper.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "github.com/stretchr/testify/mock" 5 | "net/http" 6 | ) 7 | 8 | // TestRoundTripper DEPRECATED USE net/http/httptest 9 | type TestRoundTripper struct { 10 | mock.Mock 11 | } 12 | 13 | // RoundTrip DEPRECATED USE net/http/httptest 14 | func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { 15 | args := t.Called(req) 16 | return args.Get(0).(*http.Response), args.Error(1) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package plan9 8 | 9 | import "syscall" 10 | 11 | func fixwd() { 12 | syscall.Fixwd() 13 | } 14 | 15 | func Getwd() (wd string, err error) { 16 | return syscall.Getwd() 17 | } 18 | 19 | func Chdir(path string) error { 20 | return syscall.Chdir(path) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/errors_test.go: -------------------------------------------------------------------------------- 1 | package gorm_test 2 | 3 | import ( 4 | "errors" 5 | "testing" 6 | 7 | "github.com/jinzhu/gorm" 8 | ) 9 | 10 | func TestErrorsCanBeUsedOutsideGorm(t *testing.T) { 11 | errs := []error{errors.New("First"), errors.New("Second")} 12 | 13 | gErrs := gorm.Errors(errs) 14 | gErrs = gErrs.Add(errors.New("Third")) 15 | gErrs = gErrs.Add(gErrs) 16 | 17 | if gErrs.Error() != "First; Second; Third" { 18 | t.Fatalf("Gave wrong error, got %s", gErrs.Error()) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/interface.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "database/sql" 4 | 5 | type sqlCommon interface { 6 | Exec(query string, args ...interface{}) (sql.Result, error) 7 | Prepare(query string) (*sql.Stmt, error) 8 | Query(query string, args ...interface{}) (*sql.Rows, error) 9 | QueryRow(query string, args ...interface{}) *sql.Row 10 | } 11 | 12 | type sqlDb interface { 13 | Begin() (*sql.Tx, error) 14 | } 15 | 16 | type sqlTx interface { 17 | Commit() error 18 | Rollback() error 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | sudo: true 4 | language: generic 5 | 6 | services: 7 | - docker 8 | 9 | env: 10 | global: 11 | - DOCKER_COMPOSE_VERSION=1.9.0-rc3 12 | 13 | before_install: 14 | - sudo rm /usr/local/bin/docker-compose 15 | - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose 16 | - chmod +x docker-compose 17 | - sudo mv docker-compose /usr/local/bin 18 | 19 | script: 20 | - docker-compose run test 21 | 22 | -------------------------------------------------------------------------------- /inter/servertype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ServerType"; DO NOT EDIT 2 | 3 | package inter 4 | 5 | import "fmt" 6 | 7 | const _ServerType_name = "AccountServerCharServerZoneServer" 8 | 9 | var _ServerType_index = [...]uint8{0, 13, 23, 33} 10 | 11 | func (i ServerType) String() string { 12 | i -= 1 13 | if i < 0 || i >= ServerType(len(_ServerType_index)-1) { 14 | return fmt.Sprintf("ServerType(%d)", i+1) 15 | } 16 | return _ServerType_name[_ServerType_index[i]:_ServerType_index[i+1]] 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/internal/util.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | func ToLower(s string) string { 4 | if isLower(s) { 5 | return s 6 | } 7 | 8 | b := make([]byte, len(s)) 9 | for i := range b { 10 | c := s[i] 11 | if c >= 'A' && c <= 'Z' { 12 | c += 'a' - 'A' 13 | } 14 | b[i] = c 15 | } 16 | return string(b) 17 | } 18 | 19 | func isLower(s string) bool { 20 | for i := 0; i < len(s); i++ { 21 | c := s[i] 22 | if c >= 'A' && c <= 'Z' { 23 | return false 24 | } 25 | } 26 | return true 27 | } 28 | -------------------------------------------------------------------------------- /zone/main.go: -------------------------------------------------------------------------------- 1 | package zone 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func Run(args map[string]interface{}) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | 13 | l := NewServer() 14 | 15 | sig := make(chan os.Signal) 16 | signal.Notify(sig, syscall.SIGINT) 17 | 18 | err := l.Run() 19 | 20 | if err != nil { 21 | return 22 | } 23 | 24 | for s := range sig { 25 | if s == syscall.SIGINT { 26 | l.Close() 27 | os.Exit(0) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/Makefile: -------------------------------------------------------------------------------- 1 | all: testdeps 2 | go test ./... 3 | go test ./... -short -race 4 | go vet 5 | 6 | testdeps: testdata/redis/src/redis-server 7 | 8 | bench: testdeps 9 | go test ./... -test.run=NONE -test.bench=. -test.benchmem 10 | 11 | .PHONY: all test testdeps bench 12 | 13 | testdata/redis: 14 | mkdir -p $@ 15 | wget -qO- https://github.com/antirez/redis/archive/unstable.tar.gz | tar xvz --strip-components=1 -C $@ 16 | 17 | testdata/redis/src/redis-server: testdata/redis 18 | cd $< && make all 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /packets/characceptenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharAcceptEnter struct { 4 | TotalSlotCount byte 5 | PremiumSlotStart byte 6 | PremiumSlotEnd byte 7 | Chars []*CharacterInfo 8 | } 9 | 10 | func (r *CharAcceptEnter) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 11 | p.Grow(23) 12 | 13 | p.Write(r.TotalSlotCount) 14 | p.Write(r.PremiumSlotStart) 15 | p.Write(r.PremiumSlotEnd) 16 | p.Skip(20) 17 | 18 | for _, ch := range r.Chars { 19 | ch.Write(db, d, p) 20 | } 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /packets/position2.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type Position2 struct { 4 | X0 uint16 5 | Y0 uint16 6 | X1 uint16 7 | Y1 uint16 8 | SX uint16 9 | SY uint16 10 | } 11 | 12 | func (r *Position2) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 13 | p.Write([]byte{ 14 | byte(r.X0 >> 2), 15 | byte((r.X0 << 6) | ((r.Y0 >> 4) & 0x3f)), 16 | byte((r.Y0 << 4) | ((r.X1 >> 6) & 0x0f)), 17 | byte((r.X1 << 2) | ((r.Y1 >> 8) & 0x03)), 18 | byte(r.Y1), 19 | byte((r.SX << 4) | (r.SY & 0x0f)), 20 | }) 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/pwd_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package plan9 8 | 9 | func fixwd() { 10 | } 11 | 12 | func Getwd() (wd string, err error) { 13 | fd, err := open(".", O_RDONLY) 14 | if err != nil { 15 | return "", err 16 | } 17 | defer Close(fd) 18 | return Fd2path(fd) 19 | } 20 | 21 | func Chdir(path string) error { 22 | return chdir(path) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /char/main.go: -------------------------------------------------------------------------------- 1 | package char 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func Run(args map[string]interface{}) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | 13 | l := NewServer() 14 | 15 | sig := make(chan os.Signal) 16 | signal.Notify(sig, syscall.SIGINT) 17 | 18 | err := l.Run() 19 | 20 | if err != nil { 21 | logrus.WithError(err).Fatal("error starting server") 22 | return 23 | } 24 | 25 | for s := range sig { 26 | if s == syscall.SIGINT { 27 | l.Close() 28 | os.Exit(0) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packets/charmakechar.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharMakeChar struct { 4 | Name string 5 | Slot byte 6 | HairColor uint16 7 | HairStyle uint16 8 | StartingJobID uint16 9 | Unknown uint16 // or [2]byte 10 | Sex byte 11 | } 12 | 13 | func (r *CharMakeChar) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 14 | p.ReadString(24, &r.Name) 15 | p.Read(&r.Slot) 16 | p.Read(&r.HairColor) 17 | p.Read(&r.HairStyle) 18 | p.Read(&r.StartingJobID) 19 | p.Read(&r.Unknown) 20 | p.Read(&r.Sex) 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | isatty for golang 4 | 5 | ## Usage 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "fmt" 12 | "github.com/mattn/go-isatty" 13 | "os" 14 | ) 15 | 16 | func main() { 17 | if isatty.IsTerminal(os.Stdout.Fd()) { 18 | fmt.Println("Is Terminal") 19 | } else { 20 | fmt.Println("Is Not Terminal") 21 | } 22 | } 23 | ``` 24 | 25 | ## Installation 26 | 27 | ``` 28 | $ go get github.com/mattn/go-isatty 29 | ``` 30 | 31 | # License 32 | 33 | MIT 34 | 35 | # Author 36 | 37 | Yasuhiro Matsumoto (a.k.a mattn) 38 | -------------------------------------------------------------------------------- /inter/main.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func Run(args map[string]interface{}) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | 13 | l := NewServer() 14 | 15 | sig := make(chan os.Signal) 16 | signal.Notify(sig, syscall.SIGINT) 17 | 18 | err := l.Run() 19 | 20 | if err != nil { 21 | logrus.WithError(err).Fatal("error starting server") 22 | return 23 | } 24 | 25 | for s := range sig { 26 | if s == syscall.SIGINT { 27 | l.Close() 28 | os.Exit(0) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /account/main.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func Run(args map[string]interface{}) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | 13 | l := NewServer() 14 | 15 | sig := make(chan os.Signal) 16 | signal.Notify(sig, syscall.SIGINT) 17 | 18 | err := l.Run() 19 | 20 | if err != nil { 21 | logrus.WithError(err).Fatal("error starting server") 22 | return 23 | } 24 | 25 | for s := range sig { 26 | if s == syscall.SIGINT { 27 | l.Close() 28 | os.Exit(0) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packets/zoneacceptenter.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type ZoneAcceptEnter struct { 4 | Tick uint32 5 | Position Position 6 | XSize byte 7 | YSize byte 8 | Font uint16 9 | Sex bool 10 | } 11 | 12 | func (r *ZoneAcceptEnter) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 13 | p.Write(uint32(r.Tick)) 14 | 15 | r.Position.Write(db, d, p) 16 | 17 | p.Write(byte(r.XSize)) 18 | p.Write(byte(r.YSize)) 19 | p.Write(uint16(r.Font)) 20 | 21 | if r.Sex { 22 | p.Write(byte(1)) 23 | } else { 24 | p.Write(byte(0)) 25 | } 26 | 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/issues_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import "testing" 4 | 5 | func TestIssue494(t *testing.T) { 6 | db := openTestConn(t) 7 | defer db.Close() 8 | 9 | query := `CREATE TEMP TABLE t (i INT PRIMARY KEY)` 10 | if _, err := db.Exec(query); err != nil { 11 | t.Fatal(err) 12 | } 13 | 14 | txn, err := db.Begin() 15 | if err != nil { 16 | t.Fatal(err) 17 | } 18 | 19 | if _, err := txn.Prepare(CopyIn("t", "i")); err != nil { 20 | t.Fatal(err) 21 | } 22 | 23 | if _, err := txn.Query("SELECT 1"); err == nil { 24 | t.Fatal("expected error") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build plan9,!race 6 | 7 | package plan9 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | COMMAND="mksysnum_plan9.sh $@" 7 | 8 | cat <= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.c: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build !go1.3 7 | 8 | // copied from pkg/runtime 9 | typedef unsigned int uint32; 10 | typedef unsigned long long int uint64; 11 | #ifdef _64BIT 12 | typedef uint64 uintptr; 13 | #else 14 | typedef uint32 uintptr; 15 | #endif 16 | 17 | // from sys_386.s or sys_amd64.s 18 | void ·servicemain(void); 19 | 20 | void 21 | ·getServiceMain(uintptr *r) 22 | { 23 | *r = (uintptr)·servicemain; 24 | } 25 | -------------------------------------------------------------------------------- /packets/charslotsinfo.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type CharSlotsInfo struct { 4 | NormalSlots byte 5 | PremiumSlots byte 6 | BillingSlots byte 7 | ProducibleSlots byte 8 | ValidSlots byte 9 | Chars []*CharacterInfo 10 | } 11 | 12 | func (r *CharSlotsInfo) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 13 | p.Grow(25) 14 | 15 | p.Write(r.NormalSlots) 16 | p.Write(r.PremiumSlots) 17 | p.Write(r.BillingSlots) 18 | p.Write(r.ProducibleSlots) 19 | p.Write(r.ValidSlots) 20 | p.Skip(20) 21 | 22 | for _, ch := range r.Chars { 23 | ch.Write(db, d, p) 24 | } 25 | 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-yaml/yaml/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Plan 9 environment variables. 6 | 7 | package plan9 8 | 9 | import ( 10 | "syscall" 11 | ) 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/counted/counted_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Usage: counted_example --help 10 | counted_example -v... 11 | counted_example go [go] 12 | counted_example (--path=)... 13 | counted_example 14 | 15 | Try: counted_example -vvvvvvvvvv 16 | counted_example go go 17 | counted_example --path ./here --path ./there 18 | counted_example this.txt that.txt` 19 | 20 | arguments, _ := docopt.Parse(usage, nil, true, "", false) 21 | fmt.Println(arguments) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Godeps.json: -------------------------------------------------------------------------------- 1 | { 2 | "ImportPath": "github.com/stretchr/testify", 3 | "GoVersion": "go1.5", 4 | "GodepVersion": "v74", 5 | "Packages": [ 6 | "./..." 7 | ], 8 | "Deps": [ 9 | { 10 | "ImportPath": "github.com/davecgh/go-spew/spew", 11 | "Comment": "v1.0.0-3-g6d21280", 12 | "Rev": "04cdfd42973bb9c8589fd6a731800cf222fde1a9" 13 | }, 14 | { 15 | "ImportPath": "github.com/pmezard/go-difflib/difflib", 16 | "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" 17 | }, 18 | { 19 | "ImportPath": "github.com/stretchr/objx", 20 | "Rev": "cbeaeb16a013161a98496fad62933b1d21786672" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/docker-compose.yml: -------------------------------------------------------------------------------- 1 | go: &go 2 | image: golang 3 | working_dir: /go/src/github.com/mattes/migrate 4 | volumes: 5 | - $GOPATH:/go 6 | go-test: 7 | <<: *go 8 | command: sh -c 'go get -t -v ./... && go test -v ./...' 9 | links: 10 | - postgres 11 | - mysql 12 | - cassandra 13 | go-build: 14 | <<: *go 15 | command: sh -c 'go get -v && go build -ldflags ''-s'' -o migrater' 16 | environment: 17 | CGO_ENABLED: 1 18 | postgres: 19 | image: postgres 20 | mysql: 21 | image: mysql 22 | environment: 23 | MYSQL_DATABASE: migratetest 24 | MYSQL_ALLOW_EMPTY_PASSWORD: yes 25 | cassandra: 26 | image: cassandra:2.2 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_unix_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix_test 8 | 9 | import ( 10 | "testing" 11 | 12 | "golang.org/x/sys/unix" 13 | ) 14 | 15 | func TestMmap(t *testing.T) { 16 | b, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE) 17 | if err != nil { 18 | t.Fatalf("Mmap: %v", err) 19 | } 20 | if err := unix.Munmap(b); err != nil { 21 | t.Fatalf("Munmap: %v", err) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd 6 | 7 | package unix_test 8 | 9 | import ( 10 | "os" 11 | "testing" 12 | 13 | "golang.org/x/sys/unix" 14 | ) 15 | 16 | func TestSysctUint64(t *testing.T) { 17 | _, err := unix.SysctlUint64("vm.max_kernel_address") 18 | if err != nil { 19 | if os.Getenv("GO_BUILDER_NAME") == "freebsd-386-gce101" { 20 | t.Skipf("Ignoring known failing test (golang.org/issue/15186). Failed with: %v", err) 21 | } 22 | t.Fatal(err) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go: -------------------------------------------------------------------------------- 1 | package logrus_syslog 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "log/syslog" 6 | "testing" 7 | ) 8 | 9 | func TestLocalhostAddAndPrint(t *testing.T) { 10 | log := logrus.New() 11 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 12 | 13 | if err != nil { 14 | t.Errorf("Unable to connect to local syslog.") 15 | } 16 | 17 | log.Hooks.Add(hook) 18 | 19 | for _, level := range hook.Levels() { 20 | if len(log.Hooks[level]) != 1 { 21 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) 22 | } 23 | } 24 | 25 | log.Info("Congratulations!") 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/sqlite3/README.md: -------------------------------------------------------------------------------- 1 | # Sqlite3 Driver 2 | 3 | * Runs migrations in transcations. 4 | That means that if a migration failes, it will be safely rolled back. 5 | * Tries to return helpful error messages. 6 | * Stores migration version details in table ``schema_migrations``. 7 | This table will be auto-generated. 8 | 9 | 10 | ## Usage 11 | 12 | ```bash 13 | migrate -url sqlite3://database.sqlite -path ./db/migrations create add_field_to_table 14 | migrate -url sqlite3://database.sqlite -path ./db/migrations up 15 | migrate help # for more info 16 | ``` 17 | 18 | ## Authors 19 | 20 | * Matthias Kadenbach, https://github.com/mattes 21 | * Caesar Wirth, https://github.com/cjwirth 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/internal/pool/main_test.go: -------------------------------------------------------------------------------- 1 | package pool_test 2 | 3 | import ( 4 | "net" 5 | "sync" 6 | "testing" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | func TestGinkgoSuite(t *testing.T) { 13 | RegisterFailHandler(Fail) 14 | RunSpecs(t, "pool") 15 | } 16 | 17 | func perform(n int, cbs ...func(int)) { 18 | var wg sync.WaitGroup 19 | for _, cb := range cbs { 20 | for i := 0; i < n; i++ { 21 | wg.Add(1) 22 | go func(cb func(int), i int) { 23 | defer GinkgoRecover() 24 | defer wg.Done() 25 | 26 | cb(i) 27 | }(cb, i) 28 | } 29 | } 30 | wg.Wait() 31 | } 32 | 33 | func dummyDialer() (net.Conn, error) { 34 | return &net.TCPConn{}, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/calculator/calculator_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Not a serious example. 10 | 11 | Usage: 12 | calculator_example ( ( + | - | * | / ) )... 13 | calculator_example [( , )]... 14 | calculator_example (-h | --help) 15 | 16 | Examples: 17 | calculator_example 1 + 2 + 3 + 4 + 5 18 | calculator_example 1 + 2 '*' 3 / 4 - 5 # note quotes around '*' 19 | calculator_example sum 10 , 20 , 30 , 40 20 | 21 | Options: 22 | -h, --help 23 | ` 24 | arguments, _ := docopt.Parse(usage, nil, true, "", false) 25 | fmt.Println(arguments) 26 | } 27 | -------------------------------------------------------------------------------- /packets/position.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | type Position struct { 4 | X uint16 5 | Y uint16 6 | Direction byte 7 | } 8 | 9 | func (r *Position) Write(db *PacketDatabase, d *Definition, p *RawPacket) error { 10 | p.Write([]byte{ 11 | byte(r.X >> 2), 12 | byte((r.X << 6) | ((r.Y >> 4) & 0x3F)), 13 | byte((r.Y << 4) | (uint16(r.Direction) & 0xF)), 14 | }) 15 | 16 | return nil 17 | } 18 | 19 | func (r *Position) Parse(db *PacketDatabase, d *Definition, p *RawPacket) error { 20 | raw := make([]byte, 3) 21 | 22 | p.Read(raw) 23 | 24 | r.X = uint16(((raw[0] & 0xFF) << 2) | (raw[1] >> 6)) 25 | r.Y = uint16(((raw[1] & 0x3F) << 4) | (raw[2] >> 4)) 26 | r.Direction = raw[2] & 0xF 27 | 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/types_list.txt: -------------------------------------------------------------------------------- 1 | Interface,interface{},"something",nil,Inter 2 | Map,map[string]interface{},map[string]interface{}{"name":"Tyler"},nil,MSI 3 | ObjxMap,(Map),New(1),New(nil),ObjxMap 4 | Bool,bool,true,false,Bool 5 | String,string,"hello","",Str 6 | Int,int,1,0,Int 7 | Int8,int8,1,0,Int8 8 | Int16,int16,1,0,Int16 9 | Int32,int32,1,0,Int32 10 | Int64,int64,1,0,Int64 11 | Uint,uint,1,0,Uint 12 | Uint8,uint8,1,0,Uint8 13 | Uint16,uint16,1,0,Uint16 14 | Uint32,uint32,1,0,Uint32 15 | Uint64,uint64,1,0,Uint64 16 | Uintptr,uintptr,1,0,Uintptr 17 | Float32,float32,1,0,Float32 18 | Float64,float64,1,0,Float64 19 | Complex64,complex64,1,0,Complex64 20 | Complex128,complex128,1,0,Complex128 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build plan9,race 6 | 7 | package plan9 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // NewColorable return new instance of Writer which handle escape sequence. 11 | func NewColorable(file *os.File) io.Writer { 12 | if file == nil { 13 | panic("nil passed instead of *os.File to NewColorable()") 14 | } 15 | 16 | return file 17 | } 18 | 19 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 20 | func NewColorableStdout() io.Writer { 21 | return os.Stdout 22 | } 23 | 24 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 25 | func NewColorableStderr() io.Writer { 26 | return os.Stderr 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /packets/incomingtypemap.go: -------------------------------------------------------------------------------- 1 | package packets 2 | 3 | var incomingTypeMap = map[string]IncomingPacket{ 4 | "SS_NULL": &NullPacket{}, 5 | "SS_PING": &Ping{}, 6 | 7 | "CA_LOGIN": &AccountLogin{}, 8 | 9 | "CH_ENTER": &CharEnter{}, 10 | "CH_SELECT_CHAR": &CharSelectChar{}, 11 | "CH_MAKE_CHAR": &CharMakeChar{}, 12 | "CH_DELETE_CHAR3_RESERVED": &CharDeleteChar3Reserved{}, 13 | "CH_DELETE_CHAR3": &NullPacket{}, //&CharDeleteChar3{}, 14 | "CH_DELETE_CHAR3_CANCEL": &CharDeleteChar3Cancel{}, 15 | 16 | "CZ_ENTER": &ZoneEnter{}, 17 | "CZ_REQUEST_TIME": &ZoneRequestTime{}, 18 | "CZ_NOTIFY_ACTORINIT": &ZoneNotifyActorInit{}, 19 | "CZ_REQNAME": &ZoneNameRequest{}, 20 | "CZ_REQUEST_MOVE": &ZoneRequestMove{}, 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/cov_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script uses gocov to generate a test coverage report. 4 | # The gocov tool my be obtained with the following command: 5 | # go get github.com/axw/gocov/gocov 6 | # 7 | # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. 8 | 9 | # Check for gocov. 10 | if ! type gocov >/dev/null 2>&1; then 11 | echo >&2 "This script requires the gocov tool." 12 | echo >&2 "You may obtain it with the following command:" 13 | echo >&2 "go get github.com/axw/gocov/gocov" 14 | exit 1 15 | fi 16 | 17 | # Only run the cgo tests if gcc is installed. 18 | if type gcc >/dev/null 2>&1; then 19 | (cd spew && gocov test -tags testcgo | gocov report) 20 | else 21 | (cd spew && gocov test | gocov report) 22 | fi 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/examples/hook/hook.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/Sirupsen/logrus" 5 | "gopkg.in/gemnasium/logrus-airbrake-hook.v2" 6 | ) 7 | 8 | var log = logrus.New() 9 | 10 | func init() { 11 | log.Formatter = new(logrus.TextFormatter) // default 12 | log.Hooks.Add(airbrake.NewHook(123, "xyz", "development")) 13 | } 14 | 15 | func main() { 16 | log.WithFields(logrus.Fields{ 17 | "animal": "walrus", 18 | "size": 10, 19 | }).Info("A group of walrus emerges from the ocean") 20 | 21 | log.WithFields(logrus.Fields{ 22 | "omg": true, 23 | "number": 122, 24 | }).Warn("The group's number increased tremendously!") 25 | 26 | log.WithFields(logrus.Fields{ 27 | "omg": true, 28 | "number": 100, 29 | }).Fatal("The ice breaks!") 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/type_assert/type_assert_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `usage: foo [-x] [-y]` 10 | 11 | arguments, err := docopt.Parse(usage, nil, true, "", false) 12 | if err != nil { 13 | fmt.Println(err) 14 | } 15 | 16 | fmt.Println(arguments) 17 | 18 | var x = arguments["-x"].(bool) // type assertion required 19 | if x == true { 20 | fmt.Println("x is true") 21 | } 22 | 23 | y := arguments["-y"] // no type assertion needed 24 | if y == true { 25 | fmt.Println("y is true") 26 | } 27 | y2 := arguments["-y"] 28 | if y2 == 10 { // this will never be true, a type assertion would have produced a build error 29 | fmt.Println("y is 10") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/options_shortcut/options_shortcut_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Example of program which uses [options] shortcut in pattern. 10 | 11 | Usage: 12 | options_shortcut_example [options] 13 | 14 | Options: 15 | -h --help show this help message and exit 16 | --version show version and exit 17 | -n, --number N use N as a number 18 | -t, --timeout TIMEOUT set timeout TIMEOUT seconds 19 | --apply apply changes to database 20 | -q operate in quiet mode` 21 | 22 | arguments, _ := docopt.Parse(usage, nil, true, "1.0.0rc2", false) 23 | fmt.Println(arguments) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/bash/bash.go: -------------------------------------------------------------------------------- 1 | // Package bash implements the Driver interface. 2 | package bash 3 | 4 | import ( 5 | "github.com/mattes/migrate/driver" 6 | "github.com/mattes/migrate/file" 7 | ) 8 | 9 | type Driver struct { 10 | } 11 | 12 | func (driver *Driver) Initialize(url string) error { 13 | return nil 14 | } 15 | 16 | func (driver *Driver) Close() error { 17 | return nil 18 | } 19 | 20 | func (driver *Driver) FilenameExtension() string { 21 | return "sh" 22 | } 23 | 24 | func (driver *Driver) Migrate(f file.File, pipe chan interface{}) { 25 | defer close(pipe) 26 | pipe <- f 27 | return 28 | } 29 | 30 | func (driver *Driver) Version() (uint64, error) { 31 | return uint64(0), nil 32 | } 33 | 34 | func init() { 35 | driver.RegisterDriver("bash", &Driver{}) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/naval_fate/naval_fate.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Naval Fate. 10 | 11 | Usage: 12 | naval_fate ship new ... 13 | naval_fate ship move [--speed=] 14 | naval_fate ship shoot 15 | naval_fate mine (set|remove) [--moored|--drifting] 16 | naval_fate -h | --help 17 | naval_fate --version 18 | 19 | Options: 20 | -h --help Show this screen. 21 | --version Show version. 22 | --speed= Speed in knots [default: 10]. 23 | --moored Moored (anchored) mine. 24 | --drifting Drifting mine.` 25 | 26 | arguments, _ := docopt.Parse(usage, nil, true, "Naval Fate 2.0", false) 27 | fmt.Println(arguments) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/o1egl/gormrus/README.md: -------------------------------------------------------------------------------- 1 | # Gormrus 2 | [![GoDoc](https://godoc.org/github.com/o1egl/gormrus?status.svg)](https://godoc.org/github.com/o1egl/gormrus) 3 | 4 | ## Overview 5 | 6 | Gormrus is a library for integrating [Logrus](https://github.com/Sirupsen/logrus) logger with [Gorm](https://github.com/jinzhu/gorm) 7 | 8 | ## Usage 9 | 10 | ```go 11 | package main 12 | import ( 13 | "github.com/jinzhu/gorm" 14 | _ "github.com/go-sql-driver/mysql" 15 | "github.com/o1egl/gormrus" 16 | ) 17 | 18 | db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local") 19 | db.LogMode(true) 20 | db.SetLogger(gormrus.New()) 21 | ```` 22 | 23 | ## Copyright, License & Contributors 24 | 25 | Gormrus is released under the MIT license. See [LICENSE](LICENSE) -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/search_test.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestCloneSearch(t *testing.T) { 9 | s := new(search) 10 | s.Where("name = ?", "jinzhu").Order("name").Attrs("name", "jinzhu").Select("name, age") 11 | 12 | s1 := s.clone() 13 | s1.Where("age = ?", 20).Order("age").Attrs("email", "a@e.org").Select("email") 14 | 15 | if reflect.DeepEqual(s.whereConditions, s1.whereConditions) { 16 | t.Errorf("Where should be copied") 17 | } 18 | 19 | if reflect.DeepEqual(s.orders, s1.orders) { 20 | t.Errorf("Order should be copied") 21 | } 22 | 23 | if reflect.DeepEqual(s.initAttrs, s1.initAttrs) { 24 | t.Errorf("InitAttrs should be copied") 25 | } 26 | 27 | if reflect.DeepEqual(s.Select, s1.Select) { 28 | t.Errorf("selectStr should be copied") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/arguments/arguments_example.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `Usage: arguments_example [-vqrh] [FILE] ... 10 | arguments_example (--left | --right) CORRECTION FILE 11 | 12 | Process FILE and optionally apply correction to either left-hand side or 13 | right-hand side. 14 | 15 | Arguments: 16 | FILE optional input file 17 | CORRECTION correction angle, needs FILE, --left or --right to be present 18 | 19 | Options: 20 | -h --help 21 | -v verbose mode 22 | -q quiet mode 23 | -r make report 24 | --left use left-hand side 25 | --right use right-hand side` 26 | 27 | arguments, _ := docopt.Parse(usage, nil, true, "", false) 28 | fmt.Println(arguments) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/postgres/README.md: -------------------------------------------------------------------------------- 1 | # PostgreSQL Driver 2 | 3 | * Runs migrations in transcations. 4 | That means that if a migration failes, it will be safely rolled back. 5 | * Tries to return helpful error messages. 6 | * Stores migration version details in table ``schema_migrations``. 7 | This table will be auto-generated. 8 | 9 | 10 | ## Usage 11 | 12 | ```bash 13 | migrate -url postgres://user@host:port/database -path ./db/migrations create add_field_to_table 14 | migrate -url postgres://user@host:port/database -path ./db/migrations up 15 | migrate help # for more info 16 | 17 | # TODO(mattes): thinking about adding some custom flag to allow migration within schemas: 18 | -url="postgres://user@host:port/database?schema=name" 19 | ``` 20 | 21 | ## Authors 22 | 23 | * Matthias Kadenbach, https://github.com/mattes -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2013 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for 386, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-32 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-36 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$4-4 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for amd64, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-64 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-56 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$8-8 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2013 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/.travis.yml: -------------------------------------------------------------------------------- 1 | # Travis CI (http://travis-ci.org/) is a continuous integration 2 | # service for open source projects. This file configures it 3 | # to run unit tests for docopt-go. 4 | 5 | language: go 6 | 7 | go: 8 | - 1.4 9 | - 1.5 10 | - tip 11 | 12 | matrix: 13 | fast_finish: true 14 | 15 | before_install: 16 | - go get golang.org/x/tools/cmd/vet 17 | - go get golang.org/x/tools/cmd/cover 18 | - go get github.com/golang/lint/golint 19 | - go get github.com/mattn/goveralls 20 | 21 | install: 22 | - go get -d -v ./... && go build -v ./... 23 | 24 | script: 25 | - go vet -x ./... 26 | - $HOME/gopath/bin/golint ./... 27 | - go test -v ./... 28 | - go test -covermode=count -coverprofile=profile.cov . 29 | 30 | after_script: 31 | - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci 32 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/driver/mysql/README.md: -------------------------------------------------------------------------------- 1 | # MySQL Driver 2 | 3 | ### See [issue #1](https://github.com/mattes/migrate/issues/1#issuecomment-58728186) before using this driver! 4 | 5 | * Runs migrations in transcations. 6 | That means that if a migration failes, it will be safely rolled back. 7 | * Tries to return helpful error messages. 8 | * Stores migration version details in table ``schema_migrations``. 9 | This table will be auto-generated. 10 | 11 | 12 | ## Usage 13 | 14 | ```bash 15 | migrate -url mysql://user@tcp(host:port)/database -path ./db/migrations create add_field_to_table 16 | migrate -url mysql://user@tcp(host:port)/database -path ./db/migrations up 17 | migrate help # for more info 18 | ``` 19 | 20 | See full [DSN (Data Source Name) documentation](https://github.com/go-sql-driver/mysql/#dsn-data-source-name). 21 | 22 | ## Authors 23 | 24 | * Matthias Kadenbach, https://github.com/mattes -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/export_test.go: -------------------------------------------------------------------------------- 1 | package redis 2 | 3 | import ( 4 | "time" 5 | 6 | "gopkg.in/redis.v5/internal/pool" 7 | ) 8 | 9 | func (c *baseClient) Pool() pool.Pooler { 10 | return c.connPool 11 | } 12 | 13 | func (c *PubSub) Pool() pool.Pooler { 14 | return c.base.connPool 15 | } 16 | 17 | func (c *PubSub) ReceiveMessageTimeout(timeout time.Duration) (*Message, error) { 18 | return c.receiveMessage(timeout) 19 | } 20 | 21 | func (c *ClusterClient) SlotAddrs(slot int) []string { 22 | var addrs []string 23 | for _, n := range c.state().slotNodes(slot) { 24 | addrs = append(addrs, n.Client.getAddr()) 25 | } 26 | return addrs 27 | } 28 | 29 | // SwapSlot swaps a slot's master/slave address for testing MOVED redirects. 30 | func (c *ClusterClient) SwapSlotNodes(slot int) []string { 31 | nodes := c.state().slots[slot] 32 | nodes[0], nodes[1] = nodes[1], nodes[0] 33 | return c.SlotAddrs(slot) 34 | } 35 | -------------------------------------------------------------------------------- /net/server.go: -------------------------------------------------------------------------------- 1 | package net 2 | 3 | import ( 4 | "net" 5 | 6 | "github.com/Sirupsen/logrus" 7 | ) 8 | 9 | type Server struct { 10 | handler Handler 11 | listener net.Listener 12 | log *logrus.Entry 13 | } 14 | 15 | func NewServer(handler Handler) *Server { 16 | return &Server{ 17 | handler: handler, 18 | log: logrus.WithField("component", "server"), 19 | } 20 | } 21 | 22 | func (s *Server) Listen(endpoint string) error { 23 | l, err := net.Listen("tcp", endpoint) 24 | 25 | if err != nil { 26 | return err 27 | } 28 | 29 | s.listener = l 30 | 31 | go s.run() 32 | 33 | return nil 34 | } 35 | 36 | func (s *Server) Stop() error { 37 | return s.listener.Close() 38 | } 39 | 40 | func (s *Server) run() { 41 | conn, err := s.listener.Accept() 42 | 43 | if err != nil { 44 | s.log.WithError(err).Error("error accepting client") 45 | return 46 | } 47 | 48 | s.handler.Accept(conn) 49 | s.run() 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const 13 | 14 | // Should be a built-in for unsafe.Pointer? 15 | func add(p unsafe.Pointer, x uintptr) unsafe.Pointer { 16 | return unsafe.Pointer(uintptr(p) + x) 17 | } 18 | 19 | // funcPC returns the entry PC of the function f. 20 | // It assumes that f is a func value. Otherwise the behavior is undefined. 21 | func funcPC(f interface{}) uintptr { 22 | return **(**uintptr)(add(unsafe.Pointer(&f), ptrSize)) 23 | } 24 | 25 | // from sys_386.s and sys_amd64.s 26 | func servicectlhandler(ctl uint32) uintptr 27 | func servicemain(argc uint32, argv **uint16) 28 | 29 | func getServiceMain(r *uintptr) { 30 | *r = funcPC(servicemain) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/git/remote/git_remote.go: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `usage: git remote [-v | --verbose] 10 | git remote add [-t ] [-m ] [-f] [--mirror] 11 | git remote rename 12 | git remote rm 13 | git remote set-head (-a | -d | ) 14 | git remote [-v | --verbose] show [-n] 15 | git remote prune [-n | --dry-run] 16 | git remote [-v | --verbose] update [-p | --prune] [( | )...] 17 | git remote set-branches [--add] ... 18 | git remote set-url [] 19 | git remote set-url --add 20 | git remote set-url --delete 21 | 22 | options: 23 | -v, --verbose be verbose; must be placed before a subcommand 24 | ` 25 | 26 | args, _ := docopt.Parse(usage, nil, true, "", false) 27 | fmt.Println(args) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/doc.go: -------------------------------------------------------------------------------- 1 | // Package testify is a set of packages that provide many tools for testifying that your code will behave as you intend. 2 | // 3 | // testify contains the following packages: 4 | // 5 | // The assert package provides a comprehensive set of assertion functions that tie in to the Go testing system. 6 | // 7 | // The http package contains tools to make it easier to test http activity using the Go testing system. 8 | // 9 | // The mock package provides a system by which it is possible to mock your objects and verify calls are happening as expected. 10 | // 11 | // The suite package provides a basic structure for using structs as testing suites, and methods on those structs as tests. It includes setup/teardown functionality in the way of interfaces. 12 | package testify 13 | 14 | // blank imports help docs. 15 | import ( 16 | // assert package 17 | _ "github.com/stretchr/testify/assert" 18 | // http package 19 | _ "github.com/stretchr/testify/http" 20 | // mock package 21 | _ "github.com/stretchr/testify/mock" 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | Colorable writer for windows. 4 | 5 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 6 | This package is possible to handle escape sequence for ansi color on windows. 7 | 8 | ## Too Bad! 9 | 10 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 11 | 12 | 13 | ## So Good! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 16 | 17 | ## Usage 18 | 19 | ```go 20 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 21 | logrus.SetOutput(colorable.NewColorableStdout()) 22 | 23 | logrus.Info("succeeded") 24 | logrus.Warn("not correct") 25 | logrus.Error("something error") 26 | logrus.Fatal("panic") 27 | ``` 28 | 29 | You can compile above code on non-windows OSs. 30 | 31 | ## Installation 32 | 33 | ``` 34 | $ go get github.com/mattn/go-colorable 35 | ``` 36 | 37 | # License 38 | 39 | MIT 40 | 41 | # Author 42 | 43 | Yasuhiro Matsumoto (a.k.a mattn) 44 | -------------------------------------------------------------------------------- /database/authcookie.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import "math/rand" 4 | 5 | type AuthCookieKind int 6 | 7 | //go:generate stringer -type=AuthCookieKind 8 | const ( 9 | _ AuthCookieKind = iota 10 | 11 | AccountAuthCookie 12 | InterAuthCookie 13 | ) 14 | 15 | const AuthCookieKindMask = 1 << 63 16 | 17 | type AuthCookie struct { 18 | Cookie uint64 19 | AccountID uint32 20 | } 21 | 22 | type AuthCookieStore interface { 23 | Create(cookie AuthCookie) error 24 | VerifyAndConsume(cookie AuthCookie) (bool, error) 25 | } 26 | 27 | func GenerateAuthCookie(accountID uint32, kind AuthCookieKind) AuthCookie { 28 | cookie := uint64(rand.Int63()) 29 | 30 | if kind == AccountAuthCookie { 31 | cookie |= AuthCookieKindMask 32 | } else { 33 | cookie &^= AuthCookieKindMask 34 | } 35 | 36 | return AuthCookie{ 37 | Cookie: cookie, 38 | AccountID: accountID, 39 | } 40 | } 41 | 42 | func (ac AuthCookie) Kind() AuthCookieKind { 43 | if ac.Cookie&AuthCookieKindMask != 0 { 44 | return AccountAuthCookie 45 | } else { 46 | return InterAuthCookie 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/example_test.go: -------------------------------------------------------------------------------- 1 | package docopt 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | ) 7 | 8 | func ExampleParse() { 9 | usage := `Usage: 10 | config_example tcp [] [--force] [--timeout=] 11 | config_example serial [--baud=] [--timeout=] 12 | config_example -h | --help | --version` 13 | // parse the command line `comfig_example tcp 127.0.0.1 --force` 14 | argv := []string{"tcp", "127.0.0.1", "--force"} 15 | arguments, _ := Parse(usage, argv, true, "0.1.1rc", false) 16 | // sort the keys of the arguments map 17 | var keys []string 18 | for k := range arguments { 19 | keys = append(keys, k) 20 | } 21 | sort.Strings(keys) 22 | // print the argument keys and values 23 | for _, k := range keys { 24 | fmt.Printf("%9s %v\n", k, arguments[k]) 25 | } 26 | // output: 27 | // --baud 28 | // --force true 29 | // --help false 30 | // --timeout 31 | // --version false 32 | // -h false 33 | // 127.0.0.1 34 | // 35 | // serial false 36 | // tcp true 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.5 5 | - 1.6 6 | - 1.7 7 | - tip 8 | 9 | sudo: true 10 | 11 | env: 12 | global: 13 | - PGUSER=postgres 14 | - PQGOSSLTESTS=1 15 | - PQSSLCERTTEST_PATH=$PWD/certs 16 | - PGHOST=127.0.0.1 17 | matrix: 18 | - PGVERSION=9.6 19 | - PGVERSION=9.5 20 | - PGVERSION=9.4 21 | - PGVERSION=9.3 22 | - PGVERSION=9.2 23 | - PGVERSION=9.1 24 | - PGVERSION=9.0 25 | 26 | before_install: 27 | - ./.travis.sh postgresql_uninstall 28 | - ./.travis.sh pgdg_repository 29 | - ./.travis.sh postgresql_install 30 | - ./.travis.sh postgresql_configure 31 | - ./.travis.sh client_configure 32 | - go get golang.org/x/tools/cmd/goimports 33 | 34 | before_script: 35 | - createdb pqgotest 36 | - createuser -DRS pqgossltest 37 | - createuser -DRS pqgosslcert 38 | 39 | script: 40 | - > 41 | goimports -d -e $(find -name '*.go') | awk '{ print } END { exit NR == 0 ? 0 : 1 }' 42 | - go vet ./... 43 | - PQTEST_BINARY_PARAMETERS=no go test -v ./... 44 | - PQTEST_BINARY_PARAMETERS=yes go test -v ./... 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/sys_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | // func servicemain(argc uint32, argv **uint16) 8 | TEXT ·servicemain(SB),7,$0 9 | MOVL CX, ·sArgc(SB) 10 | MOVL DX, ·sArgv(SB) 11 | 12 | SUBQ $32, SP // stack for the first 4 syscall params 13 | 14 | MOVQ ·sName(SB), CX 15 | MOVQ $·servicectlhandler(SB), DX 16 | MOVQ ·cRegisterServiceCtrlHandlerW(SB), AX 17 | CALL AX 18 | CMPQ AX, $0 19 | JE exit 20 | MOVQ AX, ·ssHandle(SB) 21 | 22 | MOVQ ·goWaitsH(SB), CX 23 | MOVQ ·cSetEvent(SB), AX 24 | CALL AX 25 | 26 | MOVQ ·cWaitsH(SB), CX 27 | MOVQ $4294967295, DX 28 | MOVQ ·cWaitForSingleObject(SB), AX 29 | CALL AX 30 | 31 | exit: 32 | ADDQ $32, SP 33 | RET 34 | 35 | // I do not know why, but this seems to be the only way to call 36 | // ctlHandlerProc on Windows 7. 37 | 38 | // func servicectlhandler(ctl uint32) uintptr 39 | TEXT ·servicectlhandler(SB),7,$0 40 | MOVQ ·ctlHandlerProc(SB), AX 41 | JMP AX 42 | -------------------------------------------------------------------------------- /vendor/gopkg.in/redis.v5/internal/pool/pool_single.go: -------------------------------------------------------------------------------- 1 | package pool 2 | 3 | type SingleConnPool struct { 4 | cn *Conn 5 | } 6 | 7 | var _ Pooler = (*SingleConnPool)(nil) 8 | 9 | func NewSingleConnPool(cn *Conn) *SingleConnPool { 10 | return &SingleConnPool{ 11 | cn: cn, 12 | } 13 | } 14 | 15 | func (p *SingleConnPool) First() *Conn { 16 | return p.cn 17 | } 18 | 19 | func (p *SingleConnPool) Get() (*Conn, bool, error) { 20 | return p.cn, false, nil 21 | } 22 | 23 | func (p *SingleConnPool) Put(cn *Conn) error { 24 | if p.cn != cn { 25 | panic("p.cn != cn") 26 | } 27 | return nil 28 | } 29 | 30 | func (p *SingleConnPool) Remove(cn *Conn, _ error) error { 31 | if p.cn != cn { 32 | panic("p.cn != cn") 33 | } 34 | return nil 35 | } 36 | 37 | func (p *SingleConnPool) Len() int { 38 | return 1 39 | } 40 | 41 | func (p *SingleConnPool) FreeLen() int { 42 | return 0 43 | } 44 | 45 | func (p *SingleConnPool) Stats() *Stats { 46 | return nil 47 | } 48 | 49 | func (p *SingleConnPool) Close() error { 50 | return nil 51 | } 52 | 53 | func (p *SingleConnPool) Closed() bool { 54 | return false 55 | } 56 | -------------------------------------------------------------------------------- /inter/interclient.go: -------------------------------------------------------------------------------- 1 | package inter 2 | 3 | import ( 4 | gonet "net" 5 | 6 | "github.com/zeusproject/zeus-server/net" 7 | ) 8 | 9 | type InterClient struct { 10 | *net.RpcClient 11 | } 12 | 13 | func NewInterClient(endpoint string) (*InterClient, error) { 14 | client, err := gonet.Dial("tcp", endpoint) 15 | 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | c := &InterClient{} 21 | 22 | c.RpcClient = net.NewRpcClient(client, c) 23 | 24 | // Setup callbacks 25 | c.Register("ping", c.handlePing) 26 | 27 | return c, nil 28 | } 29 | 30 | func (c *InterClient) Authenticate(secret string, serverType ServerType) (*HelloResponse, error) { 31 | var res HelloResponse 32 | 33 | err := c.Call("hello", &HelloRequest{ 34 | Secret: secret, 35 | Type: serverType, 36 | }, &res) 37 | 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | return &res, nil 43 | } 44 | 45 | func (c *InterClient) handlePing(req *PingRequest, res *bool) error { 46 | c.Notify("ping", &PingRequest{}) 47 | 48 | *res = true 49 | 50 | return nil 51 | } 52 | 53 | func (c *InterClient) OnDisconnect(err error) { 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks/test/test_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/Sirupsen/logrus" 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestAllHooks(t *testing.T) { 11 | 12 | assert := assert.New(t) 13 | 14 | logger, hook := NewNullLogger() 15 | assert.Nil(hook.LastEntry()) 16 | assert.Equal(0, len(hook.Entries)) 17 | 18 | logger.Error("Hello error") 19 | assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) 20 | assert.Equal("Hello error", hook.LastEntry().Message) 21 | assert.Equal(1, len(hook.Entries)) 22 | 23 | logger.Warn("Hello warning") 24 | assert.Equal(logrus.WarnLevel, hook.LastEntry().Level) 25 | assert.Equal("Hello warning", hook.LastEntry().Message) 26 | assert.Equal(2, len(hook.Entries)) 27 | 28 | hook.Reset() 29 | assert.Nil(hook.LastEntry()) 30 | assert.Equal(0, len(hook.Entries)) 31 | 32 | hook = NewGlobal() 33 | 34 | logrus.Error("Hello error") 35 | assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) 36 | assert.Equal("Hello error", hook.LastEntry().Message) 37 | assert.Equal(1, len(hook.Entries)) 38 | 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/utils_test.go: -------------------------------------------------------------------------------- 1 | package gorm_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jinzhu/gorm" 7 | ) 8 | 9 | func TestToDBNameGenerateFriendlyName(t *testing.T) { 10 | var maps = map[string]string{ 11 | "": "", 12 | "ThisIsATest": "this_is_a_test", 13 | "PFAndESI": "pf_and_esi", 14 | "AbcAndJkl": "abc_and_jkl", 15 | "EmployeeID": "employee_id", 16 | "SKU_ID": "sku_id", 17 | "HTTPAndSMTP": "http_and_smtp", 18 | "HTTPServerHandlerForURLID": "http_server_handler_for_url_id", 19 | "UUID": "uuid", 20 | "HTTPURL": "http_url", 21 | "HTTP_URL": "http_url", 22 | "ThisIsActuallyATestSoWeMayBeAbleToUseThisCodeInGormPackageAlsoIdCanBeUsedAtTheEndAsID": "this_is_actually_a_test_so_we_may_be_able_to_use_this_code_in_gorm_package_also_id_can_be_used_at_the_end_as_id", 23 | } 24 | 25 | for key, value := range maps { 26 | if gorm.ToDBName(key) != value { 27 | t.Errorf("%v ToDBName should equal %v, but got %v", key, value, gorm.ToDBName(key)) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | 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: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | 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. 9 | -------------------------------------------------------------------------------- /database/config.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | ) 7 | 8 | type Config struct { 9 | Redis RedisConfig `yaml:"redis"` 10 | Postgres PostgresConfig `yaml:"postgres"` 11 | } 12 | 13 | type RedisConfig struct { 14 | Address string `yaml:"address"` 15 | Password string `yaml:"password"` 16 | Database int `yaml:"database"` 17 | } 18 | 19 | type PostgresConfig struct { 20 | Host string `yaml:"host"` 21 | Port int `yaml:"port"` 22 | User string `yaml:"user"` 23 | Password string `yaml:"password"` 24 | Database string `yaml:"database"` 25 | Options map[string]string `yaml:"options"` 26 | } 27 | 28 | func (c *PostgresConfig) ConnectionUrl() string { 29 | query := make(url.Values) 30 | 31 | for k, v := range c.Options { 32 | query[k] = []string{v} 33 | } 34 | 35 | url := &url.URL{ 36 | Scheme: "postgres", 37 | User: url.UserPassword(c.User, c.Password), 38 | Host: fmt.Sprintf("%s:%d", c.Host, c.Port), 39 | Path: c.Database, 40 | RawQuery: query.Encode(), 41 | } 42 | 43 | return url.String() 44 | } 45 | -------------------------------------------------------------------------------- /rpc/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Cenk Altı 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | base: 5 | build: . 6 | 7 | account: 8 | extends: base 9 | command: go run main.go server account 10 | expose: 11 | - 6900 12 | - 6901 13 | ports: 14 | - 6900:6900 15 | volumes: 16 | - .:/go/src/github.com/zeusproject/zeus-server 17 | 18 | char: 19 | extends: base 20 | command: go run main.go server char 21 | expose: 22 | - 7000 23 | ports: 24 | - 7000:7000 25 | volumes: 26 | - .:/go/src/github.com/zeusproject/zeus-server 27 | 28 | inter: 29 | extends: base 30 | command: go run main.go server inter 31 | expose: 32 | - 4000 33 | volumes: 34 | - .:/go/src/github.com/zeusproject/zeus-server 35 | 36 | zone: 37 | extends: base 38 | command: go run main.go server zone 39 | expose: 40 | - 4500 41 | ports: 42 | - 4500:4500 43 | volumes: 44 | - .:/go/src/github.com/zeusproject/zeus-server 45 | 46 | postgres: 47 | image: postgres:9.5 48 | environment: 49 | POSTGRES_PASSWORD: zeus 50 | 51 | redis: 52 | image: redis:3.2 53 | 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md: -------------------------------------------------------------------------------- 1 | # Syslog Hooks for Logrus :walrus: 2 | 3 | ## Usage 4 | 5 | ```go 6 | import ( 7 | "log/syslog" 8 | "github.com/Sirupsen/logrus" 9 | logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" 10 | ) 11 | 12 | func main() { 13 | log := logrus.New() 14 | hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 15 | 16 | if err == nil { 17 | log.Hooks.Add(hook) 18 | } 19 | } 20 | ``` 21 | 22 | If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of `NewSyslogHook`. It should look like the following. 23 | 24 | ```go 25 | import ( 26 | "log/syslog" 27 | "github.com/Sirupsen/logrus" 28 | logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" 29 | ) 30 | 31 | func main() { 32 | log := logrus.New() 33 | hook, err := logrus_syslog.NewSyslogHook("", "", syslog.LOG_INFO, "") 34 | 35 | if err == nil { 36 | log.Hooks.Add(hook) 37 | } 38 | } 39 | ``` -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type JSONFormatter struct { 9 | // TimestampFormat sets the format used for marshaling timestamps. 10 | TimestampFormat string 11 | } 12 | 13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 14 | data := make(Fields, len(entry.Data)+3) 15 | for k, v := range entry.Data { 16 | switch v := v.(type) { 17 | case error: 18 | // Otherwise errors are ignored by `encoding/json` 19 | // https://github.com/Sirupsen/logrus/issues/137 20 | data[k] = v.Error() 21 | default: 22 | data[k] = v 23 | } 24 | } 25 | prefixFieldClashes(data) 26 | 27 | timestampFormat := f.TimestampFormat 28 | if timestampFormat == "" { 29 | timestampFormat = DefaultTimestampFormat 30 | } 31 | 32 | data["time"] = entry.Time.Format(timestampFormat) 33 | data["msg"] = entry.Message 34 | data["level"] = entry.Level.String() 35 | 36 | serialized, err := json.Marshal(data) 37 | if err != nil { 38 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 39 | } 40 | return append(serialized, '\n'), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/dialects/postgres/postgres.go: -------------------------------------------------------------------------------- 1 | package postgres 2 | 3 | import ( 4 | "database/sql" 5 | "database/sql/driver" 6 | 7 | _ "github.com/lib/pq" 8 | "github.com/lib/pq/hstore" 9 | ) 10 | 11 | type Hstore map[string]*string 12 | 13 | // Value get value of Hstore 14 | func (h Hstore) Value() (driver.Value, error) { 15 | hstore := hstore.Hstore{Map: map[string]sql.NullString{}} 16 | if len(h) == 0 { 17 | return nil, nil 18 | } 19 | 20 | for key, value := range h { 21 | var s sql.NullString 22 | if value != nil { 23 | s.String = *value 24 | s.Valid = true 25 | } 26 | hstore.Map[key] = s 27 | } 28 | return hstore.Value() 29 | } 30 | 31 | // Scan scan value into Hstore 32 | func (h *Hstore) Scan(value interface{}) error { 33 | hstore := hstore.Hstore{} 34 | 35 | if err := hstore.Scan(value); err != nil { 36 | return err 37 | } 38 | 39 | if len(hstore.Map) == 0 { 40 | return nil 41 | } 42 | 43 | *h = Hstore{} 44 | for k := range hstore.Map { 45 | if hstore.Map[k].Valid { 46 | s := hstore.Map[k].String 47 | (*h)[k] = &s 48 | } else { 49 | (*h)[k] = nil 50 | } 51 | } 52 | 53 | return nil 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/o1egl/gormrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oleg Lobanov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Keith Batten 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Fatih Arslan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/git/push/git_push.go: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `usage: git push [options] [ [...]] 10 | 11 | options: 12 | -h, --help 13 | -v, --verbose be more verbose 14 | -q, --quiet be more quiet 15 | --repo repository 16 | --all push all refs 17 | --mirror mirror all refs 18 | --delete delete refs 19 | --tags push tags (can't be used with --all or --mirror) 20 | -n, --dry-run dry run 21 | --porcelain machine-readable output 22 | -f, --force force updates 23 | --thin use thin pack 24 | --receive-pack 25 | receive pack program 26 | --exec 27 | receive pack program 28 | -u, --set-upstream set upstream for git pull/status 29 | --progress force progress reporting 30 | ` 31 | 32 | args, _ := docopt.Parse(usage, nil, true, "", false) 33 | fmt.Println(args) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 - Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Matthias Kadenbach 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt-go/examples/git/checkout/git_checkout.go: -------------------------------------------------------------------------------- 1 | package git 2 | 3 | import ( 4 | "fmt" 5 | "github.com/docopt/docopt-go" 6 | ) 7 | 8 | func main() { 9 | usage := `usage: git checkout [options] 10 | git checkout [options] -- ... 11 | 12 | options: 13 | -q, --quiet suppress progress reporting 14 | -b create and checkout a new branch 15 | -B create/reset and checkout a branch 16 | -l create reflog for new branch 17 | -t, --track set upstream info for new branch 18 | --orphan 19 | new unparented branch 20 | -2, --ours checkout our version for unmerged files 21 | -3, --theirs checkout their version for unmerged files 22 | -f, --force force checkout (throw away local modifications) 23 | -m, --merge perform a 3-way merge with the new branch 24 | --conflict