From 2fc4f8c96388b7473ddcf64d6a72752c9b4d9ded Mon Sep 17 00:00:00 2001 From: ston1th Date: Sat, 4 May 2019 21:58:02 +0200 Subject: [PATCH] copyright and cleanup --- pkg/core/helper.go | 2 ++ pkg/core/timeout.go | 2 ++ pkg/db/blacklist.go | 2 ++ pkg/db/migration.go | 2 ++ pkg/fs/file.go | 2 ++ pkg/fs/fs.go | 2 ++ pkg/fs/helper.go | 2 ++ pkg/index/classify.go | 2 ++ pkg/index/id.go | 2 ++ pkg/index/mapping.go | 2 ++ pkg/scan/helper.go | 2 ++ pkg/scan/scanner.go | 2 ++ pkg/server/helper.go | 45 ------------------------------------------- 13 files changed, 24 insertions(+), 45 deletions(-) delete mode 100644 pkg/server/helper.go diff --git a/pkg/core/helper.go b/pkg/core/helper.go index 48b6c49..7da268a 100644 --- a/pkg/core/helper.go +++ b/pkg/core/helper.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package core import ( diff --git a/pkg/core/timeout.go b/pkg/core/timeout.go index 771603e..3e758f9 100644 --- a/pkg/core/timeout.go +++ b/pkg/core/timeout.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package core import ( diff --git a/pkg/db/blacklist.go b/pkg/db/blacklist.go index e7160ae..bb85818 100644 --- a/pkg/db/blacklist.go +++ b/pkg/db/blacklist.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package db import "git.giftfish.de/ston1th/jwt/v3" diff --git a/pkg/db/migration.go b/pkg/db/migration.go index 8cc464e..a989548 100644 --- a/pkg/db/migration.go +++ b/pkg/db/migration.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package db import ( diff --git a/pkg/fs/file.go b/pkg/fs/file.go index d0f337d..252f1d2 100644 --- a/pkg/fs/file.go +++ b/pkg/fs/file.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package fs import ( diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go index 58ef1f0..6ba6085 100644 --- a/pkg/fs/fs.go +++ b/pkg/fs/fs.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package fs import ( diff --git a/pkg/fs/helper.go b/pkg/fs/helper.go index 385225d..54c6f50 100644 --- a/pkg/fs/helper.go +++ b/pkg/fs/helper.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package fs import ( diff --git a/pkg/index/classify.go b/pkg/index/classify.go index df5e248..9e08047 100644 --- a/pkg/index/classify.go +++ b/pkg/index/classify.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package index import ( diff --git a/pkg/index/id.go b/pkg/index/id.go index 7f846d3..73e72ac 100644 --- a/pkg/index/id.go +++ b/pkg/index/id.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package index import ( diff --git a/pkg/index/mapping.go b/pkg/index/mapping.go index 9c5d772..45c0e66 100644 --- a/pkg/index/mapping.go +++ b/pkg/index/mapping.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package index import ( diff --git a/pkg/scan/helper.go b/pkg/scan/helper.go index 7567d0f..15516d0 100644 --- a/pkg/scan/helper.go +++ b/pkg/scan/helper.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package scan import ( diff --git a/pkg/scan/scanner.go b/pkg/scan/scanner.go index 7aa0e20..2d9ec19 100644 --- a/pkg/scan/scanner.go +++ b/pkg/scan/scanner.go @@ -1,3 +1,5 @@ +// Copyright (C) 2019 Marius Schellenberger + package scan import ( diff --git a/pkg/server/helper.go b/pkg/server/helper.go deleted file mode 100644 index 56c0533..0000000 --- a/pkg/server/helper.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2019 Marius Schellenberger - -package server - -import ( - "errors" - "strconv" - "time" -) - -const ( - day = time.Hour * 24 - min = time.Second * 30 - max = day * 90 -) - -func duration(duration, mode string) (d time.Duration, err error) { - switch mode { - case "1": - d, err = time.ParseDuration(duration) - if err != nil { - err = errors.New("could not parse duration") - return - } - case "2": - var t int - t, err = strconv.Atoi(duration) - if err != nil { - err = errors.New("could not parse duration") - return - } - d = time.Duration(int(day) * t) - default: - err = errors.New("invalid mode") - return - } - - if d < min { - err = errors.New("minimum duration is 30 seconds") - } - if d > max { - err = errors.New("maximum duration is 90 days") - } - return -}