Skip to content

Commit f1a5bc2

Browse files
committed
chg: [filewatcher] daily rotation of watched folder - fixed
1 parent daf9d72 commit f1a5bc2

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

d4-goclient.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type (
7070
rate time.Duration
7171
cc bool
7272
tor bool
73-
daily bool
73+
daily bool
7474
json bool
7575
ca x509.CertPool
7676
d4error uint8
@@ -113,17 +113,17 @@ var (
113113
tmpretry, _ = time.ParseDuration("30s")
114114
tmprate, _ = time.ParseDuration("200ms")
115115

116-
confdir = flag.String("c", "", "configuration directory")
117-
debug = flag.Bool("v", false, "Set to True, true, TRUE, 1, or t to enable verbose output on stdout - Don't use in production")
118-
ce = flag.Bool("ce", true, "Set to True, true, TRUE, 1, or t to enable TLS on network destination")
119-
ct = flag.Duration("ct", tmpct, "Set timeout in human format")
120-
cka = flag.Duration("cka", tmpcka, "Keep Alive time human format, 0 to disable")
121-
retry = flag.Duration("rt", tmpretry, "Time in human format before retry after connection failure, set to 0 to exit on failure")
122-
rate = flag.Duration("rl", tmprate, "Rate limiter: time in human format before retry after EOF")
123-
cc = flag.Bool("cc", false, "Check TLS certificate against rootCA.crt")
124-
torflag = flag.Bool("tor", false, "Use a SOCKS5 tor proxy on 9050")
125-
dailyflag = flag.Bool("daily", false, "Sets up filewatcher to watch a new %Y%M%D folder at midnight")
126-
jsonflag = flag.Bool("json", false, "The files watched are json files")
116+
confdir = flag.String("c", "", "configuration directory")
117+
debug = flag.Bool("v", false, "Set to True, true, TRUE, 1, or t to enable verbose output on stdout - Don't use in production")
118+
ce = flag.Bool("ce", true, "Set to True, true, TRUE, 1, or t to enable TLS on network destination")
119+
ct = flag.Duration("ct", tmpct, "Set timeout in human format")
120+
cka = flag.Duration("cka", tmpcka, "Keep Alive time human format, 0 to disable")
121+
retry = flag.Duration("rt", tmpretry, "Time in human format before retry after connection failure, set to 0 to exit on failure")
122+
rate = flag.Duration("rl", tmprate, "Rate limiter: time in human format before retry after EOF")
123+
cc = flag.Bool("cc", false, "Check TLS certificate against rootCA.crt")
124+
torflag = flag.Bool("tor", false, "Use a SOCKS5 tor proxy on 9050")
125+
dailyflag = flag.Bool("daily", false, "Sets up filewatcher to watch a new %Y%M%D folder at midnight")
126+
jsonflag = flag.Bool("json", false, "The files watched are json files")
127127
)
128128

129129
func main() {
@@ -522,7 +522,7 @@ func setReaderWriters(d4 *d4S, force bool) bool {
522522
}
523523
case "folder":
524524
var err error
525-
(*d4).src, err = inputreader.NewFileWatcherReader((*d4).conf.folderstr, (*d4).json, (*d4).daily)
525+
(*d4).src, err = inputreader.NewFileWatcherReader((*d4).conf.folderstr, (*d4).json, (*d4).daily, logger)
526526
if err != nil {
527527
log.Printf("Could not create File Watcher %q \n", err)
528528
return false

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ module github.com/D4-project/d4-goclient
22

33
go 1.13
44

5+
56
require (
6-
github.com/D4-project/d4-golang-utils v0.1.13
7+
github.com/D4-project/d4-golang-utils v0.1.14
78
github.com/gofrs/uuid v4.0.0+incompatible // indirect
89
github.com/gomodule/redigo v2.0.0+incompatible
910
golang.org/x/net v0.0.0-20210119194325-5f4716e94777

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/D4-project/d4-golang-utils v0.1.13 h1:pqa72t2HrbL3QZUGnK0o8wtWOuslkkz8F5E0BzKjwio=
22
github.com/D4-project/d4-golang-utils v0.1.13/go.mod h1:qXVZ3kCL72i3uYe29t7aEy9dU0bNqtFvcoNE1dJu0zo=
3+
github.com/D4-project/d4-golang-utils v0.1.14 h1:APwN+i4qyDrxT8gvlbeV/VXfNas2GvPWOnkTGX1K2Lo=
4+
github.com/D4-project/d4-golang-utils v0.1.14/go.mod h1:qXVZ3kCL72i3uYe29t7aEy9dU0bNqtFvcoNE1dJu0zo=
35
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
46
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
57
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=

0 commit comments

Comments
 (0)