wire

package
v0.0.0-...-6fcdc86 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFormat = errors.New("Protocol error")
View Source
var ErrIO = errors.New("I/O error")
View Source
var Null = &null{}
View Source
var OK = &String{Value: "OK"}

Functions

This section is empty.

Types

type Array

type Array struct {
	Values []Value
}

func NewArray

func NewArray(a []Value) *Array

func (*Array) Name

func (a *Array) Name() string

func (*Array) WriteTo

func (a *Array) WriteTo(w io.Writer) error

type Blob

type Blob struct {
	Data []byte
}

func NewBlob

func NewBlob(data []byte) *Blob

func (*Blob) Name

func (b *Blob) Name() string

func (*Blob) WriteTo

func (s *Blob) WriteTo(w io.Writer) (err error)

type Bool

type Bool struct {
	Value bool
}

func NewBoolean

func NewBoolean(val bool) *Bool

func (*Bool) Name

func (b *Bool) Name() string

func (*Bool) WriteTo

func (b *Bool) WriteTo(w io.Writer) error

type Error

type Error struct {
	Code    string
	Message string
}

func NewError

func NewError(code string, format string, v ...interface{}) *Error

func (*Error) Name

func (e *Error) Name() string

func (*Error) WriteTo

func (e *Error) WriteTo(w io.Writer) (err error)

type Integer

type Integer struct {
	Value int
}

func NewInteger

func NewInteger(val int) *Integer

func (*Integer) Name

func (i *Integer) Name() string

func (*Integer) WriteTo

func (i *Integer) WriteTo(w io.Writer) (err error)

type Map

type Map struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap(m map[string]Value) *Map

func (*Map) Name

func (m *Map) Name() string

func (*Map) WriteTo

func (m *Map) WriteTo(w io.Writer) error

type String

type String struct {
	Value string
}

func NewString

func NewString(val string) *String

func (*String) Name

func (s *String) Name() string

func (*String) WriteTo

func (s *String) WriteTo(w io.Writer) (err error)

type Table

type Table struct {
	RowCount int
	ColCount int
	Data     []Value
}

func (*Table) Add

func (t *Table) Add(row []Value)

func (*Table) Name

func (t *Table) Name() string

func (*Table) Row

func (t *Table) Row(id int) []Value

func (*Table) WriteTo

func (t *Table) WriteTo(w io.Writer) error

type TaggedValue

type TaggedValue struct {
	Tag   string
	Value Value
}

func NewTaggedValue

func NewTaggedValue(val Value, tag string) *TaggedValue

func (*TaggedValue) Name

func (h *TaggedValue) Name() string

func (*TaggedValue) WriteTo

func (f *TaggedValue) WriteTo(w io.Writer) (err error)

type Value

type Value interface {
	WriteTo(io.Writer) error
	Name() string
}

func ReadValue

func ReadValue(r io.Reader) (Value, error)

type WireReader

type WireReader struct {
	MaxBlobSize int
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader) *WireReader

func (*WireReader) Read

func (r *WireReader) Read() (Value, error)

Jump to

Keyboard shortcuts

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