props

package module
v0.0.0-...-25b7025 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2016 License: MIT Imports: 4 Imported by: 0

README

props

Golang parser and emitter for java .properties files

API is crappy and will probably change. Docs at https://godoc.org/github.com/yobert/props

Following the rules specified at http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html

So far I accept most of the java spec, except for unicode escapes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeFile

func EncodeFile(path string, data Map) error

Types

type Chunk

type Chunk struct {
	Key        string
	Value      string
	SourceLine int
}

Chunk holds one key/value pair, for both encoding and decoding. if Key is the empty string, Value holds either whitespace or a comment.

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (p *Decoder) Decode() (*Chunk, error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(c *Chunk) error

type Map

type Map map[string]*Chunk

func DecodeFile

func DecodeFile(path string) (Map, error)

Jump to

Keyboard shortcuts

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