Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is used to parametrize the Fx runtime. It contains a set of unexported type-constructors that are set by the Option type, and then provided to Fx. This allows callers to override defaults, while keeping interacton with Fx to a minimum.
func (Config) ClientBootstrap ¶
func (Config) ServerBootstrap ¶
type Env ¶
type Env interface { // Context returns the main runtime context. The returned // context MAY expire, in which case callers SHOULD finish // any outstanding work and terminate promptly. Context() context.Context Log() log.Logger Metrics() metrics.Client Bool(string) bool IsSet(string) bool Path(string) string String(string) string StringSlice(string) []string Duration(string) time.Duration Float64(string) float64 }
Env is a context object that exposes environmental data and effectful operations to the runtime.
type HostConfig ¶
type HostConfig func(...libp2p.Option) casm.HostFactory
HostConfig specifies how to construct a libp2p Host, in a parametrizable way. Implementations MUST pass the options provided to libp2p.New. They MAY prepend default options.
type Option ¶
type Option func(*Config)
Option can modify the state of Config. It is used to set type constructors that will be consumed by Fx.
func HostOpt ¶
func HostOpt(opt ...libp2p.Option) Option
HostOpt declares a set of libp2p options to be passed into the HostConifg. If len(opt) == nil, no options are passed.
func WithHostConfig ¶
func WithHostConfig(f HostConfig) Option
WithHostConfig sets the host configuration for the Fx app. Panics if f == nil.
func WithPeXOpt ¶
WithPeXOpt sets the options for the boot cache. The PeX cache is disabled by default. Calling without arguments uses the default configuration.