Skip to content

Remove the strong coupling of gorilla/mux and support arbitrary middleware, such as gin #13 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/bleve-mapping-ui.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Handleface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package mapping

import "net/http"

type HandleFuncFace interface {
HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) MethodsFace
}

type MethodsFace interface {
Methods(methods ...string)
}
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
A reusable, web-based editor and viewer UI for bleve IndexMapping
JSON based on angular JS, angular-bootstrap and the angular-ui-control.

解除与gorilla/mux的耦合
支持任意的http server中间件,例如:gin

## Demo

Build the sample webapp...
Expand Down Expand Up @@ -30,9 +33,13 @@ Apache License Version 2.0
### Code generation

There's static bindata resources, which can be regenerated using...
```
go install github.com/elazarl/go-bindata-assetfs/...
go generate

go generate

or set
var StaticBleveMappingPath = flag.String("staticBleveMapping", "./static/", "optional path to static-bleve-mapping directory for web resources")
```
### Unit tests

There are some "poor man's" unit tests, which you can run by visiting...
Expand Down
174 changes: 93 additions & 81 deletions bindata_assetfs.go

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions bower_components/angular-bootstrap/ui-bootstrap-tpls.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ angular.module('ui.bootstrap.carousel', [])
* @param {boolean=} noTransition Whether to disable transitions on the carousel.
* @param {boolean=} noPause Whether to disable pausing on the carousel (by default, the carousel interval pauses on hover).
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-carousel>
<uib-slide>
Expand All @@ -948,7 +948,7 @@ angular.module('ui.bootstrap.carousel', [])
bottom: 15px;
}
</file>
</example>
</imps>
*/
.directive('uibCarousel', [function() {
return {
Expand Down Expand Up @@ -980,8 +980,8 @@ angular.module('ui.bootstrap.carousel', [])
* @param {boolean=} active Model binding, whether or not this slide is currently active.
* @param {number=} index The index of the slide. The slides will be sorted by this parameter.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<div ng-controller="CarouselDemoCtrl">
<uib-carousel>
Expand All @@ -1008,7 +1008,7 @@ function CarouselDemoCtrl($scope) {
bottom: 15px;
}
</file>
</example>
</imps>
*/

.directive('uibSlide', function() {
Expand Down Expand Up @@ -6264,8 +6264,8 @@ angular.module('ui.bootstrap.tabs', [])
* @param {boolean=} vertical Whether or not to use vertical styling for the tabs.
* @param {boolean=} justified Whether or not to use justified styling for the tabs.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-tabset>
<uib-tab heading="Tab 1"><b>First</b> Content!</uib-tab>
Expand All @@ -6281,7 +6281,7 @@ angular.module('ui.bootstrap.tabs', [])
<uib-tab heading="Justified Tab 2"><i>Second</i> Justified Content!</uib-tab>
</uib-tabset>
</file>
</example>
</imps>
*/
.directive('uibTabset', function() {
return {
Expand Down Expand Up @@ -6313,8 +6313,8 @@ angular.module('ui.bootstrap.tabs', [])
* @description
* Creates a tab with a heading and content. Must be placed within a {@link ui.bootstrap.tabs.directive:tabset tabset}.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<div ng-controller="TabsDemoCtrl">
<button class="btn btn-small" ng-click="items[0].active = true">
Expand Down Expand Up @@ -6353,7 +6353,7 @@ angular.module('ui.bootstrap.tabs', [])
};
};
</file>
</example>
</imps>
*/

/**
Expand All @@ -6364,8 +6364,8 @@ angular.module('ui.bootstrap.tabs', [])
* @description
* Creates an HTML heading for a {@link ui.bootstrap.tabs.directive:tab tab}. Must be placed as a child of a tab element.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-tabset>
<uib-tab>
Expand All @@ -6378,7 +6378,7 @@ angular.module('ui.bootstrap.tabs', [])
</uib-tab>
</uib-tabset>
</file>
</example>
</imps>
*/
.directive('uibTab', ['$parse', function($parse) {
return {
Expand Down Expand Up @@ -7568,7 +7568,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])

function escapeRegexp(queryToEscape) {
// Regex: capture the whole query string and replace it with the string that will be used to match
// the results, for example if the capture is "a" the result will be \a
// the results, for imps if the capture is "a" the result will be \a
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}

Expand Down Expand Up @@ -8084,7 +8084,7 @@ angular.module('ui.bootstrap.typeahead')

function escapeRegexp(queryToEscape) {
// Regex: capture the whole query string and replace it with the string that will be used to match
// the results, for example if the capture is "a" the result will be \a
// the results, for imps if the capture is "a" the result will be \a
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}

Expand Down
34 changes: 17 additions & 17 deletions bower_components/angular-bootstrap/ui-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ angular.module('ui.bootstrap.carousel', [])
* @param {boolean=} noTransition Whether to disable transitions on the carousel.
* @param {boolean=} noPause Whether to disable pausing on the carousel (by default, the carousel interval pauses on hover).
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-carousel>
<uib-slide>
Expand All @@ -947,7 +947,7 @@ angular.module('ui.bootstrap.carousel', [])
bottom: 15px;
}
</file>
</example>
</imps>
*/
.directive('uibCarousel', [function() {
return {
Expand Down Expand Up @@ -979,8 +979,8 @@ angular.module('ui.bootstrap.carousel', [])
* @param {boolean=} active Model binding, whether or not this slide is currently active.
* @param {number=} index The index of the slide. The slides will be sorted by this parameter.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<div ng-controller="CarouselDemoCtrl">
<uib-carousel>
Expand All @@ -1007,7 +1007,7 @@ function CarouselDemoCtrl($scope) {
bottom: 15px;
}
</file>
</example>
</imps>
*/

.directive('uibSlide', function() {
Expand Down Expand Up @@ -6263,8 +6263,8 @@ angular.module('ui.bootstrap.tabs', [])
* @param {boolean=} vertical Whether or not to use vertical styling for the tabs.
* @param {boolean=} justified Whether or not to use justified styling for the tabs.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-tabset>
<uib-tab heading="Tab 1"><b>First</b> Content!</uib-tab>
Expand All @@ -6280,7 +6280,7 @@ angular.module('ui.bootstrap.tabs', [])
<uib-tab heading="Justified Tab 2"><i>Second</i> Justified Content!</uib-tab>
</uib-tabset>
</file>
</example>
</imps>
*/
.directive('uibTabset', function() {
return {
Expand Down Expand Up @@ -6312,8 +6312,8 @@ angular.module('ui.bootstrap.tabs', [])
* @description
* Creates a tab with a heading and content. Must be placed within a {@link ui.bootstrap.tabs.directive:tabset tabset}.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<div ng-controller="TabsDemoCtrl">
<button class="btn btn-small" ng-click="items[0].active = true">
Expand Down Expand Up @@ -6352,7 +6352,7 @@ angular.module('ui.bootstrap.tabs', [])
};
};
</file>
</example>
</imps>
*/

/**
Expand All @@ -6363,8 +6363,8 @@ angular.module('ui.bootstrap.tabs', [])
* @description
* Creates an HTML heading for a {@link ui.bootstrap.tabs.directive:tab tab}. Must be placed as a child of a tab element.
*
* @example
<example module="ui.bootstrap">
* @imps
<imps module="ui.bootstrap">
<file name="index.html">
<uib-tabset>
<uib-tab>
Expand All @@ -6377,7 +6377,7 @@ angular.module('ui.bootstrap.tabs', [])
</uib-tab>
</uib-tabset>
</file>
</example>
</imps>
*/
.directive('uibTab', ['$parse', function($parse) {
return {
Expand Down Expand Up @@ -7567,7 +7567,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])

function escapeRegexp(queryToEscape) {
// Regex: capture the whole query string and replace it with the string that will be used to match
// the results, for example if the capture is "a" the result will be \a
// the results, for imps if the capture is "a" the result will be \a
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}

Expand Down Expand Up @@ -8083,7 +8083,7 @@ angular.module('ui.bootstrap.typeahead')

function escapeRegexp(queryToEscape) {
// Regex: capture the whole query string and replace it with the string that will be used to match
// the results, for example if the capture is "a" the result will be \a
// the results, for imps if the capture is "a" the result will be \a
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}

Expand Down
Loading