statf

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Overview

Code generated by tars2go 1.2.3, DO NOT EDIT. This file was generated from StatF.tars Package statf comment

Code generated by tars2go 1.2.3, DO NOT EDIT. This file was generated from StatF.tars Package statf comment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyInfo

type ProxyInfo struct {
	BFromClient bool `json:"bFromClient" tars:"bFromClient,tag:0,require:true"`
}

ProxyInfo struct implement

func (*ProxyInfo) ReadBlock

func (st *ProxyInfo) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error

ReadBlock reads struct from the given tag , require or optional.

func (*ProxyInfo) ReadFrom

func (st *ProxyInfo) ReadFrom(readBuf *codec.Reader) error

ReadFrom reads from readBuf and put into struct.

func (*ProxyInfo) ResetDefault added in v1.2.0

func (st *ProxyInfo) ResetDefault()

func (*ProxyInfo) WriteBlock

func (st *ProxyInfo) WriteBlock(buf *codec.Buffer, tag byte) error

WriteBlock encode struct

func (*ProxyInfo) WriteTo

func (st *ProxyInfo) WriteTo(buf *codec.Buffer) (err error)

WriteTo encode struct to buffer

type StatF

type StatF struct {
	// contains filtered or unexported fields
}

StatF struct

func NewStatF added in v1.4.5

func NewStatF() *StatF

NewStatF creates a new StatF servant.

func (*StatF) Dispatch

func (obj *StatF) Dispatch(tarsCtx context.Context, val interface{}, tarsReq *requestf.RequestPacket, tarsResp *requestf.ResponsePacket, withContext bool) (err error)

Dispatch is used to call the server side implement for the method defined in the tars file. withContext shows using context or not.

func (*StatF) Endpoints added in v1.4.1

func (obj *StatF) Endpoints() []*endpoint.Endpoint

Endpoints returns all active endpoint.Endpoint

func (*StatF) ReportMicMsg

func (obj *StatF) ReportMicMsg(msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool, opts ...map[string]string) (int32, error)

ReportMicMsg is the proxy function for the method defined in the tars file, with the context

func (*StatF) ReportMicMsgOneWayWithContext added in v1.2.0

func (obj *StatF) ReportMicMsgOneWayWithContext(tarsCtx context.Context, msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool, opts ...map[string]string) (ret int32, err error)

ReportMicMsgOneWayWithContext is the proxy function for the method defined in the tars file, with the context

func (*StatF) ReportMicMsgWithContext

func (obj *StatF) ReportMicMsgWithContext(tarsCtx context.Context, msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool, opts ...map[string]string) (ret int32, err error)

ReportMicMsgWithContext is the proxy function for the method defined in the tars file, with the context

func (*StatF) ReportSampleMsg

func (obj *StatF) ReportSampleMsg(msg []StatSampleMsg, opts ...map[string]string) (int32, error)

ReportSampleMsg is the proxy function for the method defined in the tars file, with the context

func (*StatF) ReportSampleMsgOneWayWithContext added in v1.2.0

func (obj *StatF) ReportSampleMsgOneWayWithContext(tarsCtx context.Context, msg []StatSampleMsg, opts ...map[string]string) (ret int32, err error)

ReportSampleMsgOneWayWithContext is the proxy function for the method defined in the tars file, with the context

func (*StatF) ReportSampleMsgWithContext

func (obj *StatF) ReportSampleMsgWithContext(tarsCtx context.Context, msg []StatSampleMsg, opts ...map[string]string) (ret int32, err error)

ReportSampleMsgWithContext is the proxy function for the method defined in the tars file, with the context

func (*StatF) SetServant

func (obj *StatF) SetServant(servant model.Servant)

SetServant sets servant for the service.

func (*StatF) TarsSetProtocol added in v1.2.0

func (obj *StatF) TarsSetProtocol(p model.Protocol)

TarsSetProtocol sets the protocol for the servant.

func (*StatF) TarsSetTimeout

func (obj *StatF) TarsSetTimeout(timeout int)

TarsSetTimeout sets the timeout for the servant which is in ms.

type StatFServant added in v1.3.0

type StatFServant interface {
	ReportMicMsg(msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool) (ret int32, err error)
	ReportSampleMsg(msg []StatSampleMsg) (ret int32, err error)
}

type StatFServantWithContext added in v1.3.0

type StatFServantWithContext interface {
	ReportMicMsg(tarsCtx context.Context, msg map[StatMicMsgHead]StatMicMsgBody, bFromClient bool) (ret int32, err error)
	ReportSampleMsg(tarsCtx context.Context, msg []StatSampleMsg) (ret int32, err error)
}

type StatMicMsgBody

type StatMicMsgBody struct {
	Count         int32           `json:"count" tars:"count,tag:0,require:true"`
	TimeoutCount  int32           `json:"timeoutCount" tars:"timeoutCount,tag:1,require:true"`
	ExecCount     int32           `json:"execCount" tars:"execCount,tag:2,require:true"`
	IntervalCount map[int32]int32 `json:"intervalCount" tars:"intervalCount,tag:3,require:true"`
	TotalRspTime  int64           `json:"totalRspTime" tars:"totalRspTime,tag:4,require:true"`
	MaxRspTime    int32           `json:"maxRspTime" tars:"maxRspTime,tag:5,require:true"`
	MinRspTime    int32           `json:"minRspTime" tars:"minRspTime,tag:6,require:true"`
}

StatMicMsgBody struct implement

func (*StatMicMsgBody) ReadBlock

func (st *StatMicMsgBody) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error

ReadBlock reads struct from the given tag , require or optional.

func (*StatMicMsgBody) ReadFrom

func (st *StatMicMsgBody) ReadFrom(readBuf *codec.Reader) error

ReadFrom reads from readBuf and put into struct.

func (*StatMicMsgBody) ResetDefault added in v1.2.0

func (st *StatMicMsgBody) ResetDefault()

func (*StatMicMsgBody) WriteBlock

func (st *StatMicMsgBody) WriteBlock(buf *codec.Buffer, tag byte) error

WriteBlock encode struct

func (*StatMicMsgBody) WriteTo

func (st *StatMicMsgBody) WriteTo(buf *codec.Buffer) (err error)

WriteTo encode struct to buffer

type StatMicMsgHead

type StatMicMsgHead struct {
	MasterName    string `json:"masterName" tars:"masterName,tag:0,require:true"`
	SlaveName     string `json:"slaveName" tars:"slaveName,tag:1,require:true"`
	InterfaceName string `json:"interfaceName" tars:"interfaceName,tag:2,require:true"`
	MasterIp      string `json:"masterIp" tars:"masterIp,tag:3,require:true"`
	SlaveIp       string `json:"slaveIp" tars:"slaveIp,tag:4,require:true"`
	SlavePort     int32  `json:"slavePort" tars:"slavePort,tag:5,require:true"`
	ReturnValue   int32  `json:"returnValue" tars:"returnValue,tag:6,require:true"`
	SlaveSetName  string `json:"slaveSetName" tars:"slaveSetName,tag:7,require:false"`
	SlaveSetArea  string `json:"slaveSetArea" tars:"slaveSetArea,tag:8,require:false"`
	SlaveSetID    string `json:"slaveSetID" tars:"slaveSetID,tag:9,require:false"`
	TarsVersion   string `json:"tarsVersion" tars:"tarsVersion,tag:10,require:false"`
}

StatMicMsgHead struct implement

func (*StatMicMsgHead) ReadBlock

func (st *StatMicMsgHead) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error

ReadBlock reads struct from the given tag , require or optional.

func (*StatMicMsgHead) ReadFrom

func (st *StatMicMsgHead) ReadFrom(readBuf *codec.Reader) error

ReadFrom reads from readBuf and put into struct.

func (*StatMicMsgHead) ResetDefault added in v1.2.0

func (st *StatMicMsgHead) ResetDefault()

func (*StatMicMsgHead) WriteBlock

func (st *StatMicMsgHead) WriteBlock(buf *codec.Buffer, tag byte) error

WriteBlock encode struct

func (*StatMicMsgHead) WriteTo

func (st *StatMicMsgHead) WriteTo(buf *codec.Buffer) (err error)

WriteTo encode struct to buffer

type StatSampleMsg

type StatSampleMsg struct {
	Unid          string `json:"unid" tars:"unid,tag:0,require:true"`
	MasterName    string `json:"masterName" tars:"masterName,tag:1,require:true"`
	SlaveName     string `json:"slaveName" tars:"slaveName,tag:2,require:true"`
	InterfaceName string `json:"interfaceName" tars:"interfaceName,tag:3,require:true"`
	MasterIp      string `json:"masterIp" tars:"masterIp,tag:4,require:true"`
	SlaveIp       string `json:"slaveIp" tars:"slaveIp,tag:5,require:true"`
	Depth         int32  `json:"depth" tars:"depth,tag:6,require:true"`
	Width         int32  `json:"width" tars:"width,tag:7,require:true"`
	ParentWidth   int32  `json:"parentWidth" tars:"parentWidth,tag:8,require:true"`
}

StatSampleMsg struct implement

func (*StatSampleMsg) ReadBlock

func (st *StatSampleMsg) ReadBlock(readBuf *codec.Reader, tag byte, require bool) error

ReadBlock reads struct from the given tag , require or optional.

func (*StatSampleMsg) ReadFrom

func (st *StatSampleMsg) ReadFrom(readBuf *codec.Reader) error

ReadFrom reads from readBuf and put into struct.

func (*StatSampleMsg) ResetDefault added in v1.2.0

func (st *StatSampleMsg) ResetDefault()

func (*StatSampleMsg) WriteBlock

func (st *StatSampleMsg) WriteBlock(buf *codec.Buffer, tag byte) error

WriteBlock encode struct

func (*StatSampleMsg) WriteTo

func (st *StatSampleMsg) WriteTo(buf *codec.Buffer) (err error)

WriteTo encode struct to buffer

Jump to

Keyboard shortcuts

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