Documentation
¶
Index ¶
- func Expression(data string) *regexp.Regexp
- type Command
- func (c Command) Expression() *regexp.Regexp
- func (c Command) Has(param ParameterInterface) bool
- func (c Command) Match(req string) (MatchInterface, error)
- func (c Command) Matches(req string) bool
- func (c Command) Parameters() []Parameter
- func (c Command) Position(param ParameterInterface) int
- func (c Command) Text() string
- type CommandInterface
- type Match
- type MatchInterface
- type Parameter
- type ParameterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expression ¶
Expression returns the regexp for a data type
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a Command definition
func (Command) Expression ¶
Expression returns the regular expression matching the command text
func (Command) Has ¶
func (c Command) Has(param ParameterInterface) bool
Has checks if the parameter is found in the command
func (Command) Match ¶
func (c Command) Match(req string) (MatchInterface, error)
Match returns the parameter matching the expression at the defined position
func (Command) Parameters ¶
Parameters returns the list of defined parameters
func (Command) Position ¶
func (c Command) Position(param ParameterInterface) int
Position returns the position of a parameter
type CommandInterface ¶
type CommandInterface interface { Expression() *regexp.Regexp Has(name ParameterInterface) bool Match(req string) (MatchInterface, error) Matches(req string) bool Parameters() []Parameter Position(param ParameterInterface) int Text() string }
CommandInterface describes how to access a Command
type Match ¶
type Match struct { Command CommandInterface Request string }
Match is the Match definition
type MatchInterface ¶
type MatchInterface interface { String(name string) (string, error) Integer(name string) (int, error) Match(position int) (string, error) Parameter(param ParameterInterface) (string, error) }
MatchInterface describes how to access a Match
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
Parameter is the Parameter definition
func NewParameterWithType ¶
NewParameterWithType returns
func (Parameter) Equals ¶
func (p Parameter) Equals(param ParameterInterface) bool
Equals checks if two parameter are equal
func (Parameter) Expression ¶
Expression returns the regexp behind the type
type ParameterInterface ¶
type ParameterInterface interface { Equals(param ParameterInterface) bool Expression() *regexp.Regexp Name() string Data() string }
ParameterInterface describes how to access a Parameter