ascii

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

package ascii implements an ASCII key-value parser.

The top-most (de)serialize must operate on a struct pointer. A struct may contain other structs, in which case all tag names should be unique. Public fields without tag names are ignored. Private fields are also ignored.

The supported field types are: - struct - string (no empty strings) - uint64 (only digits in ASCII representation) - byte array (only lower-case hex in ASCII representation) - slice of uint64 (no empty slices) - slice of byte array (no empty slices)

A key must not contain an encoding's end-of-key value. A value must not contain an encoding's end-of-value value.

For additional details, please refer to the Sigsum v0 API documentation.

Index

Constants

This section is empty.

Variables

View Source
var StdEncoding = NewEncoding("ascii", "=", "\n")

Functions

This section is empty.

Types

type Encoding

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

func NewEncoding

func NewEncoding(id, eok, eov string) *Encoding

func (*Encoding) Deserialize

func (e *Encoding) Deserialize(r io.Reader, i interface{}) error

Deserialize tries to deserialize a buffer of ASCII key-value pairs

func (*Encoding) Serialize

func (e *Encoding) Serialize(w io.Writer, i interface{}) error

Serialize tries to serialize an interface as ASCII key-value pairs

Jump to

Keyboard shortcuts

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