options

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assign

func Assign[T any](defaults *T, options ...Option[T]) error

func LazyNew

func LazyNew[T any](options ...Option[T]) func() (T, error)

func MustAssign

func MustAssign[T any](defaults *T, options ...MustOption[T])

func MustNew

func MustNew[T any](options ...MustOption[T]) T

func MustNewWithDefaults

func MustNewWithDefaults[T any](defaults T, options ...MustOption[T]) T

func New

func New[T any](options ...Option[T]) (T, error)

func NewWithDefaults

func NewWithDefaults[T any](defaults T, options ...Option[T]) (T, error)

Types

type MustOption

type MustOption[T any] func(o *T)

func (MustOption[T]) MustAssign

func (o MustOption[T]) MustAssign(t *T)

func (MustOption[T]) ToOption

func (o MustOption[T]) ToOption() Option[T]

type Option

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

func CompositeOption

func CompositeOption[T any](options ...Option[T]) Option[T]

func MustOptionsToOptions

func MustOptionsToOptions[T any](options ...MustOption[T]) []Option[T]

func (Option[T]) ToMustOption

func (o Option[T]) ToMustOption() MustOption[T]

Jump to

Keyboard shortcuts

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