Documentation ¶
Index ¶
- Constants
- type AreaSetItem
- type BatchRecordFinalizer
- type ControlData
- type CustomInfo
- type DataStore
- func (d *DataStore) CleanupPeer(peerId int16) error
- func (d *DataStore) Fetch(service, area string) ([]*Record, error)
- func (d *DataStore) InitPeer(peerId int16, fullSet *FullSet) error
- func (d *DataStore) OfflineNRecords(keys []*RecordKey)
- func (d *DataStore) OfflineRecord(key *RecordKey)
- func (d *DataStore) PeerFetchLocalFull() (*FullSet, error)
- func (d *DataStore) PeerFetchLocalIncremental(lastVersion int64) (*IncrementalSet, error)
- func (d *DataStore) PersistRecord(recordKey *RecordKey, record *Record)
- func (d *DataStore) UpdatePeer(peerId int16, incSet *IncrementalSet) error
- type EdgePeerService
- type ExternalDnsServer
- type ExternalHttpService
- type FullSet
- type HttpServerPeerService
- type IncrementalRecord
- type IncrementalSet
- type LocalNodeService
- func (l *LocalNodeService) ControlData(data *ControlData) error
- func (l *LocalNodeService) CustomInformation(info *CustomInfo) error
- func (l *LocalNodeService) Fetch(service, area string) ([]*Record, error)
- func (l *LocalNodeService) Offline(key *RecordKey) error
- func (l *LocalNodeService) OfflineN(keys []*RecordKey) error
- func (l *LocalNodeService) SelfKeepAlive(recordKey *RecordKey, record *Record) error
- func (l *LocalNodeService) SlimKeepAlive(key *RecordKey) error
- type LocalPeerService
- type Node
- type NodeService
- type NodeStatusManager
- type Peer
- type PeerService
- type PeerState
- type Record
- type RecordKey
- type RemoteClientPeerService
- type ServiceInfo
- type ServiceSetItem
- type TimeoutEntry
Constants ¶
View Source
const ( IncrementalOperationChange = "change" IncrementalOperationRemove = "remove" )
View Source
const ( PeerStateInit = iota + 1 PeerStateFull PeerStateExpired )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaSetItem ¶
type BatchRecordFinalizer ¶
type ControlData ¶
type CustomInfo ¶
type DataStore ¶
func NewDataStore ¶
func NewDataStore() *DataStore
func (*DataStore) CleanupPeer ¶
func (*DataStore) OfflineNRecords ¶
func (*DataStore) OfflineRecord ¶
func (*DataStore) PeerFetchLocalFull ¶
func (*DataStore) PeerFetchLocalIncremental ¶
func (d *DataStore) PeerFetchLocalIncremental(lastVersion int64) (*IncrementalSet, error)
func (*DataStore) PersistRecord ¶
func (*DataStore) UpdatePeer ¶
func (d *DataStore) UpdatePeer(peerId int16, incSet *IncrementalSet) error
type EdgePeerService ¶
type EdgePeerService interface { PeerService }
EdgePeerService peer service across multi-level and multi-area
type ExternalDnsServer ¶
type ExternalDnsServer struct { }
type ExternalHttpService ¶
type ExternalHttpService struct {
// contains filtered or unexported fields
}
func NewHttpService ¶
func NewHttpService(ds *DataStore) (*ExternalHttpService, error)
func (*ExternalHttpService) StartService ¶
func (e *ExternalHttpService) StartService() error
type FullSet ¶
type FullSet struct { CurrentVersion string `json:"current_version"` RecordSet []*ServiceSetItem `json:"record_set"` // contains filtered or unexported fields }
func (*FullSet) MarshalCbor ¶
func (*FullSet) MarshalJson ¶
func (*FullSet) TotalRecordCount ¶
func (*FullSet) UnmarshalCbor ¶
type HttpServerPeerService ¶
type HttpServerPeerService struct {
// contains filtered or unexported fields
}
func (*HttpServerPeerService) FullFetch ¶
func (h *HttpServerPeerService) FullFetch() (*FullSet, error)
func (*HttpServerPeerService) IncrementalFetch ¶
func (h *HttpServerPeerService) IncrementalFetch(lastVersion string) (*IncrementalSet, error)
type IncrementalRecord ¶
type IncrementalSet ¶
type IncrementalSet struct { CurrentVersion string `json:"current_version"` ReSync bool `json:"re_sync"` Records []*IncrementalRecord `json:"records"` }
type LocalNodeService ¶
type LocalNodeService struct {
DataStore *DataStore
}
func (*LocalNodeService) ControlData ¶
func (l *LocalNodeService) ControlData(data *ControlData) error
func (*LocalNodeService) CustomInformation ¶
func (l *LocalNodeService) CustomInformation(info *CustomInfo) error
func (*LocalNodeService) Fetch ¶
func (l *LocalNodeService) Fetch(service, area string) ([]*Record, error)
func (*LocalNodeService) Offline ¶
func (l *LocalNodeService) Offline(key *RecordKey) error
func (*LocalNodeService) OfflineN ¶
func (l *LocalNodeService) OfflineN(keys []*RecordKey) error
func (*LocalNodeService) SelfKeepAlive ¶
func (l *LocalNodeService) SelfKeepAlive(recordKey *RecordKey, record *Record) error
func (*LocalNodeService) SlimKeepAlive ¶
func (l *LocalNodeService) SlimKeepAlive(key *RecordKey) error
type LocalPeerService ¶
type LocalPeerService struct {
DataStore *DataStore
}
func (*LocalPeerService) FullFetch ¶
func (l *LocalPeerService) FullFetch() (*FullSet, error)
func (*LocalPeerService) IncrementalFetch ¶
func (l *LocalPeerService) IncrementalFetch(lastVersion string) (*IncrementalSet, error)
type NodeService ¶
type NodeService interface { SelfKeepAlive(recordKey *RecordKey, record *Record) error SlimKeepAlive(key *RecordKey) error Offline(key *RecordKey) error OfflineN(keys []*RecordKey) error ControlData(data *ControlData) error //TODO WIP CustomInformation(info *CustomInfo) error //TODO WIP // Fetch will fetch the service list by service and area. // Area supports nested environment which means area checks from warehouseapi.DiscoverUse will be performed. Fetch(service, area string) ([]*Record, error) }
NodeService node service for processing node request
func NewLocalNodeService ¶
func NewLocalNodeService(dataStore *DataStore) NodeService
type NodeStatusManager ¶
type NodeStatusManager struct {
// contains filtered or unexported fields
}
func NewNodeStatusManager ¶
func NewNodeStatusManager() *NodeStatusManager
func (*NodeStatusManager) KeepAlive ¶
func (n *NodeStatusManager) KeepAlive(recordKey *RecordKey) error
func (*NodeStatusManager) Offline ¶
func (n *NodeStatusManager) Offline(recordKey *RecordKey) error
func (*NodeStatusManager) SetBatchFinalizer ¶
func (n *NodeStatusManager) SetBatchFinalizer(f BatchRecordFinalizer)
func (*NodeStatusManager) StartNode ¶
func (n *NodeStatusManager) StartNode(recordKey *RecordKey) error
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func StartPeer ¶
func StartPeer(peerWrapper PeerService, peerId int16, stor *DataStore) (*Peer, error)
func (*Peer) ScheduleLoop ¶
func (p *Peer) ScheduleLoop()
type PeerService ¶
type PeerService interface { FullFetch() (*FullSet, error) IncrementalFetch(lastVersion string) (*IncrementalSet, error) }
PeerService peer service in the same area
func NewHttpServerPeerService ¶
func NewHttpServerPeerService(address string, peerId int16) PeerService
func NewLocalPeerService ¶
func NewLocalPeerService(dataStore *DataStore) PeerService
type RecordKey ¶
type RemoteClientPeerService ¶
type RemoteClientPeerService struct { }
type ServiceInfo ¶
type ServiceSetItem ¶
type ServiceSetItem struct { Service string `json:"service"` Areas []*AreaSetItem `json:"areas"` }
Click to show internal directories.
Click to hide internal directories.