Documentation
¶
Index ¶
- Constants
- Variables
- func WriteField[T any](w writer.FieldWriter, value T, write writer.WriteFunc[T]) error
- type Bytes
- type FieldWriter
- type GetFuncErr
- type Kind
- type List
- type ListWriter
- type Message
- type MessageListWriter
- type MessageType
- type MessageWriter
- type ParseFuncErr
- type String
- type TypedList
- func GetTypedList[T any](b []byte, get GetFuncErr[T]) TypedList[T]
- func GetTypedListErr[T any](b []byte, get GetFuncErr[T]) (_ TypedList[T], size int, err error)
- func NewTypedList[T any](list List, get GetFuncErr[T]) TypedList[T]
- func ParseTypedList[T any](b []byte, get GetFuncErr[T]) (_ TypedList[T], size int, err error)
- type Value
- type ValueListWriter
- type ValueWriter
- type WriteFunc
- type Writer
Constants ¶
const ( KindUndefined = format.KindUndefined KindBool = format.KindBool KindTrue = format.KindTrue KindFalse = format.KindFalse KindByte = format.KindByte KindInt16 = format.KindInt16 KindInt32 = format.KindInt32 KindInt64 = format.KindInt64 KindUint16 = format.KindUint16 KindUint32 = format.KindUint32 KindUint64 = format.KindUint64 KindFloat32 = format.KindFloat32 KindFloat64 = format.KindFloat64 KindBin64 = format.KindBin64 KindBin128 = format.KindBin128 KindBin192 = format.KindBin192 KindBin256 = format.KindBin256 KindBytes = format.KindBytes KindString = format.KindString KindList = format.KindList KindListBig = format.KindListBig KindMessage = format.KindMessage KindMessageBig = format.KindMessageBig KindStruct = format.KindStruct )
Variables ¶
var ( EncodeBool = encode.EncodeBool EncodeByte = encode.EncodeByte EncodeBin64 = encode.EncodeBin64 EncodeBin128 = encode.EncodeBin128 EncodeBin128Bytes = encode.EncodeBin128Bytes EncodeBin192 = encode.EncodeBin192 EncodeBin256 = encode.EncodeBin256 EncodeBytes = encode.EncodeBytes EncodeFloat32 = encode.EncodeFloat32 EncodeFloat64 = encode.EncodeFloat64 EncodeInt16 = encode.EncodeInt16 EncodeInt32 = encode.EncodeInt32 EncodeInt64 = encode.EncodeInt64 EncodeString = encode.EncodeString EncodeStruct = encode.EncodeStruct EncodeUint16 = encode.EncodeUint16 EncodeUint32 = encode.EncodeUint32 EncodeUint64 = encode.EncodeUint64 )
var ( DecodeKind = encode.DecodeKind DecodeKindSize = encode.DecodeKindSize DecodeBool = encode.DecodeBool DecodeByte = encode.DecodeByte DecodeBin64 = encode.DecodeBin64 DecodeBin128 = encode.DecodeBin128 DecodeBin192 = encode.DecodeBin192 DecodeBin256 = encode.DecodeBin256 DecodeBytes = encode.DecodeBytes DecodeFloat32 = encode.DecodeFloat32 DecodeFloat64 = encode.DecodeFloat64 DecodeInt16 = encode.DecodeInt16 DecodeInt32 = encode.DecodeInt32 DecodeInt64 = encode.DecodeInt64 DecodeString = encode.DecodeString DecodeStringClone = encode.DecodeStringClone DecodeStruct = encode.DecodeStruct DecodeUint16 = encode.DecodeUint16 DecodeUint32 = encode.DecodeUint32 DecodeUint64 = encode.DecodeUint64 )
Functions ¶
func WriteField ¶
WriteField writes a generic field using the given encode function.
Types ¶
type Bytes ¶
Bytes is a baseproto byte slice backed by a buffer. Clone it if you need to keep it around.
type FieldWriter ¶
type FieldWriter = writer.FieldWriter
type GetFuncErr ¶
type GetFuncErr[T any] = values.GetFuncErr[T]
GetFuncErr is a function type for decoding list elements.
type List ¶
List is a raw list of elements.
func GetList ¶
GetList gets and returns a list from bytes, or an empty list on error. The method decodes the list table, but not the elements, see ParseList.
func GetListErr ¶
GetListErr gets and returns a list from bytes, or an error. The method decodes the list table, but not the elements, see ParseList.
type ListWriter ¶
type ListWriter = writer.ListWriter
ListWriter is a raw list writer.
func NewListWriter ¶
func NewListWriter() ListWriter
NewListWriter returns a new list writer with a new empty buffer.
The writer is released on end.
func NewListWriterBuffer ¶
func NewListWriterBuffer(buf buffer.Buffer) ListWriter
NewListWriterBuffer returns a new list writer with the given buffer.
The writer is freed on end.
type Message ¶
Message is a raw message.
func GetMessage ¶
GetMessage gets and returns a message from bytes, or an empty message on error. The method decodes the message table, but not the fields, see ParseMessage.
func GetMessageErr ¶
GetMessageErr gets and returns a message from bytes, or an error. The method decodes the message table, but not the fields, see ParseMessage.
type MessageListWriter ¶
type MessageListWriter[T any] = writer.MessageListWriter[T]
MessageListWriter writes a list of messages.
func NewMessageListWriter ¶
func NewMessageListWriter[T any](w ListWriter, next func(w MessageWriter) T) MessageListWriter[T]
NewMessageListWriter returns a new message list writer.
type MessageType ¶
type MessageType = values.MessageType
MessageType is a type implemented by generated messages.
type MessageWriter ¶
type MessageWriter = writer.MessageWriter
func NewMessageWriter ¶
func NewMessageWriter() MessageWriter
NewMessageWriter returns a new message writer with a new empty buffer.
The writer is released on end.
func NewMessageWriterBuffer ¶
func NewMessageWriterBuffer(buf buffer.Buffer) MessageWriter
NewMessageWriterBuffer returns a new message writer with the given buffer.
The writer is freed on end.
type ParseFuncErr ¶
type ParseFuncErr[T any] = values.ParseFuncErr[T]
ParseFuncErr is a function type for parsing values.
type String ¶
String is a baseproto string backed by a buffer. Clone it if you need to keep it around.
type TypedList ¶
TypedList is a typed list of elements.
func GetTypedList ¶
func GetTypedList[T any](b []byte, get GetFuncErr[T]) TypedList[T]
GetTypedList gets and returns a value list, or an empty list on error.
func GetTypedListErr ¶
GetTypedListErr gets and returns a value list, or an error.
func NewTypedList ¶
func NewTypedList[T any](list List, get GetFuncErr[T]) TypedList[T]
NewTypedList returns a new value list.
func ParseTypedList ¶
ParseTypedList decodes, recursively validates and returns a list.
type Value ¶
Value is a raw binary value.
func GetValue ¶
GetValue gets and returns a value from bytes, or nil on error.
The method only checks the type, but does not recursively parse the value. See ParseValue for recursive parsing.
func GetValueErr ¶
GetValueErr gets and returns a value from bytes, or an error.
The method only checks the type, but does not recursively parse the value. See ParseValue for recursive parsing.
type ValueListWriter ¶
type ValueListWriter[T any] = writer.ValueListWriter[T]
ValueListWriter writes a list of primitive values.
func NewValueListWriter ¶
func NewValueListWriter[T any](w ListWriter, write writer.WriteFunc[T]) (_ ValueListWriter[T])
NewValueListWriter returns a new value list writer.
type ValueWriter ¶
type ValueWriter = writer.ValueWriter
func NewValueWriter ¶
func NewValueWriter() ValueWriter
NewValueWriter returns a new value writer with a new empty buffer.
The writer is released on end.
func NewValueWriterBuffer ¶
func NewValueWriterBuffer(buf buffer.Buffer) ValueWriter
NewValueWriterBuffer returns a new value writer with the given buffer.
The writer is freed on end.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
baseprotoc
command
|
|
|
internal/parser
Code generated by goyacc -l -v grammar.out -o grammar.go grammar.y.
|
Code generated by goyacc -l -v grammar.out -o grammar.go grammar.y. |
|
internal
|
|
|
proto
|
|