model

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package model is a generated protocol buffer package.

It is generated from these files:

model/types.proto

It has these top-level messages:

InnerProperties
Properties
SyslogMessage
FullMessage

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes   = fmt.Errorf("proto: integer overflow")
)
View Source
var Facilities = map[Facility]string{
	0:  "kern",
	1:  "user",
	2:  "mail",
	3:  "daemon",
	4:  "auth",
	5:  "syslog",
	6:  "lpr",
	7:  "news",
	8:  "uucp",
	9:  "clock",
	10: "authpriv",
	11: "ftp",
	12: "ntp",
	13: "logaudit",
	14: "logalert",
	15: "cron",
	16: "local0",
	17: "local1",
	18: "local2",
	19: "local3",
	20: "local4",
	21: "local5",
	22: "local6",
	23: "local7",
}
View Source
var RFacilities map[string]Facility
View Source
var RSeverities map[string]Severity
View Source
var Severities = map[Severity]string{
	0: "emerg",
	1: "alert",
	2: "crit",
	3: "err",
	4: "warning",
	5: "notice",
	6: "info",
	7: "debug",
}
View Source
var ZeroFullMessage = FullMessage{}
View Source
var ZeroSyslogMessage = SyslogMessage{}

Functions

func Free

func Free(msg *SyslogMessage)

func FullFree

func FullFree(msg *FullMessage)

func IsFatalKafkaError

func IsFatalKafkaError(e error) bool

func RawTCPFree

func RawTCPFree(raw *RawTCPMessage)

func RawUDPFree

func RawUDPFree(raw *RawUDPMessage)

Types

type DeferedRequest

type DeferedRequest struct {
	UID     utils.MyULID
	Request *http.Request
}

type Facility

type Facility int32
const (
	Fkern Facility = iota
	Fuser
	Fmail
	Fdaemon
	Fauth
	Fsyslog
	Flpr
	Fnews
	Fuucp
	Fclock
	Fauthpriv
	Fftp
	Fntp
	Flogaudit
	Flogalert
	Fcron
	Flocal0
	Flocal1
	Flocal2
	Flocal3
	Flocal4
	Flocal5
	Flocal6
	Flocal7
)

func FacilityFromString

func FacilityFromString(s string) Facility

func (Facility) String

func (f Facility) String() string

type FullMessage

type FullMessage struct {
	Txnr       int32                                          `protobuf:"varint,1,opt,name=txnr,proto3" json:"txnr,omitempty"`
	ClientAddr string                                         `protobuf:"bytes,2,opt,name=client_addr,json=clientAddr,proto3" json:"client_addr,omitempty"`
	SourceType string                                         `protobuf:"bytes,3,opt,name=source_type,json=sourceType,proto3" json:"source_type,omitempty"`
	SourcePath string                                         `protobuf:"bytes,4,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"`
	SourcePort int32                                          `protobuf:"varint,5,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"`
	ConnId     github_com_stephane_martin_skewer_utils.MyULID `` /* 127-byte string literal not displayed */
	ConfId     github_com_stephane_martin_skewer_utils.MyULID `` /* 127-byte string literal not displayed */
	Uid        github_com_stephane_martin_skewer_utils.MyULID `protobuf:"bytes,8,opt,name=uid,proto3,customtype=github.com/stephane-martin/skewer/utils.MyULID" json:"uid"`
	Fields     *SyslogMessage                                 `protobuf:"bytes,9,opt,name=fields" json:"fields,omitempty"`
}

func FromBuf

func FromBuf(buf *proto.Buffer) (msg *FullMessage, err error)

func FullFactory

func FullFactory() (msg *FullMessage)

func FullFactoryFrom

func FullFactoryFrom(smsg *SyslogMessage) (msg *FullMessage)

func (*FullMessage) Avro

func (m *FullMessage) Avro() *avro.FullMessage

func (*FullMessage) Decrypt

func (m *FullMessage) Decrypt(secret *memguard.LockedBuffer, enc []byte) (err error)

func (*FullMessage) Descriptor

func (*FullMessage) Descriptor() ([]byte, []int)

func (*FullMessage) Equal

func (this *FullMessage) Equal(that interface{}) bool

func (*FullMessage) GetClientAddr

func (m *FullMessage) GetClientAddr() string

func (*FullMessage) GetFields

func (m *FullMessage) GetFields() *SyslogMessage

func (*FullMessage) GetSourcePath

func (m *FullMessage) GetSourcePath() string

func (*FullMessage) GetSourcePort

func (m *FullMessage) GetSourcePort() int32

func (*FullMessage) GetSourceType

func (m *FullMessage) GetSourceType() string

func (*FullMessage) GetTxnr

func (m *FullMessage) GetTxnr() int32

func (*FullMessage) GoString

func (this *FullMessage) GoString() string

func (*FullMessage) Marshal

func (m *FullMessage) Marshal() (dAtA []byte, err error)

func (*FullMessage) MarshalTo

func (m *FullMessage) MarshalTo(dAtA []byte) (int, error)

func (*FullMessage) NativeAvro

func (m *FullMessage) NativeAvro() map[string]interface{}

func (*FullMessage) ProtoMessage

func (*FullMessage) ProtoMessage()

func (*FullMessage) Regular

func (m *FullMessage) Regular() *RegularFullMessage

func (*FullMessage) Reset

func (m *FullMessage) Reset()

func (*FullMessage) Size

func (m *FullMessage) Size() (n int)

func (*FullMessage) String

func (this *FullMessage) String() string

func (*FullMessage) Unmarshal

func (m *FullMessage) Unmarshal(dAtA []byte) error

type InnerProperties

type InnerProperties struct {
	Map map[string]string `` /* 140-byte string literal not displayed */
}

func (*InnerProperties) Descriptor

func (*InnerProperties) Descriptor() ([]byte, []int)

func (*InnerProperties) Equal

func (this *InnerProperties) Equal(that interface{}) bool

func (*InnerProperties) GetMap

func (m *InnerProperties) GetMap() map[string]string

func (*InnerProperties) GoString

func (this *InnerProperties) GoString() string

func (*InnerProperties) Marshal

func (m *InnerProperties) Marshal() (dAtA []byte, err error)

func (*InnerProperties) MarshalTo

func (m *InnerProperties) MarshalTo(dAtA []byte) (int, error)

func (*InnerProperties) ProtoMessage

func (*InnerProperties) ProtoMessage()

func (*InnerProperties) Reset

func (m *InnerProperties) Reset()

func (*InnerProperties) Size

func (m *InnerProperties) Size() (n int)

func (*InnerProperties) String

func (this *InnerProperties) String() string

func (*InnerProperties) Unmarshal

func (m *InnerProperties) Unmarshal(dAtA []byte) error

type JsonRsyslogMessage

type JsonRsyslogMessage struct {
	// used to parsed JSON input from rsyslog
	Message       string `json:"msg"`
	TimeReported  string `json:"timereported"`
	TimeGenerated string `json:"timegenerated"`
	Hostname      string `json:"hostname"`
	Priority      string `json:"pri"`
	Appname       string `json:"app-name"`
	Procid        string `json:"procid"`
	Msgid         string `json:"msgid"`
	Uuid          string `json:"uuid"`
	Structured    string `json:"structured-data"`

	Properties map[string]interface{} `json:"$!"`
}

ffjson: noencoder

func (*JsonRsyslogMessage) UnmarshalJSON

func (j *JsonRsyslogMessage) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*JsonRsyslogMessage) UnmarshalJSONFFLexer

func (j *JsonRsyslogMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type ListenerInfo

type ListenerInfo struct {
	Port           int    `json:"port" msg:"port"`
	BindAddr       string `json:"bind_addr" mdg:"bind_addr"`
	UnixSocketPath string `json:"unix_socket_path" msg:"unix_socket_path"`
	Protocol       string `json:"protocol" msg:"protocol"`
}

type MacOSLogMessage

type MacOSLogMessage struct {
	Category             string `json:"category"`
	ProcessImageUUID     string `json:"processImageUUID"`
	ProcessUniqueID      uint64 `json:"processUniqueID"`
	ThreadID             uint64 `json:"threadID"`
	Timestamp            string `json:"timestamp"`
	TraceID              uint64 `json:"traceID"`
	MessageType          string `json:"messageType"`
	ActivityID           uint64 `json:"activityID"`
	ProcessID            uint64 `json:"processID"`
	MachTimestamp        uint64 `json:"machTimestamp"`
	TimezoneName         string `json:"timezoneName"`
	Subsystem            string `json:"subsystem"`
	SenderProgramCounter uint64 `json:"senderProgramCounter"`
	EventMessage         string `json:"eventMessage"`
	SenderImageUUID      string `json:"senderImageUUID"`
	ProcessImagePath     string `json:"processImagePath"`
	SenderImagePath      string `json:"senderImagePath"`
}

ffjson: noencoder

func (*MacOSLogMessage) UnmarshalJSON

func (j *MacOSLogMessage) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*MacOSLogMessage) UnmarshalJSONFFLexer

func (j *MacOSLogMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type OutputMsg

type OutputMsg struct {
	Message         *FullMessage
	PartitionKey    string
	PartitionNumber int32
	Topic           string
}

func (*OutputMsg) MarshalJSON

func (j *OutputMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*OutputMsg) MarshalJSONBuf

func (j *OutputMsg) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*OutputMsg) UnmarshalJSON

func (j *OutputMsg) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*OutputMsg) UnmarshalJSONFFLexer

func (j *OutputMsg) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Priority

type Priority int32

type Properties

type Properties struct {
	Map map[string]*InnerProperties `` /* 133-byte string literal not displayed */
}

func (*Properties) Descriptor

func (*Properties) Descriptor() ([]byte, []int)

func (*Properties) Equal

func (this *Properties) Equal(that interface{}) bool

func (*Properties) GetMap

func (m *Properties) GetMap() map[string]*InnerProperties

func (*Properties) GoString

func (this *Properties) GoString() string

func (*Properties) Marshal

func (m *Properties) Marshal() (dAtA []byte, err error)

func (*Properties) MarshalTo

func (m *Properties) MarshalTo(dAtA []byte) (int, error)

func (*Properties) ProtoMessage

func (*Properties) ProtoMessage()

func (*Properties) Reset

func (m *Properties) Reset()

func (*Properties) Size

func (m *Properties) Size() (n int)

func (*Properties) String

func (this *Properties) String() string

func (*Properties) Unmarshal

func (m *Properties) Unmarshal(dAtA []byte) error

type RawFileMessage

type RawFileMessage struct {
	Decoder   conf.DecoderBaseConfig
	Hostname  string
	Directory string
	Glob      string
	Filename  string
	Line      []byte
	ConfID    utils.MyULID
}

type RawKafkaMessage

type RawKafkaMessage struct {
	RawMessage
	ConsumerID uint32
	Message    []byte
	UID        utils.MyULID
	Topic      string
	Partition  int32
	Offset     int64
}

type RawMessage

type RawMessage struct {
	Decoder        conf.DecoderBaseConfig
	Client         string
	LocalPort      int
	UnixSocketPath string
	ConfID         utils.MyULID
}

type RawTCPMessage

type RawTCPMessage struct {
	RawMessage
	Message []byte
	Txnr    int32
	ConnID  utils.MyULID
}

func RawTCPFactory

func RawTCPFactory(message []byte) (raw *RawTCPMessage)

type RawUDPMessage

type RawUDPMessage struct {
	RawMessage
	Message [65536]byte
	Size    int
}

func RawUDPFactory

func RawUDPFactory() (raw *RawUDPMessage)

func RawUDPFromConn

func RawUDPFromConn(conn net.PacketConn) (raw *RawUDPMessage, remote net.Addr, err error)

func (*RawUDPMessage) GetMessage

func (raw *RawUDPMessage) GetMessage() []byte

type RegularFullMessage

type RegularFullMessage struct {
	ClientAddr string         `json:"client_addr,omitempty"`
	SourceType string         `json:"source_type,omitempty"`
	SourcePath string         `json:"source_path,omitempty"`
	SourcePort int32          `json:"source_port"`
	Uid        string         `json:"uid,omitempty"`
	Fields     *RegularSyslog `json:"fields"`
}

func (*RegularFullMessage) Internal

func (m *RegularFullMessage) Internal() (res *FullMessage, err error)

func (*RegularFullMessage) MarshalJSON

func (j *RegularFullMessage) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*RegularFullMessage) MarshalJSONBuf

func (j *RegularFullMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*RegularFullMessage) UnmarshalJSON

func (j *RegularFullMessage) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*RegularFullMessage) UnmarshalJSONFFLexer

func (j *RegularFullMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type RegularSyslog

type RegularSyslog struct {
	Facility      string                       `json:"facility"`
	Severity      string                       `json:"severity"`
	TimeReported  time.Time                    `json:"timereported"`
	TimeGenerated time.Time                    `json:"timegenerated"`
	HostName      string                       `json:"hostname,omitempty"`
	AppName       string                       `json:"appname,omitempty"`
	ProcID        string                       `json:"procid,omitempty"`
	MsgID         string                       `json:"msgid,omitempty"`
	Message       string                       `json:"message,omitempty"`
	Properties    map[string]map[string]string `json:"properties,omitempty"`
}

func (*RegularSyslog) Internal

func (m *RegularSyslog) Internal() (res *SyslogMessage)

func (*RegularSyslog) MarshalJSON

func (j *RegularSyslog) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*RegularSyslog) MarshalJSONBuf

func (j *RegularSyslog) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*RegularSyslog) UnmarshalJSON

func (j *RegularSyslog) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*RegularSyslog) UnmarshalJSONFFLexer

func (j *RegularSyslog) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Reporter

type Reporter interface {
	Stasher
	Report(infos []ListenerInfo) error
}

type Severity

type Severity int32
const (
	Semerg Severity = iota
	Salert
	Scrit
	Serr
	SWarning
	Snotice
	Sinfo
	Sdebug
)

func SeverityFromString

func SeverityFromString(st string) Severity

func (Severity) String

func (s Severity) String() string

type Stasher

type Stasher interface {
	Stash(m *FullMessage) (error, error)
}

type SyslogMessage

type SyslogMessage struct {
	Priority         Priority   `protobuf:"varint,1,opt,name=priority,proto3,casttype=Priority" json:"priority,omitempty"`
	Facility         Facility   `protobuf:"varint,2,opt,name=facility,proto3,casttype=Facility" json:"facility,omitempty"`
	Severity         Severity   `protobuf:"varint,3,opt,name=severity,proto3,casttype=Severity" json:"severity,omitempty"`
	Version          Version    `protobuf:"varint,4,opt,name=version,proto3,casttype=Version" json:"version,omitempty"`
	TimeReportedNum  int64      `protobuf:"varint,5,opt,name=time_reported_num,json=timeReportedNum,proto3" json:"time_reported_num,omitempty"`
	TimeGeneratedNum int64      `protobuf:"varint,6,opt,name=time_generated_num,json=timeGeneratedNum,proto3" json:"time_generated_num,omitempty"`
	HostName         string     `protobuf:"bytes,7,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
	AppName          string     `protobuf:"bytes,8,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"`
	ProcId           string     `protobuf:"bytes,9,opt,name=proc_id,json=procId,proto3" json:"proc_id,omitempty"`
	MsgId            string     `protobuf:"bytes,10,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"`
	Structured       string     `protobuf:"bytes,11,opt,name=structured,proto3" json:"structured,omitempty"`
	Message          string     `protobuf:"bytes,12,opt,name=message,proto3" json:"message,omitempty"`
	Properties       Properties `protobuf:"bytes,13,opt,name=properties" json:"properties"`
}

func Factory

func Factory() (msg *SyslogMessage)

func (*SyslogMessage) Avro

func (m *SyslogMessage) Avro() *avro.SyslogMessage

func (*SyslogMessage) ClearDomain

func (m *SyslogMessage) ClearDomain(domain string)

func (*SyslogMessage) ClearProperties

func (m *SyslogMessage) ClearProperties()

func (*SyslogMessage) Date

func (m *SyslogMessage) Date() string

func (*SyslogMessage) Descriptor

func (*SyslogMessage) Descriptor() ([]byte, []int)

func (*SyslogMessage) Equal

func (this *SyslogMessage) Equal(that interface{}) bool

func (*SyslogMessage) GetAllProperties

func (m *SyslogMessage) GetAllProperties() (res map[string](map[string]string))

func (*SyslogMessage) GetAppName

func (m *SyslogMessage) GetAppName() string

func (*SyslogMessage) GetFacility

func (m *SyslogMessage) GetFacility() Facility

func (*SyslogMessage) GetHostName

func (m *SyslogMessage) GetHostName() string

func (*SyslogMessage) GetMessage

func (m *SyslogMessage) GetMessage() string

func (*SyslogMessage) GetMsgId

func (m *SyslogMessage) GetMsgId() string

func (*SyslogMessage) GetPriority

func (m *SyslogMessage) GetPriority() Priority

func (*SyslogMessage) GetProcId

func (m *SyslogMessage) GetProcId() string

func (*SyslogMessage) GetProperties

func (m *SyslogMessage) GetProperties() Properties

func (*SyslogMessage) GetProperty

func (m *SyslogMessage) GetProperty(domain, key string) string

func (*SyslogMessage) GetSeverity

func (m *SyslogMessage) GetSeverity() Severity

func (*SyslogMessage) GetStructured

func (m *SyslogMessage) GetStructured() string

func (*SyslogMessage) GetTimeGenerated

func (m *SyslogMessage) GetTimeGenerated() time.Time

func (*SyslogMessage) GetTimeGeneratedNum

func (m *SyslogMessage) GetTimeGeneratedNum() int64

func (*SyslogMessage) GetTimeReported

func (m *SyslogMessage) GetTimeReported() time.Time

func (*SyslogMessage) GetTimeReportedNum

func (m *SyslogMessage) GetTimeReportedNum() int64

func (*SyslogMessage) GetVersion

func (m *SyslogMessage) GetVersion() Version

func (*SyslogMessage) GoString

func (this *SyslogMessage) GoString() string

func (*SyslogMessage) Marshal

func (m *SyslogMessage) Marshal() (dAtA []byte, err error)

func (*SyslogMessage) MarshalTo

func (m *SyslogMessage) MarshalTo(dAtA []byte) (int, error)

func (*SyslogMessage) NativeAvro

func (m *SyslogMessage) NativeAvro() map[string]interface{}

func (*SyslogMessage) ProtoMessage

func (*SyslogMessage) ProtoMessage()

func (*SyslogMessage) Regular

func (m *SyslogMessage) Regular() (reg *RegularSyslog)

func (*SyslogMessage) RegularJSON

func (m *SyslogMessage) RegularJSON() ([]byte, error)

func (*SyslogMessage) Reset

func (m *SyslogMessage) Reset()

func (*SyslogMessage) SetAllProperties

func (m *SyslogMessage) SetAllProperties(all map[string](map[string]string))

func (*SyslogMessage) SetPriority

func (m *SyslogMessage) SetPriority()

func (*SyslogMessage) SetProperty

func (m *SyslogMessage) SetProperty(domain, key, value string)

func (*SyslogMessage) Size

func (m *SyslogMessage) Size() (n int)

func (*SyslogMessage) String

func (this *SyslogMessage) String() string

func (*SyslogMessage) Unmarshal

func (m *SyslogMessage) Unmarshal(dAtA []byte) error

type Version

type Version int32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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