Documentation ¶
Index ¶
- Constants
- func InitRouter(opts Options) error
- func ListenAndServe(ctx context.Context, options ...Option) error
- func NewLatestBlockRouter(conn *nats.EncodedConn, chain *tracking.CanonicalChain, ...) natsutil.Router
- type LatestBlockRouter
- type Option
- func Address(addr string) Option
- func BucketClientProfilesFormat(bucket string) Option
- func BucketClientStatusesFormat(bucket string) Option
- func ChainId(chainId uint64) Option
- func NatsEmbedded(embed bool) Option
- func NatsEmbeddedConfigPath(path string) Option
- func NatsUrl(url *url.URL) Option
- func NetworkId(networkId uint64) Option
- type Options
Constants ¶
View Source
const ( DefaultAddress = ":8080" DefaultNetworkId = uint64(1) DefaultChainId = uint64(1) DefaultNatsUrl = "ns://127.0.0.1:4222" DefaultNatsEmbedded = false DefaultNatsEmbeddedConfigPath = "" DefaultBucketClientStatusFormat = "eth_%d_%d_client_statuses" DefaultBucketClientProfilesFormat = "eth_%d_%d_client_profiles" DefaultMaxDistanceFromHead = 3 )
View Source
const (
ErrNatsAlreadyConnected = errors.ConstError("nats has already been connected")
)
Variables ¶
This section is empty.
Functions ¶
func InitRouter ¶
func NewLatestBlockRouter ¶
func NewLatestBlockRouter( conn *nats.EncodedConn, chain *tracking.CanonicalChain, profileStore natseth.ProfileStore, profileCache cache.Cache, maxDistanceFromHead int, ) natsutil.Router
Types ¶
type LatestBlockRouter ¶
type LatestBlockRouter struct {
// contains filtered or unexported fields
}
func (*LatestBlockRouter) RequestWithContext ¶
type Option ¶
func NatsEmbedded ¶
func NatsEmbeddedConfigPath ¶
type Options ¶
type Options struct { Address string NetworkId uint64 ChainId uint64 NatsUrl string NatsEmbedded bool NatsEmbeddedUseDefaultConfig bool NatsEmbeddedConfigPath string BucketClientStatusesFormat string BucketClientProfilesFormat string MaxDistanceFromHead int }
func GetDefaultOptions ¶
func GetDefaultOptions() Options
Click to show internal directories.
Click to hide internal directories.