From e97b3caf078f478ba20e69379233e30f9c8c7484 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Thu, 26 Oct 2017 18:17:58 +0400 Subject: [PATCH] Dependency management via dep package. --- .gitignore | 1 + Gopkg.lock | 45 +++++++++++++++++++ Gopkg.toml | 32 +++++++++++++ README.md | 3 +- i2_bot.go | 12 ++--- lib/appcontext/appcontext.go | 14 +++--- lib/connections/connections.go | 4 +- lib/getters/broadcasts.go | 2 +- lib/getters/chat.go | 2 +- lib/getters/exported.go | 4 +- .../gettersinterface/gettersinterface.go | 2 +- lib/getters/player.go | 2 +- lib/getters/pokememes.go | 2 +- lib/getters/profile.go | 2 +- lib/migrations/exported.go | 4 +- lib/parsers/exported.go | 4 +- .../parsersinterface/parsersinterface.go | 2 +- lib/parsers/pokememe.go | 2 +- lib/parsers/profile.go | 2 +- lib/router/exported.go | 2 +- lib/talkers/broadcast.go | 2 +- lib/talkers/exported.go | 4 +- lib/talkers/hello.go | 2 +- lib/talkers/help.go | 4 +- lib/talkers/pokedex.go | 2 +- lib/talkers/profile.go | 2 +- lib/talkers/suggestions.go | 2 +- .../talkersinterface/talkersinterface.go | 2 +- 28 files changed, 121 insertions(+), 42 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml diff --git a/.gitignore b/.gitignore index 1d3ed4c..b70e469 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ config.yml +vendor/* diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..c394ca0 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,45 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/go-sql-driver/mysql" + packages = ["."] + revision = "a0583e0143b1624142adab07e0e97fe106d99561" + version = "v1.3" + +[[projects]] + name = "github.com/go-telegram-bot-api/telegram-bot-api" + packages = ["."] + revision = "0a57807db79efce7f6719fbb2c0e0f83fda79aec" + version = "v4.6" + +[[projects]] + branch = "master" + name = "github.com/jmoiron/sqlx" + packages = [".","reflectx"] + revision = "3379e5993990b1f927fc8db926485e6f6becf2d2" + +[[projects]] + name = "github.com/pressly/goose" + packages = ["."] + revision = "056a4d47dcc4d67fa3947a4f13945a5c690e568b" + version = "v2.1.0" + +[[projects]] + name = "github.com/technoweenie/multipartstreamer" + packages = ["."] + revision = "a90a01d73ae432e2611d178c18367fbaa13e0154" + version = "v1.0.1" + +[[projects]] + branch = "v2" + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "5020a2712e7a565f5f7ed84b6ea5fe7a369303903dc3dfeb0de03777806f585e" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..419f88d --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,32 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + +required = ["github.com/go-sql-driver/mysql", "github.com/jmoiron/sqlx", "github.com/pressly/goose"] + +[[constraint]] + name = "github.com/go-telegram-bot-api/telegram-bot-api" + version = "4.6.0" + +[[constraint]] + branch = "v2" + name = "gopkg.in/yaml.v2" + diff --git a/README.md b/README.md index aa2e67a..b5cc7de 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # i2_bot: бот лиги Инстинкт игры @PokememBroBot -Для запуска нужен правильный ``config.json`` и выполнить ``./dependencies.sh``. +Для запуска нужен правильный ``config.json``. +Управление зависимостями осуществляет [dep](https://github.com/golang/dep). diff --git a/i2_bot.go b/i2_bot.go index 0feb90d..fe982e5 100644 --- a/i2_bot.go +++ b/i2_bot.go @@ -9,12 +9,12 @@ import ( // 3rd-party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "./lib/appcontext" - "./lib/getters" - "./lib/migrations" - "./lib/parsers" - "./lib/router" - "./lib/talkers" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/getters" + "lab.pztrn.name/fat0troll/i2_bot/lib/migrations" + "lab.pztrn.name/fat0troll/i2_bot/lib/parsers" + "lab.pztrn.name/fat0troll/i2_bot/lib/router" + "lab.pztrn.name/fat0troll/i2_bot/lib/talkers" ) var ( diff --git a/lib/appcontext/appcontext.go b/lib/appcontext/appcontext.go index 0bdd0f7..4167d07 100644 --- a/lib/appcontext/appcontext.go +++ b/lib/appcontext/appcontext.go @@ -8,14 +8,14 @@ import ( "github.com/go-telegram-bot-api/telegram-bot-api" "github.com/jmoiron/sqlx" // local - "../config" - "../connections" + "lab.pztrn.name/fat0troll/i2_bot/lib/config" + "lab.pztrn.name/fat0troll/i2_bot/lib/connections" // interfaces - "../getters/gettersinterface" - "../migrations/migrationsinterface" - "../parsers/parsersinterface" - "../router/routerinterface" - "../talkers/talkersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/getters/gettersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/migrations/migrationsinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/parsers/parsersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/router/routerinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/talkers/talkersinterface" ) // Context is an application context struct diff --git a/lib/connections/connections.go b/lib/connections/connections.go index bf1ef7b..bd0b5fd 100644 --- a/lib/connections/connections.go +++ b/lib/connections/connections.go @@ -8,10 +8,10 @@ import ( "log" // 3rd-party _ "github.com/go-sql-driver/mysql" - "github.com/go-telegram-bot-api/telegram-bot-api" "github.com/jmoiron/sqlx" + "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../config" + "lab.pztrn.name/fat0troll/i2_bot/lib/config" ) // BotInit initializes connection to Telegram diff --git a/lib/getters/broadcasts.go b/lib/getters/broadcasts.go index fd6f673..af2473c 100644 --- a/lib/getters/broadcasts.go +++ b/lib/getters/broadcasts.go @@ -8,7 +8,7 @@ import ( "log" "time" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // CreateBroadcastMessage creates broadcast message item in database diff --git a/lib/getters/chat.go b/lib/getters/chat.go index c390eac..97e24e5 100644 --- a/lib/getters/chat.go +++ b/lib/getters/chat.go @@ -10,7 +10,7 @@ import ( // 3rd-party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // GetChatByID returns dbmapping.Chat instance with given ID. diff --git a/lib/getters/exported.go b/lib/getters/exported.go index 33af2f3..c84c1b5 100644 --- a/lib/getters/exported.go +++ b/lib/getters/exported.go @@ -7,8 +7,8 @@ import ( // stdlib "log" // local - "../appcontext" - "../getters/gettersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/getters/gettersinterface" ) var ( diff --git a/lib/getters/gettersinterface/gettersinterface.go b/lib/getters/gettersinterface/gettersinterface.go index 481cb05..00d222c 100644 --- a/lib/getters/gettersinterface/gettersinterface.go +++ b/lib/getters/gettersinterface/gettersinterface.go @@ -7,7 +7,7 @@ import ( // 3rd-party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // GettersInterface implements Getters for importing via appcontext. diff --git a/lib/getters/player.go b/lib/getters/player.go index fd74119..d5b06c9 100644 --- a/lib/getters/player.go +++ b/lib/getters/player.go @@ -8,7 +8,7 @@ import ( "log" "time" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // GetPlayerByID returns dbmapping.Player instance with given ID. diff --git a/lib/getters/pokememes.go b/lib/getters/pokememes.go index 6f40656..14370d7 100644 --- a/lib/getters/pokememes.go +++ b/lib/getters/pokememes.go @@ -8,7 +8,7 @@ import ( "log" "strconv" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // Internal functions diff --git a/lib/getters/profile.go b/lib/getters/profile.go index 33b2586..bba9f5d 100644 --- a/lib/getters/profile.go +++ b/lib/getters/profile.go @@ -7,7 +7,7 @@ import ( // stdlib "log" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // GetProfile returns last saved profile of player diff --git a/lib/migrations/exported.go b/lib/migrations/exported.go index 025dc90..c12925b 100644 --- a/lib/migrations/exported.go +++ b/lib/migrations/exported.go @@ -5,8 +5,8 @@ package migrations import ( // local - "../appcontext" - "../migrations/migrationsinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/migrations/migrationsinterface" ) var ( diff --git a/lib/parsers/exported.go b/lib/parsers/exported.go index f074d8a..19ea140 100644 --- a/lib/parsers/exported.go +++ b/lib/parsers/exported.go @@ -5,8 +5,8 @@ package parsers import ( // local - "../appcontext" - "../parsers/parsersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/parsers/parsersinterface" ) var ( diff --git a/lib/parsers/parsersinterface/parsersinterface.go b/lib/parsers/parsersinterface/parsersinterface.go index c7690f2..d5fa494 100644 --- a/lib/parsers/parsersinterface/parsersinterface.go +++ b/lib/parsers/parsersinterface/parsersinterface.go @@ -7,7 +7,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // ParsersInterface implements Parsers for importing via appcontext. diff --git a/lib/parsers/pokememe.go b/lib/parsers/pokememe.go index 25d765d..d7fe1a5 100644 --- a/lib/parsers/pokememe.go +++ b/lib/parsers/pokememe.go @@ -11,7 +11,7 @@ import ( "strings" "time" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // Internal functions diff --git a/lib/parsers/profile.go b/lib/parsers/profile.go index 13765fd..32b5d4b 100644 --- a/lib/parsers/profile.go +++ b/lib/parsers/profile.go @@ -13,7 +13,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // Internal functions diff --git a/lib/router/exported.go b/lib/router/exported.go index 7a61a8d..246e029 100644 --- a/lib/router/exported.go +++ b/lib/router/exported.go @@ -7,7 +7,7 @@ import ( // stdlib "log" // local - "../appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" ) var ( diff --git a/lib/talkers/broadcast.go b/lib/talkers/broadcast.go index 2f20be4..fa3a29d 100644 --- a/lib/talkers/broadcast.go +++ b/lib/talkers/broadcast.go @@ -10,7 +10,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // AdminBroadcastMessageCompose saves message for future broadcast diff --git a/lib/talkers/exported.go b/lib/talkers/exported.go index d25edd3..d46e060 100644 --- a/lib/talkers/exported.go +++ b/lib/talkers/exported.go @@ -7,8 +7,8 @@ import ( // stdlib "log" // local - "../appcontext" - "../talkers/talkersinterface" + "lab.pztrn.name/fat0troll/i2_bot/lib/appcontext" + "lab.pztrn.name/fat0troll/i2_bot/lib/talkers/talkersinterface" ) var ( diff --git a/lib/talkers/hello.go b/lib/talkers/hello.go index 68c7fee..2a3e671 100644 --- a/lib/talkers/hello.go +++ b/lib/talkers/hello.go @@ -7,7 +7,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // HelloMessageUnauthorized tell new user what to do. diff --git a/lib/talkers/help.go b/lib/talkers/help.go index 3efbf9b..21b4e22 100644 --- a/lib/talkers/help.go +++ b/lib/talkers/help.go @@ -7,8 +7,8 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../config" - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/config" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // HelpMessage gives user all available commands diff --git a/lib/talkers/pokedex.go b/lib/talkers/pokedex.go index d965bed..1710327 100644 --- a/lib/talkers/pokedex.go +++ b/lib/talkers/pokedex.go @@ -10,7 +10,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // Internal functions diff --git a/lib/talkers/profile.go b/lib/talkers/profile.go index 8e35f19..b8c5b89 100644 --- a/lib/talkers/profile.go +++ b/lib/talkers/profile.go @@ -10,7 +10,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // ProfileMessage shows current player's profile diff --git a/lib/talkers/suggestions.go b/lib/talkers/suggestions.go index 296caca..c425fd9 100644 --- a/lib/talkers/suggestions.go +++ b/lib/talkers/suggestions.go @@ -10,7 +10,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // BestPokememesList shows list for catching based on player league and grade diff --git a/lib/talkers/talkersinterface/talkersinterface.go b/lib/talkers/talkersinterface/talkersinterface.go index 83c79e3..1c969b9 100644 --- a/lib/talkers/talkersinterface/talkersinterface.go +++ b/lib/talkers/talkersinterface/talkersinterface.go @@ -7,7 +7,7 @@ import ( // 3rd party "github.com/go-telegram-bot-api/telegram-bot-api" // local - "../../dbmapping" + "lab.pztrn.name/fat0troll/i2_bot/lib/dbmapping" ) // TalkersInterface implements Talkers for importing via appcontex