item

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessStatusPopulateP2sh       = "populate-p2sh"
	ProcessStatusPopulateAddr       = "populate-addr"
	ProcessStatusPopulateAddrInputs = "populate-addr-inputs"
)
View Source
const (
	IpBytePadSize = 18
)
View Source
const (
	SyncStatusComplete = "complete"
)

Variables

This section is empty.

Functions

func GetCountPeerConnections

func GetCountPeerConnections() (uint64, error)

func GetCountPeers

func GetCountPeers() (uint64, error)

func GetTopics

func GetTopics() []db.Object

func GetTopicsSorted

func GetTopicsSorted() []db.Object

func LogProcessError

func LogProcessError(processError *ProcessError) error

Types

type FoundPeer

type FoundPeer struct {
	Ip        []byte
	Port      uint16
	FoundIp   []byte
	FoundPort uint16
}

func GetFoundPeers

func GetFoundPeers(shard uint32, startId []byte, ip []byte, port uint16) ([]*FoundPeer, error)

func (*FoundPeer) Deserialize

func (p *FoundPeer) Deserialize([]byte)

func (*FoundPeer) GetShardSource

func (p *FoundPeer) GetShardSource() uint

func (*FoundPeer) GetTopic

func (p *FoundPeer) GetTopic() string

func (*FoundPeer) GetUid

func (p *FoundPeer) GetUid() []byte

func (*FoundPeer) Serialize

func (p *FoundPeer) Serialize() []byte

func (*FoundPeer) SetUid

func (p *FoundPeer) SetUid(uid []byte)

type IpPort

type IpPort struct {
	Ip   []byte
	Port uint16
}

type Message

type Message struct {
	Id      uint
	Message string
	Created time.Time
}

func GetMessage

func GetMessage(id uint) (*Message, error)

func (*Message) Deserialize

func (t *Message) Deserialize(data []byte)

func (*Message) GetShardSource

func (t *Message) GetShardSource() uint

func (*Message) GetTopic

func (t *Message) GetTopic() string

func (*Message) GetUid

func (t *Message) GetUid() []byte

func (*Message) Serialize

func (t *Message) Serialize() []byte

func (*Message) SetUid

func (t *Message) SetUid(uid []byte)

type Peer

type Peer struct {
	Ip       []byte
	Port     uint16
	Services uint64
}

func GetNextPeer

func GetNextPeer(shard uint32, startId []byte) (*Peer, error)

func GetPeers

func GetPeers(shard uint32, startId []byte) ([]*Peer, error)

func (*Peer) Deserialize

func (p *Peer) Deserialize(data []byte)

func (*Peer) GetShardSource

func (p *Peer) GetShardSource() uint

func (*Peer) GetTopic

func (p *Peer) GetTopic() string

func (*Peer) GetUid

func (p *Peer) GetUid() []byte

func (*Peer) Serialize

func (p *Peer) Serialize() []byte

func (*Peer) SetUid

func (p *Peer) SetUid(uid []byte)

type PeerConnection

type PeerConnection struct {
	Ip     []byte
	Port   uint16
	Time   time.Time
	Status PeerConnectionStatus
}

func GetPeerConnectionLast

func GetPeerConnectionLast(ip []byte, port uint16) (*PeerConnection, error)

func GetPeerConnectionLasts

func GetPeerConnectionLasts(ipPorts []IpPort) ([]*PeerConnection, error)

func GetPeerConnections

func GetPeerConnections(request PeerConnectionsRequest) ([]*PeerConnection, error)

func (*PeerConnection) Deserialize

func (p *PeerConnection) Deserialize(data []byte)

func (*PeerConnection) GetShardSource

func (p *PeerConnection) GetShardSource() uint

func (*PeerConnection) GetTopic

func (p *PeerConnection) GetTopic() string

func (*PeerConnection) GetUid

func (p *PeerConnection) GetUid() []byte

func (*PeerConnection) Serialize

func (p *PeerConnection) Serialize() []byte

func (*PeerConnection) SetUid

func (p *PeerConnection) SetUid(uid []byte)

type PeerConnectionStatus

type PeerConnectionStatus int
const (
	PeerConnectionStatusFail    PeerConnectionStatus = 0
	PeerConnectionStatusSuccess PeerConnectionStatus = 1
)

func (PeerConnectionStatus) String

func (s PeerConnectionStatus) String() string

type PeerConnectionsRequest

type PeerConnectionsRequest struct {
	Shard   uint32
	StartId []byte
	Ip      []byte
	Port    uint32
	Max     uint32
}

func (PeerConnectionsRequest) GetShard

func (r PeerConnectionsRequest) GetShard() uint32

type PeerFound

type PeerFound struct {
	Ip         []byte
	Port       uint16
	FinderIp   []byte
	FinderPort uint16
}

func GetPeerFounds

func GetPeerFounds(shard uint32, startId []byte) ([]*PeerFound, error)

func (*PeerFound) Deserialize

func (p *PeerFound) Deserialize([]byte)

func (*PeerFound) GetShardSource

func (p *PeerFound) GetShardSource() uint

func (*PeerFound) GetTopic

func (p *PeerFound) GetTopic() string

func (*PeerFound) GetUid

func (p *PeerFound) GetUid() []byte

func (*PeerFound) Serialize

func (p *PeerFound) Serialize() []byte

func (*PeerFound) SetUid

func (p *PeerFound) SetUid(uid []byte)

type ProcessError

type ProcessError struct {
	TxHash [32]byte
	Error  string
}

func (*ProcessError) Deserialize

func (e *ProcessError) Deserialize(data []byte)

func (*ProcessError) GetShardSource

func (e *ProcessError) GetShardSource() uint

func (*ProcessError) GetTopic

func (e *ProcessError) GetTopic() string

func (*ProcessError) GetUid

func (e *ProcessError) GetUid() []byte

func (*ProcessError) Serialize

func (e *ProcessError) Serialize() []byte

func (*ProcessError) SetUid

func (e *ProcessError) SetUid(uid []byte)

type ProcessStatus

type ProcessStatus struct {
	Name   string
	Shard  uint
	Status []byte
}

func GetProcessStatus

func GetProcessStatus(shard uint, name string) (*ProcessStatus, error)

func NewProcessStatus

func NewProcessStatus(shard uint, name string) *ProcessStatus

func (*ProcessStatus) Deserialize

func (s *ProcessStatus) Deserialize(data []byte)

func (*ProcessStatus) GetShardSource

func (s *ProcessStatus) GetShardSource() uint

func (*ProcessStatus) GetTopic

func (s *ProcessStatus) GetTopic() string

func (*ProcessStatus) GetUid

func (s *ProcessStatus) GetUid() []byte

func (*ProcessStatus) Save

func (s *ProcessStatus) Save() error

func (*ProcessStatus) Serialize

func (s *ProcessStatus) Serialize() []byte

func (*ProcessStatus) SetUid

func (s *ProcessStatus) SetUid(uid []byte)

type SyncStatus

type SyncStatus struct {
	Name   string
	Height int64
}

func GetSyncStatus

func GetSyncStatus(name string) (*SyncStatus, error)

func (*SyncStatus) Deserialize

func (s *SyncStatus) Deserialize(data []byte)

func (*SyncStatus) GetShardSource

func (s *SyncStatus) GetShardSource() uint

func (*SyncStatus) GetTopic

func (s *SyncStatus) GetTopic() string

func (*SyncStatus) GetUid

func (s *SyncStatus) GetUid() []byte

func (*SyncStatus) Serialize

func (s *SyncStatus) Serialize() []byte

func (*SyncStatus) SetUid

func (s *SyncStatus) SetUid(uid []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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