text

package
v2.13.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package text supports marshaling Cap'n Proto messages as text based on a schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(typeID uint64, s capnp.Struct) (string, error)

Marshal returns the text representation of a struct.

Types

type Encoder

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

An Encoder writes the text format of Cap'n Proto messages to an output stream.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new encoder that writes to w.

func (*Encoder) Encode

func (enc *Encoder) Encode(typeID uint64, s capnp.Struct) error

Encode writes the text representation of s to the stream.

func (*Encoder) UseRegistry

func (enc *Encoder) UseRegistry(reg *schemas.Registry)

UseRegistry changes the registry that the encoder consults for schemas from the default registry.

Jump to

Keyboard shortcuts

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