Documentation ¶
Index ¶
- Constants
- Variables
- func ExitProgram(exitFunc func())
- func GetFreePort() (int, error)
- func IsNotLocalEnv() bool
- type CancelErr
- type ConnectionMonitor
- func (m *ConnectionMonitor) AvailableConns() int
- func (m *ConnectionMonitor) ConnectionCount() int
- func (m *ConnectionMonitor) OnConnectionAvailable()
- func (m *ConnectionMonitor) OnConnectionConsumed()
- func (m *ConnectionMonitor) OnConnectionEnded()
- func (m *ConnectionMonitor) OnConnectionEnded2(path, routerSocketID string)
- func (m *ConnectionMonitor) OnConnectionEnded3(routerSocketID, path, reqComponentName string, respStatus int, ...)
- func (m *ConnectionMonitor) OnConnectionStarted()
- func (m *ConnectionMonitor) OnConnectionStarted2(path, routerSocketID string)
- func (m *ConnectionMonitor) OpenFiles() int
- func (m *ConnectionMonitor) ReportWebsocketPoolSize(size int)
- type CrankerErr
- type DataPublishHandler
- type DataPublishHandlerFunc
- type HttpClientPolicyErr
- type NoRouteErr
- type Password
- type TimeoutErr
Constants ¶
const ( UUI31223NotSendingHostHeader = false UUI51288AllowFixedLengthResponses = false UUI51292EnableResponseTimeouts = false )
Variables ¶
var LOG = logging.MustGetLogger("crank4go-core")
Functions ¶
func ExitProgram ¶
func ExitProgram(exitFunc func())
ExitProgram a helper function to execute some hooks before exiting the program. usage: 1. wrapper all things that you want to do in a func for example `exitFunc ()` 2. call `ExitProgram(ExitFunc)` inside a `init` func of your program
func GetFreePort ¶
func IsNotLocalEnv ¶
func IsNotLocalEnv() bool
Types ¶
type ConnectionMonitor ¶
type ConnectionMonitor struct {
// contains filtered or unexported fields
}
func NewConnectionMonitor ¶
func NewConnectionMonitor(handlers []DataPublishHandler) *ConnectionMonitor
func (*ConnectionMonitor) AvailableConns ¶
func (m *ConnectionMonitor) AvailableConns() int
func (*ConnectionMonitor) ConnectionCount ¶
func (m *ConnectionMonitor) ConnectionCount() int
func (*ConnectionMonitor) OnConnectionAvailable ¶
func (m *ConnectionMonitor) OnConnectionAvailable()
func (*ConnectionMonitor) OnConnectionConsumed ¶
func (m *ConnectionMonitor) OnConnectionConsumed()
OnConnectionConsumed called by connector
func (*ConnectionMonitor) OnConnectionEnded ¶
func (m *ConnectionMonitor) OnConnectionEnded()
OnConnectionEnded called by connector socket
func (*ConnectionMonitor) OnConnectionEnded2 ¶
func (m *ConnectionMonitor) OnConnectionEnded2(path, routerSocketID string)
func (*ConnectionMonitor) OnConnectionEnded3 ¶
func (m *ConnectionMonitor) OnConnectionEnded3(routerSocketID, path, reqComponentName string, respStatus int, reqDuration, reqBytes, respBytes int64)
OnConnectionEnded3 called by router socket
func (*ConnectionMonitor) OnConnectionStarted ¶
func (m *ConnectionMonitor) OnConnectionStarted()
func (*ConnectionMonitor) OnConnectionStarted2 ¶
func (m *ConnectionMonitor) OnConnectionStarted2(path, routerSocketID string)
func (*ConnectionMonitor) OpenFiles ¶
func (m *ConnectionMonitor) OpenFiles() int
func (*ConnectionMonitor) ReportWebsocketPoolSize ¶
func (m *ConnectionMonitor) ReportWebsocketPoolSize(size int)
type CrankerErr ¶
func (*CrankerErr) ErrCode ¶
func (c *CrankerErr) ErrCode() int
func (*CrankerErr) Error ¶
func (c *CrankerErr) Error() string
type DataPublishHandler ¶
type DataPublishHandlerFunc ¶
func (DataPublishHandlerFunc) PublishData ¶
func (f DataPublishHandlerFunc) PublishData(key string, value int)
type HttpClientPolicyErr ¶
type HttpClientPolicyErr struct {
Msg string
}
HttpClientPolicyErr An error is returned if caused by client policy (such as CheckRedirect), or failure to speak HTTP (such as a network connectivity problem). A non-2xx status code doesn't cause an error.
func (HttpClientPolicyErr) Error ¶
func (pe HttpClientPolicyErr) Error() string
type NoRouteErr ¶
type NoRouteErr struct {
Msg string
}
func (NoRouteErr) Error ¶
func (err NoRouteErr) Error() string
type Password ¶
type Password string
Password is just an example type implementing the Redactor interface. Any time this is logged, the Redacted() function will be called.
type TimeoutErr ¶
type TimeoutErr struct {
Msg string
}
func (TimeoutErr) Error ¶
func (err TimeoutErr) Error() string