diff --git a/config/service.go b/config/service.go index 10f4c1f..81018a1 100644 --- a/config/service.go +++ b/config/service.go @@ -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 diff --git a/config/types.go b/config/types.go index fb292be..0c00f5d 100644 --- a/config/types.go +++ b/config/types.go @@ -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{} }