Documentation ¶
Index ¶
- Constants
- func GenerateRandomString(length int) string
- func GetCurrentTime() time.Time
- func GetPathSegments(path string) []string
- func GetTimeIn(duration time.Duration) time.Time
- func HashScrypt(plaintext string) (hash string, err error)
- func JoinPaths(paths ...string) string
- func SplitPath(path string) (string, string)
- func ValidateScryptPassword(plaintext, hashed string) (err error)
- type LogFormatter
- type LogLevel
- type Logger
- type LoggingConfig
Constants ¶
View Source
const ( PanicLevel LogLevel = "panic" FatalLevel = "fatal" ErrorLevel = "error" WarnLevel = "warn" InfoLevel = "info" DebugLevel = "debug" TraceLevel = "trace" TerminalFormat LogFormatter = "terminal" JSONFormat = "json" TextFormat = "text" )
View Source
const (
ScryptHashID = "s1"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomString ¶
GenerateRandomString returns a random string of the given length. It uses 0-9, a-z and A-Z characters. You should not use this for IDs, as random strings are not sortable.
func GetCurrentTime ¶
func GetPathSegments ¶
func HashScrypt ¶
func ValidateScryptPassword ¶
Types ¶
type LogFormatter ¶
type LogFormatter string
type Logger ¶
type Logger interface { logrus.FieldLogger }
func CreateLogger ¶
func CreateLogger(config *LoggingConfig) Logger
type LoggingConfig ¶
type LoggingConfig struct { Level LogLevel Formatter LogFormatter ReportCaller bool }
Click to show internal directories.
Click to hide internal directories.