funcopt

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package funcopt provides Functional Option Pattern helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[T any](params *T, opts []Option[T]) (err error)

Apply applies a slice of functional options to the given parameters.

func New

func New[T any, U any](fn func(*T, U)) func(v U) Option[T]

New creates a functional option.

func NewFailable

func NewFailable[T any, U any](fn func(*T, U) error) func(v U) Option[T]

NewFailable creates a functional option that can fail.

Types

type Option

type Option[T any] func(params *T) error

Option represents a configuration option for functional option.

Jump to

Keyboard shortcuts

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