Documentation ¶
Overview ¶
Package gateway is the main program for TCP and HTTP services.
Copyright 2018 github.com/xiaoenai. All Rights Reserved.
Licensed 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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostsNamespace ¶
func HostsNamespace() string
HostsNamespace returns the gateway hosts prefix of ETCD key.
func RegBodyCodecForHTTP ¶ added in v1.1.0
RegBodyCodecForHTTP registers a mapping of content type to body coder (for http).
func Run ¶
Run the gateway main program. If protoFunc=nil, rawproto.NewRawProtoFunc is used by default. If biz=nil, types.DefaultBusiness() is used by default.
func SetHostsNamespace ¶
func SetHostsNamespace(prefix string)
SetHostsNamespace sets the gateway hosts prefix of ETCD key.
Types ¶
type Config ¶
type Config struct { EnableHttp bool `yaml:"enable_http"` EnableSocket bool `yaml:"enable_socket"` EnableWebSocket bool `yaml:"enable_web_socket"` OuterHttpServer short.HttpSrvConfig `yaml:"outer_http_server"` OuterSocketServer micro.SrvConfig `yaml:"outer_socket_server"` InnerSocketServer micro.SrvConfig `yaml:"inner_socket_server"` InnerSocketClient micro.CliConfig `yaml:"inner_socket_client"` WebSocketServer micro.SrvConfig `yaml:"web_socket_server"` Etcd etcd.EasyConfig `yaml:"etcd"` }
Config app config
Directories ¶
Path | Synopsis |
---|---|
helper
|
|
agent/proto
Package agent is a generated protocol buffer package.
|
Package agent is a generated protocol buffer package. |
gray/logic/model
Package model is a generated protocol buffer package.
|
Package model is a generated protocol buffer package. |
gray/types
Package types is a generated protocol buffer package.
|
Package types is a generated protocol buffer package. |
Package types is a generated protocol buffer package.
|
Package types is a generated protocol buffer package. |