Documentation ¶
Index ¶
- Constants
- func MakeeventsFromEvents(es []*historian.Event) []*event
- func MessageTypeName(m int) string
- func StateName(s int) string
- type Abort
- type AlertEventData
- type CloudServer
- func (server *CloudServer) ExternalHost() string
- func (server *CloudServer) ExternalPort() int
- func (server *CloudServer) InternalHost() string
- func (server *CloudServer) InternalPort() int
- func (server *CloudServer) IsHTTPOnly() bool
- func (server *CloudServer) Router() *mux.Router
- func (server *CloudServer) Start() error
- func (server *CloudServer) Stop()
- type CloudServerConfig
- type Hub
- func (hub *Hub) Accept(connection *websocket.Conn, partitionNumber uint64, relayID string, ...) error
- func (hub *Hub) BroadcastUpdate(siteID string, bucket string, update map[string]*SiblingSet, n uint64)
- func (hub *Hub) Connect(peerID, host string, port int) error
- func (hub *Hub) ConnectCloud(...) error
- func (hub *Hub) Disconnect(peerID string)
- func (hub *Hub) ExtractPeerID(conn *tls.Conn) (string, error)
- func (hub *Hub) ForwardAlerts()
- func (hub *Hub) ForwardEvents()
- func (hub *Hub) PeerStatus(peerID string) (connected bool, pingTime time.Duration)
- func (hub *Hub) Peers() []*PeerJSON
- func (hub *Hub) ReconnectPeer(peerID string)
- func (hub *Hub) ReconnectPeerByPartition(partitionNumber uint64)
- func (hub *Hub) ReconnectPeerBySite(siteID string)
- func (hub *Hub) StartForwardingAlerts()
- func (hub *Hub) StartForwardingEvents()
- func (hub *Hub) SyncController() *SyncController
- type InitiatorSyncSession
- func (syncSession *InitiatorSyncSession) ExplorationPathLimit() uint32
- func (syncSession *InitiatorSyncSession) ExplorationQueueSize() uint32
- func (syncSession *InitiatorSyncSession) NextState(syncMessageWrapper *SyncMessageWrapper) *SyncMessageWrapper
- func (syncSession *InitiatorSyncSession) PeekExplorationQueue() uint32
- func (syncSession *InitiatorSyncSession) PopExplorationQueue() uint32
- func (syncSession *InitiatorSyncSession) PushExplorationQueue(n uint32)
- func (syncSession *InitiatorSyncSession) ResponderDepth() uint8
- func (syncSession *InitiatorSyncSession) SetExplorationPathLimit(limit uint32)
- func (syncSession *InitiatorSyncSession) SetResponderDepth(d uint8)
- func (syncSession *InitiatorSyncSession) SetState(state int)
- func (syncSession *InitiatorSyncSession) State() int
- type MerkleNodeHash
- type ObjectNext
- type Peer
- type PeerJSON
- type PushDone
- type PushMessage
- type ResponderSyncSession
- func (syncSession *ResponderSyncSession) InitiatorDepth() uint8
- func (syncSession *ResponderSyncSession) NextState(syncMessageWrapper *SyncMessageWrapper) *SyncMessageWrapper
- func (syncSession *ResponderSyncSession) SetInitiatorDepth(d uint8)
- func (syncSession *ResponderSyncSession) SetState(state int)
- func (syncSession *ResponderSyncSession) State() int
- type Server
- type ServerConfig
- type Start
- type SyncController
- type SyncMessageWrapper
- type SyncSession
Constants ¶
View Source
const ( INCOMING = iota OUTGOING = iota )
View Source
const ( START = iota HANDSHAKE = iota ROOT_HASH_COMPARE = iota LEFT_HASH_COMPARE = iota RIGHT_HASH_COMPARE = iota HASH_COMPARE = iota DB_OBJECT_PUSH = iota END = iota )
View Source
const ( SYNC_START = iota SYNC_ABORT = iota SYNC_NODE_HASH = iota SYNC_OBJECT_NEXT = iota SYNC_PUSH_MESSAGE = iota REQUEST = iota RESPONSE = iota PUSH = iota SYNC_PUSH_DONE = iota )
View Source
const CLOUD_PEER_ID = "cloud"
View Source
const PING_PERIOD_SECONDS = 40
View Source
const PONG_WAIT_SECONDS = 60
View Source
const PROTOCOL_VERSION uint = 2
View Source
const RECONNECT_WAIT_MAX_SECONDS = 32
View Source
const SYNC_SESSION_WAIT_TIMEOUT_SECONDS = 5
View Source
const WRITE_WAIT_SECONDS = 10
Variables ¶
This section is empty.
Functions ¶
func MakeeventsFromEvents ¶
func MessageTypeName ¶
Types ¶
type AlertEventData ¶
type AlertEventData struct { Metadata interface{} `json:"metadata"` Status bool `json:"status"` }
type CloudServer ¶
type CloudServer struct {
// contains filtered or unexported fields
}
func NewCloudServer ¶
func NewCloudServer(serverConfig CloudServerConfig) *CloudServer
func (*CloudServer) ExternalHost ¶
func (server *CloudServer) ExternalHost() string
func (*CloudServer) ExternalPort ¶
func (server *CloudServer) ExternalPort() int
func (*CloudServer) InternalHost ¶
func (server *CloudServer) InternalHost() string
func (*CloudServer) InternalPort ¶
func (server *CloudServer) InternalPort() int
func (*CloudServer) IsHTTPOnly ¶
func (server *CloudServer) IsHTTPOnly() bool
func (*CloudServer) Router ¶
func (server *CloudServer) Router() *mux.Router
func (*CloudServer) Start ¶
func (server *CloudServer) Start() error
func (*CloudServer) Stop ¶
func (server *CloudServer) Stop()
type CloudServerConfig ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) BroadcastUpdate ¶
func (*Hub) ConnectCloud ¶
func (*Hub) Disconnect ¶
func (*Hub) ForwardAlerts ¶
func (hub *Hub) ForwardAlerts()
func (*Hub) ForwardEvents ¶
func (hub *Hub) ForwardEvents()
func (*Hub) PeerStatus ¶
func (*Hub) ReconnectPeer ¶
func (*Hub) ReconnectPeerByPartition ¶
func (*Hub) ReconnectPeerBySite ¶
func (*Hub) StartForwardingAlerts ¶
func (hub *Hub) StartForwardingAlerts()
func (*Hub) StartForwardingEvents ¶
func (hub *Hub) StartForwardingEvents()
func (*Hub) SyncController ¶
func (hub *Hub) SyncController() *SyncController
type InitiatorSyncSession ¶
type InitiatorSyncSession struct {
// contains filtered or unexported fields
}
the state machine
func NewInitiatorSyncSession ¶
func NewInitiatorSyncSession(id uint, bucketProxy ddbSync.BucketProxy, explorationPathLimit uint32, replicatesOutgoing bool) *InitiatorSyncSession
func (*InitiatorSyncSession) ExplorationPathLimit ¶
func (syncSession *InitiatorSyncSession) ExplorationPathLimit() uint32
func (*InitiatorSyncSession) ExplorationQueueSize ¶
func (syncSession *InitiatorSyncSession) ExplorationQueueSize() uint32
func (*InitiatorSyncSession) NextState ¶
func (syncSession *InitiatorSyncSession) NextState(syncMessageWrapper *SyncMessageWrapper) *SyncMessageWrapper
func (*InitiatorSyncSession) PeekExplorationQueue ¶
func (syncSession *InitiatorSyncSession) PeekExplorationQueue() uint32
func (*InitiatorSyncSession) PopExplorationQueue ¶
func (syncSession *InitiatorSyncSession) PopExplorationQueue() uint32
func (*InitiatorSyncSession) PushExplorationQueue ¶
func (syncSession *InitiatorSyncSession) PushExplorationQueue(n uint32)
func (*InitiatorSyncSession) ResponderDepth ¶
func (syncSession *InitiatorSyncSession) ResponderDepth() uint8
func (*InitiatorSyncSession) SetExplorationPathLimit ¶
func (syncSession *InitiatorSyncSession) SetExplorationPathLimit(limit uint32)
func (*InitiatorSyncSession) SetResponderDepth ¶
func (syncSession *InitiatorSyncSession) SetResponderDepth(d uint8)
func (*InitiatorSyncSession) SetState ¶
func (syncSession *InitiatorSyncSession) SetState(state int)
func (*InitiatorSyncSession) State ¶
func (syncSession *InitiatorSyncSession) State() int
type MerkleNodeHash ¶
type ObjectNext ¶
type ObjectNext struct {
NodeID uint32
}
type PushMessage ¶
type ResponderSyncSession ¶
type ResponderSyncSession struct {
// contains filtered or unexported fields
}
the state machine
func NewResponderSyncSession ¶
func NewResponderSyncSession(bucketProxy ddbSync.BucketProxy) *ResponderSyncSession
func (*ResponderSyncSession) InitiatorDepth ¶
func (syncSession *ResponderSyncSession) InitiatorDepth() uint8
func (*ResponderSyncSession) NextState ¶
func (syncSession *ResponderSyncSession) NextState(syncMessageWrapper *SyncMessageWrapper) *SyncMessageWrapper
func (*ResponderSyncSession) SetInitiatorDepth ¶
func (syncSession *ResponderSyncSession) SetInitiatorDepth(d uint8)
func (*ResponderSyncSession) SetState ¶
func (syncSession *ResponderSyncSession) SetState(state int)
func (*ResponderSyncSession) State ¶
func (syncSession *ResponderSyncSession) State() int
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(serverConfig ServerConfig) (*Server, error)
type ServerConfig ¶
type ServerConfig struct { DBFile string Port int MerkleDepth uint8 NodeID string Hub *Hub ServerTLS *tls.Config PeerAddresses map[string]peerAddress SyncPushBroadcastLimit uint64 GCInterval uint64 GCPurgeAge uint64 Cloud *cloudAddress History *cloudAddress Alerts *cloudAddress HistoryPurgeOnForward bool HistoryEventLimit uint64 HistoryEventFloor uint64 HistoryPurgeBatchSize int HistoryForwardBatchSize uint64 HistoryForwardInterval uint64 HistoryForwardThreshold uint64 AlertsForwardInterval uint64 SyncExplorationPathLimit uint32 }
func (*ServerConfig) LoadFromFile ¶
func (sc *ServerConfig) LoadFromFile(file string) error
type SyncController ¶
type SyncController struct {
// contains filtered or unexported fields
}
func NewSyncController ¶
func NewSyncController(maxSyncSessions uint, bucketProxyFactory ddbSync.BucketProxyFactory, syncScheduler ddbSync.SyncScheduler, explorationPathLimit uint32) *SyncController
func (*SyncController) BroadcastUpdate ¶
func (s *SyncController) BroadcastUpdate(peerID string, bucket string, update map[string]*SiblingSet, n uint64)
func (*SyncController) Start ¶
func (s *SyncController) Start()
func (*SyncController) StartInitiatorSessions ¶
func (s *SyncController) StartInitiatorSessions()
func (*SyncController) StartResponderSessions ¶
func (s *SyncController) StartResponderSessions()
type SyncMessageWrapper ¶
type SyncSession ¶
type SyncSession struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.