Version: v3.0.0-alpha.7 Latest Latest

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 6 Imported by: 0



Package capnptool provides an API for calling the capnp tool in tests.



This section is empty.


This section is empty.


This section is empty.


type Tool

type Tool string

Tool is the path to the capnp command-line tool. It can be used from multiple goroutines.

func Find

func Find() (Tool, error)

Find searches PATH for the capnp tool.

func (Tool) Decode

func (tool Tool) Decode(typ Type, r io.Reader) (string, error)

Decode decodes a Cap'n Proto message into text.

func (Tool) DecodePacked

func (tool Tool) DecodePacked(typ Type, r io.Reader) (string, error)

DecodePacked decodes a packed Cap'n Proto message into text.

func (Tool) Encode

func (tool Tool) Encode(typ Type, text string) ([]byte, error)

Encode encodes Cap'n Proto text into the binary representation.

func (Tool) Run

func (tool Tool) Run(stdin io.Reader, args ...string) ([]byte, error)

Run executes the tool with the given stdin and arguments returns the stdout.

type Type

type Type struct {
	SchemaPath string
	Name       string

Type is a reference to a Cap'n Proto type in a schema.

Source Files

Jump to

Keyboard shortcuts

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