From 9005bb6dad0811ee8747890ec274c3149a589de3 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 8 Mar 2020 00:17:54 +0530 Subject: [PATCH] Move internal packages to 'internal' dir --- go.sum | 13 ------------- import.go | 2 +- init.go | 12 ++++++------ {manager => internal/manager}/manager.go | 2 +- {media => internal/media}/media.go | 0 .../media}/providers/filesystem/filesystem.go | 2 +- {media => internal/media}/providers/s3/s3.go | 2 +- {messenger => internal/messenger}/emailer.go | 0 {messenger => internal/messenger}/messenger.go | 0 {subimporter => internal/subimporter}/importer.go | 0 main.go | 8 ++++---- media.go | 2 +- public.go | 4 ++-- subscribers.go | 2 +- 14 files changed, 18 insertions(+), 31 deletions(-) rename {manager => internal/manager}/manager.go (99%) rename {media => internal/media}/media.go (100%) rename {media => internal/media}/providers/filesystem/filesystem.go (98%) rename {media => internal/media}/providers/s3/s3.go (98%) rename {messenger => internal/messenger}/emailer.go (100%) rename {messenger => internal/messenger}/messenger.go (100%) rename {subimporter => internal/subimporter}/importer.go (100%) diff --git a/go.sum b/go.sum index a85dd11..23b0483 100644 --- a/go.sum +++ b/go.sum @@ -16,7 +16,6 @@ github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwn github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -30,8 +29,6 @@ github.com/knadh/goyesql v2.0.0+incompatible h1:hJFJrU8kaiLmvYt9I/1k1AB7q+qRhHs/ github.com/knadh/goyesql v2.0.0+incompatible/go.mod h1:W0tSzU8l7lYH1Fihj+bdQzkzOwvirrsMNHwkuY22qoY= github.com/knadh/goyesql/v2 v2.1.1 h1:Orp5ldaxPM4ozKHfu1m7p6iolJFXDGOpF3/jyOgO6ls= github.com/knadh/goyesql/v2 v2.1.1/go.mod h1:pMzCA130/ZhEIoMmSmbEFXor3A2dxl5L+JllAc/l64s= -github.com/knadh/koanf v0.4.4 h1:Pg+eR7wuJtCGHLeip31K20eJojjZ3lXE8ILQQGj2PTM= -github.com/knadh/koanf v0.4.4/go.mod h1:Qd5yvXN39ZzjoRJdXMKN2QqHzQKhSx/K8fU5gyn4LPs= github.com/knadh/koanf v0.8.1 h1:4VLACWqrkWRQIup3ooq6lOnaSbOJSNO+YVXnJn/NPZ8= github.com/knadh/koanf v0.8.1/go.mod h1:kVvmDbXnBtW49Czi4c1M+nnOWF0YSNZ8BaKvE/bCO1w= github.com/knadh/stuffbin v1.0.0 h1:NQon6PTpLXies4bRFhS3VpLCf6y+jn6YVXU3i2wPQ+M= @@ -59,8 +56,6 @@ github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfS github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rhnvrm/simples3 v0.2.4-0.20191018074503-3d5b071ef727 h1:2josYcx2gm3CT0WMqi0jBagvg50V3UMWlYN/CnBEbSI= -github.com/rhnvrm/simples3 v0.2.4-0.20191018074503-3d5b071ef727/go.mod h1:iphavgjkW1uvoIiqLUX6D42XuuI9Cr+B/63xw3gb9qA= github.com/rhnvrm/simples3 v0.5.0 h1:X+WX0hqoKScdoJAw/G3GArfZ6Ygsn8q+6MdocTMKXOw= github.com/rhnvrm/simples3 v0.5.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= @@ -72,17 +67,11 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8= github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= -golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd h1:VtIkGDhk0ph3t+THbvXHfMZ8QHgsBO39Nh52+74pq7w= -golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b h1:VHyIDlv3XkfCa5/a81uzaoDkHH4rr81Z62g+xlnO8uM= golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225 h1:kNX+jCowfMYzvlSvJu5pQWEmyWFrBXJ3PBy10xKMXK8= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992 h1:BH3eQWeGbwRU2+wxxuuPOdFBmaiBH81O8BugSjHeTFg= -golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24 h1:R8bzl0244nw47n1xKs1MUMAaTNgjavKcN/aX2Ss3+Fo= @@ -91,8 +80,6 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/import.go b/import.go index c91fd85..566486c 100644 --- a/import.go +++ b/import.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/knadh/listmonk/subimporter" + "github.com/knadh/listmonk/internal/subimporter" "github.com/labstack/echo" ) diff --git a/init.go b/init.go index a8d28d4..769a579 100644 --- a/init.go +++ b/init.go @@ -14,12 +14,12 @@ import ( "github.com/knadh/goyesql/v2" goyesqlx "github.com/knadh/goyesql/v2/sqlx" "github.com/knadh/koanf/maps" - "github.com/knadh/listmonk/manager" - "github.com/knadh/listmonk/media" - "github.com/knadh/listmonk/media/providers/filesystem" - "github.com/knadh/listmonk/media/providers/s3" - "github.com/knadh/listmonk/messenger" - "github.com/knadh/listmonk/subimporter" + "github.com/knadh/listmonk/internal/manager" + "github.com/knadh/listmonk/internal/media" + "github.com/knadh/listmonk/internal/media/providers/filesystem" + "github.com/knadh/listmonk/internal/media/providers/s3" + "github.com/knadh/listmonk/internal/messenger" + "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/stuffbin" "github.com/labstack/echo" ) diff --git a/manager/manager.go b/internal/manager/manager.go similarity index 99% rename from manager/manager.go rename to internal/manager/manager.go index 2652227..4c816fc 100644 --- a/manager/manager.go +++ b/internal/manager/manager.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/knadh/listmonk/messenger" + "github.com/knadh/listmonk/internal/messenger" "github.com/knadh/listmonk/models" ) diff --git a/media/media.go b/internal/media/media.go similarity index 100% rename from media/media.go rename to internal/media/media.go diff --git a/media/providers/filesystem/filesystem.go b/internal/media/providers/filesystem/filesystem.go similarity index 98% rename from media/providers/filesystem/filesystem.go rename to internal/media/providers/filesystem/filesystem.go index 4d9c19a..112db93 100644 --- a/media/providers/filesystem/filesystem.go +++ b/internal/media/providers/filesystem/filesystem.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/knadh/listmonk/media" + "github.com/knadh/listmonk/internal/media" ) const tmpFilePrefix = "listmonk" diff --git a/media/providers/s3/s3.go b/internal/media/providers/s3/s3.go similarity index 98% rename from media/providers/s3/s3.go rename to internal/media/providers/s3/s3.go index 653db81..0b23686 100644 --- a/media/providers/s3/s3.go +++ b/internal/media/providers/s3/s3.go @@ -6,7 +6,7 @@ import ( "io" "time" - "github.com/knadh/listmonk/media" + "github.com/knadh/listmonk/internal/media" "github.com/rhnvrm/simples3" ) diff --git a/messenger/emailer.go b/internal/messenger/emailer.go similarity index 100% rename from messenger/emailer.go rename to internal/messenger/emailer.go diff --git a/messenger/messenger.go b/internal/messenger/messenger.go similarity index 100% rename from messenger/messenger.go rename to internal/messenger/messenger.go diff --git a/subimporter/importer.go b/internal/subimporter/importer.go similarity index 100% rename from subimporter/importer.go rename to internal/subimporter/importer.go diff --git a/main.go b/main.go index cbb0c03..a3cb4be 100644 --- a/main.go +++ b/main.go @@ -14,10 +14,10 @@ import ( "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/posflag" - "github.com/knadh/listmonk/manager" - "github.com/knadh/listmonk/media" - "github.com/knadh/listmonk/messenger" - "github.com/knadh/listmonk/subimporter" + "github.com/knadh/listmonk/internal/manager" + "github.com/knadh/listmonk/internal/media" + "github.com/knadh/listmonk/internal/messenger" + "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/stuffbin" flag "github.com/spf13/pflag" ) diff --git a/media.go b/media.go index c36ba40..a07ee3d 100644 --- a/media.go +++ b/media.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/gofrs/uuid" - "github.com/knadh/listmonk/media" + "github.com/knadh/listmonk/internal/media" "github.com/labstack/echo" ) diff --git a/public.go b/public.go index afa6c34..6175615 100644 --- a/public.go +++ b/public.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" - "github.com/knadh/listmonk/messenger" + "github.com/knadh/listmonk/internal/messenger" + "github.com/knadh/listmonk/internal/subimporter" "github.com/knadh/listmonk/models" - "github.com/knadh/listmonk/subimporter" "github.com/labstack/echo" "github.com/lib/pq" ) diff --git a/subscribers.go b/subscribers.go index ab6e38f..3d7032e 100644 --- a/subscribers.go +++ b/subscribers.go @@ -13,7 +13,7 @@ import ( "github.com/asaskevich/govalidator" "github.com/gofrs/uuid" "github.com/knadh/listmonk/models" - "github.com/knadh/listmonk/subimporter" + "github.com/knadh/listmonk/internal/subimporter" "github.com/labstack/echo" "github.com/lib/pq" )