Documentation ¶
Index ¶
- type Init
- func (ini *Init) Add(initFn func() (any, error)) *Init
- func (ini *Init) AddWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init
- func (ini *Init) Branch(initFn func() (any, error)) *Init
- func (ini *Init) BranchWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init
- func (ini *Init) Do() (any, error)
- func (ini *Init) InitCount() int
- func (ini *Init) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Init ¶
type Init struct {
// contains filtered or unexported fields
}
Init holds a graph of lazily initialized dependencies.
func (*Init) AddWithTimeout ¶
func (ini *Init) AddWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init
AddWithTimeout is same as Add, but with a timeout that aborts initialization.
func (*Init) Branch ¶
Branch creates a new dependency branch based on an existing and adds the given dependency as a child.
func (*Init) BranchWithTimeout ¶ added in v0.60.0
func (ini *Init) BranchWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init
BranchdWithTimeout is same as Branch, but with a timeout.
Click to show internal directories.
Click to hide internal directories.