fields

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any added in v1.1.0

func Any(key string, val interface{}) zap.Field

Any is a wrappers of zap.Any.

func Binary added in v1.1.0

func Binary(key string, val []byte) zap.Field

Binary is a wrappers of zap.Binary.

func Bool added in v1.1.0

func Bool(key string, val bool) zap.Field

Bool is a wrappers of zap.Bool.

func Bools added in v1.1.0

func Bools(key string, val []bool) zap.Field

Bools is a wrappers of zap.Bools.

func ByteString added in v1.1.0

func ByteString(key string, val []byte) zap.Field

ByteString is a wrappers of zap.ByteString.

func ByteStrings added in v1.1.0

func ByteStrings(key string, val [][]byte) zap.Field

ByteStrings is a wrappers of zap.ByteStrings.

func Duration added in v1.1.0

func Duration(key string, val time.Duration) zap.Field

Duration is a wrappers of zap.Duration.

func Durations added in v1.1.0

func Durations(key string, val []time.Duration) zap.Field

Durations is a wrappers of zap.Durations.

func Error added in v1.1.0

func Error(err error) zap.Field

Error is a wrappers of zap.Error.

func Float32 added in v1.1.0

func Float32(key string, val float32) zap.Field

Float32 is a wrappers of zap.Float32.

func Float32s added in v1.1.0

func Float32s(key string, val []float32) zap.Field

Float32s is a wrappers of zap.Float32s.

func Float64 added in v1.1.0

func Float64(key string, val float64) zap.Field

Float64 is a wrappers of zap.Float64.

func Float64s added in v1.1.0

func Float64s(key string, val []float64) zap.Field

Float64s is a wrappers of zap.Float64s.

func HTTPRequest

func HTTPRequest(req *http.Request) zapcore.Field

HTTPRequest returns ECS http.request as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-http.html

func HTTPResponse

func HTTPResponse(resp *http.Response) zapcore.Field

HTTPResponse returns ECS http.response as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-http.html

func Int added in v1.1.0

func Int(key string, val int) zap.Field

Int is a wrappers of zap.Int.

func Int64 added in v1.1.0

func Int64(key string, val int64) zap.Field

Int64 is a wrappers of zap.Int64.

func NamedError added in v1.1.0

func NamedError(key string, err error) zap.Field

NamedError is a wrappers of zap.NamedError.

func Object added in v1.1.0

func Object(key string, val zapcore.ObjectMarshaler) zap.Field

Object is a wrappers of zap.Object.

func Service

func Service(name string, version string) zapcore.Field

Service returns ECS service as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-service.html

func Source

func Source(ip string, port int) zapcore.Field

Source returns ECS source as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-source.html

func String added in v1.1.0

func String(key string, val string) zap.Field

String is a wrappers of zap.String.

func Strings added in v1.1.0

func Strings(key string, val []string) zap.Field

Strings is a wrappers of zap.Strings.

func Time added in v1.1.0

func Time(key string, val time.Time) zap.Field

Time is a wrappers of zap.Time.

func Times added in v1.1.0

func Times(key string, val []time.Time) zap.Field

Times is a wrappers of zap.Times.

func URL

func URL(url *url.URL) zapcore.Field

URL returns ECS url as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-url.html

func UserAgent

func UserAgent(original string) zapcore.Field

UserAgent returns ECS user_agent as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-user_agent.html

Types

type HTTPRequestField added in v1.1.0

type HTTPRequestField struct {
	Request *http.Request
}

HTTPRequestField struct represents ECS http.request object https://www.elastic.co/guide/en/ecs/current/ecs-http.html

func (*HTTPRequestField) MarshalLogObject added in v1.1.0

func (r *HTTPRequestField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type HTTPResponseField added in v1.1.0

type HTTPResponseField struct {
	Response *http.Response
}

HTTPResponseField struct represents ECS http.response object https://www.elastic.co/guide/en/ecs/current/ecs-http.html

func (*HTTPResponseField) MarshalLogObject added in v1.1.0

func (r *HTTPResponseField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type ServiceField added in v1.1.0

type ServiceField struct {
	Name    string
	Version string
}

ServiceField struct represents ECS service object https://www.elastic.co/guide/en/ecs/current/ecs-service.html

func (*ServiceField) MarshalLogObject added in v1.1.0

func (s *ServiceField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type SourceField added in v1.1.0

type SourceField struct {
	IP   string
	Port int
}

SourceField struct represents ECS source object https://www.elastic.co/guide/en/ecs/current/ecs-source.html

func (*SourceField) MarshalLogObject added in v1.1.0

func (s *SourceField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type URLField added in v1.1.0

type URLField struct {
	URL *url.URL
}

URLField struct represents ECS url object https://www.elastic.co/guide/en/ecs/current/ecs-url.html

func (*URLField) MarshalLogObject added in v1.1.0

func (u *URLField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type UserAgentField added in v1.1.0

type UserAgentField struct {
	Original string
}

UserAgentField struct represents ECS user_agent object https://www.elastic.co/guide/en/ecs/current/ecs-user_agent.html

func (*UserAgentField) MarshalLogObject added in v1.1.0

func (u *UserAgentField) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

Jump to

Keyboard shortcuts

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