file

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package file help read from/write to config file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(fname string, v interface{}, decoder encodeio.DecodeFunc) error

func ReadGOB

func ReadGOB(fname string, v interface{}) error

func ReadGZIP

func ReadGZIP(fname string) (data []byte, err error)

func ReadJSON

func ReadJSON(fname string, v interface{}) error

func ReadProperties

func ReadProperties(fname string) (map[string]string, error)

func ReadString

func ReadString(fname string) (s string, err error)

func ReadXML

func ReadXML(fname string, v interface{}) error

Types

type WriteMode

type WriteMode bool
const APPEND WriteMode = false
const TRUNC WriteMode = true

func (WriteMode) Write

func (m WriteMode) Write(fname string, v interface{}, encoder encodeio.EncodeFunc) error

func (WriteMode) WriteGOB

func (m WriteMode) WriteGOB(fname string, v interface{}) error

WriteGOB write interface{} to writer use gob encoder

func (WriteMode) WriteGZIP

func (m WriteMode) WriteGZIP(fname string, v interface{}) (err error)

func (WriteMode) WriteJSON

func (m WriteMode) WriteJSON(fname string, v interface{}) error

WriteJSON write interface{} to writer use json encoder

func (WriteMode) WriteString

func (m WriteMode) WriteString(fname, str string) (c int, err error)

WriteString write string to writer

func (WriteMode) WriteXML

func (m WriteMode) WriteXML(fname string, v interface{}) error

WriteXML write interface{} to writer use xml encoder

Jump to

Keyboard shortcuts

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