Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/vendor/github.com/heroku/x/logplex/encoding/message.go

40 lines
688 B

package encoding
import (
"io"
"time"
)
// Message is a syslog message
type Message struct {
Timestamp time.Time
Hostname string
Application string
Process string
ID string
Message string
Version uint16
Priority uint8
RFCCompliant bool
}
// Size returns the message size in bytes, including the octet framing header
func (m Message) Size() (int, error) {
b, err := Encode(m)
if err != nil {
return 0, err
}
return len(b), nil
}
// WriteTo writes the message to a stream
func (m Message) WriteTo(w io.Writer) (int64, error) {
b, err := Encode(m)
if err != nil {
return 0, err
}
i, err := w.Write(b)
return int64(i), err
}