http

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBodyCodec

func GetBodyCodec(contentType string, defCodecId byte) byte

GetBodyCodec returns the codec id from content type.

func GetContentType added in v1.3.0

func GetContentType(codecId byte, defContentType string) string

GetContentType returns the content type from codec id.

func RegBodyCodec

func RegBodyCodec(contentType string, codecId byte)

RegBodyCodec registers a mapping of content type to body coder.

func Serve

func Serve(srvCfg HttpSrvConfig)

Serve starts HTTP gateway service.

Types

type HttpSrvConfig added in v1.2.0

type HttpSrvConfig struct {
	ListenAddress string `yaml:"listen_address"`
	OuterHost     string `yaml:"outer_host"`
	TlsCertFile   string `yaml:"tls_cert_file"`
	TlsKeyFile    string `yaml:"tls_key_file"`
	AllowCross    bool   `yaml:"allow_cross"`
}

HttpSrvConfig config of HTTP server

func (*HttpSrvConfig) InnerIpPort added in v1.2.0

func (h *HttpSrvConfig) InnerIpPort() string

InnerIpPort returns the service's intranet address, such as '192.168.1.120:8080'.

func (*HttpSrvConfig) ListenPort added in v1.2.0

func (h *HttpSrvConfig) ListenPort() string

ListenPort returns the listened port, such as '8080'.

func (*HttpSrvConfig) OuterIpPort added in v1.2.0

func (h *HttpSrvConfig) OuterIpPort() string

OuterIpPort returns the service's extranet address, such as '113.116.141.121:8080'.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL