Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct { // The text from the argument. Text string // contains filtered or unexported fields }
Argument is used to define an argument.
func (*Argument) Rewind ¶
Rewind is used to rewind the reader to before an argument was read. This is useful for some argument verification situations. Note that if you want to rewind multiple arguments, you need to run it on every argument you parsed AFTER the one you wish to rewind in order of last to first.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is used to define an argument parser from the ParserManager. Note this (and functions on provided arguments) are not thread safe.
func (*Parser) Done ¶
func (p *Parser) Done()
Done should be called when you are done with a scratchpad.
func (*Parser) GetNextArg ¶
GetNextArg is used to get the next argument. If there are no additional arguments, the pointer will be nil.
type ParserManager ¶
type ParserManager struct {
// contains filtered or unexported fields
}
ParserManager is used to manage the parsing of arguments.
func NewParserManager ¶
func NewParserManager(MessageLen, PreAllocatedPads int) *ParserManager
NewParserManager is used to create a new parser manager. MessageLen is the maximum length of each message, and PreAllocatedPads are the amount of scratchpads which will be pre-allocated. Each pre-allocated scratchpad uses the amount of bytes which a message would take, but they mean that the memory will not need to be allocated on the fly later.
func (*ParserManager) Parser ¶
func (m *ParserManager) Parser(r io.ReadSeeker) *Parser
Parser is used to get a parser from the manager.