fx_opt

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(typ interface{}) interface{}

From (*T) -> func(t T) T {return t}

func FromVal

func FromVal[T any](v T) func() T

Types

type Invoke

type Invoke int

func NextInvoke

func NextInvoke() Invoke

type Logger

type Logger struct{}

Logger log for debug fx message

func (Logger) Printf

func (log Logger) Printf(msg string, arg ...interface{})

Printf print fx log message to debug log

type Option

type Option func(*Settings) error

Option is a functional option which can be used with the New function to change how the node is constructed

Options are applied in sequence

func Annotate

func Annotate(typ, constructor interface{}) Option

func ApplyIf

func ApplyIf(check func(s *Settings) bool, opts ...Option) Option

func Error

func Error(err error) Option

Error is a special option which returns an error when applied

func If

func If(b bool, opts ...Option) Option

func Options

func Options(opts ...Option) Option

Options groups multiple options into one

func Override

func Override(typ, constructor interface{}) Option

Override option changes constructor for a given type

func Unset

func Unset(typ interface{}) Option

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

type StopFunc

type StopFunc func(context.Context) error

func New

func New(ctx context.Context, opts ...Option) (StopFunc, error)

New builds and starts new Filecoin node

Jump to

Keyboard shortcuts

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