Versions in this module Expand all Collapse all v0 v0.0.200 Nov 8, 2021 Changes in this version + const DomainTypeA + const USER_AGENT + var ErrStorageNotFound = errors.New("not found") + type DnsEndpoint struct + Addr string + DebugPrintDnsRequest bool + Server *dns.Server + Storage Storage + func NewDnsEndpoint(addr string, storage Storage) (*DnsEndpoint, error) + func (this *DnsEndpoint) ServeDNS(w dns.ResponseWriter, r *dns.Msg) + func (this *DnsEndpoint) StartSync() error + type DnsHttp struct + Addr string + DebugPrintDnsRequest bool + Router *httprouter.Router + Storage Storage + func NewHttpDns(addr string, storage Storage) (*DnsHttp, error) + func (this *DnsHttp) StartSync() error + type DomainType int + type HaModule struct + ClientPeerMapping map[string]... + ClientPeerMappingLock sync.Mutex + ClusterName string + ClusterSecret string + DebugPrint bool + Listen string + NodeId string + NodePeerMapping map[string]string + Storage Storage + SyncQueue chan SyncReq + func NewHaModule(node, listen, clusterName, clusterSecret string, peerMapping map[string]string, ...) (*HaModule, error) + func (this *HaModule) CheckPeerHealth() + func (this *HaModule) HttpEndpoint() error + func (this *HaModule) PeerSyncWorker(addr, peerNodeId string) + func (this *HaModule) ProcessSyncWorker() + func (this *HaModule) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (this *HaModule) StartSync() error + type HttpEndpoint struct + AccessPassword string + Addr string + DebugPrint bool + EnableAuth bool + Router *httprouter.Router + Storage Storage + func NewHttpEndpoint(addr string, storage Storage, enableAuth bool, accessPassword string) (*HttpEndpoint, error) + func (this *HttpEndpoint) CheckPublishClients() + func (this *HttpEndpoint) StartSync() error + type MemStore struct + func NewMemStore() *MemStore + func (m *MemStore) Abandon(node string) error + func (m *MemStore) FetchChangesForPeerNodeRequest(node string) (add, del map[string][]byte, err error) + func (m *MemStore) FetchFullAndWatch(node string) (map[string][]byte, error) + func (m *MemStore) FullFrom(node string, data map[string][]byte) error + func (m *MemStore) PutDomain(domain, resolve string, domainType DomainType) + func (m *MemStore) ResolveDomain(domain string, domainType DomainType) (string, error) + func (m *MemStore) SyncFrom(node, origNode string, add, del map[string][]byte) error + func (m *MemStore) Unwatch(node string) error + func (this *MemStore) DeleteService(service string, item *ServiceItem) error + func (this *MemStore) GetServiceList(service string) ([]*ServiceItem, error) + func (this *MemStore) PublishService(service string, item *ServiceItem) error + type ServiceItem struct + Addr string + NodeId string + type Storage interface + Abandon func(node string) error + DeleteService func(service string, item *ServiceItem) error + FetchChangesForPeerNodeRequest func(node string) (add, del map[string][]byte, err error) + FetchFullAndWatch func(node string) (map[string][]byte, error) + FullFrom func(node string, data map[string][]byte) error + GetServiceList func(service string) ([]*ServiceItem, error) + PublishService func(service string, item *ServiceItem) error + PutDomain func(domain, resolve string, domainType DomainType) + ResolveDomain func(domain string, domainType DomainType) (string, error) + SyncFrom func(node, origNode string, add, del map[string][]byte) error + Unwatch func(node string) error + type SyncReq struct + Add map[string][]byte + Del map[string][]byte + Err chan error + Full map[string][]byte + NodeId string