capnptool

package
v2.18.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

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