package runtime

Import Path
	github.com/oapi-codegen/runtime (on go.dev)

Dependency Relation
	imports 15 packages, and imported by one package

Involved Source Files Copyright 2021 DeepMap, Inc. Licensed 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 http://www.apache.org/licenses/LICENSE-2.0 Unless 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. bindform.go Copyright 2019 DeepMap, Inc. Licensed 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 http://www.apache.org/licenses/LICENSE-2.0 Unless 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. Copyright 2019 DeepMap, Inc. Licensed 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 http://www.apache.org/licenses/LICENSE-2.0 Unless 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. deepobject.go jsonmerge.go Copyright 2019 DeepMap, Inc. Licensed 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 http://www.apache.org/licenses/LICENSE-2.0 Unless 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.
Package-Level Type Names (total 5, in which 4 are exported)
/* sort exporteds by: | */
Binder is the interface implemented by types that can be bound to a query string or a parameter string The input can be assumed to be a valid string. If you define a Bind method you are responsible for all data being completely bound to the type. By convention, to approximate the behavior of Bind functions themselves, Binder implements Bind("") as a no-op. ( Binder) Bind(src string) error
BindStyledParameterOptions defines optional arguments for BindStyledParameterWithOptions Whether the parameter should use exploded structure ParamLocation tells us where the parameter is located in the request. Whether the parameter is required in the query func BindStyledParameterWithOptions(style string, paramName string, value string, dest any, opts BindStyledParameterOptions) error
func BindStyledParameterWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value string, dest interface{}) error func StyleParamWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value interface{}) (string, error) const ParamLocationCookie const ParamLocationHeader const ParamLocationPath const ParamLocationQuery const ParamLocationUndefined
ContentType string Explode *bool Required *bool Style string func BindForm(ptr interface{}, form map[string][]string, files map[string][]*multipart.FileHeader, encodings map[string]RequestBodyEncoding) error func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url.Values, error)
Package-Level Functions (total 39, in which 14 are exported)
func BindForm(ptr interface{}, form map[string][]string, files map[string][]*multipart.FileHeader, encodings map[string]RequestBodyEncoding) error
func BindMultipart(ptr interface{}, reader multipart.Reader) error
BindQueryParameter 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&firstName=Alex (unexploded) /users?id=role,admin,firstName,Alex In the first case, we can pull the "id" parameter off the 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.
BindStringToObject 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.
BindStyledParameter binds a parameter as described in the Path Parameters section here to a Go object: https://swagger.io/docs/specification/serialization/ It is a backward compatible function to clients generated with codegen up to version v1.5.5. v1.5.6+ calls the function below. Deprecated: BindStyledParameter is deprecated.
BindStyledParameterWithLocation binds a parameter as described in the Path Parameters section here to a Go object: https://swagger.io/docs/specification/serialization/ This is a compatibility function which is used by oapi-codegen v2.0.0 and earlier. Deprecated: BindStyledParameterWithLocation is deprecated.
BindStyledParameterWithOptions binds a parameter as described in the Path Parameters section here to a Go object: https://swagger.io/docs/specification/serialization/
JSONMerge merges two JSON representation into a single object. `data` is the existing representation and `patch` is the new data to be merged in
JsonMerge merges two JSON representation into a single object. `data` is the existing representation and `patch` is the new data to be merged in Deprecated: Use JSONMerge instead.
func MarshalDeepObject(i interface{}, paramName string) (string, error)
func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url.Values, error)
StyleParam is used by older generated code, and must remain compatible with that code. It is not to be used in new templates. Please see the function below, which can specialize its output based on the location of the parameter.
Given an input value, such as a primitive type, array or object, turn it into a parameter based on style/explode definition, performing whatever escaping is necessary based on parameter location
func UnmarshalDeepObject(dst interface{}, paramName string, params url.Values) error
Package-Level Constants (total 7, in which 5 are exported)