opt

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[Options any](this *Options, opts ...Option[Options])

Apply sets the given options on the provided structure. this is a pointer to the structure to configure. opts are a list of configuration options to apply.

func TryApply

func TryApply[Options any](this *Options, opts ...TryOption[Options]) error

TryApply applies a list of TryOption functions to the given options and returns an error if any of the functions fail.

Types

type Option

type Option[Options any] func(opt *Options)

Option represents a function that configures an instance of the specified type Options by modifying its fields.

type TryOption

type TryOption[Options any] func(opt *Options) error

TryOption defines a function type that modifies an Options object and returns an error if the modification fails.

Jump to

Keyboard shortcuts

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