-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarshaler.go
More file actions
27 lines (21 loc) · 932 Bytes
/
marshaler.go
File metadata and controls
27 lines (21 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package glog
// ArrayMarshaler allows user-defined data types to efficiently add an array into to the log entry.
type ArrayMarshaler interface {
MarshalGLogArray(ae ArrayEncoder) error
}
// ArrayMarshalerFunc is a type adapter that turns a function into an ArrayMarshaler.
type ArrayMarshalerFunc func(ae ArrayEncoder) error
// MarshalGLogArray calls the underlying function.
func (f ArrayMarshalerFunc) MarshalGLogArray(ae ArrayEncoder) error {
return f(ae)
}
// ObjectMarshaler allows user-defined data types to efficiently add an object into to the log entry.
type ObjectMarshaler interface {
MarshalGLogObject(oe ObjectEncoder) error
}
// ObjectMarshalerFunc is a type adapter that turns a function into an ObjectMarshaler.
type ObjectMarshalerFunc func(oe ObjectEncoder) error
// MarshalGLogObject calls the underlying function.
func (f ObjectMarshalerFunc) MarshalGLogObject(oe ObjectEncoder) error {
return f(oe)
}