strepr: Index | Examples | Files

package strepr

import ""

Package strepr is an implementation of the strepr stable representation algorithm.

For details on strepr, see the specification at:



Package Files

dumper.go strepr.go

func NewDumper Uses

func NewDumper(w io.Writer) io.WriteCloser

NewDumper returns an io.WriteCloser that expects raw strepr data to be written into it. Once data is written, it will output into w a textual debug dump of the raw data received.

The returned value must be closed after all data is written on it both for the debug dump to report unfinished data and for used resources to be released.

type Encoder Uses

type Encoder struct {
    // contains filtered or unexported fields

Encoder streams the strepr stable representation for provided values into an io.Writer.


value := map[string]interface{}{"a": 1, "b": []int{2, 3}}
hash := sha1.New()
fmt.Printf("%x\n", hash.Sum(nil))



func NewEncoder Uses

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new strepr encoder for writing the stable representation for provided values into w.

func (*Encoder) Encode Uses

func (e *Encoder) Encode(v interface{}) error

Encode serializes v's stable representation into e's writer.

Package strepr imports 10 packages (graph). Updated 2016-07-23. Refresh now. Tools for package owners.