/
type.go
45 lines (40 loc) · 1.11 KB
/
type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package biu
import (
"github.com/emicklei/go-restful"
)
// NS contains configuration of a namespace
type NS struct {
NameSpace string // url parent of controller
Controller CtlInterface // controller implement CtlInterface
Desc string // description of controller of namespace
ExternalDesc string // external documentation of controller
ExternalURL string // external url of ExternalDesc
}
// WS extends *restful.WebService
type WS struct {
namespace string
*restful.WebService
}
// CtlInterface is the interface of controllers
type CtlInterface interface {
WebService(WS)
}
// SwaggerInfo contains configuration of swagger documents.
type SwaggerInfo struct {
Title string
Description string
TermsOfService string
ContactName string
ContactURL string
ContactEmail string
LicenseName string
LicenseURL string
Version string
WebServicesURL string
DisableCORS bool
// swagger service will running under
// http://<api>/<RoutePrefix>/<RouteSuffix>
// by default the RouteSuffix is swagger
RoutePrefix string
RouteSuffix string
}