{"modulePath":"github.com/devk-insurance/oapi-codegen","version":"v1.9.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runtime\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\n## Constants\n\n```go\nconst (\n\t// ErrSecurityProviderApiKeyInvalidIn indicates a usage of an invalid In.\n\t// Should be cookie, header or query\n\tErrSecurityProviderApiKeyInvalidIn = SecurityProviderError(\"invalid 'in' specified for apiKey\")\n)\n```\n\n## Functions\n\n```go\nfunc BindQueryParameter(style string, explode bool, required bool, paramName string,\n\tqueryParams url.Values, dest interface{}) error\n```\nThis works much like BindStyledParameter, however it takes a query argument input array from the url package, since query arguments come through a different path than the styled arguments. They're also exceptionally fussy. For example, consider the exploded and unexploded form parameter examples: (exploded) /users?role=admin\u0026firstName=Alex (unexploded) /users?id=role,admin,firstName,Alex\n\nIn the first case, we can pull the \"id\" parameter off the echo context, and unmarshal via json as an intermediate. Easy. In the second case, we don't have the id QueryParam present, but must find \"role\", and \"firstName\". what if there is another parameter similar to \"ID\" named \"role\"? We can't tell them apart. This code tries to fail, but the moral of the story is that you shouldn't pass objects via form styled query arguments, just use the Content parameter form.\n\n```go\nfunc BindStringToObject(src string, dst interface{}) error\n```\nThis function takes a string, and attempts to assign it to the destination interface via whatever type conversion is necessary. We have to do this via reflection instead of a much simpler type switch so that we can handle type aliases. This function was the easy way out, the better way, since we know the destination type each place that we use this, is to generate code to read each specific type.\n\n```go\nfunc BindStyledParameter(style string, explode bool, paramName string,\n\tvalue string, dest interface{}) error\n```\nThis function binds a parameter as described in the Path Parameters section here to a Go object: [https://swagger.io/docs/specification/serialization/](https://swagger.io/docs/specification/serialization/)\n\n```go\nfunc StyleParam(style string, explode bool, paramName string, value interface{}) (string, error)\n```\nGiven an input value, such as a primitive type, array or object, turn it into a parameter based on style/explode definition.\n\n## Types\n\n```go\ntype EchoRouter interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route\n}\n```\nThis is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration\n\n```go\ntype SecurityProviderApiKey struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderApiKey will attach an apiKey either to a cookie, header or query.\n\n```go\nfunc NewSecurityProviderApiKey(in, name, apiKey string) (*SecurityProviderApiKey, error)\n```\nNewSecurityProviderApiKey will attach a generic apiKey for a given name either to a cookie, header or as a query parameter.\n\n```go\nfunc (s *SecurityProviderApiKey) Intercept(req *http.Request, ctx context.Context) error\n```\nIntercept will attach a cookie, header or query param for the configured name and apiKey.\n\n```go\ntype SecurityProviderBasicAuth struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderBasicAuth sends a base64-encoded combination of username, password along with a request.\n\n```go\nfunc NewSecurityProviderBasicAuth(username, password string) (*SecurityProviderBasicAuth, error)\n```\nNewSecurityProviderBasicAuth provides a SecurityProvider, which can solve the BasicAuth challenge for api-calls.\n\n```go\nfunc (s *SecurityProviderBasicAuth) Intercept(req *http.Request, ctx context.Context) error\n```\nIntercept will attach an Authorization header to the request and ensures that the username, password are base64 encoded and attached to the header.\n\n```go\ntype SecurityProviderBearerToken struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderBearerToken sends a token as part of an Authorization: Bearer header along with a request.\n\n```go\nfunc NewSecurityProviderBearerToken(token string) (*SecurityProviderBearerToken, error)\n```\nNewSecurityProviderBearerToken provides a SecurityProvider, which can solve the Bearer Auth challende for api-calls.\n\n```go\nfunc (s *SecurityProviderBearerToken) Intercept(req *http.Request, ctx context.Context) error\n```\nIntercept will attach an Authorization header to the request and ensures that the bearer token is attached to the header.\n\n```go\ntype SecurityProviderError string\n```\nSecurityProviderError defines error values of a security provider.\n\n```go\nfunc (e SecurityProviderError) Error() string\n```\nError implements the error interface.\n\n","path":"github.com/devk-insurance/oapi-codegen/pkg/runtime","name":"runtime","synopsis":"","isRedistributable":true}
