gen

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gen provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type Context

type Context struct {
	TargetingKey         *string                `json:"targetingKey,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

A logical identifier for the subject (end-user, service) of this flag evaluation.

func (Context) Get

func (a Context) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Context. Returns the specified element and whether it was found

func (Context) MarshalJSON

func (a Context) MarshalJSON() ([]byte, error)

Override default JSON handling for Context to handle AdditionalProperties

func (*Context) Set

func (a *Context) Set(fieldName string, value interface{})

Setter for additional properties for Context

func (*Context) UnmarshalJSON

func (a *Context) UnmarshalJSON(b []byte) error

Override default JSON handling for Context to handle AdditionalProperties

type FlagKey

type FlagKey = string

FlagKey defines model for flagKey.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type N400

N400 defines model for 400.

type N404

N404 defines model for 404.

type N500

N500 defines model for 500.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ResolutionDetails

type ResolutionDetails struct {
	Reason  *string `json:"reason,omitempty"`
	Variant *string `json:"variant,omitempty"`
}

The resolution details of the flag resolution operation.

type ResolutionDetailsBoolean

type ResolutionDetailsBoolean struct {
	Reason  *string `json:"reason,omitempty"`
	Value   bool    `json:"value"`
	Variant *string `json:"variant,omitempty"`
}

ResolutionDetailsBoolean defines model for resolutionDetailsBoolean.

type ResolutionDetailsNumber

type ResolutionDetailsNumber struct {
	Reason  *string `json:"reason,omitempty"`
	Value   float32 `json:"value"`
	Variant *string `json:"variant,omitempty"`
}

ResolutionDetailsNumber defines model for resolutionDetailsNumber.

type ResolutionDetailsObject

type ResolutionDetailsObject struct {
	Reason  *string                       `json:"reason,omitempty"`
	Value   ResolutionDetailsObject_Value `json:"value"`
	Variant *string                       `json:"variant,omitempty"`
}

ResolutionDetailsObject defines model for resolutionDetailsObject.

type ResolutionDetailsObject_Value

type ResolutionDetailsObject_Value struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

ResolutionDetailsObject_Value defines model for ResolutionDetailsObject.Value.

func (ResolutionDetailsObject_Value) Get

func (a ResolutionDetailsObject_Value) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ResolutionDetailsObject_Value. Returns the specified element and whether it was found

func (ResolutionDetailsObject_Value) MarshalJSON

func (a ResolutionDetailsObject_Value) MarshalJSON() ([]byte, error)

Override default JSON handling for ResolutionDetailsObject_Value to handle AdditionalProperties

func (*ResolutionDetailsObject_Value) Set

func (a *ResolutionDetailsObject_Value) Set(fieldName string, value interface{})

Setter for additional properties for ResolutionDetailsObject_Value

func (*ResolutionDetailsObject_Value) UnmarshalJSON

func (a *ResolutionDetailsObject_Value) UnmarshalJSON(b []byte) error

Override default JSON handling for ResolutionDetailsObject_Value to handle AdditionalProperties

type ResolutionDetailsString

type ResolutionDetailsString struct {
	Reason  *string `json:"reason,omitempty"`
	Value   string  `json:"value"`
	Variant *string `json:"variant,omitempty"`
}

ResolutionDetailsString defines model for resolutionDetailsString.

type ResolutionDetailsWithError

type ResolutionDetailsWithError struct {
	ErrorCode *string `json:"errorCode,omitempty"`
	Reason    *string `json:"reason,omitempty"`
	Variant   *string `json:"variant,omitempty"`
}

ResolutionDetailsWithError defines model for resolutionDetailsWithError.

type ResolveBooleanJSONBody

type ResolveBooleanJSONBody = Context

ResolveBooleanJSONBody defines parameters for ResolveBoolean.

type ResolveBooleanJSONRequestBody

type ResolveBooleanJSONRequestBody = ResolveBooleanJSONBody

ResolveBooleanJSONRequestBody defines body for ResolveBoolean for application/json ContentType.

type ResolveBooleanParams

type ResolveBooleanParams struct {
	// The value that will be resolved in case of any error, or if the flag is not defined in the flag management system.
	DefaultValue bool `form:"default-value" json:"default-value"`
}

ResolveBooleanParams defines parameters for ResolveBoolean.

type ResolveNumberJSONBody

type ResolveNumberJSONBody = Context

ResolveNumberJSONBody defines parameters for ResolveNumber.

type ResolveNumberJSONRequestBody

type ResolveNumberJSONRequestBody = ResolveNumberJSONBody

ResolveNumberJSONRequestBody defines body for ResolveNumber for application/json ContentType.

type ResolveNumberParams

type ResolveNumberParams struct {
	// The value that will be resolved in case of any error, or if the flag is not defined in the flag management system.
	DefaultValue float32 `form:"default-value" json:"default-value"`
}

ResolveNumberParams defines parameters for ResolveNumber.

type ResolveObjectJSONBody

type ResolveObjectJSONBody = Context

ResolveObjectJSONBody defines parameters for ResolveObject.

type ResolveObjectJSONRequestBody

type ResolveObjectJSONRequestBody = ResolveObjectJSONBody

ResolveObjectJSONRequestBody defines body for ResolveObject for application/json ContentType.

type ResolveObjectParams

type ResolveObjectParams struct {
	// The value that will be resolved in case of any error, or if the flag is not defined in the flag management system.
	DefaultValue ResolveObjectParams_DefaultValue `form:"default-value" json:"default-value"`
}

ResolveObjectParams defines parameters for ResolveObject.

type ResolveObjectParams_DefaultValue

type ResolveObjectParams_DefaultValue struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

ResolveObjectParams_DefaultValue defines parameters for ResolveObject.

func (ResolveObjectParams_DefaultValue) Get

func (a ResolveObjectParams_DefaultValue) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ResolveObjectParams_DefaultValue. Returns the specified element and whether it was found

func (ResolveObjectParams_DefaultValue) MarshalJSON

func (a ResolveObjectParams_DefaultValue) MarshalJSON() ([]byte, error)

Override default JSON handling for ResolveObjectParams_DefaultValue to handle AdditionalProperties

func (*ResolveObjectParams_DefaultValue) Set

func (a *ResolveObjectParams_DefaultValue) Set(fieldName string, value interface{})

Setter for additional properties for ResolveObjectParams_DefaultValue

func (*ResolveObjectParams_DefaultValue) UnmarshalJSON

func (a *ResolveObjectParams_DefaultValue) UnmarshalJSON(b []byte) error

Override default JSON handling for ResolveObjectParams_DefaultValue to handle AdditionalProperties

type ResolveStringJSONBody

type ResolveStringJSONBody = Context

ResolveStringJSONBody defines parameters for ResolveString.

type ResolveStringJSONRequestBody

type ResolveStringJSONRequestBody = ResolveStringJSONBody

ResolveStringJSONRequestBody defines body for ResolveString for application/json ContentType.

type ResolveStringParams

type ResolveStringParams struct {
	// The value that will be resolved in case of any error, or if the flag is not defined in the flag management system.
	DefaultValue string `form:"default-value" json:"default-value"`
}

ResolveStringParams defines parameters for ResolveString.

type ServerInterface

type ServerInterface interface {

	// (POST /flags/{flag-key}/resolve/boolean)
	ResolveBoolean(w http.ResponseWriter, r *http.Request, flagKey FlagKey, params ResolveBooleanParams)

	// (POST /flags/{flag-key}/resolve/number)
	ResolveNumber(w http.ResponseWriter, r *http.Request, flagKey FlagKey, params ResolveNumberParams)

	// (POST /flags/{flag-key}/resolve/object)
	ResolveObject(w http.ResponseWriter, r *http.Request, flagKey FlagKey, params ResolveObjectParams)

	// (POST /flags/{flag-key}/resolve/string)
	ResolveString(w http.ResponseWriter, r *http.Request, flagKey FlagKey, params ResolveStringParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ResolveBoolean

func (siw *ServerInterfaceWrapper) ResolveBoolean(w http.ResponseWriter, r *http.Request)

ResolveBoolean operation middleware

func (*ServerInterfaceWrapper) ResolveNumber

func (siw *ServerInterfaceWrapper) ResolveNumber(w http.ResponseWriter, r *http.Request)

ResolveNumber operation middleware

func (*ServerInterfaceWrapper) ResolveObject

func (siw *ServerInterfaceWrapper) ResolveObject(w http.ResponseWriter, r *http.Request)

ResolveObject operation middleware

func (*ServerInterfaceWrapper) ResolveString

func (siw *ServerInterfaceWrapper) ResolveString(w http.ResponseWriter, r *http.Request)

ResolveString operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL