diff --git a/Dockerfile b/Dockerfile index d5fee195..03acc4d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM golang:1.13 -# TODO: work out how to get this from version.go -ARG app_version=v0.0.0-dev +ARG VERSION COPY . /go/src/github.com/stefanprodan/mgob @@ -9,19 +8,19 @@ WORKDIR /go/src/github.com/stefanprodan/mgob RUN CGO_ENABLED=0 GOOS=linux \ go build \ - -ldflags "-X main.version=$app_version" \ + -ldflags "-X main.version=$VERSION" \ -a -installsuffix cgo \ -o mgob github.com/stefanprodan/mgob/cmd/mgob -FROM alpine:3.9 +FROM alpine:3.11 ARG BUILD_DATE ARG VCS_REF ARG VERSION -ENV MONGODB_TOOLS_VERSION 4.0.5-r0 -ENV GOOGLE_CLOUD_SDK_VERSION 235.0.0 -ENV AZURE_CLI_VERSION 2.0.58 +ENV MONGODB_TOOLS_VERSION 4.2.1-r0 +ENV GOOGLE_CLOUD_SDK_VERSION 276.0.0 +ENV AZURE_CLI_VERSION 2.0.80 ENV PATH /root/google-cloud-sdk/bin:$PATH LABEL org.label-schema.build-date=$BUILD_DATE \ diff --git a/Makefile b/Makefile index e6d378fb..073b220f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL:=/bin/bash -APP_VERSION?=1.0 +APP_VERSION?=1.1 # build vars BUILD_DATE:=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") @@ -14,6 +14,14 @@ TRAVIS:=$$(pwd)/test/travis PACKAGES:=$(shell go list ./... | grep -v '/vendor/') VETARGS:=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -rangeloops -shift -structtags -unsafeptr +build: + @echo ">>> Building $(REPOSITORY)/mgob:$(APP_VERSION)" + @docker build \ + --build-arg BUILD_DATE=$(BUILD_DATE) \ + --build-arg VCS_REF=$(TRAVIS_COMMIT) \ + --build-arg VERSION=$(APP_VERSION) \ + -t $(REPOSITORY)/mgob:$(APP_VERSION) . + travis: @echo ">>> Building mgob:$(APP_VERSION).$(TRAVIS_BUILD_NUMBER) image" @docker build \ @@ -46,7 +54,7 @@ release: @docker push $(REPOSITORY)/mgob:$(APP_VERSION) @docker push $(REPOSITORY)/mgob:latest -run: build +run: @echo ">>> Starting mgob container" @docker run -dp 8090:8090 --name mgob-$(APP_VERSION) \ --restart unless-stopped \ diff --git a/README.md b/README.md index 4e0c6e8e..144ae610 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # mgob [![Build Status](https://travis-ci.org/stefanprodan/mgob.svg?branch=master)](https://travis-ci.org/stefanprodan/mgob) -[![Docker Image](https://images.microbadger.com/badges/image/stefanprodan/mgob:edge.svg)](https://hub.docker.com/r/stefanprodan/mgob/) +[![Docker Pulls](https://img.shields.io/docker/pulls/stefanprodan/mgob)](https://hub.docker.com/r/stefanprodan/mgob/) -MGOB is a MongoDB backup automation tool built with golang. +MGOB is a MongoDB backup automation tool built with Go. #### Features @@ -33,6 +33,7 @@ Compatibility matrix: `stefanprodan/mgob:0.9` | 3.4 `stefanprodan/mgob:0.10` | 3.6 `stefanprodan/mgob:1.0` | 4.0 +`stefanprodan/mgob:1.1` | 4.2 Docker: diff --git a/cmd/mgob/mgob.go b/cmd/mgob/mgob.go index 2a589112..6d94967a 100644 --- a/cmd/mgob/mgob.go +++ b/cmd/mgob/mgob.go @@ -2,15 +2,23 @@ package main import ( "os" + "os/signal" + "path" + "syscall" - log "github.com/Sirupsen/logrus" - "github.com/stefanprodan/mgob" - "github.com/stefanprodan/mgob/config" + log "github.com/sirupsen/logrus" "github.com/urfave/cli" + + "github.com/stefanprodan/mgob/pkg/api" + "github.com/stefanprodan/mgob/pkg/backup" + "github.com/stefanprodan/mgob/pkg/config" + "github.com/stefanprodan/mgob/pkg/db" + "github.com/stefanprodan/mgob/pkg/scheduler" ) var ( appConfig = &config.AppConfig{} + version = "v1.1.0-dev" ) func beforeApp(c *cli.Context) error { @@ -33,7 +41,7 @@ func beforeApp(c *cli.Context) error { func main() { app := cli.NewApp() app.Name = "mgob" - app.Version = mgob.Version + app.Version = version app.Usage = "mongodb dockerized backup agent" app.Action = start app.Before = beforeApp @@ -77,7 +85,7 @@ func main() { } func start(c *cli.Context) error { - log.Infof("mgob %v", mgob.Version) + log.Infof("mgob %v", version) appConfig.LogLevel = c.String("LogLevel") appConfig.JSONLog = c.Bool("JSONLog") @@ -86,8 +94,63 @@ func start(c *cli.Context) error { appConfig.StoragePath = c.String("StoragePath") appConfig.TmpPath = c.String("TmpPath") appConfig.DataPath = c.String("DataPath") + appConfig.Version = version + + log.Infof("starting with config: %+v", appConfig) + + info, err := backup.CheckMongodump() + if err != nil { + log.Fatal(err) + } + log.Info(info) + + info, err = backup.CheckMinioClient() + if err != nil { + log.Fatal(err) + } + log.Info(info) + + info, err = backup.CheckGCloudClient() + if err != nil { + log.Fatal(err) + } + log.Info(info) + + info, err = backup.CheckAzureClient() + if err != nil { + log.Fatal(err) + } + log.Info(info) + + plans, err := config.LoadPlans(appConfig.ConfigPath) + if err != nil { + log.Fatal(err) + } + + store, err := db.Open(path.Join(appConfig.DataPath, "mgob.db")) + if err != nil { + log.Fatal(err) + } + statusStore, err := db.NewStatusStore(store) + if err != nil { + log.Fatal(err) + } + sch := scheduler.New(plans, appConfig, statusStore) + sch.Start() + + server := &api.HttpServer{ + Config: appConfig, + Stats: statusStore, + } + log.Infof("starting http server on port %v", appConfig.Port) + go server.Start(appConfig.Version) + + // wait for SIGINT (Ctrl+C) or SIGTERM (docker stop) + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) + sig := <-sigChan - mgob.Start(appConfig) + log.Infof("shutting down %v signal received", sig) return nil } diff --git a/entry.go b/entry.go deleted file mode 100644 index 269f3e13..00000000 --- a/entry.go +++ /dev/null @@ -1,75 +0,0 @@ -package mgob - -import ( - "os" - "os/signal" - "path" - "syscall" - - log "github.com/Sirupsen/logrus" - "github.com/stefanprodan/mgob/api" - "github.com/stefanprodan/mgob/backup" - "github.com/stefanprodan/mgob/config" - "github.com/stefanprodan/mgob/db" - "github.com/stefanprodan/mgob/scheduler" -) - -var appConfig = &config.AppConfig{} - -func Start(appConfig *config.AppConfig) { - log.Infof("starting with config: %+v", appConfig) - - info, err := backup.CheckMongodump() - if err != nil { - log.Fatal(err) - } - log.Info(info) - - info, err = backup.CheckMinioClient() - if err != nil { - log.Fatal(err) - } - log.Info(info) - - info, err = backup.CheckGCloudClient() - if err != nil { - log.Fatal(err) - } - log.Info(info) - - info, err = backup.CheckAzureClient() - if err != nil { - log.Fatal(err) - } - log.Info(info) - - plans, err := config.LoadPlans(appConfig.ConfigPath) - if err != nil { - log.Fatal(err) - } - - store, err := db.Open(path.Join(appConfig.DataPath, "mgob.db")) - if err != nil { - log.Fatal(err) - } - statusStore, err := db.NewStatusStore(store) - if err != nil { - log.Fatal(err) - } - sch := scheduler.New(plans, appConfig, statusStore) - sch.Start() - - server := &api.HttpServer{ - Config: appConfig, - Stats: statusStore, - } - log.Infof("starting http server on port %v", appConfig.Port) - go server.Start(Version) - - // wait for SIGINT (Ctrl+C) or SIGTERM (docker stop) - sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) - sig := <-sigChan - - log.Infof("shutting down %v signal received", sig) -} diff --git a/go.mod b/go.mod index 4d8476d2..008b8953 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/stefanprodan/mgob go 1.13 require ( - github.com/Sirupsen/logrus v0.11.5 github.com/boltdb/bolt v1.3.1 github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect github.com/codeskyblue/go-sh v0.0.0-20170112005953-b097669b1569 @@ -15,9 +14,9 @@ require ( github.com/pkg/sftp v1.10.1-0.20190523025818-e98a7bef6829 github.com/prometheus/client_golang v0.9.3 github.com/robfig/cron v1.0.1-0.20170309132418-df38d32658d8 + github.com/sirupsen/logrus v1.4.2 github.com/urfave/cli v1.20.0 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 - golang.org/x/sys v0.0.0-20190124100055-b90733256f2e // indirect golang.org/x/text v0.3.2 // indirect gopkg.in/yaml.v2 v2.2.1 ) diff --git a/go.sum b/go.sum index dc8c96e8..d9501563 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,4 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Sirupsen/logrus v0.11.5 h1:aIMrrsnipdTlAieMe7FC/iiuJ0+ELiXCT4YiVQiK9j8= -github.com/Sirupsen/logrus v0.11.5/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -31,6 +29,7 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -62,6 +61,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/robfig/cron v1.0.1-0.20170309132418-df38d32658d8 h1:70QTOM3skvDpJG6xz4AVSU2l91+lu1nAP5qvZU7NhRc= github.com/robfig/cron v1.0.1-0.20170309132418-df38d32658d8/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= @@ -77,8 +78,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190124100055-b90733256f2e h1:3GIlrlVLfkoipSReOMNAgApI0ajnalyLa/EZHHca/XI= -golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/api/backup.go b/pkg/api/backup.go similarity index 93% rename from api/backup.go rename to pkg/api/backup.go index ce4e206d..693b1a85 100644 --- a/api/backup.go +++ b/pkg/api/backup.go @@ -6,13 +6,14 @@ import ( "net/http" "time" - log "github.com/Sirupsen/logrus" "github.com/dustin/go-humanize" "github.com/go-chi/chi" "github.com/go-chi/render" - "github.com/stefanprodan/mgob/backup" - "github.com/stefanprodan/mgob/config" - "github.com/stefanprodan/mgob/notifier" + log "github.com/sirupsen/logrus" + + "github.com/stefanprodan/mgob/pkg/backup" + "github.com/stefanprodan/mgob/pkg/config" + "github.com/stefanprodan/mgob/pkg/notifier" ) func configCtx(data config.AppConfig) func(next http.Handler) http.Handler { diff --git a/api/metrics.go b/pkg/api/metrics.go similarity index 100% rename from api/metrics.go rename to pkg/api/metrics.go diff --git a/api/server.go b/pkg/api/server.go similarity index 92% rename from api/server.go rename to pkg/api/server.go index 64691dfa..20e68a08 100644 --- a/api/server.go +++ b/pkg/api/server.go @@ -5,11 +5,12 @@ import ( "net/http" "strings" - log "github.com/Sirupsen/logrus" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" - "github.com/stefanprodan/mgob/config" - "github.com/stefanprodan/mgob/db" + log "github.com/sirupsen/logrus" + + "github.com/stefanprodan/mgob/pkg/config" + "github.com/stefanprodan/mgob/pkg/db" ) type HttpServer struct { diff --git a/api/status.go b/pkg/api/status.go similarity index 96% rename from api/status.go rename to pkg/api/status.go index 652213aa..230c3e95 100644 --- a/api/status.go +++ b/pkg/api/status.go @@ -6,7 +6,8 @@ import ( "github.com/go-chi/chi" "github.com/go-chi/render" - "github.com/stefanprodan/mgob/db" + + "github.com/stefanprodan/mgob/pkg/db" ) type appStatus []*db.Status diff --git a/api/version.go b/pkg/api/version.go similarity index 100% rename from api/version.go rename to pkg/api/version.go diff --git a/backup/azure.go b/pkg/backup/azure.go similarity index 95% rename from backup/azure.go rename to pkg/backup/azure.go index 255a85ee..eceace8c 100644 --- a/backup/azure.go +++ b/pkg/backup/azure.go @@ -7,7 +7,8 @@ import ( "github.com/codeskyblue/go-sh" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + + "github.com/stefanprodan/mgob/pkg/config" ) func azureUpload(file string, plan config.Plan) (string, error) { diff --git a/backup/backup.go b/pkg/backup/backup.go similarity index 96% rename from backup/backup.go rename to pkg/backup/backup.go index da76e9f5..49fd72cd 100644 --- a/backup/backup.go +++ b/pkg/backup/backup.go @@ -6,10 +6,11 @@ import ( "path/filepath" "time" - log "github.com/Sirupsen/logrus" "github.com/codeskyblue/go-sh" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + log "github.com/sirupsen/logrus" + + "github.com/stefanprodan/mgob/pkg/config" ) func Run(plan config.Plan, tmpPath string, storagePath string) (Result, error) { diff --git a/backup/checks.go b/pkg/backup/checks.go similarity index 100% rename from backup/checks.go rename to pkg/backup/checks.go diff --git a/backup/gcloud.go b/pkg/backup/gcloud.go similarity index 95% rename from backup/gcloud.go rename to pkg/backup/gcloud.go index ec55fdf2..8bd9eb06 100644 --- a/backup/gcloud.go +++ b/pkg/backup/gcloud.go @@ -7,7 +7,8 @@ import ( "github.com/codeskyblue/go-sh" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + + "github.com/stefanprodan/mgob/pkg/config" ) func gCloudUpload(file string, plan config.Plan) (string, error) { diff --git a/backup/local.go b/pkg/backup/local.go similarity index 97% rename from backup/local.go rename to pkg/backup/local.go index bcd09587..980c1356 100644 --- a/backup/local.go +++ b/pkg/backup/local.go @@ -6,10 +6,11 @@ import ( "strings" "time" - log "github.com/Sirupsen/logrus" "github.com/codeskyblue/go-sh" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + log "github.com/sirupsen/logrus" + + "github.com/stefanprodan/mgob/pkg/config" ) func dump(plan config.Plan, tmpPath string, ts time.Time) (string, string, error) { diff --git a/backup/result.go b/pkg/backup/result.go similarity index 100% rename from backup/result.go rename to pkg/backup/result.go diff --git a/backup/s3.go b/pkg/backup/s3.go similarity index 96% rename from backup/s3.go rename to pkg/backup/s3.go index b5fc2ea0..42223612 100644 --- a/backup/s3.go +++ b/pkg/backup/s3.go @@ -8,7 +8,8 @@ import ( "github.com/codeskyblue/go-sh" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + + "github.com/stefanprodan/mgob/pkg/config" ) func s3Upload(file string, plan config.Plan) (string, error) { @@ -24,7 +25,7 @@ func s3Upload(file string, plan config.Plan) (string, error) { if err != nil { return "", errors.Wrapf(err, "mc config host for plan %v failed %s", plan.Name, output) } - + fileName := filepath.Base(file) upload := fmt.Sprintf("mc --quiet cp %v %v/%v/%v", diff --git a/backup/sftp.go b/pkg/backup/sftp.go similarity index 98% rename from backup/sftp.go rename to pkg/backup/sftp.go index 90f71bbd..af14fce4 100644 --- a/backup/sftp.go +++ b/pkg/backup/sftp.go @@ -11,8 +11,9 @@ import ( "github.com/pkg/errors" "github.com/pkg/sftp" - "github.com/stefanprodan/mgob/config" "golang.org/x/crypto/ssh" + + "github.com/stefanprodan/mgob/pkg/config" ) func sftpUpload(file string, plan config.Plan) (string, error) { diff --git a/config/app.go b/pkg/config/app.go similarity index 89% rename from config/app.go rename to pkg/config/app.go index d86e71b8..d0d936e7 100644 --- a/config/app.go +++ b/pkg/config/app.go @@ -8,4 +8,5 @@ type AppConfig struct { StoragePath string `json:"storage_path"` TmpPath string `json:"tmp_path"` DataPath string `json:"data_path"` + Version string `json:"version"` } diff --git a/config/plan.go b/pkg/config/plan.go similarity index 100% rename from config/plan.go rename to pkg/config/plan.go diff --git a/db/stats.go b/pkg/db/stats.go similarity index 99% rename from db/stats.go rename to pkg/db/stats.go index f439114e..cba7b29d 100644 --- a/db/stats.go +++ b/pkg/db/stats.go @@ -4,9 +4,9 @@ import ( "encoding/json" "time" - log "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" ) type Status struct { diff --git a/db/store.go b/pkg/db/store.go similarity index 100% rename from db/store.go rename to pkg/db/store.go diff --git a/metrics/metrics.go b/pkg/metrics/metrics.go similarity index 100% rename from metrics/metrics.go rename to pkg/metrics/metrics.go diff --git a/notifier/notifier.go b/pkg/notifier/notifier.go similarity index 86% rename from notifier/notifier.go rename to pkg/notifier/notifier.go index 33d496d4..c88c1c02 100644 --- a/notifier/notifier.go +++ b/pkg/notifier/notifier.go @@ -1,6 +1,6 @@ package notifier -import "github.com/stefanprodan/mgob/config" +import "github.com/stefanprodan/mgob/pkg/config" func SendNotification(subject string, body string, warn bool, plan config.Plan) error { diff --git a/notifier/slack.go b/pkg/notifier/slack.go similarity index 97% rename from notifier/slack.go rename to pkg/notifier/slack.go index 55050110..dbdc300f 100644 --- a/notifier/slack.go +++ b/pkg/notifier/slack.go @@ -8,7 +8,8 @@ import ( "net/http" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + + "github.com/stefanprodan/mgob/pkg/config" ) type slackPayload struct { diff --git a/notifier/smtp.go b/pkg/notifier/smtp.go similarity index 93% rename from notifier/smtp.go rename to pkg/notifier/smtp.go index f98a1b5b..22d619b6 100644 --- a/notifier/smtp.go +++ b/pkg/notifier/smtp.go @@ -6,7 +6,8 @@ import ( "strings" "github.com/pkg/errors" - "github.com/stefanprodan/mgob/config" + + "github.com/stefanprodan/mgob/pkg/config" ) func sendEmailNotification(subject string, body string, config *config.SMTP) error { diff --git a/scheduler/scheduler.go b/pkg/scheduler/scheduler.go similarity index 93% rename from scheduler/scheduler.go rename to pkg/scheduler/scheduler.go index 70dad55e..b6f7c54b 100644 --- a/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -4,15 +4,16 @@ import ( "fmt" "time" - log "github.com/Sirupsen/logrus" "github.com/dustin/go-humanize" "github.com/pkg/errors" "github.com/robfig/cron" - "github.com/stefanprodan/mgob/backup" - "github.com/stefanprodan/mgob/config" - "github.com/stefanprodan/mgob/db" - "github.com/stefanprodan/mgob/metrics" - "github.com/stefanprodan/mgob/notifier" + log "github.com/sirupsen/logrus" + + "github.com/stefanprodan/mgob/pkg/backup" + "github.com/stefanprodan/mgob/pkg/config" + "github.com/stefanprodan/mgob/pkg/db" + "github.com/stefanprodan/mgob/pkg/metrics" + "github.com/stefanprodan/mgob/pkg/notifier" ) type Scheduler struct { diff --git a/version.go b/version.go deleted file mode 100644 index 7389ed0f..00000000 --- a/version.go +++ /dev/null @@ -1,5 +0,0 @@ -package mgob - -const ( - Version = "v0.0.0-dev" -)