Documentation
¶
Index ¶
- Constants
- Variables
- func CheckReplicationFactor() int
- func Contains(arr []string, val string) bool
- func ConvertHumanReadable(b int64) string
- func DuplicateDevice(src, dest string) error
- func Filter(list []string, check func(string) bool) []string
- func FilteredLoggingHandler(filteredPaths map[string]struct{}, writer io.Writer, router http.Handler) http.Handler
- func GetFileActualSize(file string) int64
- func GetReadTimeout() time.Duration
- func GetWriteTimeout() time.Duration
- func LogRotate(dir string) error
- func Now() string
- func ParseAddresses(address string) (string, string, string, error)
- func RemoveDevice(dev string) error
- func SetLogging(dir string, lf LogToFile) error
- func StartLoggingToFile(dir string, lf LogToFile) error
- func SyncDir(dir string) error
- func UUID() string
- func ValidVolumeName(name string) bool
- func Volume2ISCSIName(name string) string
- func WriteLogInfo(dir string, lf LogToFile) error
- type LogToFile
Constants ¶
View Source
const ( LogInfo = "log.info" BlockSizeLinux = 512 MaxLogFileSize = "maxLogFileSize" RetentionPeriod = "retentionPeriod" MaxBackups = "maxBackups" DefaultLogFileSize = 100 DefaultRetentionPeriod = 180 DefaultMaxBackups = 5 )
Variables ¶
View Source
var ( MaximumVolumeNameSize = 64 Logrotator *lumberjack.Logger )
Functions ¶
func CheckReplicationFactor ¶
func CheckReplicationFactor() int
CheckReplicationFactor returns the value of env var REPLICATION_FACTOR if it has not been set, then it returns 0.
func ConvertHumanReadable ¶
func DuplicateDevice ¶
func FilteredLoggingHandler ¶
func GetFileActualSize ¶
func GetReadTimeout ¶
GetReadTimeout gets the read timeout value from the env
func GetWriteTimeout ¶
GetWriteTimeout gets the write timeout value from the env
func ParseAddresses ¶
ParseAddresses returns the base address and two with subsequent ports
func RemoveDevice ¶
func SetLogging ¶
func StartLoggingToFile ¶
func SyncDir ¶
SyncDir sync dir after creating or deleting the file the directory also needs to be synced in order to guarantee the file is visible across system crashes. See man page of fsync for more details.
func ValidVolumeName ¶
func Volume2ISCSIName ¶
func WriteLogInfo ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.