dmesh package - github.com/streamingfast/dmesh - Go Packages
- Constants
- Variables
- func GetLocalIP() string
- func Observe(ctx context.Context, store *clientv3.Client, ...) <-chan *PeerEvent
- func ValidateServiceList(services []string) ([]string, error)
- type BlockRangeData
- type ConnectablePeer
- type GenericPeer
- type HeadBlockData
- type MergeablePeer
- type Peer
- type PeerEvent
- type RelayerPeer
- type SearchPeer
- func NewSearchArchivePeer(serviceVersion, listenAddr string, hasMovingTail, hasMovingHead bool, ...) *SearchPeer
- func NewSearchForkResolverPeer(serviceVersion, listenAddr string, pollingDuration time.Duration) *SearchPeer
- func NewSearchHeadPeer(serviceVersion, listenAddr string, shardSize uint64, tierLevel uint32, ...) *SearchPeer
const ( EventUnkown = "unknown" EventSync = "sync" EventUpdate = "update" EventDelete = "delete" )
const ( SearchServiceName = "search" RelayerServiceName = "relayer" )
Cleans up service prefixes to watch
/v2/service-name-123/ -> /v2/service-name-123/ /v2/service-name-123 -> /v2/service-name-123/ v2/service-name-123/ -> /v2/service-name-123/ v2/service-name-123 -> /v2/service-name-123/
type BlockRangeData struct {
TailBlock uint64 `json:"tailBlockNum,omitempty"`
TailBlockID string `json:"tailBlockID,omitempty"`
TailBlockTime *time.Time `json:"tailBlockTime,omitempty"`
HeadBlockData
}
func NewTestBlockRangeData(tail, irr, head uint64) BlockRangeData
func (d BlockRangeData) Blocks() (tail, irr, head uint64)
type GenericPeer struct {
sync.RWMutex
Ready bool `json:"ready,omitempty"`
Host string `json:"host,omitempty"`
Boot *time.Time `json:"boot,omitempty"`
}
func NewTestGenericPeer(serviceVersion, serviceName, addr string) GenericPeer
func NewTestReadyGenericPeer(serviceVersion, serviceName, addr string) GenericPeer
ConnectiblePeer interface
type HeadBlockData struct {
IrrBlock uint64 `json:"irrBlockNum,omitempty"`
IrrBlockID string `json:"irrBlockID,omitempty"`
IrrBlockTime *time.Time `json:"irrBlockTime,omitempty"`
HeadBlock uint64 `json:"headBlockNum,omitempty"`
HeadBlockID string `json:"headBlockID,omitempty"`
HeadBlockTime *time.Time `json:"headBlockTime,omitempty"`
}
type MergeablePeer interface {
Merge(in Peer)
}
type RelayerPeer struct {
GenericPeer
HeadBlockData
HighBlockNum uint64 `json:"high_blk"`
}
func NewRelayerPeer(serviceVersion, listenAddr string, highBlockNum uint64) *RelayerPeer
func (p *RelayerPeer) Locked(f func()) Peer
func (p *RelayerPeer) Merge(in Peer)
type SearchPeer struct {
GenericPeer
BlockRangeData
ServesResolveForks bool `json:"resolveForks,omitempty"`
ServesReversible bool `json:"reversible,omitempty"`
HasMovingHead bool `json:"headMoves,omitempty"`
HasMovingTail bool `json:"tailMoves,omitempty"`
ShardSize uint64 `json:"shardSize"`
TierLevel uint32 `json:"tier"`
}
func NewSearchForkResolverPeer(serviceVersion, listenAddr string, pollingDuration time.Duration) *SearchPeer
func (p *SearchPeer) Locked(f func()) Peer
func (p *SearchPeer) Merge(in Peer)