Documentation ¶
Overview ¶
Internal message representation.
Index ¶
- Constants
- Variables
- func ForgivingTimeParse(timeLayout, inputTime string, loc *time.Location) (parsedTime time.Time, err error)
- func NewInt64Field(m *Message, name string, val int64, representation string)
- func NewIntField(m *Message, name string, val int, representation string) (err error)
- func NewStringField(m *Message, name string, val string)
- type Field
- func (f *Field) AddValue(value interface{}) error
- func (m *Field) GetName() string
- func (m *Field) GetRepresentation() string
- func (f *Field) GetValue() (value interface{})
- func (m *Field) GetValueBool() []bool
- func (m *Field) GetValueBytes() [][]byte
- func (m *Field) GetValueDouble() []float64
- func (m *Field) GetValueInteger() []int64
- func (m *Field) GetValueString() []string
- func (m *Field) GetValueType() Field_ValueType
- func (*Field) ProtoMessage()
- func (m *Field) Reset()
- func (m *Field) String() string
- type Field_ValueType
- type Header
- func (m *Header) GetHmac() []byte
- func (m *Header) GetHmacHashFunction() Header_HmacHashFunction
- func (m *Header) GetHmacKeyVersion() uint32
- func (m *Header) GetHmacSigner() string
- func (m *Header) GetMessageLength() uint32
- func (*Header) ProtoMessage()
- func (m *Header) Reset()
- func (h *Header) SetHmac(v []byte)
- func (h *Header) SetHmacHashFunction(v Header_HmacHashFunction)
- func (h *Header) SetHmacKeyVersion(v uint32)
- func (h *Header) SetHmacSigner(v string)
- func (h *Header) SetMessageLength(v uint32)
- func (m *Header) String() string
- type Header_HmacHashFunction
- type MatcherSpecification
- type MatcherSpecificationParser
- type Message
- func (m *Message) AddField(f *Field)
- func (src *Message) Copy(dst *Message)
- func (m *Message) Equals(other interface{}) bool
- func (m *Message) FindAllFields(name string) (all []*Field)
- func (m *Message) FindFirstField(name string) *Field
- func (m *Message) GetEnvVersion() string
- func (m *Message) GetFieldValue(name string) (value interface{}, ok bool)
- func (m *Message) GetFields() []*Field
- func (m *Message) GetHostname() string
- func (m *Message) GetLogger() string
- func (m *Message) GetPayload() string
- func (m *Message) GetPid() int32
- func (m *Message) GetSeverity() int32
- func (m *Message) GetTimestamp() int64
- func (m *Message) GetType() string
- func (m *Message) GetUuid() []byte
- func (m *Message) GetUuidString() string
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) SetEnvVersion(v string)
- func (m *Message) SetHostname(v string)
- func (m *Message) SetLogger(v string)
- func (m *Message) SetPayload(v string)
- func (m *Message) SetPid(v int32)
- func (m *Message) SetSeverity(v int32)
- func (m *Message) SetTimestamp(v int64)
- func (m *Message) SetType(v string)
- func (m *Message) SetUuid(v []byte)
- func (m *Message) String() string
- type MessageSigningConfig
- type Statement
Constants ¶
const ( HEADER_DELIMITER_SIZE = 2 // record separator + len HEADER_FRAMING_SIZE = HEADER_DELIMITER_SIZE + 1 // unit separator MAX_HEADER_SIZE = 255 MAX_MESSAGE_SIZE = 64 * 1024 MAX_RECORD_SIZE = HEADER_FRAMING_SIZE + MAX_HEADER_SIZE + MAX_MESSAGE_SIZE RECORD_SEPARATOR = uint8(0x1e) UNIT_SEPARATOR = uint8(0x1f) UUID_SIZE = 16 )
const Default_Message_Severity int32 = 7
const FALSE = 57370
const NUMERIC_VALUE = 57367
const OP_AND = 57355
const OP_EQ = 57346
const OP_GT = 57348
const OP_GTE = 57349
const OP_LT = 57350
const OP_LTE = 57351
const OP_NE = 57347
const OP_NRE = 57353
const OP_OR = 57354
const OP_RE = 57352
const REGEXP_VALUE = 57368
const STRING_VALUE = 57366
const TRUE = 57369
const VAR_ENVVERSION = 57360
const VAR_FIELDS = 57365
const VAR_HOSTNAME = 57361
const VAR_LOGGER = 57358
const VAR_PAYLOAD = 57359
const VAR_PID = 57364
const VAR_SEVERITY = 57363
const VAR_TIMESTAMP = 57362
const VAR_TYPE = 57357
const VAR_UUID = 57356
Variables ¶
var Field_ValueType_name = map[int32]string{
0: "STRING",
1: "BYTES",
2: "INTEGER",
3: "DOUBLE",
4: "BOOL",
}
var Field_ValueType_value = map[string]int32{
"STRING": 0,
"BYTES": 1,
"INTEGER": 2,
"DOUBLE": 3,
"BOOL": 4,
}
var Header_HmacHashFunction_name = map[int32]string{
0: "MD5",
1: "SHA1",
}
var Header_HmacHashFunction_value = map[string]int32{
"MD5": 0,
"SHA1": 1,
}
var ( // A mapping that returns a complex regular expression string for // a commonly matched portion rather than having to construct one. // // Currently HelperRegexSubs has the following keys upon startup that // may be used: // TIMESTAMP - A complex regular expression string that matches // any of the Go time const layouts. HelperRegexSubs map[string]string )
Functions ¶
func ForgivingTimeParse ¶
func ForgivingTimeParse(timeLayout, inputTime string, loc *time.Location) ( parsedTime time.Time, err error)
Parse a time with the supplied timeLayout, falling back to all the basicTimeLayouts.
func NewInt64Field ¶
Convenience function for creating a new int64 field on a message object.
func NewIntField ¶
Convenience function for creating a new integer field on a message object.
func NewStringField ¶
Convenience function for creating and setting a string field called "name" on a message object.
Types ¶
type Field ¶
type Field struct { Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` ValueType *Field_ValueType `protobuf:"varint,2,opt,name=value_type,enum=message.Field_ValueType,def=0" json:"value_type,omitempty"` Representation *string `protobuf:"bytes,3,opt,name=representation" json:"representation,omitempty"` ValueString []string `protobuf:"bytes,4,rep,name=value_string" json:"value_string,omitempty"` ValueBytes [][]byte `protobuf:"bytes,5,rep,name=value_bytes" json:"value_bytes,omitempty"` ValueInteger []int64 `protobuf:"varint,6,rep,packed,name=value_integer" json:"value_integer,omitempty"` ValueDouble []float64 `protobuf:"fixed64,7,rep,packed,name=value_double" json:"value_double,omitempty"` ValueBool []bool `protobuf:"varint,8,rep,packed,name=value_bool" json:"value_bool,omitempty"` XXX_unrecognized []byte `json:"-"` }
func NewFieldInit ¶
func NewFieldInit(name string, valueType Field_ValueType, representation string) *Field
Field initializer sets up the key, value type, and format but does not actually add a value
func (*Field) AddValue ¶
Creates an array of values in this field, of the same type, in the order they were added
func (*Field) GetRepresentation ¶
func (*Field) GetValue ¶
func (f *Field) GetValue() (value interface{})
Helper function that returns the appropriate value object.
func (*Field) GetValueBool ¶
func (*Field) GetValueBytes ¶
func (*Field) GetValueDouble ¶
func (*Field) GetValueInteger ¶
func (*Field) GetValueString ¶
func (*Field) GetValueType ¶
func (m *Field) GetValueType() Field_ValueType
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
type Field_ValueType ¶
type Field_ValueType int32
const ( Field_STRING Field_ValueType = 0 Field_BYTES Field_ValueType = 1 Field_INTEGER Field_ValueType = 2 Field_DOUBLE Field_ValueType = 3 Field_BOOL Field_ValueType = 4 )
const Default_Field_ValueType Field_ValueType = Field_STRING
func (Field_ValueType) Enum ¶
func (x Field_ValueType) Enum() *Field_ValueType
func (Field_ValueType) String ¶
func (x Field_ValueType) String() string
func (*Field_ValueType) UnmarshalJSON ¶
func (x *Field_ValueType) UnmarshalJSON(data []byte) error
type Header ¶
type Header struct { MessageLength *uint32 `protobuf:"varint,1,req,name=message_length" json:"message_length,omitempty"` HmacHashFunction *Header_HmacHashFunction `` /* 126-byte string literal not displayed */ HmacSigner *string `protobuf:"bytes,4,opt,name=hmac_signer" json:"hmac_signer,omitempty"` HmacKeyVersion *uint32 `protobuf:"varint,5,opt,name=hmac_key_version" json:"hmac_key_version,omitempty"` Hmac []byte `protobuf:"bytes,6,opt,name=hmac" json:"hmac,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Header) GetHmacHashFunction ¶
func (m *Header) GetHmacHashFunction() Header_HmacHashFunction
func (*Header) GetHmacKeyVersion ¶
func (*Header) GetHmacSigner ¶
func (*Header) GetMessageLength ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) SetHmacHashFunction ¶
func (h *Header) SetHmacHashFunction(v Header_HmacHashFunction)
func (*Header) SetHmacKeyVersion ¶
func (*Header) SetHmacSigner ¶
func (*Header) SetMessageLength ¶
type Header_HmacHashFunction ¶
type Header_HmacHashFunction int32
const ( Header_MD5 Header_HmacHashFunction = 0 Header_SHA1 Header_HmacHashFunction = 1 )
const Default_Header_HmacHashFunction Header_HmacHashFunction = Header_MD5
func (Header_HmacHashFunction) Enum ¶
func (x Header_HmacHashFunction) Enum() *Header_HmacHashFunction
func (Header_HmacHashFunction) String ¶
func (x Header_HmacHashFunction) String() string
func (*Header_HmacHashFunction) UnmarshalJSON ¶
func (x *Header_HmacHashFunction) UnmarshalJSON(data []byte) error
type MatcherSpecification ¶
type MatcherSpecification struct {
// contains filtered or unexported fields
}
MatcherSpecification used by the message router to distribute messages
func CreateMatcherSpecification ¶
func CreateMatcherSpecification(spec string) (*MatcherSpecification, error)
CreateMatcherSpecification compiles the spec string into a simple virtual machine for execution
func (*MatcherSpecification) Match ¶
func (m *MatcherSpecification) Match(message *Message) bool
Match compares the message against the matcher spec and return the match result
func (*MatcherSpecification) String ¶
func (m *MatcherSpecification) String() string
String outputs the spec as text
type MatcherSpecificationParser ¶
type MatcherSpecificationParser struct {
// contains filtered or unexported fields
}
func (*MatcherSpecificationParser) Error ¶
func (m *MatcherSpecificationParser) Error(s string)
func (*MatcherSpecificationParser) Lex ¶
func (m *MatcherSpecificationParser) Lex(yylval *yySymType) int
type Message ¶
type Message struct { Uuid []byte `protobuf:"bytes,1,req,name=uuid" json:"uuid,omitempty"` Timestamp *int64 `protobuf:"varint,2,req,name=timestamp" json:"timestamp,omitempty"` Type *string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` Logger *string `protobuf:"bytes,4,opt,name=logger" json:"logger,omitempty"` Severity *int32 `protobuf:"varint,5,opt,name=severity,def=7" json:"severity,omitempty"` Payload *string `protobuf:"bytes,6,opt,name=payload" json:"payload,omitempty"` EnvVersion *string `protobuf:"bytes,7,opt,name=env_version" json:"env_version,omitempty"` Pid *int32 `protobuf:"varint,8,opt,name=pid" json:"pid,omitempty"` Hostname *string `protobuf:"bytes,9,opt,name=hostname" json:"hostname,omitempty"` Fields []*Field `protobuf:"bytes,10,rep,name=fields" json:"fields,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Message) FindAllFields ¶
FindAllFields finds and returns all the fields with the specified name if not found a nil slice is returned
func (*Message) FindFirstField ¶
FindFirstField finds and returns the first field with the specified name if not found nil is returned
func (*Message) GetEnvVersion ¶
func (*Message) GetFieldValue ¶
GetFieldValue helper function to simplify extracting single value fields
func (*Message) GetHostname ¶
func (*Message) GetPayload ¶
func (*Message) GetSeverity ¶
func (*Message) GetTimestamp ¶
func (*Message) GetUuidString ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()