Documentation
¶
Index ¶
- Constants
- Variables
- func ConnCountCur() int
- func ConnCountDec()
- func ConnCountInc()
- func GetListeners() ([]net.Listener, error)
- func GetListenersByAddrs(addrs string) ([]net.Listener, error)
- func OnAccept(handler AcceptFunc)
- func OnClose(handler CloseFunc)
- func OnExit(handler ExitFunc)
- func OnInit(handler InitFunc)
- func OnPreJail(handler PreJailFunc)
- func Prepare()
- func ServiceInit(addrs string) ([]net.Listener, error)
- func Stop(ok bool)
- func TcpAloneStart(addrs string) error
- func TcpDaemonStart() error
- func TcpServiceStart(addrs string) error
- func Wait() bool
- func WebServiceStart(addrs string, handler http.Handler) error
- type AcceptFunc
- type CloseFunc
- type Config
- type ExitFunc
- type InitFunc
- type PreJailFunc
- type TcpService
- type WebService
Constants ¶
View Source
const Version string = "1.1.2"
Variables ¶
View Source
var ( AppConf *Config AppService string AppLogPath string AppOwner string AppArgs string AppRootDir string AppUseLimit = 0 AppIdleLimit = 0 AppReusePort = false AppQuickAbort = false AppWaitLimit = 10 AppAccessAllow = "all" Appthreads = 0 TlsCertFile string TlsKeyFile string )
from configure file of the app
View Source
var ( Configure string ServiceName string ServiceType string Verbose bool Unprivileged bool Chroot = false SocketCount = 1 Alone bool )
from command args
Functions ¶
func ConnCountCur ¶
func ConnCountCur() int
func ConnCountDec ¶
func ConnCountDec()
func ConnCountInc ¶
func ConnCountInc()
func GetListeners ¶
GetListeners In acl_master daemon running mode, this function will be called to init the listener handles.
func GetListenersByAddrs ¶
GetListenersByAddrs In run alone mode, the application should give the listening addrs and call this function to listen the given addrs
func OnAccept ¶
func OnAccept(handler AcceptFunc)
func OnPreJail ¶
func OnPreJail(handler PreJailFunc)
func Prepare ¶
func Prepare()
Prepare this function can be called automatically in net_service.go or web_service.go to load configure, and it can also be canned in application's main function
func TcpAloneStart ¶
func TcpDaemonStart ¶
func TcpDaemonStart() error
func TcpServiceStart ¶
TcpStart start TCP service with the specified listening addrs
Types ¶
type AcceptFunc ¶
type Config ¶
func (*Config) InitConfig ¶
type PreJailFunc ¶
type PreJailFunc func()
type TcpService ¶
type TcpService struct { AcceptHandler AcceptFunc CloseHandler CloseFunc // contains filtered or unexported fields }
func TcpServiceInit ¶
func TcpServiceInit(addrs string) (*TcpService, error)
func (*TcpService) Run ¶
func (service *TcpService) Run()
type WebService ¶
type WebService struct { AcceptHandler AcceptFunc CloseHandler CloseFunc // contains filtered or unexported fields }
func WebServiceInit ¶
func WebServiceInit(addrs string, handler http.Handler) (*WebService, error)
func (*WebService) Run ¶
func (service *WebService) Run()
WebServiceStart start WEB service with the specified listening addrs
Click to show internal directories.
Click to hide internal directories.