Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
confyg/reader.go
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (15 sloc)
709 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package confyg | |
import "bytes" | |
// Reader is called when individual lines of the configuration file are being read. | |
// This is where you should populate any relevant structures with information. | |
// | |
// If something goes wrong in the file parsing step, add data to the errs buffer | |
// describing what went wrong. | |
type Reader interface { | |
Read(errs *bytes.Buffer, fs *FileSyntax, line *Line, verb string, args []string) | |
} | |
// ReaderFunc implements Reader for inline definitions. | |
type ReaderFunc func(errs *bytes.Buffer, fs *FileSyntax, line *Line, verb string, args []string) | |
func (r ReaderFunc) Read(errs *bytes.Buffer, fs *FileSyntax, line *Line, verb string, args []string) { | |
r(errs, fs, line, verb, args) | |
} |