Documentation
¶
Index ¶
- Constants
- Variables
- func Debug(ctx context.Context, tag *Tag, fn func() []Field)
- func DumpNode(node *Node, indent int, buf *bytes.Buffer)
- func Error(ctx context.Context, tag *Tag, fields ...Field)
- func Fatal(ctx context.Context, tag *Tag, fields ...Field)
- func Info(ctx context.Context, tag *Tag, fields ...Field)
- func NewPlugin(t reflect.Type, node *Node, properties map[string]string) (reflect.Value, error)
- func Panic(ctx context.Context, tag *Tag, fields ...Field)
- func PutEvent(e *Event)
- func Record(ctx context.Context, level Level, tag *Tag, fields ...Field)
- func RefreshFile(fileName string) error
- func RefreshReader(input io.Reader, ext string) error
- func RegisterConverter[T any](fn Converter[T])
- func RegisterPlugin[T Lifecycle](name string, typ PluginType)
- func RegisterReader(r Reader, ext ...string)
- func Trace(ctx context.Context, tag *Tag, fn func() []Field)
- func Warn(ctx context.Context, tag *Tag, fields ...Field)
- func WriteFields(enc Encoder, fields []Field)
- type Appender
- type AppenderRef
- type ArrayValue
- type AsyncLoggerConfig
- type BaseAppender
- type BaseLayout
- type BoolValue
- type BoolsValue
- type ConsoleAppender
- type Converter
- type DiscardAppender
- type Encoder
- type Event
- type Field
- func Any(key string, value interface{}) Field
- func Array(key string, val ...Value) Field
- func Bool(key string, val bool) Field
- func BoolPtr(key string, val *bool) Field
- func Bools(key string, val []bool) Field
- func Float32(key string, val float32) Field
- func Float32Ptr(key string, val *float32) Field
- func Float32s(key string, val []float32) Field
- func Float64(key string, val float64) Field
- func Float64Ptr(key string, val *float64) Field
- func Float64s(key string, val []float64) Field
- func Int(key string, val int) Field
- func Int16(key string, val int16) Field
- func Int16Ptr(key string, val *int16) Field
- func Int16s(key string, val []int16) Field
- func Int32(key string, val int32) Field
- func Int32Ptr(key string, val *int32) Field
- func Int32s(key string, val []int32) Field
- func Int64(key string, val int64) Field
- func Int64Ptr(key string, val *int64) Field
- func Int64s(key string, val []int64) Field
- func Int8(key string, val int8) Field
- func Int8Ptr(key string, val *int8) Field
- func Int8s(key string, val []int8) Field
- func IntPtr(key string, val *int) Field
- func Ints(key string, val []int) Field
- func Msg(msg string) Field
- func Msgf(format string, args ...any) Field
- func Nil(key string) Field
- func Object(key string, fields ...Field) Field
- func Reflect(key string, val interface{}) Field
- func String(key string, val string) Field
- func StringPtr(key string, val *string) Field
- func Strings(key string, val []string) Field
- func Uint(key string, val uint) Field
- func Uint16(key string, val uint16) Field
- func Uint16Ptr(key string, val *uint16) Field
- func Uint16s(key string, val []uint16) Field
- func Uint32(key string, val uint32) Field
- func Uint32Ptr(key string, val *uint32) Field
- func Uint32s(key string, val []uint32) Field
- func Uint64(key string, val uint64) Field
- func Uint64Ptr(key string, val *uint64) Field
- func Uint64s(key string, val []uint64) Field
- func Uint8(key string, val uint8) Field
- func Uint8Ptr(key string, val *uint8) Field
- func Uint8s(key string, val []uint8) Field
- func UintPtr(key string, val *uint) Field
- func Uints(key string, val []uint) Field
- type FileAppender
- type Float32sValue
- type Float64Value
- type Float64sValue
- type HumanizeBytes
- type Int16sValue
- type Int32sValue
- type Int64Value
- type Int64sValue
- type Int8sValue
- type IntsValue
- type JSONEncoder
- func (enc *JSONEncoder) AppendArrayBegin()
- func (enc *JSONEncoder) AppendArrayEnd()
- func (enc *JSONEncoder) AppendBool(v bool)
- func (enc *JSONEncoder) AppendEncoderBegin()
- func (enc *JSONEncoder) AppendEncoderEnd()
- func (enc *JSONEncoder) AppendFloat64(v float64)
- func (enc *JSONEncoder) AppendInt64(v int64)
- func (enc *JSONEncoder) AppendKey(key string)
- func (enc *JSONEncoder) AppendObjectBegin()
- func (enc *JSONEncoder) AppendObjectEnd()
- func (enc *JSONEncoder) AppendReflect(v interface{})
- func (enc *JSONEncoder) AppendString(v string)
- func (enc *JSONEncoder) AppendUint64(u uint64)
- func (enc *JSONEncoder) Reset()
- type JSONLayout
- type Layout
- type Level
- type Lifecycle
- type Logger
- type LoggerConfig
- type Node
- type ObjectValue
- type Plugin
- type PluginTag
- type PluginType
- type Reader
- type ReflectValue
- type StringValue
- type StringsValue
- type Tag
- type TextEncoder
- func (enc *TextEncoder) AppendArrayBegin()
- func (enc *TextEncoder) AppendArrayEnd()
- func (enc *TextEncoder) AppendBool(v bool)
- func (enc *TextEncoder) AppendEncoderBegin()
- func (enc *TextEncoder) AppendEncoderEnd()
- func (enc *TextEncoder) AppendFloat64(v float64)
- func (enc *TextEncoder) AppendInt64(v int64)
- func (enc *TextEncoder) AppendKey(key string)
- func (enc *TextEncoder) AppendObjectBegin()
- func (enc *TextEncoder) AppendObjectEnd()
- func (enc *TextEncoder) AppendReflect(v interface{})
- func (enc *TextEncoder) AppendString(v string)
- func (enc *TextEncoder) AppendUint64(v uint64)
- type TextLayout
- type Uint16sValue
- type Uint32sValue
- type Uint64Value
- type Uint64sValue
- type Uint8sValue
- type UintsValue
- type Value
- type XMLReader
Constants ¶
const MsgKey = "msg"
Variables ¶
var FieldsFromContext func(ctx context.Context) []Field
FieldsFromContext can be set to extract structured fields from the context (e.g., trace IDs, user IDs).
var OnDropEvent func(*Event)
OnDropEvent is a callback function that is called when an event is dropped.
var StringFromContext func(ctx context.Context) string
StringFromContext can be set to extract a string from the context.
var TimeNow func(ctx context.Context) time.Time
TimeNow is a function that can be overridden to provide custom timestamp behavior (e.g., for testing).
Functions ¶
func Record ¶
Record is the core function that handles publishing log events. It checks the logger level, captures caller information, gathers context fields, and sends the log event to the logger.
func RefreshFile ¶
RefreshFile loads a logging configuration from a file by its name.
func RefreshReader ¶
RefreshReader reads the configuration from an io.Reader using the reader for the given extension.
func RegisterConverter ¶
RegisterConverter Registers a converter for a specific type T.
func RegisterPlugin ¶
func RegisterPlugin[T Lifecycle](name string, typ PluginType)
RegisterPlugin Registers a plugin with a given name and type.
func RegisterReader ¶
RegisterReader registers a Reader for one or more file extensions. This allows dynamic selection of parsers based on file type.
func WriteFields ¶
WriteFields writes a slice of Field objects to the encoder.
Types ¶
type Appender ¶
type Appender interface {
Lifecycle // Appenders must be startable and stoppable
Append(e *Event) // Handles writing a log event
}
Appender is an interface that defines components that handle log output.
type AppenderRef ¶
type AppenderRef struct {
Ref string `PluginAttribute:"ref"`
// contains filtered or unexported fields
}
AppenderRef represents a reference to an appender by name, which will be resolved and bound later.
func (*AppenderRef) Start ¶
func (a *AppenderRef) Start() error
func (*AppenderRef) Stop ¶
func (a *AppenderRef) Stop()
type ArrayValue ¶
type ArrayValue []Value
ArrayValue represents a slice of Value carried by Field.
func (ArrayValue) Encode ¶
func (v ArrayValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type AsyncLoggerConfig ¶
type AsyncLoggerConfig struct {
BufferSize int `PluginAttribute:"bufferSize,default=10000"`
// contains filtered or unexported fields
}
AsyncLoggerConfig is an asynchronous logger configuration. It buffers log events and processes them in a separate goroutine.
func (*AsyncLoggerConfig) Start ¶
func (c *AsyncLoggerConfig) Start() error
Start initializes the asynchronous logger and starts its worker goroutine.
func (*AsyncLoggerConfig) Stop ¶
func (c *AsyncLoggerConfig) Stop()
Stop shuts down the asynchronous logger and waits for the worker goroutine to finish.
type BaseAppender ¶
type BaseAppender struct {
Name string `PluginAttribute:"name"` // Appender name from config
Layout Layout `PluginElement:"Layout"` // Layout defines how logs are formatted
}
BaseAppender provides shared configuration and behavior for appenders.
func (*BaseAppender) Append ¶
func (c *BaseAppender) Append(e *Event)
func (*BaseAppender) Start ¶
func (c *BaseAppender) Start() error
func (*BaseAppender) Stop ¶
func (c *BaseAppender) Stop()
type BaseLayout ¶
type BaseLayout struct {
BufferSize HumanizeBytes `PluginAttribute:"bufferSize,default=1MB"`
FileLineLength int `PluginAttribute:"fileLineLength,default=48"`
// contains filtered or unexported fields
}
BaseLayout is the base class for Layout.
func (*BaseLayout) GetBuffer ¶
func (c *BaseLayout) GetBuffer() *bytes.Buffer
GetBuffer returns a buffer that can be used to format the log event.
func (*BaseLayout) GetFileLine ¶
func (c *BaseLayout) GetFileLine(e *Event) string
GetFileLine returns the file name and line number of the log event.
func (*BaseLayout) PutBuffer ¶
func (c *BaseLayout) PutBuffer(buf *bytes.Buffer)
PutBuffer puts a buffer back into the pool.
func (*BaseLayout) Start ¶
func (c *BaseLayout) Start() error
func (*BaseLayout) Stop ¶
func (c *BaseLayout) Stop()
type BoolsValue ¶
type BoolsValue []bool
BoolsValue represents a slice of bool carried by Field.
func (BoolsValue) Encode ¶
func (v BoolsValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type ConsoleAppender ¶
type ConsoleAppender struct {
BaseAppender
}
ConsoleAppender writes formatted log events to stdout.
func (*ConsoleAppender) Append ¶
func (c *ConsoleAppender) Append(e *Event)
Append formats the event and writes it to standard output.
type DiscardAppender ¶
type DiscardAppender struct {
BaseAppender
}
DiscardAppender ignores all log events (no output).
type Encoder ¶
type Encoder interface {
AppendEncoderBegin()
AppendEncoderEnd()
AppendObjectBegin()
AppendObjectEnd()
AppendArrayBegin()
AppendArrayEnd()
AppendKey(key string)
AppendBool(v bool)
AppendInt64(v int64)
AppendUint64(v uint64)
AppendFloat64(v float64)
AppendString(v string)
AppendReflect(v interface{})
}
Encoder is an interface that defines methods for appending structured data elements.
type Event ¶
type Event struct {
Level Level // The severity level of the log (e.g., INFO, ERROR, DEBUG)
Time time.Time // The timestamp when the event occurred
File string // The source file where the log was triggered
Line int // The line number in the source file
Tag string // A tag used to categorize the log (e.g., subsystem name)
Fields []Field // Custom fields provided specifically for this log event
CtxString string // The string representation of the context
CtxFields []Field // Additional fields derived from the context (e.g., request ID, user ID)
}
Event provides contextual information about a log message.
type Field ¶
Field represents a structured log field with a key and a value.
func Any ¶
Any creates a Field from a value of any type by inspecting its dynamic type. It dispatches to the appropriate typed constructor based on the actual value. If the type is not explicitly handled, it falls back to using Reflect.
func Float32Ptr ¶
Float32Ptr creates a Field from a *float32, or returns Nil if pointer is nil.
func Float64Ptr ¶
Float64Ptr creates a Field from a *float64, or returns Nil if pointer is nil.
func Object ¶
Object creates a Field containing a variadic slice of Fields, treated as a nested object.
type FileAppender ¶
type FileAppender struct {
BaseAppender
FileName string `PluginAttribute:"fileName"`
// contains filtered or unexported fields
}
FileAppender writes formatted log events to a specified file.
func (*FileAppender) Append ¶
func (c *FileAppender) Append(e *Event)
Append formats the log event and writes it to the file.
func (*FileAppender) Start ¶
func (c *FileAppender) Start() error
type Float32sValue ¶
type Float32sValue []float32
Float32sValue represents a slice of float32 carried by Field.
func (Float32sValue) Encode ¶
func (v Float32sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Float64Value ¶
type Float64Value float64
Float64Value represents a float64 carried by Field.
func (Float64Value) Encode ¶
func (v Float64Value) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Float64sValue ¶
type Float64sValue []float64
Float64sValue represents a slice of float64 carried by Field.
func (Float64sValue) Encode ¶
func (v Float64sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type HumanizeBytes ¶
type HumanizeBytes int
func ParseHumanizeBytes ¶
func ParseHumanizeBytes(s string) (HumanizeBytes, error)
ParseHumanizeBytes converts a human-readable byte string to an integer.
type Int16sValue ¶
type Int16sValue []int16
Int16sValue represents a slice of int16 carried by Field.
func (Int16sValue) Encode ¶
func (v Int16sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Int32sValue ¶
type Int32sValue []int32
Int32sValue represents a slice of int32 carried by Field.
func (Int32sValue) Encode ¶
func (v Int32sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Int64Value ¶
type Int64Value int64
Int64Value represents an int64 carried by Field.
func (Int64Value) Encode ¶
func (v Int64Value) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Int64sValue ¶
type Int64sValue []int64
Int64sValue represents a slice of int64 carried by Field.
func (Int64sValue) Encode ¶
func (v Int64sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Int8sValue ¶
type Int8sValue []int8
Int8sValue represents a slice of int8 carried by Field.
func (Int8sValue) Encode ¶
func (v Int8sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type JSONEncoder ¶
type JSONEncoder struct {
// contains filtered or unexported fields
}
JSONEncoder is a simple JSON encoder.
func NewJSONEncoder ¶
func NewJSONEncoder(buf *bytes.Buffer) *JSONEncoder
NewJSONEncoder creates a new JSONEncoder.
func (*JSONEncoder) AppendArrayBegin ¶
func (enc *JSONEncoder) AppendArrayBegin()
AppendArrayBegin writes the beginning of a JSON array.
func (*JSONEncoder) AppendArrayEnd ¶
func (enc *JSONEncoder) AppendArrayEnd()
AppendArrayEnd writes the end of a JSON array.
func (*JSONEncoder) AppendBool ¶
func (enc *JSONEncoder) AppendBool(v bool)
AppendBool writes a boolean value.
func (*JSONEncoder) AppendEncoderBegin ¶
func (enc *JSONEncoder) AppendEncoderBegin()
AppendEncoderBegin writes the start of an encoder section.
func (*JSONEncoder) AppendEncoderEnd ¶
func (enc *JSONEncoder) AppendEncoderEnd()
AppendEncoderEnd writes the end of an encoder section.
func (*JSONEncoder) AppendFloat64 ¶
func (enc *JSONEncoder) AppendFloat64(v float64)
AppendFloat64 writes a float64 value.
func (*JSONEncoder) AppendInt64 ¶
func (enc *JSONEncoder) AppendInt64(v int64)
AppendInt64 writes an int64 value.
func (*JSONEncoder) AppendKey ¶
func (enc *JSONEncoder) AppendKey(key string)
AppendKey writes a JSON key.
func (*JSONEncoder) AppendObjectBegin ¶
func (enc *JSONEncoder) AppendObjectBegin()
AppendObjectBegin writes the beginning of a JSON object.
func (*JSONEncoder) AppendObjectEnd ¶
func (enc *JSONEncoder) AppendObjectEnd()
AppendObjectEnd writes the end of a JSON object.
func (*JSONEncoder) AppendReflect ¶
func (enc *JSONEncoder) AppendReflect(v interface{})
AppendReflect marshals any Go value into JSON and appends it.
func (*JSONEncoder) AppendString ¶
func (enc *JSONEncoder) AppendString(v string)
AppendString writes a string value with proper escaping.
func (*JSONEncoder) AppendUint64 ¶
func (enc *JSONEncoder) AppendUint64(u uint64)
AppendUint64 writes an uint64 value.
type JSONLayout ¶
type JSONLayout struct {
BaseLayout
}
JSONLayout formats the log event as a structured JSON object.
func (*JSONLayout) ToBytes ¶
func (c *JSONLayout) ToBytes(e *Event) []byte
ToBytes converts a log event to a JSON-formatted byte slice.
type Level ¶
type Level int32
Level is an enumeration used to identify the severity of a logging event.
const ( NoneLevel Level = iota // No logging TraceLevel // Very detailed logging, typically for debugging at a granular level DebugLevel // Debugging information InfoLevel // General informational messages WarnLevel // Warnings that may indicate a potential problem ErrorLevel // Errors that allow the application to continue running PanicLevel // Severe issues that may lead to a panic FatalLevel // Critical issues that will cause application termination )
func ParseLevel ¶
ParseLevel converts a string (case-insensitive) into a corresponding Level value. Returns an error if the input string does not match any valid level.
type Lifecycle ¶
type Lifecycle interface {
Start() error
Stop()
}
Lifecycle Optional lifecycle interface for plugin instances.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the primary logging structure used to emit log events.
type LoggerConfig ¶
type LoggerConfig struct {
// contains filtered or unexported fields
}
LoggerConfig is a synchronous logger configuration.
type Node ¶
type Node struct {
Label string // Tag name of the XML element
Children []*Node // Child elements (nested tags)
Attributes map[string]string // Attributes of the XML element
Text string // Text content of the XML element
}
Node represents a parsed XML element with a label (tag name), child nodes, and a map of attributes.
type ObjectValue ¶
type ObjectValue []Field
ObjectValue represents a slice of Field carried by Field.
func (ObjectValue) Encode ¶
func (v ObjectValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Plugin ¶
type Plugin struct {
Name string // Name of plugin
Type PluginType // Type of plugin
Class reflect.Type // Underlying struct type
File string // Source file of registration
Line int // Line number of registration
}
Plugin metadata structure
type PluginTag ¶
type PluginTag string
type PluginType ¶
type PluginType string
PluginType Defines types of plugins supported by the logging system.
const ( PluginTypeAppender PluginType = "Appender" PluginTypeLayout PluginType = "Layout" PluginTypeAppenderRef PluginType = "AppenderRef" PluginTypeRoot PluginType = "Root" PluginTypeAsyncRoot PluginType = "AsyncRoot" PluginTypeLogger PluginType = "Logger" PluginTypeAsyncLogger PluginType = "AsyncLogger" )
type ReflectValue ¶
type ReflectValue struct {
Val interface{}
}
ReflectValue represents an interface{} carried by Field.
func (ReflectValue) Encode ¶
func (v ReflectValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type StringValue ¶
type StringValue string
StringValue represents a string carried by Field.
func (StringValue) Encode ¶
func (v StringValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type StringsValue ¶
type StringsValue []string
StringsValue represents a slice of string carried by Field.
func (StringsValue) Encode ¶
func (v StringsValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag is a struct representing a named logging tag. It holds a pointer to a Logger and a string identifier.
func GetTag ¶
GetTag creates or retrieves a Tag by name. If the tag does not exist, it is created and added to the global registry.
type TextEncoder ¶
type TextEncoder struct {
// contains filtered or unexported fields
}
TextEncoder encodes key-value pairs in a plain text format, optionally using JSON when inside objects/arrays.
func NewTextEncoder ¶
func NewTextEncoder(buf *bytes.Buffer, separator string) *TextEncoder
NewTextEncoder creates a new TextEncoder, using the specified separator.
func (*TextEncoder) AppendArrayBegin ¶
func (enc *TextEncoder) AppendArrayBegin()
AppendArrayBegin signals the start of a JSON array. Increments the depth and delegates to the JSON encoder.
func (*TextEncoder) AppendArrayEnd ¶
func (enc *TextEncoder) AppendArrayEnd()
AppendArrayEnd signals the end of a JSON array. Decrements the depth and resets the JSON encoder if back to top level.
func (*TextEncoder) AppendBool ¶
func (enc *TextEncoder) AppendBool(v bool)
AppendBool appends a boolean value, using JSON encoder if nested.
func (*TextEncoder) AppendEncoderBegin ¶
func (enc *TextEncoder) AppendEncoderBegin()
AppendEncoderBegin writes the start of an encoder section.
func (*TextEncoder) AppendEncoderEnd ¶
func (enc *TextEncoder) AppendEncoderEnd()
AppendEncoderEnd writes the end of an encoder section.
func (*TextEncoder) AppendFloat64 ¶
func (enc *TextEncoder) AppendFloat64(v float64)
AppendFloat64 appends a float64 value, using JSON encoder if nested.
func (*TextEncoder) AppendInt64 ¶
func (enc *TextEncoder) AppendInt64(v int64)
AppendInt64 appends an int64 value, using JSON encoder if nested.
func (*TextEncoder) AppendKey ¶
func (enc *TextEncoder) AppendKey(key string)
AppendKey appends a key for a key-value pair. If inside a JSON structure, the key is handled by the JSON encoder. Otherwise, it's written directly with proper separator handling.
func (*TextEncoder) AppendObjectBegin ¶
func (enc *TextEncoder) AppendObjectBegin()
AppendObjectBegin signals the start of a JSON object. Increments the depth and delegates to the JSON encoder.
func (*TextEncoder) AppendObjectEnd ¶
func (enc *TextEncoder) AppendObjectEnd()
AppendObjectEnd signals the end of a JSON object. Decrements the depth and resets the JSON encoder if back to top level.
func (*TextEncoder) AppendReflect ¶
func (enc *TextEncoder) AppendReflect(v interface{})
AppendReflect uses reflection to marshal any value as JSON. If nested, delegates to JSON encoder.
func (*TextEncoder) AppendString ¶
func (enc *TextEncoder) AppendString(v string)
AppendString appends a string value, using JSON encoder if nested.
func (*TextEncoder) AppendUint64 ¶
func (enc *TextEncoder) AppendUint64(v uint64)
AppendUint64 appends a uint64 value, using JSON encoder if nested.
type TextLayout ¶
type TextLayout struct {
BaseLayout
}
TextLayout formats the log event as a human-readable text string.
func (*TextLayout) ToBytes ¶
func (c *TextLayout) ToBytes(e *Event) []byte
ToBytes converts a log event to a formatted plain-text line.
type Uint16sValue ¶
type Uint16sValue []uint16
Uint16sValue represents a slice of uint16 carried by Field.
func (Uint16sValue) Encode ¶
func (v Uint16sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Uint32sValue ¶
type Uint32sValue []uint32
Uint32sValue represents a slice of uint32 carried by Field.
func (Uint32sValue) Encode ¶
func (v Uint32sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Uint64Value ¶
type Uint64Value uint64
Uint64Value represents an uint64 carried by Field.
func (Uint64Value) Encode ¶
func (v Uint64Value) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Uint64sValue ¶
type Uint64sValue []uint64
Uint64sValue represents a slice of uint64 carried by Field.
func (Uint64sValue) Encode ¶
func (v Uint64sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Uint8sValue ¶
type Uint8sValue []uint8
Uint8sValue represents a slice of uint8 carried by Field.
func (Uint8sValue) Encode ¶
func (v Uint8sValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type UintsValue ¶
type UintsValue []uint
UintsValue represents a slice of uint carried by Field.
func (UintsValue) Encode ¶
func (v UintsValue) Encode(enc Encoder)
Encode encodes the data represented by v to an Encoder.
type Value ¶
type Value interface {
Encode(enc Encoder)
}
Value is an interface for types that can encode themselves using an Encoder.