brio-gen

command
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Command brio-gen generates (un)marshaler code for types.

For each type given to brio-gen, marshaling and unmarshaling code will be generated so the types implement binary.Binary(Un)Marshaler.

  • values are encoded using binary.LittleEndian,
  • int and uint are encoded as (resp.) int64 and uint64,
  • booleans are encoded as a single uint8 (0==false, 1==true),
  • strings are encoded as a pair(uint64, []byte),
  • arrays are encoded as a sequence of Ts, the length is implicit as it is part of the array type,
  • slices are encoded as a pair(uint64, T...)
  • pointers are encoded as *T (like encoding/gob)
  • interfaces are not supported.

Usage: brio-gen [options]

ex:

$> brio-gen -p image -t Point -o image_brio.go
$> brio-gen -p go-hep.org/x/hep/hbook -t Dist0D,Dist1D,Dist2D -o foo_brio.go

options:

-o string
  	output file name (default "brio_gen.go")
-p string
  	package import path
-t string
  	comma-separated list of type names

Directories

Path Synopsis
internal
gen

Jump to

Keyboard shortcuts

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