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 InitHeader
- type Message
- func (m *Message) AddData(k string, v ...string)
- func (m *Message) Complete()
- func (m *Message) GetData() *bytes.Buffer
- func (m *Message) GetDomain() (domain string)
- func (t *Message) GetFlushStatus() bool
- func (m *Message) GetHeader() (header *Header)
- func (m *Message) GetHostname() (hostname string)
- func (m *Message) GetIp() (messageId string)
- func (m *Message) GetMessageId() (messageId string)
- func (m *Message) GetName() string
- func (m *Message) GetParentMessageId() (parentMessageId string)
- func (m *Message) GetRootMessageId() (rootMessageId 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) SetDomain(domain string)
- func (t *Message) SetFlushStatus(flushStatus bool)
- func (m *Message) SetHeader(header *Header)
- func (m *Message) SetHostname(hostname string)
- func (m *Message) SetIp(ip string)
- func (m *Message) SetMessageId(messageId string)
- func (m *Message) SetParentMessageId(parentMessageId string)
- func (m *Message) SetRootMessageId(rootMessageId 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) GetDomain() (domain string)
- func (t *NullMessage) GetFlushStatus() bool
- func (m *NullMessage) GetHeader() (header *Header)
- func (m *NullMessage) GetHostname() (hostname string)
- func (m *NullMessage) GetIp() (messageId string)
- func (m *NullMessage) GetMessageId() (messageId string)
- func (m *NullMessage) GetName() string
- func (m *NullMessage) GetParentMessageId() (parentMessageId string)
- func (m *NullMessage) GetRootMessageId() (rootMessageId 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) SetDomain(domain string)
- func (t *NullMessage) SetFlushStatus(flushStatus bool)
- func (m *NullMessage) SetHeader(header *Header)
- func (m *NullMessage) SetHostname(hostname string)
- func (m *NullMessage) SetIp(ip string)
- func (m *NullMessage) SetMessageId(messageId string)
- func (m *NullMessage) SetParentMessageId(parentMessageId string)
- func (m *NullMessage) SetRootMessageId(rootMessageId 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)
- 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)
- type TransactionGetter
- type Transactor
- type TxtEncoder
- func (e *TxtEncoder) EncodeEvent(buf *bytes.Buffer, m *Event) (err error)
- func (e *TxtEncoder) EncodeHeader(buf *bytes.Buffer, header *Header) (err error)
- func (e *TxtEncoder) EncodeHeartbeat(buf *bytes.Buffer, m *Heartbeat) (err error)
- func (e *TxtEncoder) EncodeMessage(buf *bytes.Buffer, message Messager) (err error)
- func (e *TxtEncoder) EncodeMetric(buf *bytes.Buffer, m *Metric) (err error)
- func (e *TxtEncoder) EncodeTransaction(buf *bytes.Buffer, trans *Transaction) (err error)
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 (e *BinaryEncoder) EncodeHeader(buf *bytes.Buffer, header *Header) (err error)
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 Heartbeat ¶
type Heartbeat struct {
Message
}
func NewHeartbeat ¶
func NewHeartbeat(mtype, name string, flush Flush, initHeader InitHeader) *Heartbeat
type Message ¶
type Message struct { Type string Name string Status string Header *Header // contains filtered or unexported fields }
func NewMessage ¶
func NewMessage(mtype, name string, flush Flush, initHeader InitHeader) Message
func (*Message) GetFlushStatus ¶
func (*Message) GetHostname ¶
func (*Message) GetMessageId ¶
func (*Message) GetParentMessageId ¶
func (*Message) GetRootMessageId ¶
func (*Message) SetFlushStatus ¶
func (*Message) SetHostname ¶
func (*Message) SetMessageId ¶
func (*Message) SetParentMessageId ¶
func (*Message) SetRootMessageId ¶
func (*Message) SetSuccessStatus ¶
func (m *Message) SetSuccessStatus()
type MessageGetter ¶
type MessageGetter interface { GetType() string GetName() string GetStatus() string GetData() *bytes.Buffer GetTime() time.Time GetDomain() string GetHostname() string GetIp() string GetMessageId() string GetParentMessageId() string GetRootMessageId() string GetHeader() *Header GetFlushStatus() bool }
noinspection GoNameStartsWithPackageName
type Messager ¶
type Messager interface { MessageGetter AddData(k string, v ...string) SetData(v string) SetStatus(status string) SetTime(time time.Time) Complete() SetDomain(domain string) SetHostname(hostname string) SetIp(ip string) SetMessageId(messageId string) SetParentMessageId(parentMessageId string) SetRootMessageId(rootMessageId string) SetHeader(header *Header) SetFlushStatus(status bool) }
type NullMessage ¶
type NullMessage struct { }
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) GetDomain ¶
func (m *NullMessage) GetDomain() (domain string)
func (*NullMessage) GetFlushStatus ¶
func (t *NullMessage) GetFlushStatus() bool
func (*NullMessage) GetHeader ¶
func (m *NullMessage) GetHeader() (header *Header)
func (*NullMessage) GetHostname ¶
func (m *NullMessage) GetHostname() (hostname string)
func (*NullMessage) GetIp ¶
func (m *NullMessage) GetIp() (messageId string)
func (*NullMessage) GetMessageId ¶
func (m *NullMessage) GetMessageId() (messageId string)
func (*NullMessage) GetName ¶
func (m *NullMessage) GetName() string
func (*NullMessage) GetParentMessageId ¶
func (m *NullMessage) GetParentMessageId() (parentMessageId string)
func (*NullMessage) GetRootMessageId ¶
func (m *NullMessage) GetRootMessageId() (rootMessageId 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) SetDomain ¶
func (m *NullMessage) SetDomain(domain string)
func (*NullMessage) SetFlushStatus ¶
func (t *NullMessage) SetFlushStatus(flushStatus bool)
func (*NullMessage) SetHeader ¶
func (m *NullMessage) SetHeader(header *Header)
func (*NullMessage) SetHostname ¶
func (m *NullMessage) SetHostname(hostname string)
func (*NullMessage) SetIp ¶
func (m *NullMessage) SetIp(ip string)
func (*NullMessage) SetMessageId ¶
func (m *NullMessage) SetMessageId(messageId string)
func (*NullMessage) SetParentMessageId ¶
func (m *NullMessage) SetParentMessageId(parentMessageId string)
func (*NullMessage) SetRootMessageId ¶
func (m *NullMessage) SetRootMessageId(rootMessageId 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 ¶
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)
type Transaction ¶
type Transaction struct { Message // contains filtered or unexported fields }
func NewTransaction ¶
func NewTransaction(mtype, name string, flush Flush, initHeader InitHeader) *Transaction
需要设置header
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)
type TransactionGetter ¶
type Transactor ¶
type TxtEncoder ¶
type TxtEncoder struct {
// contains filtered or unexported fields
}
func NewTxtEncoder ¶
func NewTxtEncoder() *TxtEncoder
func (*TxtEncoder) EncodeEvent ¶
func (e *TxtEncoder) EncodeEvent(buf *bytes.Buffer, m *Event) (err error)
func (*TxtEncoder) EncodeHeader ¶
func (e *TxtEncoder) EncodeHeader(buf *bytes.Buffer, header *Header) (err error)
func (*TxtEncoder) EncodeHeartbeat ¶
func (e *TxtEncoder) EncodeHeartbeat(buf *bytes.Buffer, m *Heartbeat) (err error)
func (*TxtEncoder) EncodeMessage ¶
func (e *TxtEncoder) EncodeMessage(buf *bytes.Buffer, message Messager) (err error)
func (*TxtEncoder) EncodeMetric ¶
func (e *TxtEncoder) EncodeMetric(buf *bytes.Buffer, m *Metric) (err error)
func (*TxtEncoder) EncodeTransaction ¶
func (e *TxtEncoder) EncodeTransaction(buf *bytes.Buffer, trans *Transaction) (err error)
Click to show internal directories.
Click to hide internal directories.