rename package

This commit is contained in:
Dawid Wysokiński 2020-06-02 09:00:40 +02:00
parent 135709e698
commit dcf839ed77
12 changed files with 35 additions and 91 deletions

View File

@ -5,12 +5,13 @@ import (
"fmt"
"log"
"time"
"twdcbot/discord"
"twdcbot/scraper"
"twdcbot/server"
"twdcbot/tribalwars"
"twdcbot/tribe"
"twdcbot/utils"
"github.com/tribalwarshelp/dcbot/discord"
"github.com/tribalwarshelp/dcbot/scraper"
"github.com/tribalwarshelp/dcbot/server"
"github.com/tribalwarshelp/dcbot/tribalwars"
"github.com/tribalwarshelp/dcbot/tribe"
"github.com/tribalwarshelp/dcbot/utils"
"github.com/robfig/cron/v3"
)

View File

@ -5,9 +5,10 @@ import (
"fmt"
"strconv"
"strings"
"twdcbot/models"
"twdcbot/server"
"twdcbot/tribe"
"github.com/tribalwarshelp/dcbot/models"
"github.com/tribalwarshelp/dcbot/server"
"github.com/tribalwarshelp/dcbot/tribe"
"github.com/bwmarrin/discordgo"
)

View File

@ -1,31 +0,0 @@
version: '3.6'
services:
db:
image: 'postgres:10.13'
container_name: twdcpg
networks:
- internal
volumes:
- '/twdcpg:/var/lib/postgresql/data'
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=twdcbot
- TZ=UTC
bot:
build: ./
container_name: twdc
networks:
- internal
environment:
- WAIT_HOSTS=db:5432
- DB_HOST=db
- DB_NAME=twdcbot
- DB_PORT=5432
- DB_USER=postgres
- DB_PASSWORD=${POSTGRES_PASSWORD}
- TZ=UTC
- BOT_TOKEN
networks:
internal:
external: false

3
go.mod
View File

@ -1,4 +1,4 @@
module twdcbot
module github.com/tribalwarshelp/dcbot
go 1.14
@ -19,6 +19,7 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/temoto/robotstxt v1.1.1 // indirect
github.com/tribalwarshelp/shared v0.0.0-20200602060635-0b3cb090edc5
golang.org/x/net v0.0.0-20200528225125-3c3fba18258b // indirect
google.golang.org/protobuf v1.24.0 // indirect
)

2
go.sum
View File

@ -120,6 +120,8 @@ github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++Ja
github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
github.com/tribalwarshelp/shared v0.0.0-20200602060635-0b3cb090edc5 h1:LeReuMU2zNi7tftm8nytrmkuD4BtLFUYZ3nlSZLE6ow=
github.com/tribalwarshelp/shared v0.0.0-20200602060635-0b3cb090edc5/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
github.com/vmihailenco/bufpool v0.1.5/go.mod h1:fL9i/PRTuS7AELqAHwSU1Zf1c70xhkhGe/cD5ud9pJk=
github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=

14
main.go
View File

@ -5,11 +5,13 @@ import (
"os"
"os/signal"
"syscall"
_cron "twdcbot/cron"
"twdcbot/discord"
"twdcbot/mode"
server_repository "twdcbot/server/repository"
tribe_repository "twdcbot/tribe/repository"
_cron "github.com/tribalwarshelp/dcbot/cron"
"github.com/tribalwarshelp/dcbot/discord"
server_repository "github.com/tribalwarshelp/dcbot/server/repository"
tribe_repository "github.com/tribalwarshelp/dcbot/tribe/repository"
"github.com/tribalwarshelp/shared/mode"
"github.com/go-pg/pg/v10"
"github.com/joho/godotenv"
@ -77,6 +79,4 @@ func main() {
<-channel
log.Print("shutting down")
os.Exit(0)
}

View File

@ -1,35 +0,0 @@
package mode
import "os"
const (
EnvMode = "mode"
DevelopmentMode = "development"
ProductionMode = "production"
TestMode = "test"
)
var mode = DevelopmentMode
func init() {
Set(os.Getenv(EnvMode))
}
func Set(value string) {
if value == "" {
value = DevelopmentMode
}
switch value {
case DevelopmentMode,
ProductionMode,
TestMode:
mode = value
default:
panic("unknown mode: " + value)
}
}
func Get() string {
return mode
}

View File

@ -7,8 +7,9 @@ import (
"strings"
"sync"
"time"
"twdcbot/tribalwars"
"twdcbot/utils"
"github.com/tribalwarshelp/dcbot/tribalwars"
"github.com/tribalwarshelp/dcbot/utils"
"github.com/PuerkitoBio/goquery"
"github.com/gocolly/colly"

View File

@ -2,7 +2,8 @@ package server
import (
"context"
"twdcbot/models"
"github.com/tribalwarshelp/dcbot/models"
)
type Repository interface {

View File

@ -2,8 +2,9 @@ package repository
import (
"context"
"twdcbot/models"
"twdcbot/server"
"github.com/tribalwarshelp/dcbot/models"
"github.com/tribalwarshelp/dcbot/server"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"

View File

@ -2,7 +2,8 @@ package tribe
import (
"context"
"twdcbot/models"
"github.com/tribalwarshelp/dcbot/models"
)
type Repository interface {

View File

@ -2,8 +2,9 @@ package repository
import (
"context"
"twdcbot/models"
"twdcbot/tribe"
"github.com/tribalwarshelp/dcbot/models"
"github.com/tribalwarshelp/dcbot/tribe"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"