internal

package
v0.0.0-...-3cd5639 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package internal contains various random shared code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit() string

func FindFreePort

func FindFreePort(preferred ...int) int

FindFreePort returns an available TCP port to listen to, first trying preferred.

func InitLog

func InitLog(programLevel *slog.LevelVar)

func IsHostPort

func IsHostPort(s string) bool

IsHostPort returns true if the string seems like a valid "host:port" string.

func Logger

func Logger(ctx context.Context) *slog.Logger

Logger retrieves a slog.Logger from the context if any, otherwise returns slog.Default().

func WithLogger

func WithLogger(ctx context.Context, logger *slog.Logger) context.Context

WithLogger injects a slog.Logger into the context. It can be retrieved with Logger().

Types

This section is empty.

Directories

Path Synopsis
Package internaltest is awesome sauce for unit testing.
Package internaltest is awesome sauce for unit testing.

Jump to

Keyboard shortcuts

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