func (m *Message) Keys() []string {
	keys := make([]string, len(m.keys))
	copy(keys, m.keys)
	return keys
}
Keys returns the list of valid message keys.
package vici
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"reflect"
	"strconv"
	"strings"
)
const (
	msgSectionStart uint8 = iota + 1
	msgSectionEnd
	msgKeyValue
	msgListStart
	msgListItem
	msgListEnd
)
var (
	errEncoding  = errors.New("vici: error encoding message")
	errDecoding  = errors.New("vici: error decoding message")
	errMarshal   = errors.New("vici: error marshaling message")
	errUnmarshal = errors.New("vici: error unmarshaling message")
	errUnsupportedType = errors.New("vici: unsupported message element type")
	errCommandFailed = errors.New("vici: command failed")
	errMalformedMessage = errors.New("vici: malformed message")
	errBadKey            = fmt.Errorf("%v: expected key length does not match actual length", errMalformedMessage)
	errBadValue          = fmt.Errorf("%v: expected value length does not match actual length", errMalformedMessage)
	errEndOfBuffer       = fmt.Errorf("%v: unexpected end of buffer", errMalformedMessage)
	errExpectedBeginning = fmt.Errorf("%v: expected beginning of message element", errMalformedMessage)
	errMarshalUnsupportedType = fmt.Errorf("%v: encountered unsupported type", errMarshal)
	errUnmarshalBadType         = fmt.Errorf("%v: type must be non-nil pointer or map", errUnmarshal)
	errUnmarshalTypeMismatch    = fmt.Errorf("%v: incompatible types", errUnmarshal)
	errUnmarshalNonMessage      = fmt.Errorf("%v: encountered non-message type", errUnmarshal)
	errUnmarshalUnsupportedType = fmt.Errorf("%v: encountered unsupported type", errUnmarshal)
	errUnmarshalParseFailure    = fmt.Errorf("%v: failed to parse value", errUnmarshal)
)
type MessageStream struct {
	messages []*Message
}
func NewMessageStream(messages ...*Message) *MessageStream {
	return &MessageStream{messages: messages}
}
func (ms *MessageStream) Messages() []*Message {
	return ms.messages
}
type Message struct {
	keys []string
	data map[string]interface{}
}
func NewMessage() *Message {
	return &Message{
		keys: make([]string, 0),
		data: make(map[string]interface{}),
	}
}
func MarshalMessage(v interface{}) (*Message, error) {
	m := NewMessage()
	if err := m.marshal(v); err != nil {
		return nil, err
	}
	return m, nil
}
func UnmarshalMessage(m *Message, v interface{}) error {
	return m.unmarshal(v)
}
func (m *Message) Set(key string, value interface{}) error {
	return m.marshalField(key, reflect.ValueOf(value))
}
func (m *Message) Unset(key string) {
	for i, v := range m.keys {
		if v != key {
			continue
		}
		m.keys = append(m.keys[:i], m.keys[i+1:]...)
		delete(m.data, key)
		return
	}
}
func (m *Message) Get(key string) interface{} {
	v, ok := m.data[key]
	if !ok {
		return nil
	}
	return v
}