Documentation ¶
Index ¶
- Variables
- func Marshal(value any) ([]byte, error)
- type Builder
- func (pb *Builder) Reset()
- func (pb *Builder) String() string
- func (pb *Builder) WithStringBuilder(sb *strings.Builder) *Builder
- func (pb *Builder) WriteBeginArray() *Builder
- func (pb *Builder) WriteBeginBag() *Builder
- func (pb *Builder) WriteBeginTuple()
- func (pb *Builder) WriteBoolean(value bool) *Builder
- func (pb *Builder) WriteBooleanArray(values []bool) *Builder
- func (pb *Builder) WriteBooleanBag(values []bool) *Builder
- func (pb *Builder) WriteEndArray() *Builder
- func (pb *Builder) WriteEndBag() *Builder
- func (pb *Builder) WriteEndTuple()
- func (pb *Builder) WriteFloat(value float64) *Builder
- func (pb *Builder) WriteFloatArray(values []float64) *Builder
- func (pb *Builder) WriteFloatBag(values []float64) *Builder
- func (pb *Builder) WriteInteger(value int64) *Builder
- func (pb *Builder) WriteIntegerArray(values []int) *Builder
- func (pb *Builder) WriteIntegerBag(values []int) *Builder
- func (pb *Builder) WriteKey(name string) *Builder
- func (pb *Builder) WriteNull() *Builder
- func (pb *Builder) WriteString(value string) *Builder
- func (pb *Builder) WriteStringArray(values []string) *Builder
- func (pb *Builder) WriteStringBag(values []string) *Builder
- func (pb *Builder) WriteUInteger(value uint64) *Builder
- func (pb *Builder) WriteUIntegerArray(values []uint) *Builder
- func (pb *Builder) WriteUIntegerBag(values []uint) *Builder
- type Encoder
- type Marshaler
- type TimeMarshaler
Constants ¶
This section is empty.
Variables ¶
var DefaultTimeMarshaler = func(t time.Time) any { return t.Format(time.RFC3339Nano) }
DefaultTimeMarshaler converts a time.Time into a string using the RFC3339Nano format.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewPartiQLBuilder ¶
func NewPartiQLBuilder() *Builder
func (*Builder) WithStringBuilder ¶
func (*Builder) WriteBeginArray ¶
func (*Builder) WriteBeginBag ¶
func (*Builder) WriteBeginTuple ¶
func (pb *Builder) WriteBeginTuple()
func (*Builder) WriteBoolean ¶
func (*Builder) WriteBooleanArray ¶
func (*Builder) WriteBooleanBag ¶
func (*Builder) WriteEndArray ¶
func (*Builder) WriteEndBag ¶
func (*Builder) WriteEndTuple ¶
func (pb *Builder) WriteEndTuple()
func (*Builder) WriteFloat ¶
func (*Builder) WriteFloatArray ¶
func (*Builder) WriteFloatBag ¶
func (*Builder) WriteInteger ¶
func (*Builder) WriteIntegerArray ¶
func (*Builder) WriteIntegerBag ¶
func (*Builder) WriteString ¶
func (*Builder) WriteStringArray ¶
func (*Builder) WriteStringBag ¶
func (*Builder) WriteUInteger ¶
func (*Builder) WriteUIntegerArray ¶
func (*Builder) WriteUIntegerBag ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a PartiQL encoder that can be configured.
func NewEncoder ¶
func NewEncoder() *Encoder
NewEncoder returns a new PartiQL encoder with default settings.
func (*Encoder) MarshalCollection ¶
MarshalCollection returns the PartiQL encoding of value as a collection. It will force the value to be encoded as a Bag if asBag is true.
func (*Encoder) WithTagNames ¶
WithTagNames sets the tag names to be used by the encoder. It must contain at least one tag name.
func (*Encoder) WithTimeMarshaler ¶
func (e *Encoder) WithTimeMarshaler(marshaler TimeMarshaler) *Encoder
WithTimeMarshaler sets the time marshaler to be used by the encoder.
type Marshaler ¶
Marshaler is the interface implemented by objects that can marshal themselves into PartiQL.
type TimeMarshaler ¶
TimeMarshaler is a function that can be used to encode time.Time values into another go value to be converted into PartiQL. Check the DefaultTimeMarshaler for an example.