{"id":13413956,"url":"https://github.com/sbstjn/allot","last_synced_at":"2025-04-21T22:33:28.468Z","repository":{"id":44688630,"uuid":"71060423","full_name":"sbstjn/allot","owner":"sbstjn","description":"Parse placeholder and wildcard text commands","archived":false,"fork":false,"pushed_at":"2022-01-31T09:04:19.000Z","size":35,"stargazers_count":59,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T20:53:11.365Z","etag":null,"topics":["chatops","command","go","golang","matching","parsing","pattern","slackbot","text"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstjn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-16T15:49:08.000Z","updated_at":"2024-05-31T15:22:00.000Z","dependencies_parsed_at":"2022-09-09T22:40:48.743Z","dependency_job_id":null,"html_url":"https://github.com/sbstjn/allot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fallot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fallot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fallot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fallot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstjn","download_url":"https://codeload.github.com/sbstjn/allot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250145343,"owners_count":21382396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatops","command","go","golang","matching","parsing","pattern","slackbot","text"],"created_at":"2024-07-30T20:01:53.636Z","updated_at":"2025-04-21T22:33:23.455Z","avatar_url":"https://github.com/sbstjn.png","language":"Go","readme":"# allot [![MIT License](https://img.shields.io/github/license/sbstjn/allot.svg?maxAge=3600)](https://github.com/sbstjn/allot/blob/master/LICENSE.md) [![GoDoc](https://godoc.org/github.com/sbstjn/allot?status.svg)](https://godoc.org/github.com/sbstjn/allot) [![Go Report Card](https://goreportcard.com/badge/github.com/sbstjn/allot)](https://goreportcard.com/report/github.com/sbstjn/allot) [![allot - Coverage Status](https://img.shields.io/coveralls/sbstjn/allot.svg)](https://coveralls.io/github/sbstjn/allot) [![Build Status](https://img.shields.io/circleci/project/sbstjn/allot.svg?maxAge=600)](https://circleci.com/gh/sbstjn/allot)\n\n**allot** is a small `Golang` library to match and parse commands with pre-defined strings. For example use **allot** to define a list of commands your CLI application or Slackbot supports and check if incoming requests are matching your commands.\n\nThe **allot** library supports placeholders and regular expressions for parameter matching and parsing.\n\n## Usage\n\n```go\ncmd := allot.NewCommand(\"revert \u003ccommits:integer\u003e commits on \u003cproject:string\u003e at (stage|prod)\")\nmatch, err := cmd.Match(\"revert 12 commits on example at prod\")\n\nif (err != nil)\n  commits, _ = match.Integer(\"commits\")\n  project, _ = match.String(\"project\")\n  env, _ = match.Match(2)\n\n  fmt.Printf(\"Revert \\\"%d\\\" on \\\"%s\\\" at \\\"%s\\\"\", commits, project, env)\n} else {\n  fmt.Println(\"Request did not match command.\")\n}\n```\n\n## Examples\n\nSee the [hanu Slackbot](https://github.com/sbstjn/hanu) framework for a usecase for **allot**:\n\n* [Host a Golang Slack bot on Heroku](https://sbstjn.com/host-golang-slackbot-on-heroku-with-hanu.html)\n\n## Credits\n * [Go coverage script from Mathias Lafeldt](https://mlafeldt.github.io/blog/test-coverage-in-go/)\n","funding_links":[],"categories":["Text Processing","文本处理","Template Engines","文本处理`解析和操作文本的代码库`","Specific Formats","Bot Building","文本處理","\u003cspan id=\"文字处理-text-processing\"\u003e文字处理 Text Processing\u003c/span\u003e"],"sub_categories":["Advanced Console UIs","Parsers/Encoders/Decoders","解析 器/Encoders/Decoders","HTTP Clients","查询语","交流","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fallot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstjn%2Fallot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fallot/lists"}