id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,300 | rs/zerolog | internal/json/types.go | AppendFloats32 | func (Encoder) AppendFloats32(dst []byte, vals []float32) []byte {
if len(vals) == 0 {
return append(dst, '[', ']')
}
dst = append(dst, '[')
dst = appendFloat(dst, float64(vals[0]), 32)
if len(vals) > 1 {
for _, val := range vals[1:] {
dst = appendFloat(append(dst, ','), float64(val), 32)
}
}
dst = appe... | go | func (Encoder) AppendFloats32(dst []byte, vals []float32) []byte {
if len(vals) == 0 {
return append(dst, '[', ']')
}
dst = append(dst, '[')
dst = appendFloat(dst, float64(vals[0]), 32)
if len(vals) > 1 {
for _, val := range vals[1:] {
dst = appendFloat(append(dst, ','), float64(val), 32)
}
}
dst = appe... | [
"func",
"(",
"Encoder",
")",
"AppendFloats32",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"float32",
")",
"[",
"]",
"byte",
"{",
"if",
"len",
"(",
"vals",
")",
"==",
"0",
"{",
"return",
"append",
"(",
"dst",
",",
"'['",
",",
"']'",
")... | // AppendFloats32 encodes the input float32s to json and
// appends the encoded string list to the input byte slice. | [
"AppendFloats32",
"encodes",
"the",
"input",
"float32s",
"to",
"json",
"and",
"appends",
"the",
"encoded",
"string",
"list",
"to",
"the",
"input",
"byte",
"slice",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L325-L338 |
25,301 | rs/zerolog | internal/json/types.go | AppendFloat64 | func (Encoder) AppendFloat64(dst []byte, val float64) []byte {
return appendFloat(dst, val, 64)
} | go | func (Encoder) AppendFloat64(dst []byte, val float64) []byte {
return appendFloat(dst, val, 64)
} | [
"func",
"(",
"Encoder",
")",
"AppendFloat64",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"float64",
")",
"[",
"]",
"byte",
"{",
"return",
"appendFloat",
"(",
"dst",
",",
"val",
",",
"64",
")",
"\n",
"}"
] | // AppendFloat64 converts the input float64 to a string and
// appends the encoded string to the input byte slice. | [
"AppendFloat64",
"converts",
"the",
"input",
"float64",
"to",
"a",
"string",
"and",
"appends",
"the",
"encoded",
"string",
"to",
"the",
"input",
"byte",
"slice",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L342-L344 |
25,302 | rs/zerolog | internal/json/types.go | AppendFloats64 | func (Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
if len(vals) == 0 {
return append(dst, '[', ']')
}
dst = append(dst, '[')
dst = appendFloat(dst, vals[0], 32)
if len(vals) > 1 {
for _, val := range vals[1:] {
dst = appendFloat(append(dst, ','), val, 64)
}
}
dst = append(dst, ']')
retu... | go | func (Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
if len(vals) == 0 {
return append(dst, '[', ']')
}
dst = append(dst, '[')
dst = appendFloat(dst, vals[0], 32)
if len(vals) > 1 {
for _, val := range vals[1:] {
dst = appendFloat(append(dst, ','), val, 64)
}
}
dst = append(dst, ']')
retu... | [
"func",
"(",
"Encoder",
")",
"AppendFloats64",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"float64",
")",
"[",
"]",
"byte",
"{",
"if",
"len",
"(",
"vals",
")",
"==",
"0",
"{",
"return",
"append",
"(",
"dst",
",",
"'['",
",",
"']'",
")... | // AppendFloats64 encodes the input float64s to json and
// appends the encoded string list to the input byte slice. | [
"AppendFloats64",
"encodes",
"the",
"input",
"float64s",
"to",
"json",
"and",
"appends",
"the",
"encoded",
"string",
"list",
"to",
"the",
"input",
"byte",
"slice",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L348-L361 |
25,303 | rs/zerolog | internal/json/types.go | AppendObjectData | func (Encoder) AppendObjectData(dst []byte, o []byte) []byte {
// Two conditions we want to put a ',' between existing content and
// new content:
// 1. new content starts with '{' - which shd be dropped OR
// 2. existing content has already other fields
if o[0] == '{' {
o[0] = ','
} else if len(dst) > 1 {
... | go | func (Encoder) AppendObjectData(dst []byte, o []byte) []byte {
// Two conditions we want to put a ',' between existing content and
// new content:
// 1. new content starts with '{' - which shd be dropped OR
// 2. existing content has already other fields
if o[0] == '{' {
o[0] = ','
} else if len(dst) > 1 {
... | [
"func",
"(",
"Encoder",
")",
"AppendObjectData",
"(",
"dst",
"[",
"]",
"byte",
",",
"o",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"// Two conditions we want to put a ',' between existing content and",
"// new content:",
"// 1. new content starts with '{' - which shd ... | // AppendObjectData takes in an object that is already in a byte array
// and adds it to the dst. | [
"AppendObjectData",
"takes",
"in",
"an",
"object",
"that",
"is",
"already",
"in",
"a",
"byte",
"array",
"and",
"adds",
"it",
"to",
"the",
"dst",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L375-L386 |
25,304 | rs/zerolog | internal/json/types.go | AppendIPAddr | func (e Encoder) AppendIPAddr(dst []byte, ip net.IP) []byte {
return e.AppendString(dst, ip.String())
} | go | func (e Encoder) AppendIPAddr(dst []byte, ip net.IP) []byte {
return e.AppendString(dst, ip.String())
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendIPAddr",
"(",
"dst",
"[",
"]",
"byte",
",",
"ip",
"net",
".",
"IP",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendString",
"(",
"dst",
",",
"ip",
".",
"String",
"(",
")",
")",
"\n",
"}"
] | // AppendIPAddr adds IPv4 or IPv6 address to dst. | [
"AppendIPAddr",
"adds",
"IPv4",
"or",
"IPv6",
"address",
"to",
"dst",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L389-L391 |
25,305 | rs/zerolog | internal/json/types.go | AppendMACAddr | func (e Encoder) AppendMACAddr(dst []byte, ha net.HardwareAddr) []byte {
return e.AppendString(dst, ha.String())
} | go | func (e Encoder) AppendMACAddr(dst []byte, ha net.HardwareAddr) []byte {
return e.AppendString(dst, ha.String())
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendMACAddr",
"(",
"dst",
"[",
"]",
"byte",
",",
"ha",
"net",
".",
"HardwareAddr",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendString",
"(",
"dst",
",",
"ha",
".",
"String",
"(",
")",
")",
"\n",
"}"... | // AppendMACAddr adds MAC address to dst. | [
"AppendMACAddr",
"adds",
"MAC",
"address",
"to",
"dst",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/types.go#L400-L402 |
25,306 | rs/zerolog | journald/journald.go | levelToJPrio | func levelToJPrio(zLevel string) journal.Priority {
lvl, _ := zerolog.ParseLevel(zLevel)
switch lvl {
case zerolog.DebugLevel:
return journal.PriDebug
case zerolog.InfoLevel:
return journal.PriInfo
case zerolog.WarnLevel:
return journal.PriWarning
case zerolog.ErrorLevel:
return journal.PriErr
case zero... | go | func levelToJPrio(zLevel string) journal.Priority {
lvl, _ := zerolog.ParseLevel(zLevel)
switch lvl {
case zerolog.DebugLevel:
return journal.PriDebug
case zerolog.InfoLevel:
return journal.PriInfo
case zerolog.WarnLevel:
return journal.PriWarning
case zerolog.ErrorLevel:
return journal.PriErr
case zero... | [
"func",
"levelToJPrio",
"(",
"zLevel",
"string",
")",
"journal",
".",
"Priority",
"{",
"lvl",
",",
"_",
":=",
"zerolog",
".",
"ParseLevel",
"(",
"zLevel",
")",
"\n\n",
"switch",
"lvl",
"{",
"case",
"zerolog",
".",
"DebugLevel",
":",
"return",
"journal",
... | // levelToJPrio converts zerolog Level string into
// journalD's priority values. JournalD has more
// priorities than zerolog. | [
"levelToJPrio",
"converts",
"zerolog",
"Level",
"string",
"into",
"journalD",
"s",
"priority",
"values",
".",
"JournalD",
"has",
"more",
"priorities",
"than",
"zerolog",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/journald/journald.go#L46-L66 |
25,307 | rs/zerolog | diode/internal/diodes/waiter.go | NewWaiter | func NewWaiter(d Diode, opts ...WaiterConfigOption) *Waiter {
w := new(Waiter)
w.Diode = d
w.c = sync.NewCond(&w.mu)
w.ctx = context.Background()
for _, opt := range opts {
opt(w)
}
go func() {
<-w.ctx.Done()
w.c.Broadcast()
}()
return w
} | go | func NewWaiter(d Diode, opts ...WaiterConfigOption) *Waiter {
w := new(Waiter)
w.Diode = d
w.c = sync.NewCond(&w.mu)
w.ctx = context.Background()
for _, opt := range opts {
opt(w)
}
go func() {
<-w.ctx.Done()
w.c.Broadcast()
}()
return w
} | [
"func",
"NewWaiter",
"(",
"d",
"Diode",
",",
"opts",
"...",
"WaiterConfigOption",
")",
"*",
"Waiter",
"{",
"w",
":=",
"new",
"(",
"Waiter",
")",
"\n",
"w",
".",
"Diode",
"=",
"d",
"\n",
"w",
".",
"c",
"=",
"sync",
".",
"NewCond",
"(",
"&",
"w",
... | // NewWaiter returns a new Waiter that wraps the given diode. | [
"NewWaiter",
"returns",
"a",
"new",
"Waiter",
"that",
"wraps",
"the",
"given",
"diode",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/diode/internal/diodes/waiter.go#L30-L46 |
25,308 | rs/zerolog | diode/internal/diodes/waiter.go | Set | func (w *Waiter) Set(data GenericDataType) {
w.Diode.Set(data)
w.c.Broadcast()
} | go | func (w *Waiter) Set(data GenericDataType) {
w.Diode.Set(data)
w.c.Broadcast()
} | [
"func",
"(",
"w",
"*",
"Waiter",
")",
"Set",
"(",
"data",
"GenericDataType",
")",
"{",
"w",
".",
"Diode",
".",
"Set",
"(",
"data",
")",
"\n",
"w",
".",
"c",
".",
"Broadcast",
"(",
")",
"\n",
"}"
] | // Set invokes the wrapped diode's Set with the given data and uses Broadcast
// to wake up any readers. | [
"Set",
"invokes",
"the",
"wrapped",
"diode",
"s",
"Set",
"with",
"the",
"given",
"data",
"and",
"uses",
"Broadcast",
"to",
"wake",
"up",
"any",
"readers",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/diode/internal/diodes/waiter.go#L50-L53 |
25,309 | rs/zerolog | diode/internal/diodes/waiter.go | Next | func (w *Waiter) Next() GenericDataType {
w.mu.Lock()
defer w.mu.Unlock()
for {
data, ok := w.Diode.TryNext()
if !ok {
if w.isDone() {
return nil
}
w.c.Wait()
continue
}
return data
}
} | go | func (w *Waiter) Next() GenericDataType {
w.mu.Lock()
defer w.mu.Unlock()
for {
data, ok := w.Diode.TryNext()
if !ok {
if w.isDone() {
return nil
}
w.c.Wait()
continue
}
return data
}
} | [
"func",
"(",
"w",
"*",
"Waiter",
")",
"Next",
"(",
")",
"GenericDataType",
"{",
"w",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"w",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"{",
"data",
",",
"ok",
":=",
"w",
".",
"Diode",
"."... | // Next returns the next data point on the wrapped diode. If there is not any
// new data, it will Wait for set to be called or the context to be done.
// If the context is done, then nil will be returned. | [
"Next",
"returns",
"the",
"next",
"data",
"point",
"on",
"the",
"wrapped",
"diode",
".",
"If",
"there",
"is",
"not",
"any",
"new",
"data",
"it",
"will",
"Wait",
"for",
"set",
"to",
"be",
"called",
"or",
"the",
"context",
"to",
"be",
"done",
".",
"If"... | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/diode/internal/diodes/waiter.go#L58-L74 |
25,310 | rs/zerolog | internal/cbor/types.go | AppendNil | func (Encoder) AppendNil(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeNull))
} | go | func (Encoder) AppendNil(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeNull))
} | [
"func",
"(",
"Encoder",
")",
"AppendNil",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"return",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeSimpleAndFloat",
"|",
"additionalTypeNull",
")",
")",
"\n",
"}"
] | // AppendNil inserts a 'Nil' object into the dst byte array. | [
"AppendNil",
"inserts",
"a",
"Nil",
"object",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L11-L13 |
25,311 | rs/zerolog | internal/cbor/types.go | AppendBeginMarker | func (Encoder) AppendBeginMarker(dst []byte) []byte {
return append(dst, byte(majorTypeMap|additionalTypeInfiniteCount))
} | go | func (Encoder) AppendBeginMarker(dst []byte) []byte {
return append(dst, byte(majorTypeMap|additionalTypeInfiniteCount))
} | [
"func",
"(",
"Encoder",
")",
"AppendBeginMarker",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"return",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeMap",
"|",
"additionalTypeInfiniteCount",
")",
")",
"\n",
"}"
] | // AppendBeginMarker inserts a map start into the dst byte array. | [
"AppendBeginMarker",
"inserts",
"a",
"map",
"start",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L16-L18 |
25,312 | rs/zerolog | internal/cbor/types.go | AppendEndMarker | func (Encoder) AppendEndMarker(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeBreak))
} | go | func (Encoder) AppendEndMarker(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeBreak))
} | [
"func",
"(",
"Encoder",
")",
"AppendEndMarker",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"return",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeSimpleAndFloat",
"|",
"additionalTypeBreak",
")",
")",
"\n",
"}"
] | // AppendEndMarker inserts a map end into the dst byte array. | [
"AppendEndMarker",
"inserts",
"a",
"map",
"end",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L21-L23 |
25,313 | rs/zerolog | internal/cbor/types.go | AppendObjectData | func (Encoder) AppendObjectData(dst []byte, o []byte) []byte {
// BeginMarker is present in the dst, which
// should not be copied when appending to existing data.
return append(dst, o[1:]...)
} | go | func (Encoder) AppendObjectData(dst []byte, o []byte) []byte {
// BeginMarker is present in the dst, which
// should not be copied when appending to existing data.
return append(dst, o[1:]...)
} | [
"func",
"(",
"Encoder",
")",
"AppendObjectData",
"(",
"dst",
"[",
"]",
"byte",
",",
"o",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"// BeginMarker is present in the dst, which",
"// should not be copied when appending to existing data.",
"return",
"append",
"(",
... | // AppendObjectData takes an object in form of a byte array and appends to dst. | [
"AppendObjectData",
"takes",
"an",
"object",
"in",
"form",
"of",
"a",
"byte",
"array",
"and",
"appends",
"to",
"dst",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L26-L30 |
25,314 | rs/zerolog | internal/cbor/types.go | AppendArrayStart | func (Encoder) AppendArrayStart(dst []byte) []byte {
return append(dst, byte(majorTypeArray|additionalTypeInfiniteCount))
} | go | func (Encoder) AppendArrayStart(dst []byte) []byte {
return append(dst, byte(majorTypeArray|additionalTypeInfiniteCount))
} | [
"func",
"(",
"Encoder",
")",
"AppendArrayStart",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"return",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeArray",
"|",
"additionalTypeInfiniteCount",
")",
")",
"\n",
"}"
] | // AppendArrayStart adds markers to indicate the start of an array. | [
"AppendArrayStart",
"adds",
"markers",
"to",
"indicate",
"the",
"start",
"of",
"an",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L33-L35 |
25,315 | rs/zerolog | internal/cbor/types.go | AppendArrayEnd | func (Encoder) AppendArrayEnd(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeBreak))
} | go | func (Encoder) AppendArrayEnd(dst []byte) []byte {
return append(dst, byte(majorTypeSimpleAndFloat|additionalTypeBreak))
} | [
"func",
"(",
"Encoder",
")",
"AppendArrayEnd",
"(",
"dst",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"return",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeSimpleAndFloat",
"|",
"additionalTypeBreak",
")",
")",
"\n",
"}"
] | // AppendArrayEnd adds markers to indicate the end of an array. | [
"AppendArrayEnd",
"adds",
"markers",
"to",
"indicate",
"the",
"end",
"of",
"an",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L38-L40 |
25,316 | rs/zerolog | internal/cbor/types.go | AppendBool | func (Encoder) AppendBool(dst []byte, val bool) []byte {
b := additionalTypeBoolFalse
if val {
b = additionalTypeBoolTrue
}
return append(dst, byte(majorTypeSimpleAndFloat|b))
} | go | func (Encoder) AppendBool(dst []byte, val bool) []byte {
b := additionalTypeBoolFalse
if val {
b = additionalTypeBoolTrue
}
return append(dst, byte(majorTypeSimpleAndFloat|b))
} | [
"func",
"(",
"Encoder",
")",
"AppendBool",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"bool",
")",
"[",
"]",
"byte",
"{",
"b",
":=",
"additionalTypeBoolFalse",
"\n",
"if",
"val",
"{",
"b",
"=",
"additionalTypeBoolTrue",
"\n",
"}",
"\n",
"return",
"appen... | // AppendBool encodes and inserts a boolean value into the dst byte array. | [
"AppendBool",
"encodes",
"and",
"inserts",
"a",
"boolean",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L55-L61 |
25,317 | rs/zerolog | internal/cbor/types.go | AppendBools | func (e Encoder) AppendBools(dst []byte, vals []bool) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _,... | go | func (e Encoder) AppendBools(dst []byte, vals []bool) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _,... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendBools",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"bool",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
"{"... | // AppendBools encodes and inserts an array of boolean values into the dst byte array. | [
"AppendBools",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"boolean",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L64-L80 |
25,318 | rs/zerolog | internal/cbor/types.go | AppendInt | func (Encoder) AppendInt(dst []byte, val int) []byte {
major := majorTypeUnsignedInt
contentVal := val
if val < 0 {
major = majorTypeNegativeInt
contentVal = -val - 1
}
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, majo... | go | func (Encoder) AppendInt(dst []byte, val int) []byte {
major := majorTypeUnsignedInt
contentVal := val
if val < 0 {
major = majorTypeNegativeInt
contentVal = -val - 1
}
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, majo... | [
"func",
"(",
"Encoder",
")",
"AppendInt",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"int",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeUnsignedInt",
"\n",
"contentVal",
":=",
"val",
"\n",
"if",
"val",
"<",
"0",
"{",
"major",
"=",
"majorTypeN... | // AppendInt encodes and inserts an integer value into the dst byte array. | [
"AppendInt",
"encodes",
"and",
"inserts",
"an",
"integer",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L83-L97 |
25,319 | rs/zerolog | internal/cbor/types.go | AppendInt8 | func (e Encoder) AppendInt8(dst []byte, val int8) []byte {
return e.AppendInt(dst, int(val))
} | go | func (e Encoder) AppendInt8(dst []byte, val int8) []byte {
return e.AppendInt(dst, int(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInt8",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"int8",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendInt",
"(",
"dst",
",",
"int",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendInt8 encodes and inserts an int8 value into the dst byte array. | [
"AppendInt8",
"encodes",
"and",
"inserts",
"an",
"int8",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L119-L121 |
25,320 | rs/zerolog | internal/cbor/types.go | AppendInt16 | func (e Encoder) AppendInt16(dst []byte, val int16) []byte {
return e.AppendInt(dst, int(val))
} | go | func (e Encoder) AppendInt16(dst []byte, val int16) []byte {
return e.AppendInt(dst, int(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInt16",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"int16",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendInt",
"(",
"dst",
",",
"int",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendInt16 encodes and inserts a int16 value into the dst byte array. | [
"AppendInt16",
"encodes",
"and",
"inserts",
"a",
"int16",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L143-L145 |
25,321 | rs/zerolog | internal/cbor/types.go | AppendInts16 | func (e Encoder) AppendInts16(dst []byte, vals []int16) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | go | func (e Encoder) AppendInts16(dst []byte, vals []int16) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInts16",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"int16",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
"... | // AppendInts16 encodes and inserts an array of int16 values into the dst byte array. | [
"AppendInts16",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"int16",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L148-L164 |
25,322 | rs/zerolog | internal/cbor/types.go | AppendInt32 | func (e Encoder) AppendInt32(dst []byte, val int32) []byte {
return e.AppendInt(dst, int(val))
} | go | func (e Encoder) AppendInt32(dst []byte, val int32) []byte {
return e.AppendInt(dst, int(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInt32",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"int32",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendInt",
"(",
"dst",
",",
"int",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendInt32 encodes and inserts a int32 value into the dst byte array. | [
"AppendInt32",
"encodes",
"and",
"inserts",
"a",
"int32",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L167-L169 |
25,323 | rs/zerolog | internal/cbor/types.go | AppendInt64 | func (Encoder) AppendInt64(dst []byte, val int64) []byte {
major := majorTypeUnsignedInt
contentVal := val
if val < 0 {
major = majorTypeNegativeInt
contentVal = -val - 1
}
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, ... | go | func (Encoder) AppendInt64(dst []byte, val int64) []byte {
major := majorTypeUnsignedInt
contentVal := val
if val < 0 {
major = majorTypeNegativeInt
contentVal = -val - 1
}
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, ... | [
"func",
"(",
"Encoder",
")",
"AppendInt64",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"int64",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeUnsignedInt",
"\n",
"contentVal",
":=",
"val",
"\n",
"if",
"val",
"<",
"0",
"{",
"major",
"=",
"majorT... | // AppendInt64 encodes and inserts a int64 value into the dst byte array. | [
"AppendInt64",
"encodes",
"and",
"inserts",
"a",
"int64",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L191-L205 |
25,324 | rs/zerolog | internal/cbor/types.go | AppendInts64 | func (e Encoder) AppendInts64(dst []byte, vals []int64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | go | func (e Encoder) AppendInts64(dst []byte, vals []int64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInts64",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"int64",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
"... | // AppendInts64 encodes and inserts an array of int64 values into the dst byte array. | [
"AppendInts64",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"int64",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L208-L224 |
25,325 | rs/zerolog | internal/cbor/types.go | AppendUint | func (e Encoder) AppendUint(dst []byte, val uint) []byte {
return e.AppendInt64(dst, int64(val))
} | go | func (e Encoder) AppendUint(dst []byte, val uint) []byte {
return e.AppendInt64(dst, int64(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUint",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"uint",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendInt64",
"(",
"dst",
",",
"int64",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendUint encodes and inserts an unsigned integer value into the dst byte array. | [
"AppendUint",
"encodes",
"and",
"inserts",
"an",
"unsigned",
"integer",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L227-L229 |
25,326 | rs/zerolog | internal/cbor/types.go | AppendUints | func (e Encoder) AppendUints(dst []byte, vals []uint) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _,... | go | func (e Encoder) AppendUints(dst []byte, vals []uint) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _,... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUints",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"uint",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
"{"... | // AppendUints encodes and inserts an array of unsigned integer values into the dst byte array. | [
"AppendUints",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"unsigned",
"integer",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L232-L248 |
25,327 | rs/zerolog | internal/cbor/types.go | AppendUint8 | func (e Encoder) AppendUint8(dst []byte, val uint8) []byte {
return e.AppendUint(dst, uint(val))
} | go | func (e Encoder) AppendUint8(dst []byte, val uint8) []byte {
return e.AppendUint(dst, uint(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUint8",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"uint8",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendUint",
"(",
"dst",
",",
"uint",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendUint8 encodes and inserts a unsigned int8 value into the dst byte array. | [
"AppendUint8",
"encodes",
"and",
"inserts",
"a",
"unsigned",
"int8",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L251-L253 |
25,328 | rs/zerolog | internal/cbor/types.go | AppendUints8 | func (e Encoder) AppendUints8(dst []byte, vals []uint8) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | go | func (e Encoder) AppendUints8(dst []byte, vals []uint8) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for ... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUints8",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"uint8",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
"... | // AppendUints8 encodes and inserts an array of uint8 values into the dst byte array. | [
"AppendUints8",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"uint8",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L256-L272 |
25,329 | rs/zerolog | internal/cbor/types.go | AppendUint16 | func (e Encoder) AppendUint16(dst []byte, val uint16) []byte {
return e.AppendUint(dst, uint(val))
} | go | func (e Encoder) AppendUint16(dst []byte, val uint16) []byte {
return e.AppendUint(dst, uint(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUint16",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"uint16",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendUint",
"(",
"dst",
",",
"uint",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendUint16 encodes and inserts a uint16 value into the dst byte array. | [
"AppendUint16",
"encodes",
"and",
"inserts",
"a",
"uint16",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L275-L277 |
25,330 | rs/zerolog | internal/cbor/types.go | AppendUints16 | func (e Encoder) AppendUints16(dst []byte, vals []uint16) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | go | func (e Encoder) AppendUints16(dst []byte, vals []uint16) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUints16",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"uint16",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
... | // AppendUints16 encodes and inserts an array of uint16 values into the dst byte array. | [
"AppendUints16",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"uint16",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L280-L296 |
25,331 | rs/zerolog | internal/cbor/types.go | AppendUint32 | func (e Encoder) AppendUint32(dst []byte, val uint32) []byte {
return e.AppendUint(dst, uint(val))
} | go | func (e Encoder) AppendUint32(dst []byte, val uint32) []byte {
return e.AppendUint(dst, uint(val))
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUint32",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"uint32",
")",
"[",
"]",
"byte",
"{",
"return",
"e",
".",
"AppendUint",
"(",
"dst",
",",
"uint",
"(",
"val",
")",
")",
"\n",
"}"
] | // AppendUint32 encodes and inserts a uint32 value into the dst byte array. | [
"AppendUint32",
"encodes",
"and",
"inserts",
"a",
"uint32",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L299-L301 |
25,332 | rs/zerolog | internal/cbor/types.go | AppendUints32 | func (e Encoder) AppendUints32(dst []byte, vals []uint32) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | go | func (e Encoder) AppendUints32(dst []byte, vals []uint32) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUints32",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"uint32",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
... | // AppendUints32 encodes and inserts an array of uint32 values into the dst byte array. | [
"AppendUints32",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"uint32",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L304-L320 |
25,333 | rs/zerolog | internal/cbor/types.go | AppendUint64 | func (Encoder) AppendUint64(dst []byte, val uint64) []byte {
major := majorTypeUnsignedInt
contentVal := val
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(contentVal))
}
return dst
} | go | func (Encoder) AppendUint64(dst []byte, val uint64) []byte {
major := majorTypeUnsignedInt
contentVal := val
if contentVal <= additionalMax {
lb := byte(contentVal)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(contentVal))
}
return dst
} | [
"func",
"(",
"Encoder",
")",
"AppendUint64",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"uint64",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeUnsignedInt",
"\n",
"contentVal",
":=",
"val",
"\n",
"if",
"contentVal",
"<=",
"additionalMax",
"{",
"lb... | // AppendUint64 encodes and inserts a uint64 value into the dst byte array. | [
"AppendUint64",
"encodes",
"and",
"inserts",
"a",
"uint64",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L323-L333 |
25,334 | rs/zerolog | internal/cbor/types.go | AppendUints64 | func (e Encoder) AppendUints64(dst []byte, vals []uint64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | go | func (e Encoder) AppendUints64(dst []byte, vals []uint64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
fo... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendUints64",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"uint64",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",
... | // AppendUints64 encodes and inserts an array of uint64 values into the dst byte array. | [
"AppendUints64",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"uint64",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L336-L352 |
25,335 | rs/zerolog | internal/cbor/types.go | AppendFloat32 | func (Encoder) AppendFloat32(dst []byte, val float32) []byte {
switch {
case math.IsNaN(float64(val)):
return append(dst, "\xfa\x7f\xc0\x00\x00"...)
case math.IsInf(float64(val), 1):
return append(dst, "\xfa\x7f\x80\x00\x00"...)
case math.IsInf(float64(val), -1):
return append(dst, "\xfa\xff\x80\x00\x00"...)
... | go | func (Encoder) AppendFloat32(dst []byte, val float32) []byte {
switch {
case math.IsNaN(float64(val)):
return append(dst, "\xfa\x7f\xc0\x00\x00"...)
case math.IsInf(float64(val), 1):
return append(dst, "\xfa\x7f\x80\x00\x00"...)
case math.IsInf(float64(val), -1):
return append(dst, "\xfa\xff\x80\x00\x00"...)
... | [
"func",
"(",
"Encoder",
")",
"AppendFloat32",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"float32",
")",
"[",
"]",
"byte",
"{",
"switch",
"{",
"case",
"math",
".",
"IsNaN",
"(",
"float64",
"(",
"val",
")",
")",
":",
"return",
"append",
"(",
"dst",
... | // AppendFloat32 encodes and inserts a single precision float value into the dst byte array. | [
"AppendFloat32",
"encodes",
"and",
"inserts",
"a",
"single",
"precision",
"float",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L355-L372 |
25,336 | rs/zerolog | internal/cbor/types.go | AppendFloats32 | func (e Encoder) AppendFloats32(dst []byte, vals []float32) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
... | go | func (e Encoder) AppendFloats32(dst []byte, vals []float32) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendFloats32",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"float32",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",... | // AppendFloats32 encodes and inserts an array of single precision float value into the dst byte array. | [
"AppendFloats32",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"single",
"precision",
"float",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L375-L391 |
25,337 | rs/zerolog | internal/cbor/types.go | AppendFloat64 | func (Encoder) AppendFloat64(dst []byte, val float64) []byte {
switch {
case math.IsNaN(val):
return append(dst, "\xfb\x7f\xf8\x00\x00\x00\x00\x00\x00"...)
case math.IsInf(val, 1):
return append(dst, "\xfb\x7f\xf0\x00\x00\x00\x00\x00\x00"...)
case math.IsInf(val, -1):
return append(dst, "\xfb\xff\xf0\x00\x00\... | go | func (Encoder) AppendFloat64(dst []byte, val float64) []byte {
switch {
case math.IsNaN(val):
return append(dst, "\xfb\x7f\xf8\x00\x00\x00\x00\x00\x00"...)
case math.IsInf(val, 1):
return append(dst, "\xfb\x7f\xf0\x00\x00\x00\x00\x00\x00"...)
case math.IsInf(val, -1):
return append(dst, "\xfb\xff\xf0\x00\x00\... | [
"func",
"(",
"Encoder",
")",
"AppendFloat64",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"float64",
")",
"[",
"]",
"byte",
"{",
"switch",
"{",
"case",
"math",
".",
"IsNaN",
"(",
"val",
")",
":",
"return",
"append",
"(",
"dst",
",",
"\"",
"\\xfb",
... | // AppendFloat64 encodes and inserts a double precision float value into the dst byte array. | [
"AppendFloat64",
"encodes",
"and",
"inserts",
"a",
"double",
"precision",
"float",
"value",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L394-L412 |
25,338 | rs/zerolog | internal/cbor/types.go | AppendFloats64 | func (e Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
... | go | func (e Encoder) AppendFloats64(dst []byte, vals []float64) []byte {
major := majorTypeArray
l := len(vals)
if l == 0 {
return e.AppendArrayEnd(e.AppendArrayStart(dst))
}
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendFloats64",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"float64",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"==",
"0",... | // AppendFloats64 encodes and inserts an array of double precision float values into the dst byte array. | [
"AppendFloats64",
"encodes",
"and",
"inserts",
"an",
"array",
"of",
"double",
"precision",
"float",
"values",
"into",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L415-L431 |
25,339 | rs/zerolog | internal/cbor/types.go | AppendInterface | func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
marshaled, err := json.Marshal(i)
if err != nil {
return e.AppendString(dst, fmt.Sprintf("marshaling error: %v", err))
}
return AppendEmbeddedJSON(dst, marshaled)
} | go | func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
marshaled, err := json.Marshal(i)
if err != nil {
return e.AppendString(dst, fmt.Sprintf("marshaling error: %v", err))
}
return AppendEmbeddedJSON(dst, marshaled)
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendInterface",
"(",
"dst",
"[",
"]",
"byte",
",",
"i",
"interface",
"{",
"}",
")",
"[",
"]",
"byte",
"{",
"marshaled",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"i",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // AppendInterface takes an arbitrary object and converts it to JSON and embeds it dst. | [
"AppendInterface",
"takes",
"an",
"arbitrary",
"object",
"and",
"converts",
"it",
"to",
"JSON",
"and",
"embeds",
"it",
"dst",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L434-L440 |
25,340 | rs/zerolog | internal/cbor/types.go | AppendHex | func (e Encoder) AppendHex(dst []byte, val []byte) []byte {
dst = append(dst, byte(majorTypeTags|additionalTypeIntUint16))
dst = append(dst, byte(additionalTypeTagHexString>>8))
dst = append(dst, byte(additionalTypeTagHexString&0xff))
return e.AppendBytes(dst, val)
} | go | func (e Encoder) AppendHex(dst []byte, val []byte) []byte {
dst = append(dst, byte(majorTypeTags|additionalTypeIntUint16))
dst = append(dst, byte(additionalTypeTagHexString>>8))
dst = append(dst, byte(additionalTypeTagHexString&0xff))
return e.AppendBytes(dst, val)
} | [
"func",
"(",
"e",
"Encoder",
")",
"AppendHex",
"(",
"dst",
"[",
"]",
"byte",
",",
"val",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"dst",
"=",
"append",
"(",
"dst",
",",
"byte",
"(",
"majorTypeTags",
"|",
"additionalTypeIntUint16",
")",
")",
"\... | // AppendHex adds a TAG and inserts a hex bytes as a string. | [
"AppendHex",
"adds",
"a",
"TAG",
"and",
"inserts",
"a",
"hex",
"bytes",
"as",
"a",
"string",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/types.go#L473-L478 |
25,341 | rs/zerolog | writer.go | WriteLevel | func (s *syncWriter) WriteLevel(l Level, p []byte) (n int, err error) {
s.mu.Lock()
defer s.mu.Unlock()
return s.lw.WriteLevel(l, p)
} | go | func (s *syncWriter) WriteLevel(l Level, p []byte) (n int, err error) {
s.mu.Lock()
defer s.mu.Unlock()
return s.lw.WriteLevel(l, p)
} | [
"func",
"(",
"s",
"*",
"syncWriter",
")",
"WriteLevel",
"(",
"l",
"Level",
",",
"p",
"[",
"]",
"byte",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"Unlock",
... | // WriteLevel implements the LevelWriter interface. | [
"WriteLevel",
"implements",
"the",
"LevelWriter",
"interface",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/writer.go#L49-L53 |
25,342 | rs/zerolog | internal/cbor/string.go | AppendStrings | func (e Encoder) AppendStrings(dst []byte, vals []string) []byte {
major := majorTypeArray
l := len(vals)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _, v := range vals {
dst = e.AppendString(dst, v)
}
return ds... | go | func (e Encoder) AppendStrings(dst []byte, vals []string) []byte {
major := majorTypeArray
l := len(vals)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
for _, v := range vals {
dst = e.AppendString(dst, v)
}
return ds... | [
"func",
"(",
"e",
"Encoder",
")",
"AppendStrings",
"(",
"dst",
"[",
"]",
"byte",
",",
"vals",
"[",
"]",
"string",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeArray",
"\n",
"l",
":=",
"len",
"(",
"vals",
")",
"\n",
"if",
"l",
"<=",
"addit... | // AppendStrings encodes and adds an array of strings to the dst byte array. | [
"AppendStrings",
"encodes",
"and",
"adds",
"an",
"array",
"of",
"strings",
"to",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/string.go#L4-L17 |
25,343 | rs/zerolog | internal/cbor/string.go | AppendString | func (Encoder) AppendString(dst []byte, s string) []byte {
major := majorTypeUtf8String
l := len(s)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, majorTypeUtf8String, uint64(l))
}
return append(dst, s...)
} | go | func (Encoder) AppendString(dst []byte, s string) []byte {
major := majorTypeUtf8String
l := len(s)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, majorTypeUtf8String, uint64(l))
}
return append(dst, s...)
} | [
"func",
"(",
"Encoder",
")",
"AppendString",
"(",
"dst",
"[",
"]",
"byte",
",",
"s",
"string",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeUtf8String",
"\n\n",
"l",
":=",
"len",
"(",
"s",
")",
"\n",
"if",
"l",
"<=",
"additionalMax",
"{",
"... | // AppendString encodes and adds a string to the dst byte array. | [
"AppendString",
"encodes",
"and",
"adds",
"a",
"string",
"to",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/string.go#L20-L31 |
25,344 | rs/zerolog | internal/cbor/string.go | AppendBytes | func (Encoder) AppendBytes(dst, s []byte) []byte {
major := majorTypeByteString
l := len(s)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
return append(dst, s...)
} | go | func (Encoder) AppendBytes(dst, s []byte) []byte {
major := majorTypeByteString
l := len(s)
if l <= additionalMax {
lb := byte(l)
dst = append(dst, byte(major|lb))
} else {
dst = appendCborTypePrefix(dst, major, uint64(l))
}
return append(dst, s...)
} | [
"func",
"(",
"Encoder",
")",
"AppendBytes",
"(",
"dst",
",",
"s",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeByteString",
"\n\n",
"l",
":=",
"len",
"(",
"s",
")",
"\n",
"if",
"l",
"<=",
"additionalMax",
"{",
"lb",
":=",
... | // AppendBytes encodes and adds an array of bytes to the dst byte array. | [
"AppendBytes",
"encodes",
"and",
"adds",
"an",
"array",
"of",
"bytes",
"to",
"the",
"dst",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/string.go#L34-L45 |
25,345 | rs/zerolog | internal/cbor/string.go | AppendEmbeddedJSON | func AppendEmbeddedJSON(dst, s []byte) []byte {
major := majorTypeTags
minor := additionalTypeEmbeddedJSON
// Append the TAG to indicate this is Embedded JSON.
dst = append(dst, byte(major|additionalTypeIntUint16))
dst = append(dst, byte(minor>>8))
dst = append(dst, byte(minor&0xff))
// Append the JSON Object ... | go | func AppendEmbeddedJSON(dst, s []byte) []byte {
major := majorTypeTags
minor := additionalTypeEmbeddedJSON
// Append the TAG to indicate this is Embedded JSON.
dst = append(dst, byte(major|additionalTypeIntUint16))
dst = append(dst, byte(minor>>8))
dst = append(dst, byte(minor&0xff))
// Append the JSON Object ... | [
"func",
"AppendEmbeddedJSON",
"(",
"dst",
",",
"s",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"major",
":=",
"majorTypeTags",
"\n",
"minor",
":=",
"additionalTypeEmbeddedJSON",
"\n\n",
"// Append the TAG to indicate this is Embedded JSON.",
"dst",
"=",
"append",... | // AppendEmbeddedJSON adds a tag and embeds input JSON as such. | [
"AppendEmbeddedJSON",
"adds",
"a",
"tag",
"and",
"embeds",
"input",
"JSON",
"as",
"such",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/string.go#L48-L68 |
25,346 | rs/zerolog | ctx.go | Ctx | func Ctx(ctx context.Context) *Logger {
if l, ok := ctx.Value(ctxKey{}).(*Logger); ok {
return l
}
return disabledLogger
} | go | func Ctx(ctx context.Context) *Logger {
if l, ok := ctx.Value(ctxKey{}).(*Logger); ok {
return l
}
return disabledLogger
} | [
"func",
"Ctx",
"(",
"ctx",
"context",
".",
"Context",
")",
"*",
"Logger",
"{",
"if",
"l",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKey",
"{",
"}",
")",
".",
"(",
"*",
"Logger",
")",
";",
"ok",
"{",
"return",
"l",
"\n",
"}",
"\n",
"retur... | // Ctx returns the Logger associated with the ctx. If no logger
// is associated, a disabled logger is returned. | [
"Ctx",
"returns",
"the",
"Logger",
"associated",
"with",
"the",
"ctx",
".",
"If",
"no",
"logger",
"is",
"associated",
"a",
"disabled",
"logger",
"is",
"returned",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/ctx.go#L42-L47 |
25,347 | rs/zerolog | internal/cbor/decode_stream.go | DecodeObjectToStr | func DecodeObjectToStr(in []byte) string {
if binaryFmt(in) {
var b bytes.Buffer
cbor2JsonOneObject(getReader(string(in)), &b)
return b.String()
}
return string(in)
} | go | func DecodeObjectToStr(in []byte) string {
if binaryFmt(in) {
var b bytes.Buffer
cbor2JsonOneObject(getReader(string(in)), &b)
return b.String()
}
return string(in)
} | [
"func",
"DecodeObjectToStr",
"(",
"in",
"[",
"]",
"byte",
")",
"string",
"{",
"if",
"binaryFmt",
"(",
"in",
")",
"{",
"var",
"b",
"bytes",
".",
"Buffer",
"\n",
"cbor2JsonOneObject",
"(",
"getReader",
"(",
"string",
"(",
"in",
")",
")",
",",
"&",
"b",... | // DecodeObjectToStr checks if the input is a binary format, if so,
// it will decode a single Object and return the decoded string. | [
"DecodeObjectToStr",
"checks",
"if",
"the",
"input",
"is",
"a",
"binary",
"format",
"if",
"so",
"it",
"will",
"decode",
"a",
"single",
"Object",
"and",
"return",
"the",
"decoded",
"string",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/decode_stream.go#L596-L603 |
25,348 | rs/zerolog | internal/cbor/decode_stream.go | DecodeIfBinaryToBytes | func DecodeIfBinaryToBytes(in []byte) []byte {
if binaryFmt(in) {
var b bytes.Buffer
Cbor2JsonManyObjects(bytes.NewReader(in), &b)
return b.Bytes()
}
return in
} | go | func DecodeIfBinaryToBytes(in []byte) []byte {
if binaryFmt(in) {
var b bytes.Buffer
Cbor2JsonManyObjects(bytes.NewReader(in), &b)
return b.Bytes()
}
return in
} | [
"func",
"DecodeIfBinaryToBytes",
"(",
"in",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"if",
"binaryFmt",
"(",
"in",
")",
"{",
"var",
"b",
"bytes",
".",
"Buffer",
"\n",
"Cbor2JsonManyObjects",
"(",
"bytes",
".",
"NewReader",
"(",
"in",
")",
",",
"... | // DecodeIfBinaryToBytes checks if the input is a binary format, if so,
// it will decode all Objects and return the decoded string as byte array. | [
"DecodeIfBinaryToBytes",
"checks",
"if",
"the",
"input",
"is",
"a",
"binary",
"format",
"if",
"so",
"it",
"will",
"decode",
"all",
"Objects",
"and",
"return",
"the",
"decoded",
"string",
"as",
"byte",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/cbor/decode_stream.go#L607-L614 |
25,349 | rs/zerolog | cmd/lint/lint.go | init | func init() {
flag.Var(&recursivelyIgnoredPkgs, "ignorePkgRecursively", "ignore the specified package and all subpackages recursively")
flag.Var(&ignoredPkgs, "ignorePkg", "ignore the specified package")
flag.Var(&ignoredFiles, "ignoreFile", "ignore the specified file by its path and/or go path (package/file.go)")
... | go | func init() {
flag.Var(&recursivelyIgnoredPkgs, "ignorePkgRecursively", "ignore the specified package and all subpackages recursively")
flag.Var(&ignoredPkgs, "ignorePkg", "ignore the specified package")
flag.Var(&ignoredFiles, "ignoreFile", "ignore the specified file by its path and/or go path (package/file.go)")
... | [
"func",
"init",
"(",
")",
"{",
"flag",
".",
"Var",
"(",
"&",
"recursivelyIgnoredPkgs",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"flag",
".",
"Var",
"(",
"&",
"ignoredPkgs",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"flag",
".",
"Var",
"(... | // parse input flags and args | [
"parse",
"input",
"flags",
"and",
"args"
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/cmd/lint/lint.go#L25-L40 |
25,350 | rs/zerolog | diode/diode.go | Close | func (dw Writer) Close() error {
dw.c()
<-dw.done
if w, ok := dw.w.(io.Closer); ok {
return w.Close()
}
return nil
} | go | func (dw Writer) Close() error {
dw.c()
<-dw.done
if w, ok := dw.w.(io.Closer); ok {
return w.Close()
}
return nil
} | [
"func",
"(",
"dw",
"Writer",
")",
"Close",
"(",
")",
"error",
"{",
"dw",
".",
"c",
"(",
")",
"\n",
"<-",
"dw",
".",
"done",
"\n",
"if",
"w",
",",
"ok",
":=",
"dw",
".",
"w",
".",
"(",
"io",
".",
"Closer",
")",
";",
"ok",
"{",
"return",
"w... | // Close releases the diode poller and call Close on the wrapped writer if
// io.Closer is implemented. | [
"Close",
"releases",
"the",
"diode",
"poller",
"and",
"call",
"Close",
"on",
"the",
"wrapped",
"writer",
"if",
"io",
".",
"Closer",
"is",
"implemented",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/diode/diode.go#L84-L91 |
25,351 | rs/zerolog | context.go | Dict | func (c Context) Dict(key string, dict *Event) Context {
dict.buf = enc.AppendEndMarker(dict.buf)
c.l.context = append(enc.AppendKey(c.l.context, key), dict.buf...)
putEvent(dict)
return c
} | go | func (c Context) Dict(key string, dict *Event) Context {
dict.buf = enc.AppendEndMarker(dict.buf)
c.l.context = append(enc.AppendKey(c.l.context, key), dict.buf...)
putEvent(dict)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Dict",
"(",
"key",
"string",
",",
"dict",
"*",
"Event",
")",
"Context",
"{",
"dict",
".",
"buf",
"=",
"enc",
".",
"AppendEndMarker",
"(",
"dict",
".",
"buf",
")",
"\n",
"c",
".",
"l",
".",
"context",
"=",
"appen... | // Dict adds the field key with the dict to the logger context. | [
"Dict",
"adds",
"the",
"field",
"key",
"with",
"the",
"dict",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L27-L32 |
25,352 | rs/zerolog | context.go | EmbedObject | func (c Context) EmbedObject(obj LogObjectMarshaler) Context {
e := newEvent(levelWriterAdapter{ioutil.Discard}, 0)
e.EmbedObject(obj)
c.l.context = enc.AppendObjectData(c.l.context, e.buf)
putEvent(e)
return c
} | go | func (c Context) EmbedObject(obj LogObjectMarshaler) Context {
e := newEvent(levelWriterAdapter{ioutil.Discard}, 0)
e.EmbedObject(obj)
c.l.context = enc.AppendObjectData(c.l.context, e.buf)
putEvent(e)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"EmbedObject",
"(",
"obj",
"LogObjectMarshaler",
")",
"Context",
"{",
"e",
":=",
"newEvent",
"(",
"levelWriterAdapter",
"{",
"ioutil",
".",
"Discard",
"}",
",",
"0",
")",
"\n",
"e",
".",
"EmbedObject",
"(",
"obj",
")",
... | // EmbedObject marshals and Embeds an object that implement the LogObjectMarshaler interface. | [
"EmbedObject",
"marshals",
"and",
"Embeds",
"an",
"object",
"that",
"implement",
"the",
"LogObjectMarshaler",
"interface",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L64-L70 |
25,353 | rs/zerolog | context.go | Str | func (c Context) Str(key, val string) Context {
c.l.context = enc.AppendString(enc.AppendKey(c.l.context, key), val)
return c
} | go | func (c Context) Str(key, val string) Context {
c.l.context = enc.AppendString(enc.AppendKey(c.l.context, key), val)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Str",
"(",
"key",
",",
"val",
"string",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendString",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
")",
"... | // Str adds the field key with val as a string to the logger context. | [
"Str",
"adds",
"the",
"field",
"key",
"with",
"val",
"as",
"a",
"string",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L73-L76 |
25,354 | rs/zerolog | context.go | Strs | func (c Context) Strs(key string, vals []string) Context {
c.l.context = enc.AppendStrings(enc.AppendKey(c.l.context, key), vals)
return c
} | go | func (c Context) Strs(key string, vals []string) Context {
c.l.context = enc.AppendStrings(enc.AppendKey(c.l.context, key), vals)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Strs",
"(",
"key",
"string",
",",
"vals",
"[",
"]",
"string",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendStrings",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context... | // Strs adds the field key with val as a string to the logger context. | [
"Strs",
"adds",
"the",
"field",
"key",
"with",
"val",
"as",
"a",
"string",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L79-L82 |
25,355 | rs/zerolog | context.go | Hex | func (c Context) Hex(key string, val []byte) Context {
c.l.context = enc.AppendHex(enc.AppendKey(c.l.context, key), val)
return c
} | go | func (c Context) Hex(key string, val []byte) Context {
c.l.context = enc.AppendHex(enc.AppendKey(c.l.context, key), val)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Hex",
"(",
"key",
"string",
",",
"val",
"[",
"]",
"byte",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendHex",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
","... | // Hex adds the field key with val as a hex string to the logger context. | [
"Hex",
"adds",
"the",
"field",
"key",
"with",
"val",
"as",
"a",
"hex",
"string",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L91-L94 |
25,356 | rs/zerolog | context.go | RawJSON | func (c Context) RawJSON(key string, b []byte) Context {
c.l.context = appendJSON(enc.AppendKey(c.l.context, key), b)
return c
} | go | func (c Context) RawJSON(key string, b []byte) Context {
c.l.context = appendJSON(enc.AppendKey(c.l.context, key), b)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"RawJSON",
"(",
"key",
"string",
",",
"b",
"[",
"]",
"byte",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"appendJSON",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
... | // RawJSON adds already encoded JSON to context.
//
// No sanity check is performed on b; it must not contain carriage returns and
// be valid JSON. | [
"RawJSON",
"adds",
"already",
"encoded",
"JSON",
"to",
"context",
".",
"No",
"sanity",
"check",
"is",
"performed",
"on",
"b",
";",
"it",
"must",
"not",
"contain",
"carriage",
"returns",
"and",
"be",
"valid",
"JSON",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L100-L103 |
25,357 | rs/zerolog | context.go | AnErr | func (c Context) AnErr(key string, err error) Context {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case nil:
return c
case LogObjectMarshaler:
return c.Object(key, m)
case error:
return c.Str(key, m.Error())
case string:
return c.Str(key, m)
default:
return c.Interface(key, m)
}... | go | func (c Context) AnErr(key string, err error) Context {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case nil:
return c
case LogObjectMarshaler:
return c.Object(key, m)
case error:
return c.Str(key, m.Error())
case string:
return c.Str(key, m)
default:
return c.Interface(key, m)
}... | [
"func",
"(",
"c",
"Context",
")",
"AnErr",
"(",
"key",
"string",
",",
"err",
"error",
")",
"Context",
"{",
"marshaled",
":=",
"ErrorMarshalFunc",
"(",
"err",
")",
"\n",
"switch",
"m",
":=",
"marshaled",
".",
"(",
"type",
")",
"{",
"case",
"nil",
":",... | // AnErr adds the field key with serialized err to the logger context. | [
"AnErr",
"adds",
"the",
"field",
"key",
"with",
"serialized",
"err",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L106-L120 |
25,358 | rs/zerolog | context.go | Errs | func (c Context) Errs(key string, errs []error) Context {
arr := Arr()
for _, err := range errs {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case LogObjectMarshaler:
arr = arr.Object(m)
case error:
arr = arr.Str(m.Error())
case string:
arr = arr.Str(m)
default:
arr = arr... | go | func (c Context) Errs(key string, errs []error) Context {
arr := Arr()
for _, err := range errs {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case LogObjectMarshaler:
arr = arr.Object(m)
case error:
arr = arr.Str(m.Error())
case string:
arr = arr.Str(m)
default:
arr = arr... | [
"func",
"(",
"c",
"Context",
")",
"Errs",
"(",
"key",
"string",
",",
"errs",
"[",
"]",
"error",
")",
"Context",
"{",
"arr",
":=",
"Arr",
"(",
")",
"\n",
"for",
"_",
",",
"err",
":=",
"range",
"errs",
"{",
"marshaled",
":=",
"ErrorMarshalFunc",
"(",... | // Errs adds the field key with errs as an array of serialized errors to the
// logger context. | [
"Errs",
"adds",
"the",
"field",
"key",
"with",
"errs",
"as",
"an",
"array",
"of",
"serialized",
"errors",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L124-L141 |
25,359 | rs/zerolog | context.go | Err | func (c Context) Err(err error) Context {
return c.AnErr(ErrorFieldName, err)
} | go | func (c Context) Err(err error) Context {
return c.AnErr(ErrorFieldName, err)
} | [
"func",
"(",
"c",
"Context",
")",
"Err",
"(",
"err",
"error",
")",
"Context",
"{",
"return",
"c",
".",
"AnErr",
"(",
"ErrorFieldName",
",",
"err",
")",
"\n",
"}"
] | // Err adds the field "error" with serialized err to the logger context. | [
"Err",
"adds",
"the",
"field",
"error",
"with",
"serialized",
"err",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L144-L146 |
25,360 | rs/zerolog | context.go | Bool | func (c Context) Bool(key string, b bool) Context {
c.l.context = enc.AppendBool(enc.AppendKey(c.l.context, key), b)
return c
} | go | func (c Context) Bool(key string, b bool) Context {
c.l.context = enc.AppendBool(enc.AppendKey(c.l.context, key), b)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Bool",
"(",
"key",
"string",
",",
"b",
"bool",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendBool",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
"... | // Bool adds the field key with val as a bool to the logger context. | [
"Bool",
"adds",
"the",
"field",
"key",
"with",
"val",
"as",
"a",
"bool",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L149-L152 |
25,361 | rs/zerolog | context.go | Int | func (c Context) Int(key string, i int) Context {
c.l.context = enc.AppendInt(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Int(key string, i int) Context {
c.l.context = enc.AppendInt(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Int",
"(",
"key",
"string",
",",
"i",
"int",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInt",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
")",... | // Int adds the field key with i as a int to the logger context. | [
"Int",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"int",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L161-L164 |
25,362 | rs/zerolog | context.go | Int8 | func (c Context) Int8(key string, i int8) Context {
c.l.context = enc.AppendInt8(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Int8(key string, i int8) Context {
c.l.context = enc.AppendInt8(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Int8",
"(",
"key",
"string",
",",
"i",
"int8",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInt8",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
"... | // Int8 adds the field key with i as a int8 to the logger context. | [
"Int8",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"int8",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L173-L176 |
25,363 | rs/zerolog | context.go | Int16 | func (c Context) Int16(key string, i int16) Context {
c.l.context = enc.AppendInt16(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Int16(key string, i int16) Context {
c.l.context = enc.AppendInt16(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Int16",
"(",
"key",
"string",
",",
"i",
"int16",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInt16",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
... | // Int16 adds the field key with i as a int16 to the logger context. | [
"Int16",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"int16",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L185-L188 |
25,364 | rs/zerolog | context.go | Int32 | func (c Context) Int32(key string, i int32) Context {
c.l.context = enc.AppendInt32(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Int32(key string, i int32) Context {
c.l.context = enc.AppendInt32(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Int32",
"(",
"key",
"string",
",",
"i",
"int32",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInt32",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
... | // Int32 adds the field key with i as a int32 to the logger context. | [
"Int32",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"int32",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L197-L200 |
25,365 | rs/zerolog | context.go | Int64 | func (c Context) Int64(key string, i int64) Context {
c.l.context = enc.AppendInt64(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Int64(key string, i int64) Context {
c.l.context = enc.AppendInt64(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Int64",
"(",
"key",
"string",
",",
"i",
"int64",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInt64",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
... | // Int64 adds the field key with i as a int64 to the logger context. | [
"Int64",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"int64",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L209-L212 |
25,366 | rs/zerolog | context.go | Uint | func (c Context) Uint(key string, i uint) Context {
c.l.context = enc.AppendUint(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Uint(key string, i uint) Context {
c.l.context = enc.AppendUint(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Uint",
"(",
"key",
"string",
",",
"i",
"uint",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendUint",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
"... | // Uint adds the field key with i as a uint to the logger context. | [
"Uint",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"uint",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L221-L224 |
25,367 | rs/zerolog | context.go | Uint8 | func (c Context) Uint8(key string, i uint8) Context {
c.l.context = enc.AppendUint8(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Uint8(key string, i uint8) Context {
c.l.context = enc.AppendUint8(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Uint8",
"(",
"key",
"string",
",",
"i",
"uint8",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendUint8",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key",
... | // Uint8 adds the field key with i as a uint8 to the logger context. | [
"Uint8",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"uint8",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L233-L236 |
25,368 | rs/zerolog | context.go | Uint16 | func (c Context) Uint16(key string, i uint16) Context {
c.l.context = enc.AppendUint16(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Uint16(key string, i uint16) Context {
c.l.context = enc.AppendUint16(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Uint16",
"(",
"key",
"string",
",",
"i",
"uint16",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendUint16",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key... | // Uint16 adds the field key with i as a uint16 to the logger context. | [
"Uint16",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"uint16",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L245-L248 |
25,369 | rs/zerolog | context.go | Uint32 | func (c Context) Uint32(key string, i uint32) Context {
c.l.context = enc.AppendUint32(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Uint32(key string, i uint32) Context {
c.l.context = enc.AppendUint32(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Uint32",
"(",
"key",
"string",
",",
"i",
"uint32",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendUint32",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key... | // Uint32 adds the field key with i as a uint32 to the logger context. | [
"Uint32",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"uint32",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L257-L260 |
25,370 | rs/zerolog | context.go | Uint64 | func (c Context) Uint64(key string, i uint64) Context {
c.l.context = enc.AppendUint64(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Uint64(key string, i uint64) Context {
c.l.context = enc.AppendUint64(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Uint64",
"(",
"key",
"string",
",",
"i",
"uint64",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendUint64",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"key... | // Uint64 adds the field key with i as a uint64 to the logger context. | [
"Uint64",
"adds",
"the",
"field",
"key",
"with",
"i",
"as",
"a",
"uint64",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L269-L272 |
25,371 | rs/zerolog | context.go | Float32 | func (c Context) Float32(key string, f float32) Context {
c.l.context = enc.AppendFloat32(enc.AppendKey(c.l.context, key), f)
return c
} | go | func (c Context) Float32(key string, f float32) Context {
c.l.context = enc.AppendFloat32(enc.AppendKey(c.l.context, key), f)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Float32",
"(",
"key",
"string",
",",
"f",
"float32",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendFloat32",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"... | // Float32 adds the field key with f as a float32 to the logger context. | [
"Float32",
"adds",
"the",
"field",
"key",
"with",
"f",
"as",
"a",
"float32",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L281-L284 |
25,372 | rs/zerolog | context.go | Float64 | func (c Context) Float64(key string, f float64) Context {
c.l.context = enc.AppendFloat64(enc.AppendKey(c.l.context, key), f)
return c
} | go | func (c Context) Float64(key string, f float64) Context {
c.l.context = enc.AppendFloat64(enc.AppendKey(c.l.context, key), f)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Float64",
"(",
"key",
"string",
",",
"f",
"float64",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendFloat64",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
",",
"... | // Float64 adds the field key with f as a float64 to the logger context. | [
"Float64",
"adds",
"the",
"field",
"key",
"with",
"f",
"as",
"a",
"float64",
"to",
"the",
"logger",
"context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L293-L296 |
25,373 | rs/zerolog | context.go | Dur | func (c Context) Dur(key string, d time.Duration) Context {
c.l.context = enc.AppendDuration(enc.AppendKey(c.l.context, key), d, DurationFieldUnit, DurationFieldInteger)
return c
} | go | func (c Context) Dur(key string, d time.Duration) Context {
c.l.context = enc.AppendDuration(enc.AppendKey(c.l.context, key), d, DurationFieldUnit, DurationFieldInteger)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Dur",
"(",
"key",
"string",
",",
"d",
"time",
".",
"Duration",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendDuration",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"conte... | // Dur adds the fields key with d divided by unit and stored as a float. | [
"Dur",
"adds",
"the",
"fields",
"key",
"with",
"d",
"divided",
"by",
"unit",
"and",
"stored",
"as",
"a",
"float",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L334-L337 |
25,374 | rs/zerolog | context.go | Durs | func (c Context) Durs(key string, d []time.Duration) Context {
c.l.context = enc.AppendDurations(enc.AppendKey(c.l.context, key), d, DurationFieldUnit, DurationFieldInteger)
return c
} | go | func (c Context) Durs(key string, d []time.Duration) Context {
c.l.context = enc.AppendDurations(enc.AppendKey(c.l.context, key), d, DurationFieldUnit, DurationFieldInteger)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Durs",
"(",
"key",
"string",
",",
"d",
"[",
"]",
"time",
".",
"Duration",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendDurations",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",... | // Durs adds the fields key with d divided by unit and stored as a float. | [
"Durs",
"adds",
"the",
"fields",
"key",
"with",
"d",
"divided",
"by",
"unit",
"and",
"stored",
"as",
"a",
"float",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L340-L343 |
25,375 | rs/zerolog | context.go | Interface | func (c Context) Interface(key string, i interface{}) Context {
c.l.context = enc.AppendInterface(enc.AppendKey(c.l.context, key), i)
return c
} | go | func (c Context) Interface(key string, i interface{}) Context {
c.l.context = enc.AppendInterface(enc.AppendKey(c.l.context, key), i)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"Interface",
"(",
"key",
"string",
",",
"i",
"interface",
"{",
"}",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendInterface",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"... | // Interface adds the field key with obj marshaled using reflection. | [
"Interface",
"adds",
"the",
"field",
"key",
"with",
"obj",
"marshaled",
"using",
"reflection",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L346-L349 |
25,376 | rs/zerolog | context.go | IPAddr | func (c Context) IPAddr(key string, ip net.IP) Context {
c.l.context = enc.AppendIPAddr(enc.AppendKey(c.l.context, key), ip)
return c
} | go | func (c Context) IPAddr(key string, ip net.IP) Context {
c.l.context = enc.AppendIPAddr(enc.AppendKey(c.l.context, key), ip)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"IPAddr",
"(",
"key",
"string",
",",
"ip",
"net",
".",
"IP",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendIPAddr",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
"context",
... | // IPAddr adds IPv4 or IPv6 Address to the context | [
"IPAddr",
"adds",
"IPv4",
"or",
"IPv6",
"Address",
"to",
"the",
"context"
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L406-L409 |
25,377 | rs/zerolog | context.go | MACAddr | func (c Context) MACAddr(key string, ha net.HardwareAddr) Context {
c.l.context = enc.AppendMACAddr(enc.AppendKey(c.l.context, key), ha)
return c
} | go | func (c Context) MACAddr(key string, ha net.HardwareAddr) Context {
c.l.context = enc.AppendMACAddr(enc.AppendKey(c.l.context, key), ha)
return c
} | [
"func",
"(",
"c",
"Context",
")",
"MACAddr",
"(",
"key",
"string",
",",
"ha",
"net",
".",
"HardwareAddr",
")",
"Context",
"{",
"c",
".",
"l",
".",
"context",
"=",
"enc",
".",
"AppendMACAddr",
"(",
"enc",
".",
"AppendKey",
"(",
"c",
".",
"l",
".",
... | // MACAddr adds MAC address to the context | [
"MACAddr",
"adds",
"MAC",
"address",
"to",
"the",
"context"
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/context.go#L418-L421 |
25,378 | rs/zerolog | globals.go | DisableSampling | func DisableSampling(v bool) {
var i uint32
if v {
i = 1
}
atomic.StoreUint32(disableSampling, i)
} | go | func DisableSampling(v bool) {
var i uint32
if v {
i = 1
}
atomic.StoreUint32(disableSampling, i)
} | [
"func",
"DisableSampling",
"(",
"v",
"bool",
")",
"{",
"var",
"i",
"uint32",
"\n",
"if",
"v",
"{",
"i",
"=",
"1",
"\n",
"}",
"\n",
"atomic",
".",
"StoreUint32",
"(",
"disableSampling",
",",
"i",
")",
"\n",
"}"
] | // DisableSampling will disable sampling in all Loggers if true. | [
"DisableSampling",
"will",
"disable",
"sampling",
"in",
"all",
"Loggers",
"if",
"true",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/globals.go#L100-L106 |
25,379 | rs/zerolog | event.go | RawJSON | func (e *Event) RawJSON(key string, b []byte) *Event {
if e == nil {
return e
}
e.buf = appendJSON(enc.AppendKey(e.buf, key), b)
return e
} | go | func (e *Event) RawJSON(key string, b []byte) *Event {
if e == nil {
return e
}
e.buf = appendJSON(enc.AppendKey(e.buf, key), b)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"RawJSON",
"(",
"key",
"string",
",",
"b",
"[",
"]",
"byte",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"e",
".",
"buf",
"=",
"appendJSON",
"(",
"enc",
".",
"Appen... | // RawJSON adds already encoded JSON to the log line under key.
//
// No sanity check is performed on b; it must not contain carriage returns and
// be valid JSON. | [
"RawJSON",
"adds",
"already",
"encoded",
"JSON",
"to",
"the",
"log",
"line",
"under",
"key",
".",
"No",
"sanity",
"check",
"is",
"performed",
"on",
"b",
";",
"it",
"must",
"not",
"contain",
"carriage",
"returns",
"and",
"be",
"valid",
"JSON",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L258-L264 |
25,380 | rs/zerolog | event.go | Dur | func (e *Event) Dur(key string, d time.Duration) *Event {
if e == nil {
return e
}
e.buf = enc.AppendDuration(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldInteger)
return e
} | go | func (e *Event) Dur(key string, d time.Duration) *Event {
if e == nil {
return e
}
e.buf = enc.AppendDuration(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldInteger)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"Dur",
"(",
"key",
"string",
",",
"d",
"time",
".",
"Duration",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"e",
".",
"buf",
"=",
"enc",
".",
"AppendDuration",
"(",
... | // Dur adds the field key with duration d stored as zerolog.DurationFieldUnit.
// If zerolog.DurationFieldInteger is true, durations are rendered as integer
// instead of float. | [
"Dur",
"adds",
"the",
"field",
"key",
"with",
"duration",
"d",
"stored",
"as",
"zerolog",
".",
"DurationFieldUnit",
".",
"If",
"zerolog",
".",
"DurationFieldInteger",
"is",
"true",
"durations",
"are",
"rendered",
"as",
"integer",
"instead",
"of",
"float",
"."
... | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L616-L622 |
25,381 | rs/zerolog | event.go | Durs | func (e *Event) Durs(key string, d []time.Duration) *Event {
if e == nil {
return e
}
e.buf = enc.AppendDurations(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldInteger)
return e
} | go | func (e *Event) Durs(key string, d []time.Duration) *Event {
if e == nil {
return e
}
e.buf = enc.AppendDurations(enc.AppendKey(e.buf, key), d, DurationFieldUnit, DurationFieldInteger)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"Durs",
"(",
"key",
"string",
",",
"d",
"[",
"]",
"time",
".",
"Duration",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"e",
".",
"buf",
"=",
"enc",
".",
"AppendDura... | // Durs adds the field key with duration d stored as zerolog.DurationFieldUnit.
// If zerolog.DurationFieldInteger is true, durations are rendered as integer
// instead of float. | [
"Durs",
"adds",
"the",
"field",
"key",
"with",
"duration",
"d",
"stored",
"as",
"zerolog",
".",
"DurationFieldUnit",
".",
"If",
"zerolog",
".",
"DurationFieldInteger",
"is",
"true",
"durations",
"are",
"rendered",
"as",
"integer",
"instead",
"of",
"float",
"."... | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L627-L633 |
25,382 | rs/zerolog | event.go | Interface | func (e *Event) Interface(key string, i interface{}) *Event {
if e == nil {
return e
}
if obj, ok := i.(LogObjectMarshaler); ok {
return e.Object(key, obj)
}
e.buf = enc.AppendInterface(enc.AppendKey(e.buf, key), i)
return e
} | go | func (e *Event) Interface(key string, i interface{}) *Event {
if e == nil {
return e
}
if obj, ok := i.(LogObjectMarshaler); ok {
return e.Object(key, obj)
}
e.buf = enc.AppendInterface(enc.AppendKey(e.buf, key), i)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"Interface",
"(",
"key",
"string",
",",
"i",
"interface",
"{",
"}",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"if",
"obj",
",",
"ok",
":=",
"i",
".",
"(",
"LogObj... | // Interface adds the field key with i marshaled using reflection. | [
"Interface",
"adds",
"the",
"field",
"key",
"with",
"i",
"marshaled",
"using",
"reflection",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L651-L660 |
25,383 | rs/zerolog | event.go | IPAddr | func (e *Event) IPAddr(key string, ip net.IP) *Event {
if e == nil {
return e
}
e.buf = enc.AppendIPAddr(enc.AppendKey(e.buf, key), ip)
return e
} | go | func (e *Event) IPAddr(key string, ip net.IP) *Event {
if e == nil {
return e
}
e.buf = enc.AppendIPAddr(enc.AppendKey(e.buf, key), ip)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"IPAddr",
"(",
"key",
"string",
",",
"ip",
"net",
".",
"IP",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"e",
".",
"buf",
"=",
"enc",
".",
"AppendIPAddr",
"(",
"enc... | // IPAddr adds IPv4 or IPv6 Address to the event | [
"IPAddr",
"adds",
"IPv4",
"or",
"IPv6",
"Address",
"to",
"the",
"event"
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L680-L686 |
25,384 | rs/zerolog | event.go | MACAddr | func (e *Event) MACAddr(key string, ha net.HardwareAddr) *Event {
if e == nil {
return e
}
e.buf = enc.AppendMACAddr(enc.AppendKey(e.buf, key), ha)
return e
} | go | func (e *Event) MACAddr(key string, ha net.HardwareAddr) *Event {
if e == nil {
return e
}
e.buf = enc.AppendMACAddr(enc.AppendKey(e.buf, key), ha)
return e
} | [
"func",
"(",
"e",
"*",
"Event",
")",
"MACAddr",
"(",
"key",
"string",
",",
"ha",
"net",
".",
"HardwareAddr",
")",
"*",
"Event",
"{",
"if",
"e",
"==",
"nil",
"{",
"return",
"e",
"\n",
"}",
"\n",
"e",
".",
"buf",
"=",
"enc",
".",
"AppendMACAddr",
... | // MACAddr adds MAC address to the event | [
"MACAddr",
"adds",
"MAC",
"address",
"to",
"the",
"event"
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/event.go#L698-L704 |
25,385 | rs/zerolog | internal/json/bytes.go | AppendHex | func (Encoder) AppendHex(dst, s []byte) []byte {
dst = append(dst, '"')
for _, v := range s {
dst = append(dst, hex[v>>4], hex[v&0x0f])
}
return append(dst, '"')
} | go | func (Encoder) AppendHex(dst, s []byte) []byte {
dst = append(dst, '"')
for _, v := range s {
dst = append(dst, hex[v>>4], hex[v&0x0f])
}
return append(dst, '"')
} | [
"func",
"(",
"Encoder",
")",
"AppendHex",
"(",
"dst",
",",
"s",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"dst",
"=",
"append",
"(",
"dst",
",",
"'\"'",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"s",
"{",
"dst",
"=",
"append",
"(",
... | // AppendHex encodes the input bytes to a hex string and appends
// the encoded string to the input byte slice.
//
// The operation loops though each byte and encodes it as hex using
// the hex lookup table. | [
"AppendHex",
"encodes",
"the",
"input",
"bytes",
"to",
"a",
"hex",
"string",
"and",
"appends",
"the",
"encoded",
"string",
"to",
"the",
"input",
"byte",
"slice",
".",
"The",
"operation",
"loops",
"though",
"each",
"byte",
"and",
"encodes",
"it",
"as",
"hex... | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/internal/json/bytes.go#L23-L29 |
25,386 | rs/zerolog | array.go | Arr | func Arr() *Array {
a := arrayPool.Get().(*Array)
a.buf = a.buf[:0]
return a
} | go | func Arr() *Array {
a := arrayPool.Get().(*Array)
a.buf = a.buf[:0]
return a
} | [
"func",
"Arr",
"(",
")",
"*",
"Array",
"{",
"a",
":=",
"arrayPool",
".",
"Get",
"(",
")",
".",
"(",
"*",
"Array",
")",
"\n",
"a",
".",
"buf",
"=",
"a",
".",
"buf",
"[",
":",
"0",
"]",
"\n",
"return",
"a",
"\n",
"}"
] | // Arr creates an array to be added to an Event or Context. | [
"Arr",
"creates",
"an",
"array",
"to",
"be",
"added",
"to",
"an",
"Event",
"or",
"Context",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L38-L42 |
25,387 | rs/zerolog | array.go | Object | func (a *Array) Object(obj LogObjectMarshaler) *Array {
e := Dict()
obj.MarshalZerologObject(e)
e.buf = enc.AppendEndMarker(e.buf)
a.buf = append(enc.AppendArrayDelim(a.buf), e.buf...)
putEvent(e)
return a
} | go | func (a *Array) Object(obj LogObjectMarshaler) *Array {
e := Dict()
obj.MarshalZerologObject(e)
e.buf = enc.AppendEndMarker(e.buf)
a.buf = append(enc.AppendArrayDelim(a.buf), e.buf...)
putEvent(e)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Object",
"(",
"obj",
"LogObjectMarshaler",
")",
"*",
"Array",
"{",
"e",
":=",
"Dict",
"(",
")",
"\n",
"obj",
".",
"MarshalZerologObject",
"(",
"e",
")",
"\n",
"e",
".",
"buf",
"=",
"enc",
".",
"AppendEndMarker",
... | // Object marshals an object that implement the LogObjectMarshaler
// interface and append append it to the array. | [
"Object",
"marshals",
"an",
"object",
"that",
"implement",
"the",
"LogObjectMarshaler",
"interface",
"and",
"append",
"append",
"it",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L61-L68 |
25,388 | rs/zerolog | array.go | Str | func (a *Array) Str(val string) *Array {
a.buf = enc.AppendString(enc.AppendArrayDelim(a.buf), val)
return a
} | go | func (a *Array) Str(val string) *Array {
a.buf = enc.AppendString(enc.AppendArrayDelim(a.buf), val)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Str",
"(",
"val",
"string",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendString",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"val",
")",
"\n",
"return",
"a",
"\... | // Str append append the val as a string to the array. | [
"Str",
"append",
"append",
"the",
"val",
"as",
"a",
"string",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L71-L74 |
25,389 | rs/zerolog | array.go | Bytes | func (a *Array) Bytes(val []byte) *Array {
a.buf = enc.AppendBytes(enc.AppendArrayDelim(a.buf), val)
return a
} | go | func (a *Array) Bytes(val []byte) *Array {
a.buf = enc.AppendBytes(enc.AppendArrayDelim(a.buf), val)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Bytes",
"(",
"val",
"[",
"]",
"byte",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendBytes",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"val",
")",
"\n",
"return"... | // Bytes append append the val as a string to the array. | [
"Bytes",
"append",
"append",
"the",
"val",
"as",
"a",
"string",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L77-L80 |
25,390 | rs/zerolog | array.go | Hex | func (a *Array) Hex(val []byte) *Array {
a.buf = enc.AppendHex(enc.AppendArrayDelim(a.buf), val)
return a
} | go | func (a *Array) Hex(val []byte) *Array {
a.buf = enc.AppendHex(enc.AppendArrayDelim(a.buf), val)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Hex",
"(",
"val",
"[",
"]",
"byte",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendHex",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"val",
")",
"\n",
"return",
... | // Hex append append the val as a hex string to the array. | [
"Hex",
"append",
"append",
"the",
"val",
"as",
"a",
"hex",
"string",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L83-L86 |
25,391 | rs/zerolog | array.go | Err | func (a *Array) Err(err error) *Array {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case LogObjectMarshaler:
e := newEvent(nil, 0)
e.buf = e.buf[:0]
e.appendObject(m)
a.buf = append(enc.AppendArrayDelim(a.buf), e.buf...)
putEvent(e)
case error:
a.buf = enc.AppendString(enc.AppendAr... | go | func (a *Array) Err(err error) *Array {
marshaled := ErrorMarshalFunc(err)
switch m := marshaled.(type) {
case LogObjectMarshaler:
e := newEvent(nil, 0)
e.buf = e.buf[:0]
e.appendObject(m)
a.buf = append(enc.AppendArrayDelim(a.buf), e.buf...)
putEvent(e)
case error:
a.buf = enc.AppendString(enc.AppendAr... | [
"func",
"(",
"a",
"*",
"Array",
")",
"Err",
"(",
"err",
"error",
")",
"*",
"Array",
"{",
"marshaled",
":=",
"ErrorMarshalFunc",
"(",
"err",
")",
"\n",
"switch",
"m",
":=",
"marshaled",
".",
"(",
"type",
")",
"{",
"case",
"LogObjectMarshaler",
":",
"e... | // Err serializes and appends the err to the array. | [
"Err",
"serializes",
"and",
"appends",
"the",
"err",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L89-L107 |
25,392 | rs/zerolog | array.go | Bool | func (a *Array) Bool(b bool) *Array {
a.buf = enc.AppendBool(enc.AppendArrayDelim(a.buf), b)
return a
} | go | func (a *Array) Bool(b bool) *Array {
a.buf = enc.AppendBool(enc.AppendArrayDelim(a.buf), b)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Bool",
"(",
"b",
"bool",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendBool",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"b",
")",
"\n",
"return",
"a",
"\n",
"... | // Bool append append the val as a bool to the array. | [
"Bool",
"append",
"append",
"the",
"val",
"as",
"a",
"bool",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L110-L113 |
25,393 | rs/zerolog | array.go | Int | func (a *Array) Int(i int) *Array {
a.buf = enc.AppendInt(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Int(i int) *Array {
a.buf = enc.AppendInt(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Int",
"(",
"i",
"int",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendInt",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
"}"
... | // Int append append i as a int to the array. | [
"Int",
"append",
"append",
"i",
"as",
"a",
"int",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L116-L119 |
25,394 | rs/zerolog | array.go | Int8 | func (a *Array) Int8(i int8) *Array {
a.buf = enc.AppendInt8(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Int8(i int8) *Array {
a.buf = enc.AppendInt8(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Int8",
"(",
"i",
"int8",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendInt8",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
"... | // Int8 append append i as a int8 to the array. | [
"Int8",
"append",
"append",
"i",
"as",
"a",
"int8",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L122-L125 |
25,395 | rs/zerolog | array.go | Int16 | func (a *Array) Int16(i int16) *Array {
a.buf = enc.AppendInt16(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Int16(i int16) *Array {
a.buf = enc.AppendInt16(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Int16",
"(",
"i",
"int16",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendInt16",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
... | // Int16 append append i as a int16 to the array. | [
"Int16",
"append",
"append",
"i",
"as",
"a",
"int16",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L128-L131 |
25,396 | rs/zerolog | array.go | Int32 | func (a *Array) Int32(i int32) *Array {
a.buf = enc.AppendInt32(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Int32(i int32) *Array {
a.buf = enc.AppendInt32(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Int32",
"(",
"i",
"int32",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendInt32",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
... | // Int32 append append i as a int32 to the array. | [
"Int32",
"append",
"append",
"i",
"as",
"a",
"int32",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L134-L137 |
25,397 | rs/zerolog | array.go | Int64 | func (a *Array) Int64(i int64) *Array {
a.buf = enc.AppendInt64(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Int64(i int64) *Array {
a.buf = enc.AppendInt64(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Int64",
"(",
"i",
"int64",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendInt64",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
... | // Int64 append append i as a int64 to the array. | [
"Int64",
"append",
"append",
"i",
"as",
"a",
"int64",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L140-L143 |
25,398 | rs/zerolog | array.go | Uint | func (a *Array) Uint(i uint) *Array {
a.buf = enc.AppendUint(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Uint(i uint) *Array {
a.buf = enc.AppendUint(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Uint",
"(",
"i",
"uint",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendUint",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
"... | // Uint append append i as a uint to the array. | [
"Uint",
"append",
"append",
"i",
"as",
"a",
"uint",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L146-L149 |
25,399 | rs/zerolog | array.go | Uint8 | func (a *Array) Uint8(i uint8) *Array {
a.buf = enc.AppendUint8(enc.AppendArrayDelim(a.buf), i)
return a
} | go | func (a *Array) Uint8(i uint8) *Array {
a.buf = enc.AppendUint8(enc.AppendArrayDelim(a.buf), i)
return a
} | [
"func",
"(",
"a",
"*",
"Array",
")",
"Uint8",
"(",
"i",
"uint8",
")",
"*",
"Array",
"{",
"a",
".",
"buf",
"=",
"enc",
".",
"AppendUint8",
"(",
"enc",
".",
"AppendArrayDelim",
"(",
"a",
".",
"buf",
")",
",",
"i",
")",
"\n",
"return",
"a",
"\n",
... | // Uint8 append append i as a uint8 to the array. | [
"Uint8",
"append",
"append",
"i",
"as",
"a",
"uint8",
"to",
"the",
"array",
"."
] | acf3980132bfcdc48638724e6e3d9e5749b85999 | https://github.com/rs/zerolog/blob/acf3980132bfcdc48638724e6e3d9e5749b85999/array.go#L152-L155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.