-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
20,278 additions
and
6,148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ linters: | |
- noctx | ||
- unparam | ||
- forbidigo | ||
- tagalign | ||
|
||
issues: | ||
exclude-files: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package internal | ||
|
||
import ( | ||
rest "github.com/hasura/ndc-rest/ndc-rest-schema/schema" | ||
"github.com/hasura/ndc-sdk-go/schema" | ||
) | ||
|
||
// MetadataCollection stores list of REST metadata with helper methods | ||
type MetadataCollection []rest.NDCRestSchema | ||
|
||
// GetFunction gets the NDC function by name | ||
func (rms MetadataCollection) GetFunction(name string) (*rest.OperationInfo, *rest.NDCRestSettings, error) { | ||
for _, rm := range rms { | ||
fn := rm.GetFunction(name) | ||
if fn != nil { | ||
return fn, rm.Settings, nil | ||
} | ||
} | ||
return nil, nil, schema.UnprocessableContentError("unsupported query: "+name, nil) | ||
} | ||
|
||
// GetProcedure gets the NDC procedure by name | ||
func (rms MetadataCollection) GetProcedure(name string) (*rest.OperationInfo, *rest.NDCRestSettings, error) { | ||
for _, rm := range rms { | ||
fn := rm.GetProcedure(name) | ||
if fn != nil { | ||
return fn, rm.Settings, nil | ||
} | ||
} | ||
return nil, nil, schema.UnprocessableContentError("unsupported query: "+name, nil) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.