Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateSelfSignedSSLCert(prefix string) (*tls.Config, error)
- func LoadX509KeyPair(certFile, keyFile string) (*tls.Config, error)
- type Client
- func (c *Client) Close() error
- func (c *Client) Command(args ...string) (*Message, error)
- func (c *Client) Exec(args ...*Value) (*Message, error)
- func (c *Client) Read() (*Message, error)
- func (c *Client) ReadValue() (*Value, error)
- func (c *Client) Write(message *Message) error
- func (c *Client) WriteArrayHeader(n int) error
- func (c *Client) WriteBytesHeader(n int, tag string) error
- func (c *Client) WriteCRLF() error
- func (c *Client) WriteError(msg string) error
- func (c *Client) WriteMapHeader(n int) error
- func (c *Client) WriteOK() error
- func (c *Client) WriteSimpleString(s string) error
- func (c *Client) WriteStringHeader(n int) error
- func (c *Client) WriteValue(val *Value) error
- type Command
- type Kind
- type Message
- type MessageKind
- type Server
- type User
- type Value
- func Decode(r io.Reader) (*Value, error)
- func DecodeBytes(b []byte) (*Value, error)
- func New(value interface{}) *Value
- func NewArray(a []*Value) *Value
- func NewBigInt(i *big.Int) *Value
- func NewBool(b bool) *Value
- func NewBytes(b []byte) *Value
- func NewError(s string) *Value
- func NewErrorNoPrefix(s string) *Value
- func NewFloat64(f float64) *Value
- func NewInt(i int) *Value
- func NewInt64(i int64) *Value
- func NewMap(m map[string]*Value) *Value
- func NewNil() *Value
- func NewString(s string) *Value
- func NewValue(kind Kind, data interface{}) *Value
- func (v *Value) Encode(w io.Writer) error
- func (v *Value) EncodeBytes() ([]byte, error)
- func (v *Value) Is(kind Kind) bool
- func (v *Value) IsNil() bool
- func (v Value) MarshalJSON() ([]byte, error)
- func (v *Value) ToArray() []*Value
- func (v *Value) ToBigInt() *big.Int
- func (v *Value) ToBool() bool
- func (v *Value) ToBytes() []byte
- func (v *Value) ToError() error
- func (v *Value) ToFloat32() float32
- func (v *Value) ToFloat64() float64
- func (v *Value) ToInt() int
- func (v *Value) ToInt64() int64
- func (v *Value) ToMap() map[string]*Value
- func (v *Value) ToString() string
- func (v *Value) UnmarshalJSON(b []byte) error
Constants ¶
View Source
const WormVersion = 1
Variables ¶
View Source
var ( ErrInvalidType = errors.New("invalid type") ErrNotEnoughArguments = errors.New("not enough arguments") ErrInvalidArguments = errors.New("invalid arguments") )
View Source
var NilValue = Value{Kind: Nil, Data: nil}
Functions ¶
Types ¶
type Client ¶
type Client struct { Version string Input *bufio.Reader Output *bufio.Writer User *User Data map[string]interface{} // contains filtered or unexported fields }
func (*Client) WriteArrayHeader ¶
func (*Client) WriteError ¶
func (*Client) WriteMapHeader ¶
func (*Client) WriteSimpleString ¶
func (*Client) WriteStringHeader ¶
func (*Client) WriteValue ¶
type MessageKind ¶
type MessageKind int
const ( Default MessageKind = iota Verbatim SetReply Push Hello )
type Server ¶
type Server struct { Addr string Mode string Context interface{} Commands map[string]Command Closed bool Users map[string]User // contains filtered or unexported fields }
func NewTCPServer ¶
type Value ¶
type Value struct { Kind Kind Data interface{} }
func DecodeBytes ¶
func NewErrorNoPrefix ¶
func NewFloat64 ¶
func (*Value) EncodeBytes ¶
func (Value) MarshalJSON ¶
func (*Value) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.