Documentation ¶
Overview ¶
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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 ¶
- Variables
- func CreateAgentBackendConnection(conn api.Connection) *agentBackendConnection
- func CreateTunnelNetworkFilterFactory(config map[string]interface{}) (api.NetworkFilterChainFactory, error)
- func DecodeFromBuffer(buffer api.IoBuffer) (interface{}, error)
- func Encode(i interface{}) (buffer.IoBuffer, error)
- func NewHost(config v2.Host, clusterInfo types.ClusterInfo, ...) *host
- func NewHostRemover(address string, cluster string) *hostRemover
- type AgentAsideConnection
- type AgentBootstrapConfig
- type AgentClientConnection
- type AgentPeer
- type ConnectStatus
- type ConnectionConfig
- type ConnectionInitInfo
- type ConnectionInitResponse
- type GracefulCloseOnewayRequest
Constants ¶
This section is empty.
Variables ¶
var ( Magic = []byte{0x20, 0x88} HeaderLen = 8 Version = byte(0x01) MagicIndex = 0 VersionIndex = 2 FlagIndex = 3 TypeIndex = 4 DataLengthIndex = 6 PayLoadIndex = 8 ConnectUnknownFailed ConnectStatus = 0 ConnectSuccess ConnectStatus = 1 ConnectAuthFailed ConnectStatus = 2 ConnectValidatorNotFound ConnectStatus = 3 ConnectClusterNotExist ConnectStatus = 4 RequestType = []byte{0x01, 0x00} ResponseType = []byte{0x02, 0x00} )
var ErrUnRecognizedData = errors.New("unrecognized payload data")
Functions ¶
func CreateAgentBackendConnection ¶
func CreateAgentBackendConnection(conn api.Connection) *agentBackendConnection
func CreateTunnelNetworkFilterFactory ¶
func CreateTunnelNetworkFilterFactory(config map[string]interface{}) (api.NetworkFilterChainFactory, error)
func DecodeFromBuffer ¶
func NewHost ¶
func NewHost(config v2.Host, clusterInfo types.ClusterInfo, connection types.ClientConnection) *host
func NewHostRemover ¶
Types ¶
type AgentAsideConnection ¶
type AgentAsideConnection struct {
// contains filtered or unexported fields
}
AgentAsideConnection indicates a connection on the client side. Unlike AgentClientConnection, AgentAsideConnection is only responsible for sending control commands to server, such as GracefulCloseOnewayRequest
func NewAgentAsideConnection ¶
func NewAgentAsideConnection(config ConnectionConfig, listener types.Listener) *AgentAsideConnection
func (AgentAsideConnection) OnEvent ¶
func (a AgentAsideConnection) OnEvent(event api.ConnectionEvent)
func (AgentAsideConnection) PrepareClose ¶
func (a AgentAsideConnection) PrepareClose()
func (AgentAsideConnection) ReadOneMessage ¶
func (a AgentAsideConnection) ReadOneMessage() (interface{}, error)
type AgentBootstrapConfig ¶
type AgentBootstrapConfig struct { Enable bool `json:"enable"` // The number of connections established between the agent and each server ConnectionNum int `json:"connection_num"` // The cluster of remote server Cluster string `json:"cluster"` // After the connection is established, the data transmission is processed by this listener HostingListener string `json:"hosting_listener"` // Static remote server list StaticServerList []string `json:"server_list"` // DynamicServerListConfig is used to specify dynamic server configuration DynamicServerListConfig struct { DynamicServerLister string `json:"dynamic_server_lister"` } `json:"dynamic_server_list_config"` // ConnectRetryTimes ConnectRetryTimes int `json:"connect_retry_times"` // ReconnectBaseDuration ReconnectBaseDuration api.DurationConfig `json:"reconnect_base_duration"` // ConnectTimeoutDuration specifies the timeout for establishing a connection and initializing the agent ConnectTimeoutDuration api.DurationConfig `json:"connect_timeout_duration"` CredentialPolicy string `json:"credential_policy"` // GracefulCloseMaxWaitDuration specifies the maximum waiting time to close conn gracefully GracefulCloseMaxWaitDuration api.DurationConfig `json:"graceful_close_max_wait_duration"` TLSContext *v2.TLSConfig `json:"tls_context"` }
type AgentClientConnection ¶
type AgentClientConnection struct { ConnectionConfig // contains filtered or unexported fields }
AgentClientConnection indicates a tunnel agent connection on the client side
func NewAgentCoreConnection ¶
func NewAgentCoreConnection(config ConnectionConfig, listener types.Listener) *AgentClientConnection
func (AgentClientConnection) OnEvent ¶
func (a AgentClientConnection) OnEvent(event api.ConnectionEvent)
func (AgentClientConnection) PrepareClose ¶
func (a AgentClientConnection) PrepareClose()
func (AgentClientConnection) ReadOneMessage ¶
func (a AgentClientConnection) ReadOneMessage() (interface{}, error)
type ConnectStatus ¶
type ConnectStatus int64
type ConnectionConfig ¶
type ConnectionConfig struct { Address string `json:"address"` ClusterName string `json:"cluster_name"` Weight int64 `json:"weight"` ConnectRetryTimes int `json:"connect_retry_times"` // ConnectTimeoutDuration specifies the timeout for establishing a connection and initializing the agent ConnectTimeoutDuration time.Duration `json:"connect_timeout_duration"` Network string `json:"network"` ReconnectBaseDuration time.Duration `json:"reconnect_base_duration"` CredentialPolicy string `json:"credential_policy"` ConnectionNumPerAddress int `json:"connection_num_per_address"` GracefulCloseMaxWaitDuration time.Duration `json:"graceful_close_max_wait_duration"` TLSContext *v2.TLSConfig `json:"tls_context"` }
type ConnectionInitInfo ¶
type ConnectionInitInfo struct { ClusterName string `json:"cluster_name"` Weight int64 `json:"weight"` HostName string `json:"host_name"` CredentialPolicy string `json:"credential_policy"` Credential string `json:"credential"` Extra map[string]interface{} `json:"extra"` }
ConnectionInitInfo is the basic information of agent host, it is sent immediately after the physical connection is established
type ConnectionInitResponse ¶
type ConnectionInitResponse struct {
Status ConnectStatus `json:"status"`
}