utils

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILEPERM_755 fs.FileMode = 0755 // Owner=rwx, Group=r-x, Other=r-x
	FILEPERM_666 fs.FileMode = 0666 // Owner=rw-, Group=rw-, Other=rw-
)

Variables

This section is empty.

Functions

func FullPathInW3SecurityCacheDir

func FullPathInW3SecurityCacheDir(cacheDir string, filename string) (string, error)

func W3SecurityCacheDir

func W3SecurityCacheDir() (string, error)

func W3SecurityCacheDirImpl

func W3SecurityCacheDirImpl(osUtil W3SecurityOSUtil) (string, error)

func W3SecurityTempDirectory

func W3SecurityTempDirectory(debugLogger *log.Logger) (string, error)

Types

type OutputDestination

type OutputDestination interface {
	Println(a ...any) (n int, err error)
	Remove(name string) error
	WriteFile(filename string, data []byte, perm fs.FileMode) error
}

func NewOutputDestination

func NewOutputDestination() OutputDestination

type OutputDestinationImpl

type OutputDestinationImpl struct{}

func (*OutputDestinationImpl) Println

func (odi *OutputDestinationImpl) Println(a ...any) (n int, err error)

func (*OutputDestinationImpl) Remove

func (odi *OutputDestinationImpl) Remove(name string) error

func (*OutputDestinationImpl) WriteFile

func (odi *OutputDestinationImpl) WriteFile(filename string, data []byte, perm fs.FileMode) error

type ToLog

type ToLog struct {
	Logger *log.Logger
}

ToLog is an io.Writer that can be used to write into a log.Logger, for example into an existing zerolog.Logger

func (*ToLog) Write

func (w *ToLog) Write(p []byte) (n int, err error)

type ToZeroLogDebug

type ToZeroLogDebug struct {
	Logger *zerolog.Logger
}

ToZeroLogDebug is an io.Writer that can be used for example with log.Logger to write to an existing zerolog writer

func (*ToZeroLogDebug) Write

func (w *ToZeroLogDebug) Write(p []byte) (n int, err error)

Write writes debug messages to the given zerolog logger

type W3SecurityOSUtil

type W3SecurityOSUtil interface {
	UserCacheDir() (string, error)
	MkdirAll(path string, perm os.FileMode) error
	Stat(name string) (os.FileInfo, error)
	TempDir() string
}

func NewW3SecurityOSUtil

func NewW3SecurityOSUtil() W3SecurityOSUtil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL