internal

package
v2.11.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxSizeSubjectsListForLog added in v2.10.0

func MaxSizeSubjectsListForLog(subjects map[string]struct{}, maxToDisplay int) []string

MaxSizeSubjectsListForLog returns the keys in the map as a slice of maximum length maxToDisplay. It is useful for logging domains being managed, for example, since a map is typically needed for quick lookup, but a slice is needed for logging, and this can be quite a doozy since there may be a huge amount (hundreds of thousands).

func PrivateRangesCIDR added in v2.9.0

func PrivateRangesCIDR() []string

PrivateRangesCIDR returns a list of private CIDR range strings, which can be used as a configuration shortcut.

func SplitUnixSocketPermissionsBits

func SplitUnixSocketPermissionsBits(addr string) (path string, fileMode fs.FileMode, err error)

SplitUnixSocketPermissionsBits takes a unix socket address in the unusual "path|bits" format (e.g. /run/caddy.sock|0222) and tries to split it into socket path (host) and permissions bits (port). Colons (":") can't be used as separator, as socket paths on Windows may include a drive letter (e.g. `unix/c:\absolute\path.sock`). Permission bits will default to 0200 if none are specified. Throws an error, if the first carrying bit does not include write perms (e.g. `0422` or `022`). Symbolic permission representation (e.g. `u=w,g=w,o=w`) is not supported and will throw an error for now!

Types

type LogBufferCore added in v2.11.0

type LogBufferCore struct {
	// contains filtered or unexported fields
}

LogBufferCore is a zapcore.Core that buffers log entries in memory.

func NewLogBufferCore added in v2.11.0

func NewLogBufferCore(level zapcore.LevelEnabler) *LogBufferCore

func (*LogBufferCore) Check added in v2.11.0

func (*LogBufferCore) Enabled added in v2.11.0

func (c *LogBufferCore) Enabled(lvl zapcore.Level) bool

func (*LogBufferCore) FlushTo added in v2.11.0

func (c *LogBufferCore) FlushTo(logger *zap.Logger)

FlushTo flushes buffered logs to the given zap.Logger.

func (*LogBufferCore) Sync added in v2.11.0

func (c *LogBufferCore) Sync() error

func (*LogBufferCore) With added in v2.11.0

func (c *LogBufferCore) With(fields []zapcore.Field) zapcore.Core

func (*LogBufferCore) Write added in v2.11.0

func (c *LogBufferCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type LogBufferCoreInterface added in v2.11.0

type LogBufferCoreInterface interface {
	zapcore.Core
	FlushTo(*zap.Logger)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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