Go API Documentation

github.com/caddyserver/caddy/v2/internal

No package summary is available.

Package

Files: 2. Third party imports: 0. Imports from organisation: 0. Tests: 0. Benchmarks: 0.

Functions

func MaxSizeSubjectsListForLog

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).

Uses: fmt.Sprintf.

func PrivateRangesCIDR

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

func SplitUnixSocketPermissionsBits

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!

Uses: fmt.Errorf, fs.FileMode, strconv.ParseUint, strings.SplitN.