Documentation ¶
Index ¶
- Constants
- type BinaryEncoder
- func (e *BinaryEncoder) EncodeEvent(buf *bytes.Buffer, m *Event) (err error)
- func (e *BinaryEncoder) EncodeHeader(buf *bytes.Buffer, header *Header) (err error)
- func (e *BinaryEncoder) EncodeHeartbeat(buf *bytes.Buffer, m *Heartbeat) (err error)
- func (e *BinaryEncoder) EncodeMessage(buf *bytes.Buffer, message Messager) (err error)
- func (e *BinaryEncoder) EncodeMetric(buf *bytes.Buffer, m *Metric) (err error)
- func (e *BinaryEncoder) EncodeTransaction(buf *bytes.Buffer, trans *Transaction) (err error)
- type Encoder
- type Event
- type Flush
- type Header
- type Heartbeat
- type Message
- func (m *Message) AddData(k string, v ...string)
- func (m *Message) Complete()
- func (m *Message) GetData() *bytes.Buffer
- func (m *Message) GetMessageId() string
- func (m *Message) GetName() string
- func (m *Message) GetParentMessageId() string
- func (m *Message) GetRootMessageId() string
- func (m *Message) GetStatus() string
- func (m *Message) GetTime() time.Time
- func (m *Message) GetType() string
- func (m *Message) SetData(v string)
- func (m *Message) SetStatus(status string)
- func (m *Message) SetSuccessStatus()
- func (m *Message) SetTime(t time.Time)
- type MessageGetter
- type Messager
- type Metric
- type NullMessage
- func (m *NullMessage) AddData(k string, v ...string)
- func (m *NullMessage) Complete()
- func (m *NullMessage) GetData() *bytes.Buffer
- func (m *NullMessage) GetMessageId() string
- func (m *NullMessage) GetName() string
- func (m *NullMessage) GetParentMessageId() string
- func (m *NullMessage) GetRootMessageId() string
- func (m *NullMessage) GetStatus() string
- func (m *NullMessage) GetTime() time.Time
- func (m *NullMessage) GetType() string
- func (m *NullMessage) SetData(v string)
- func (m *NullMessage) SetStatus(status string)
- func (m *NullMessage) SetTime(time time.Time)
- func (m *NullMessage) SetTimestamp(timestampMs int64)
- type NullTransaction
- func (t *NullTransaction) AddChild(m Messager)
- func (t *NullTransaction) GetChildren() []Messager
- func (t *NullTransaction) GetDuration() time.Duration
- func (t *NullTransaction) LogEvent(mtype, name string, args ...string)
- func (t *NullTransaction) NewEvent(mtype, name string) Messager
- func (t *NullTransaction) SetDuration(duration time.Duration)
- func (t *NullTransaction) SetDurationStart(duration time.Time)
- func (t *NullTransaction) SetMessageId(messageId string)
- func (t *NullTransaction) SetParentMessageId(parentMessageId string)
- func (t *NullTransaction) SetRootMessageId(rootMessageId string)
- type Transaction
- func (t *Transaction) AddChild(m Messager)
- func (t *Transaction) Complete()
- func (t *Transaction) GetChildren() []Messager
- func (t *Transaction) GetDuration() time.Duration
- func (t *Transaction) LogEvent(mtype, name string, args ...string)
- func (t *Transaction) NewEvent(mtype, name string) Messager
- func (t *Transaction) SetDuration(duration time.Duration)
- func (t *Transaction) SetDurationStart(time time.Time)
- func (t *Transaction) SetMessageId(messageId string)
- func (t *Transaction) SetParentMessageId(parentMessageId string)
- func (t *Transaction) SetRootMessageId(rootMessageId string)
- type TransactionGetter
- type Transactor
Constants ¶
View Source
const ( ReadableProtocol = "PT1" BinaryProtocol = "NT1" )
View Source
const ( CatSuccess = "0" CatError = "-1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryEncoder ¶
type BinaryEncoder struct {
// contains filtered or unexported fields
}
func NewBinaryEncoder ¶
func NewBinaryEncoder() *BinaryEncoder
func (*BinaryEncoder) EncodeEvent ¶
func (e *BinaryEncoder) EncodeEvent(buf *bytes.Buffer, m *Event) (err error)
func (*BinaryEncoder) EncodeHeader ¶
func (*BinaryEncoder) EncodeHeartbeat ¶
func (e *BinaryEncoder) EncodeHeartbeat(buf *bytes.Buffer, m *Heartbeat) (err error)
func (*BinaryEncoder) EncodeMessage ¶
func (e *BinaryEncoder) EncodeMessage(buf *bytes.Buffer, message Messager) (err error)
func (*BinaryEncoder) EncodeMetric ¶
func (e *BinaryEncoder) EncodeMetric(buf *bytes.Buffer, m *Metric) (err error)
func (*BinaryEncoder) EncodeTransaction ¶
func (e *BinaryEncoder) EncodeTransaction(buf *bytes.Buffer, trans *Transaction) (err error)
type Encoder ¶
type Encoder interface { EncodeHeader(*bytes.Buffer, *Header) error EncodeMessage(*bytes.Buffer, Messager) error EncodeTransaction(*bytes.Buffer, *Transaction) error EncodeEvent(*bytes.Buffer, *Event) error EncodeHeartbeat(*bytes.Buffer, *Heartbeat) error EncodeMetric(*bytes.Buffer, *Metric) error }
type Message ¶
type Message struct { Type string Name string Status string // contains filtered or unexported fields }
func NewMessage ¶
func (*Message) GetMessageId ¶ added in v1.1.0
func (*Message) GetParentMessageId ¶ added in v1.1.0
func (*Message) GetRootMessageId ¶ added in v1.1.0
func (*Message) SetSuccessStatus ¶
func (m *Message) SetSuccessStatus()
type MessageGetter ¶
type MessageGetter interface { GetType() string GetName() string GetStatus() string GetData() *bytes.Buffer GetTime() time.Time }
noinspection GoNameStartsWithPackageName
type NullMessage ¶
type NullMessage struct {
// contains filtered or unexported fields
}
func (*NullMessage) AddData ¶
func (m *NullMessage) AddData(k string, v ...string)
func (*NullMessage) Complete ¶
func (m *NullMessage) Complete()
func (*NullMessage) GetData ¶
func (m *NullMessage) GetData() *bytes.Buffer
func (*NullMessage) GetMessageId ¶ added in v1.1.0
func (m *NullMessage) GetMessageId() string
func (*NullMessage) GetName ¶
func (m *NullMessage) GetName() string
func (*NullMessage) GetParentMessageId ¶ added in v1.1.0
func (m *NullMessage) GetParentMessageId() string
func (*NullMessage) GetRootMessageId ¶ added in v1.1.0
func (m *NullMessage) GetRootMessageId() string
func (*NullMessage) GetStatus ¶
func (m *NullMessage) GetStatus() string
func (*NullMessage) GetTime ¶
func (m *NullMessage) GetTime() time.Time
func (*NullMessage) GetType ¶
func (m *NullMessage) GetType() string
func (*NullMessage) SetData ¶
func (m *NullMessage) SetData(v string)
func (*NullMessage) SetStatus ¶
func (m *NullMessage) SetStatus(status string)
func (*NullMessage) SetTime ¶
func (m *NullMessage) SetTime(time time.Time)
func (*NullMessage) SetTimestamp ¶
func (m *NullMessage) SetTimestamp(timestampMs int64)
type NullTransaction ¶
type NullTransaction struct {
NullMessage
}
func (*NullTransaction) AddChild ¶ added in v1.0.1
func (t *NullTransaction) AddChild(m Messager)
func (*NullTransaction) GetChildren ¶
func (t *NullTransaction) GetChildren() []Messager
func (*NullTransaction) GetDuration ¶
func (t *NullTransaction) GetDuration() time.Duration
func (*NullTransaction) LogEvent ¶
func (t *NullTransaction) LogEvent(mtype, name string, args ...string)
func (*NullTransaction) NewEvent ¶
func (t *NullTransaction) NewEvent(mtype, name string) Messager
func (*NullTransaction) SetDuration ¶
func (t *NullTransaction) SetDuration(duration time.Duration)
func (*NullTransaction) SetDurationStart ¶
func (t *NullTransaction) SetDurationStart(duration time.Time)
func (*NullTransaction) SetMessageId ¶ added in v1.1.0
func (t *NullTransaction) SetMessageId(messageId string)
func (*NullTransaction) SetParentMessageId ¶ added in v1.1.0
func (t *NullTransaction) SetParentMessageId(parentMessageId string)
func (*NullTransaction) SetRootMessageId ¶ added in v1.1.0
func (t *NullTransaction) SetRootMessageId(rootMessageId string)
type Transaction ¶
type Transaction struct { Message // contains filtered or unexported fields }
func NewTransaction ¶
func NewTransaction(mType, name string, flush Flush) *Transaction
func (*Transaction) AddChild ¶
func (t *Transaction) AddChild(m Messager)
func (*Transaction) Complete ¶
func (t *Transaction) Complete()
func (*Transaction) GetChildren ¶
func (t *Transaction) GetChildren() []Messager
func (*Transaction) GetDuration ¶
func (t *Transaction) GetDuration() time.Duration
func (*Transaction) LogEvent ¶
func (t *Transaction) LogEvent(mtype, name string, args ...string)
func (*Transaction) NewEvent ¶
func (t *Transaction) NewEvent(mtype, name string) Messager
func (*Transaction) SetDuration ¶
func (t *Transaction) SetDuration(duration time.Duration)
func (*Transaction) SetDurationStart ¶
func (t *Transaction) SetDurationStart(time time.Time)
func (*Transaction) SetMessageId ¶ added in v1.1.0
func (t *Transaction) SetMessageId(messageId string)
func (*Transaction) SetParentMessageId ¶ added in v1.1.0
func (t *Transaction) SetParentMessageId(parentMessageId string)
func (*Transaction) SetRootMessageId ¶ added in v1.1.0
func (t *Transaction) SetRootMessageId(rootMessageId string)
type TransactionGetter ¶
type Transactor ¶
type Transactor interface { Messager TransactionGetter SetDuration(duration time.Duration) SetDurationStart(time time.Time) NewEvent(mType, name string) Messager LogEvent(mType, name string, args ...string) AddChild(m Messager) GetChildren() []Messager SetRootMessageId(rootMessageId string) SetParentMessageId(parentMessageId string) SetMessageId(messageId string) }
Click to show internal directories.
Click to hide internal directories.