allot

package
v0.0.0-...-c5bcced Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

The text/allot enables matching and parsing of predefined text commands.

var lib = require('text/allot');

lib.add("revert <commits:integer> commits on <project:string> at (live|test|dev)", function(match) {
	console.log('Commits:', match.integer('commits') );
	console.log('Project:', match.string('project') );
	console.log('Branch:', match.match(2) );
});

lib.add("commit all changes in <project:string> to (live|test|dev)", function(match) {
	console.log('Project:', match.string('project') );
	console.log('Branch:', match.match(1) );
});

lib.run(context.req.body);

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(orb *orbit.Orbit) interface{}

Types

type Match

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

func NewMatch

func NewMatch(orb *orbit.Orbit, val allot.MatchInterface) *Match

func (*Match) Integer

func (this *Match) Integer(name string) int

func (*Match) Match

func (this *Match) Match(pos int) string

func (*Match) Param

func (this *Match) Param(name, kind string) string

func (*Match) String

func (this *Match) String(name string) string

type Module

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

func (*Module) Add

func (this *Module) Add(value string, cb otto.Value)

func (*Module) Run

func (this *Module) Run(value interface{})

Jump to

Keyboard shortcuts

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