Versions in this module Expand all Collapse all v0 v0.0.2 May 10, 2020 v0.0.1 May 10, 2020 Changes in this version + const AcceptTimeout + const AdapterProxyResetCount + const AdapterProxyTicker + const AsyncInvokeTimeout + const ClientDialTimeout + const ClientIdleTimeout + const ClientQueueLen + const ClientReadTimeout + const ClientWriteTimeout + const GracedownTimeout + const HandleTimeout + const IdleTimeout + const MainLoopTicker + const MaxPackageLength + const NOTIFY_ERROR + const NOTIFY_NORMAL + const NOTIFY_WARN + const ObjQueueMax + const PropertyReportInterval + const QueueCap + const ReadTimeout + const ReqDefaultTimeout + const STAT_FAILED + const STAT_SUCCESS + const StatReportChannelBufLen + const StatReportInterval + const TCPNoDelay + const TCPReadBuffer + const TCPWriteBuffer + const TarsVersion + const WriteTimeout + const ZombileTimeout + var MaxInvoke int32 + var ServerConfigPath string + func AddHttpServant(mux *TarsHttpMux, obj string) + func AddHttpServantWithExceptionStatusChecker(mux *TarsHttpMux, obj string, exceptionStatusChecker func(int) bool) + func AddServant(v dispatch, f interface{}, obj string) + func AddServantWithContext(v dispatch, f interface{}, obj string) + func AddServantWithProtocol(proto transport.ServerProtocol, obj string) + func CheckPanic() + func DefaultExceptionStatusChecker(statusCode int) bool + func GetClientConfig() *clientConfig + func GetDayLogger(name string, numDay int) *rogger.Logger + func GetHourLogger(name string, numHour int) *rogger.Logger + func GetLogger(name string) *rogger.Logger + func GetRemoteLogger(name string) *rogger.Logger + func GetServerConfig() *serverConfig + func Init() + func RegisterAdmin(name string, fn adminFn) + func RegisterClientFilter(f ClientFilter) + func RegisterPostClientFilter(f ClientFilter) + func RegisterPostServerFilter(f ServerFilter) + func RegisterPreClientFilter(f ClientFilter) + func RegisterPreServerFilter(f ServerFilter) + func RegisterServerFilter(f ServerFilter) + func ReportAvg(key string, i int) + func ReportCount(key string, i int) + func ReportDistr(key string, in []int, i int) + func ReportMax(key string, i int) + func ReportMin(key string, i int) + func ReportNotifyInfo(level int32, info string) + func ReportStat(msg *Message, succ int32, timeout int32, exec int32) + func ReportStatBase(head *statf.StatMicMsgHead, body *statf.StatMicMsgBody, FromServer bool) + func ReportStatFromClient(msg *Message, succ int32, timeout int32, exec int32) + func ReportStatFromServer(InterfaceName, MasterName string, ReturnValue int32, TotalRspTime int64) + func ReportSum(key string, i int) + func Run() + type AdapterProxy struct + func NewAdapterProxy(point *endpointf.EndpointF, comm *Communicator) *AdapterProxy + func (c *AdapterProxy) Close() + func (c *AdapterProxy) GetPoint() *endpointf.EndpointF + func (c *AdapterProxy) ParsePackage(buff []byte) (int, int) + func (c *AdapterProxy) Recv(pkg []byte) + func (c *AdapterProxy) Send(req *requestf.RequestPacket) error + type Admin struct + func (a *Admin) Notify(command string) (string, error) + func (a *Admin) Shutdown() error + type AppCache struct + LogLevel string + ModifyTime string + ObjCaches []ObjCache + TarsVersion string + func GetAppCache() AppCache + type Avg struct + func NewAvg() *Avg + func (a *Avg) Enum() ReportPolicy + func (a *Avg) Get() (out string) + func (a *Avg) Set(in int) + type ClientFilter func(ctx context.Context, msg *Message, invoke Invoke, timeout time.Duration) (err error) + type Communicator struct + Client *clientConfig + func NewCommunicator() *Communicator + func (c *Communicator) GetLocator() string + func (c *Communicator) GetProperty(key string) (string, bool) + func (c *Communicator) GetPropertyBool(key string) (bool, bool) + func (c *Communicator) GetPropertyInt(key string) (int, bool) + func (c *Communicator) SetLocator(obj string) + func (c *Communicator) SetProperty(key string, value interface{}) + func (c *Communicator) StringToProxy(servant string, p ProxyPrx) + type Count struct + func NewCount() *Count + func (c *Count) Enum() ReportPolicy + func (c *Count) Get() (out string) + func (c *Count) Set(in int) + type Dispatch func(context.Context, interface{}, *requestf.RequestPacket, ...) error + type Distr struct + func NewDistr(in []int) (d *Distr) + func (d *Distr) Enum() ReportPolicy + func (d *Distr) Get() string + func (d *Distr) Set(in int) + type EndpointManager interface + GetAllEndpoint func() []*endpoint.Endpoint + SelectAdapterProxy func(msg *Message) (*AdapterProxy, bool) + func GetManager(comm *Communicator, objName string) EndpointManager + type HashType int + const ConsistentHash + const ModHash + type Invoke func(ctx context.Context, msg *Message, timeout time.Duration) (err error) + type Max struct + func NewMax() *Max + func (m *Max) Enum() ReportPolicy + func (m *Max) Get() (out string) + func (m *Max) Set(in int) + type Message struct + Adp *AdapterProxy + BeginTime int64 + EndTime int64 + Req *requestf.RequestPacket + Resp *requestf.ResponsePacket + Ser *ServantProxy + Status int32 + func (m *Message) Cost() int64 + func (m *Message) End() + func (m *Message) Init() + func (m *Message) SetHash(code uint32, h HashType) + type Min struct + func NewMin() *Min + func (m *Min) Enum() ReportPolicy + func (m *Min) Get() (out string) + func (m *Min) Set(in int) + type NodeFHelper struct + func (n *NodeFHelper) KeepAlive(adapter string) + func (n *NodeFHelper) ReportVersion(version string) + func (n *NodeFHelper) SetNodeInfo(comm *Communicator, node string, app string, server string, container string) + type NotifyHelper struct + func (n *NotifyHelper) ReportNotifyInfo(level int32, info string) + func (n *NotifyHelper) SetNotifyInfo(comm *Communicator, notify string, app string, server string, container string) + type ObjCache struct + Endpoints []endpointf.EndpointF + InactiveEndpoints []endpointf.EndpointF + Locator string + Name string + type PropertyReport struct + func CreatePropertyReport(key string, argvs ...ReportMethod) *PropertyReport + func GetPropertyReport(key string) *PropertyReport + func (p *PropertyReport) Report(in int) + type PropertyReportHelper struct + var ProHelper *PropertyReportHelper + func (p *PropertyReportHelper) AddToReport(pr *PropertyReport) + func (p *PropertyReportHelper) Init(comm *Communicator, node string) + func (p *PropertyReportHelper) ReportToServer() + func (p *PropertyReportHelper) Run() + type ProxyPrx interface + SetServant func(s.Servant) + type RConf struct + func NewRConf(app string, server string, path string) *RConf + func (c *RConf) GetConfig(filename string) (config string, err error) + func (c *RConf) GetConfigList() (flist []string, err error) + type RemoteTimeWriter struct + func NewRemoteTimeWriter() *RemoteTimeWriter + func (rw *RemoteTimeWriter) EnablePrefix(hasAppNamePrefix bool) + func (rw *RemoteTimeWriter) EnableSqarewrapper(hasSquareBracket bool) + func (rw *RemoteTimeWriter) EnableSufix(hasSufix bool) + func (rw *RemoteTimeWriter) InitFormat(s string) + func (rw *RemoteTimeWriter) InitServerInfo(app string, server string, filename string, setdivision string) + func (rw *RemoteTimeWriter) NeedPrefix() bool + func (rw *RemoteTimeWriter) SetFileNameConcatStr(s string) + func (rw *RemoteTimeWriter) SetLogType(logType string) + func (rw *RemoteTimeWriter) SetPrefix(enable bool) + func (rw *RemoteTimeWriter) SetSeparator(s string) + func (rw *RemoteTimeWriter) Sync2remote() + func (rw *RemoteTimeWriter) Write(b []byte) + type ReportMethod interface + Enum func() ReportPolicy + Get func() string + Set func(int) + type ReportPolicy int + const ReportPolicyAvg + const ReportPolicyCount + const ReportPolicyDistr + const ReportPolicyMax + const ReportPolicyMin + const ReportPolicySum + const ReportPolicyUnknown + func (p ReportPolicy) String() string + type ServantProxy struct + func (s *ServantProxy) TarsSetProtocol(proto model.Protocol) + func (s *ServantProxy) TarsSetTimeout(t int) + func (s *ServantProxy) TarsSetVersion(iVersion int16) + func (s *ServantProxy) Tars_invoke(ctx context.Context, ctype byte, sFuncName string, buf []byte, ...) error + type ServerFilter func(ctx context.Context, d Dispatch, f interface{}, req *requestf.RequestPacket, ...) (err error) + type StatFHelper struct + var StatReport *StatFHelper + func (s *StatFHelper) Init(comm *Communicator, node string) + func (s *StatFHelper) ReportMicMsg(stStatInfo StatInfo, fromServer bool) + func (s *StatFHelper) Run() + type StatInfo struct + Body statf.StatMicMsgBody + Head statf.StatMicMsgHead + type Sum struct + func NewSum() *Sum + func (s *Sum) Enum() ReportPolicy + func (s *Sum) Get() (out string) + func (s *Sum) Set(in int) + type TarsHttpConf struct + AppName string + Container string + ExceptionStatusChecker func(int) bool + IP string + Port int32 + SetId string + Version string + type TarsHttpMux struct + func (mux *TarsHttpMux) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (mux *TarsHttpMux) SetConfig(cfg *TarsHttpConf) + type TarsProtocol struct + func NewTarsProtocol(dispatcher dispatch, imp interface{}, withContext bool) *TarsProtocol + func (s *TarsProtocol) GetCloseMsg() []byte + func (s *TarsProtocol) Invoke(ctx context.Context, req []byte) (rsp []byte) + func (s *TarsProtocol) InvokeTimeout(pkg []byte) []byte + func (s *TarsProtocol) ParsePackage(buff []byte) (int, int) + type TarsResponseWriter struct + StatusCode int + func (w *TarsResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w *TarsResponseWriter) WriteHeader(code int)