Documentation ¶
Index ¶
- Constants
- Variables
- type DnsEndpoint
- type DnsHttp
- type DomainType
- type HaModule
- type HttpEndpoint
- type MemStore
- func (m *MemStore) Abandon(node string) error
- func (this *MemStore) DeleteService(service string, item *ServiceItem) 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 (this *MemStore) GetServiceList(service string) ([]*ServiceItem, error)
- func (this *MemStore) PublishService(service string, item *ServiceItem) 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
- type ServiceItem
- type Storage
- type SyncReq
Constants ¶
View Source
const (
DomainTypeA = 1
)
View Source
const (
USER_AGENT = "DNS-over-HTTPS/1.0 NekoQ-Bootstrap"
)
Variables ¶
View Source
var ErrStorageNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type DnsEndpoint ¶
type DnsEndpoint struct { Storage Storage Server *dns.Server Addr string DebugPrintDnsRequest bool }
func NewDnsEndpoint ¶
func NewDnsEndpoint(addr string, storage Storage) (*DnsEndpoint, error)
func (*DnsEndpoint) ServeDNS ¶
func (this *DnsEndpoint) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
func (*DnsEndpoint) StartSync ¶
func (this *DnsEndpoint) StartSync() error
type DnsHttp ¶
type DnsHttp struct { Storage Storage Router *httprouter.Router Addr string DebugPrintDnsRequest bool }
type DomainType ¶
type DomainType int
type HaModule ¶
type HaModule struct { NodeId string Listen string Storage Storage NodePeerMapping map[string]string ClientPeerMapping map[string]*struct { LastUpdate int64 } ClientPeerMappingLock sync.Mutex ClusterName string ClusterSecret string SyncQueue chan SyncReq DebugPrint bool // contains filtered or unexported fields }
func NewHaModule ¶
func (*HaModule) CheckPeerHealth ¶
func (this *HaModule) CheckPeerHealth()
func (*HaModule) HttpEndpoint ¶
func (*HaModule) PeerSyncWorker ¶
func (*HaModule) ProcessSyncWorker ¶
func (this *HaModule) ProcessSyncWorker()
type HttpEndpoint ¶
type HttpEndpoint struct { Storage Storage Router *httprouter.Router EnableAuth bool AccessPassword string Addr string DebugPrint bool // contains filtered or unexported fields }
func NewHttpEndpoint ¶
func (*HttpEndpoint) CheckPublishClients ¶
func (this *HttpEndpoint) CheckPublishClients()
func (*HttpEndpoint) StartSync ¶
func (this *HttpEndpoint) StartSync() error
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
func NewMemStore ¶
func NewMemStore() *MemStore
func (*MemStore) DeleteService ¶
func (this *MemStore) DeleteService(service string, item *ServiceItem) error
func (*MemStore) FetchChangesForPeerNodeRequest ¶
func (*MemStore) FetchFullAndWatch ¶
func (*MemStore) GetServiceList ¶
func (this *MemStore) GetServiceList(service string) ([]*ServiceItem, error)
func (*MemStore) PublishService ¶
func (this *MemStore) PublishService(service string, item *ServiceItem) error
func (*MemStore) PutDomain ¶
func (m *MemStore) PutDomain(domain, resolve string, domainType DomainType)
func (*MemStore) ResolveDomain ¶
func (m *MemStore) ResolveDomain(domain string, domainType DomainType) (string, error)
type ServiceItem ¶
type Storage ¶
type Storage interface { ResolveDomain(domain string, domainType DomainType) (string, error) PutDomain(domain, resolve string, domainType DomainType) GetServiceList(service string) ([]*ServiceItem, error) PublishService(service string, item *ServiceItem) error DeleteService(service string, item *ServiceItem) error /* for High Availability - client(listener) side */ FullFrom(node string, data map[string][]byte) error // get and watch SyncFrom(node, origNode string, add, del map[string][]byte) error Abandon(node string) error /* for High Availability - server(source) side */ FetchFullAndWatch(node string) (map[string][]byte, error) FetchChangesForPeerNodeRequest(node string) (add, del map[string][]byte, err error) Unwatch(node string) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.