Versions in this module Expand all Collapse all v1 v1.0.1 Mar 25, 2022 v1.0.0 Jul 12, 2021 v0 v0.0.1 Jul 12, 2021 Changes in this version + const LogConfChanBuffSize + const LogConfCronTime + const LogConfDebugFilePath + const LogConfDebugOpen + const LogConfFatalFilePath + const LogConfFileLifeTime + const LogConfFlushTimer + const LogConfLevel + const LogConfNoticeFilePath + const LogConfTraceFilePath + const LogConfTypeNum + const LogConfTypeStr + const LogConfWarningFilePath + const LogTypeDebug + const LogTypeDebugStr + const LogTypeFatal + const LogTypeFatalStr + const LogTypeNotice + const LogTypeNoticeStr + const LogTypeTrace + const LogTypeTraceStr + const LogTypeWarning + const LogTypeWarningStr + var GConfFileToTypeMap = map[string]int + var GConfItemMap = map[string]int + var GFlushLock *sync.Mutex = &sync.Mutex + var GFlushLogFlag bool = false + var GLogTypeMap = map[int]string + var GOnceV sync.Once + func LogDebugPrint(msg string, v interface{}) + func LogGetFileSuffix(now time.Time) string + func LogGetOsSeparator(pathName string) string + func LogInit() + func LogIsDebug() bool + func LogOpenFile() error + func LogRun(RunConfigMap map[string]string) + func LogWriteFile(logMsg LogMsgT) + func LogfileCleanup(fileLifetime int64) + func RegisterRpcTypeForValue(value interface{}) + type Config struct + func NewConfig() *Config + func (c *Config) Get(key string) string + func (c *Config) GetAll() map[string]string + func (c *Config) GetInt(key string) int + func (c *Config) GetInt64(key string) int64 + func (c *Config) GetSlice(key string, separator string) []string + func (c *Config) GetSliceInt(key string, separator string) []int + func (c *Config) Load(configFile string) error + type HttpClient struct + func NewHttpClient() *HttpClient + func (c *HttpClient) Close() error + func (c *HttpClient) ConnectTo(address string, timeout time.Duration) error + func (c *HttpClient) Dial(localAddress string, remoteAddress string, timeout time.Duration) error + func (c *HttpClient) Get(uri string, readTimeout time.Duration, writeTimeout time.Duration) (*HttpResponse, error) + func (c *HttpClient) Post(uri string, posts map[string]string, readTimeout time.Duration, ...) (*HttpResponse, error) + func (c *HttpClient) Recv(readTimeout time.Duration) (*HttpResponse, error) + func (c *HttpClient) Send(request *HttpRequest, writeTimeout time.Duration) error + func (c *HttpClient) SetDebug(debug bool) + type HttpConnection struct + func NewHttpConnection(tcpConnection *TcpConnection) *HttpConnection + func (c *HttpConnection) ReadRequest(timeout time.Duration) (*HttpRequest, error) + func (c *HttpConnection) ReadResponse(timeout time.Duration) (*HttpResponse, error) + func (c *HttpConnection) WriteRequest(request *HttpRequest, timeout time.Duration) error + func (c *HttpConnection) WriteResponse(response *HttpResponse, timeout time.Duration) error + type HttpMessage interface + Header func(key string) string + SetHeader func(key string, value string) + Stream func() []byte + type HttpRequest struct + func NewHttpRequest() *HttpRequest + func (r *HttpRequest) Chas(key string) bool + func (r *HttpRequest) Cint(key string) int + func (r *HttpRequest) Cookies() map[string]string + func (r *HttpRequest) Cstr(key string) string + func (r *HttpRequest) GetRemoteIP() string + func (r *HttpRequest) Gets() map[string]string + func (r *HttpRequest) Ghas(key string) bool + func (r *HttpRequest) Gint(key string) int + func (r *HttpRequest) Gstr(key string) string + func (r *HttpRequest) Header(key string) string + func (r *HttpRequest) IsDelete() bool + func (r *HttpRequest) IsGet() bool + func (r *HttpRequest) IsKeepAlive() bool + func (r *HttpRequest) IsPost() bool + func (r *HttpRequest) IsPut() bool + func (r *HttpRequest) Method() string + func (r *HttpRequest) PathInfo() string + func (r *HttpRequest) Phas(key string) bool + func (r *HttpRequest) Pint(key string) int + func (r *HttpRequest) Posts() map[string]string + func (r *HttpRequest) Pstr(key string) string + func (r *HttpRequest) Rint(key string) int + func (r *HttpRequest) Rstr(key string) string + func (r *HttpRequest) SetHeader(key string, value string) + func (r *HttpRequest) SetMethod(method string) + func (r *HttpRequest) SetPosts(posts map[string]string) + func (r *HttpRequest) SetUri(uri string) + func (r *HttpRequest) SetVar(key string, value interface{}) + func (r *HttpRequest) SetVersion(version string) + func (r *HttpRequest) Stream() []byte + func (r *HttpRequest) String() string + func (r *HttpRequest) Uri() string + func (r *HttpRequest) Var(key string) interface{} + func (r *HttpRequest) Version() string + type HttpResponse struct + func NewHttpResponse() *HttpResponse + func (r *HttpResponse) BodyStream() []byte + func (r *HttpResponse) BodyString() string + func (r *HttpResponse) Code() int + func (r *HttpResponse) Header(key string) string + func (r *HttpResponse) IsConnectionClose() bool + func (r *HttpResponse) Putb(stream []byte) + func (r *HttpResponse) Puts(content string) + func (r *HttpResponse) SetBodyStream(bodyStream []byte) + func (r *HttpResponse) SetBodyString(bodyString string) + func (r *HttpResponse) SetCode(code int) + func (r *HttpResponse) SetHeader(key string, value string) + func (r *HttpResponse) SetStatus(code int, phrase string) + func (r *HttpResponse) SetVersion(version string) + func (r *HttpResponse) Status() (int, string) + func (r *HttpResponse) Stream() []byte + func (r *HttpResponse) String() string + func (r *HttpResponse) Version() string + type LogMsgT struct + LogData string + LogType int + type LogT struct + FlushLogChan chan bool + LogChan chan LogMsgT + LogChanBuffSize int + LogCronTime string + LogDebugOpen bool + LogErrorFilePath string + LogFilePath map[int]string + LogFlushTimer int + LogLevel int + LogLifeTime int + LogNoticeFilePath string + MergeLogFd map[string]*os.File + MergeLogFile map[string]string + RunConfigMap map[string]string + var GLogV *LogT + type Logger struct + LogID string + func NewLogger(logid string) *Logger + func (l *Logger) Debug(logMessage string) + func (l *Logger) Fatal(logMessage string) + func (l *Logger) Notice(logMessage string) + func (l *Logger) Trace(logMessage string) + func (l *Logger) Warning(logMessage string) + type RpcRequest struct + Args map[string]interface{} + Func string + func NewRpcRequest() *RpcRequest + type RpcResponse struct + Args map[string]interface{} + Code int + Data interface{} + Reason string + Result bool + func NewRpcResponse() *RpcResponse + type TcpConnection struct + func TcpConnect(localAddress string, remoteAddress string, timeout time.Duration) (*TcpConnection, error) + func (c *TcpConnection) IsHttpProto() bool + func (c *TcpConnection) Read(p []byte) (n int, err error) + func (c *TcpConnection) ReadProtoBuffer() error + func (c *TcpConnection) ReadRpcRequest(timeout time.Duration) (*RpcRequest, error) + func (c *TcpConnection) ReadStream(stream []byte, count int) error + func (c *TcpConnection) Rpc(request *RpcRequest, readTimeout time.Duration, writeTimeout time.Duration) (*RpcResponse, error) + func (c *TcpConnection) WriteRpcResponse(response *RpcResponse, timeout time.Duration) error + type TcpListener struct + func TcpListen(address string) (*TcpListener, error) + func (l *TcpListener) Accept() (*TcpConnection, error)