make captures public
This commit is contained in:
parent
d1ab4fefb0
commit
2c1b9cf5ff
|
@ -65,10 +65,10 @@ func (svc *Service) checkPattern() error {
|
|||
braceName := matches[0][1]
|
||||
|
||||
// append
|
||||
if svc.captures == nil {
|
||||
svc.captures = make([]*braceCapture, 0)
|
||||
if svc.Captures == nil {
|
||||
svc.Captures = make([]*BraceCapture, 0)
|
||||
}
|
||||
svc.captures = append(svc.captures, &braceCapture{
|
||||
svc.Captures = append(svc.Captures, &BraceCapture{
|
||||
Index: i,
|
||||
Name: braceName,
|
||||
Ref: nil,
|
||||
|
@ -105,7 +105,7 @@ func (svc *Service) checkAndFormatInput(types []datatype.DataType) error {
|
|||
braceName := matches[0][1]
|
||||
|
||||
found := false
|
||||
for _, capture := range svc.captures {
|
||||
for _, capture := range svc.Captures {
|
||||
if capture.Name == braceName {
|
||||
capture.Ref = param
|
||||
found = true
|
||||
|
|
|
@ -24,7 +24,7 @@ type Service struct {
|
|||
// Download *bool `json:"download"`
|
||||
// Output map[string]*Parameter `json:"out"`
|
||||
|
||||
captures []*braceCapture
|
||||
Captures []*BraceCapture
|
||||
}
|
||||
|
||||
// Parameter represents a parameter definition (from api.json)
|
||||
|
@ -39,8 +39,8 @@ type Parameter struct {
|
|||
Validator datatype.Validator
|
||||
}
|
||||
|
||||
// links to the related URI parameter
|
||||
type braceCapture struct {
|
||||
// BraceCapture links to the related URI parameter
|
||||
type BraceCapture struct {
|
||||
Name string
|
||||
Index int
|
||||
Ref *Parameter
|
||||
|
@ -48,6 +48,6 @@ type braceCapture struct {
|
|||
|
||||
// links to the related URI parameter and hold a value
|
||||
type braceCaptureValue struct {
|
||||
braceCapture
|
||||
BraceCapture
|
||||
Value interface{}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue