Documentation
¶
Overview ¶
*
- Tencent is pleased to support the open source community by making polaris-go available. *
- Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. *
- Licensed under the BSD 3-Clause License (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- https://opensource.org/licenses/BSD-3-Clause *
- Unless required by applicable law or agreed to in writing, software distributed
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
- specific language governing permissions and limitations under the License.
*
- Tencent is pleased to support the open source community by making polaris-go available. *
- Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. *
- Licensed under the BSD 3-Clause License (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- https://opensource.org/licenses/BSD-3-Clause *
- Unless required by applicable law or agreed to in writing, software distributed
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
- specific language governing permissions and limitations under the License.
*
- Tencent is pleased to support the open source community by making polaris-go available. *
- Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. *
- Licensed under the BSD 3-Clause License (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- https://opensource.org/licenses/BSD-3-Clause *
- Unless required by applicable law or agreed to in writing, software distributed
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
- specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type AsyncConn
- type Conn
- type ConnBase
- type Connector
- func (g *Connector) DeRegisterServiceHandler(key *model.ServiceEventKey) error
- func (g *Connector) DeregisterInstance(instance *model.InstanceDeRegisterRequest) error
- func (g *Connector) Heartbeat(instance *model.InstanceHeartbeatRequest) error
- func (c *Connector) Init(ctx *plugin.InitContext)
- func (g *Connector) IsEnable(cfg config.Configuration) bool
- func (c *Connector) Name() string
- func (c *Connector) Recv() (*namingpb.DiscoverResponse, error)
- func (g *Connector) RegisterInstance(request *model.InstanceRegisterRequest) (*model.InstanceRegisterResponse, error)
- func (g *Connector) RegisterServiceHandler(svcEventHandler *serverconnector.ServiceEventHandler) error
- func (g *Connector) ReportClient(request *model.ReportClientRequest) (*model.ReportClientResponse, error)
- func (c *Connector) Send(request *namingpb.DiscoverRequest) error
- func (c *Connector) SyncExchange(m *dns.Msg) (*RspData, time.Duration, error)
- func (g *Connector) SyncGetResourceReq(request *namingpb.DiscoverRequest) (*namingpb.DiscoverResponse, error)
- func (g *Connector) UpdateServers(key *model.ServiceEventKey) error
- type GetNewConnFunc
- type MsgBuffer
- type RspData
Constants ¶
View Source
const (
UDPSize uint16 = 65535
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncConn ¶
type AsyncConn struct { ConnBase MsgBufMap sync.Map WriteChan chan *dns.Msg ReadChan chan *RspData // contains filtered or unexported fields }
异步Conn
type Conn ¶
type Conn interface { Dial(dstIp string, port int) error Close() ReadMsg() (*dns.Msg, error) WriteMsg(m *dns.Msg) error SetWriteDeadline(t time.Time) error SetReadDeadline(t time.Time) error }
conn interface
type ConnBase ¶
发送Conn
func (*ConnBase) SetReadDeadline ¶
SetReadDeadline
func (*ConnBase) SetWriteDeadline ¶
SetWriteDeadline
type Connector ¶
type Connector struct { *plugin.PluginBase Timeout time.Duration DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration Conn *AsyncConn // 用于异步发送 DnsID uint32 SideCarIp string SideCarPort int GetSyncConnFunc GetNewConnFunc // contains filtered or unexported fields }
SideCar connector
func (*Connector) DeRegisterServiceHandler ¶
func (g *Connector) DeRegisterServiceHandler(key *model.ServiceEventKey) error
DeRegisterEventHandler 反注册事件监听器
func (*Connector) DeregisterInstance ¶
func (g *Connector) DeregisterInstance(instance *model.InstanceDeRegisterRequest) error
DeregisterInstance 同步反注册服务
func (*Connector) Heartbeat ¶
func (g *Connector) Heartbeat(instance *model.InstanceHeartbeatRequest) error
心跳上报
func (*Connector) RegisterInstance ¶
func (g *Connector) RegisterInstance(request *model.InstanceRegisterRequest) (*model.InstanceRegisterResponse, error)
RegisterInstance 同步注册服务
func (*Connector) RegisterServiceHandler ¶
func (g *Connector) RegisterServiceHandler(svcEventHandler *serverconnector.ServiceEventHandler) error
RegisterServiceHandler 注册服务监听
func (*Connector) ReportClient ¶
func (g *Connector) ReportClient(request *model.ReportClientRequest) (*model.ReportClientResponse, error)
报客户端信息
func (*Connector) SyncExchange ¶
同步发送收取包
func (*Connector) SyncGetResourceReq ¶
func (g *Connector) SyncGetResourceReq(request *namingpb.DiscoverRequest) (*namingpb.DiscoverResponse, error)
同步获取资源
func (*Connector) UpdateServers ¶
func (g *Connector) UpdateServers(key *model.ServiceEventKey) error
更新服务端地址 sideCar模式目前无需实现
type GetNewConnFunc ¶
type GetNewConnFunc func() Conn
Click to show internal directories.
Click to hide internal directories.