opt

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package opt provides a small generic implementation of the functional options pattern. Option[T] is a function that mutates a value of type T and may return an error; Options[T] is a slice of them whose Apply method runs each option in order and stops at the first error. It lets constructors accept a variadic ...Option[T] for type-safe, composable configuration without per-type boilerplate. Code generated by apic; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option[T any] func(T) error

func (Option[T]) Apply

func (o Option[T]) Apply(v T) error

type Options

type Options[T any] []Option[T]

func (Options[T]) Apply

func (o Options[T]) Apply(v T) error

Jump to

Keyboard shortcuts

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