Documentation ¶
Index ¶
- func DumpHeaders(headers map[string]spec.Header)
- func WalkOps(spec *spec.Swagger, fn WalkOpsFunc)
- type LogReporter
- type Opts
- type Proxy
- func (proxy *Proxy) AppConfig() *appconfig.AppConfig
- func (proxy *Proxy) Handler(next http.Handler) http.Handler
- func (proxy *Proxy) PendingOperations() []*spec.Operation
- func (proxy *Proxy) Router() http.Handler
- func (proxy *Proxy) SetSpec(spec *spec.Swagger) error
- func (proxy *Proxy) Target() string
- func (proxy *Proxy) Validate(resp Response, op *spec.Operation) error
- func (proxy *Proxy) ValidateBody(resp Response, op *spec.Operation) error
- func (proxy *Proxy) ValidateHeaders(resp Response, op *spec.Operation) error
- func (proxy *Proxy) ValidateMIME(resp Response, op *spec.Operation) error
- type Reporter
- type Response
- type WalkOpsFunc
- type WriterRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WalkOps ¶
func WalkOps(spec *spec.Swagger, fn WalkOpsFunc)
WalkOps ... For all the paths in the spec get the operations and methods call the WalkOpsFunc (which is passed in) to process
Types ¶
type LogReporter ¶
type LogReporter struct { }
LogReporter - type for "Logging" using the Reporter Interface Naming likey needs tidying a bit
func (*LogReporter) Error ¶
func (r *LogReporter) Error(req *http.Request, err error)
Error - log error event
func (*LogReporter) Success ¶
func (r *LogReporter) Success(req *http.Request)
Success - log successful event
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy defining type
func (*Proxy) PendingOperations ¶
PendingOperations -
func (*Proxy) SetSpec ¶
SetSpec - Marshalls the spec into a generic doc interface for the purpose of validating the spec (if it won't marshall its broken) The doc interface is useful in other scenarious within the proxy
func (*Proxy) ValidateBody ¶
ValidateBody -
func (*Proxy) ValidateHeaders ¶
ValidateHeaders -
type Reporter ¶
type Reporter interface { Success(req *http.Request) Error(req *http.Request, err error) Warning(req *http.Request, msg string) Report() }
Reporter Interface - types implementing this interface can be wired to receive
type WalkOpsFunc ¶
WalkOpsFunc - for use with the WalkOps spec iterator Define func type to handline data structure walking
type WriterRecorder ¶
type WriterRecorder struct { http.ResponseWriter // contains filtered or unexported fields }
WriterRecorder - struct to access call responses
func (*WriterRecorder) Body ¶
func (w *WriterRecorder) Body() []byte
Body - return the response body
func (*WriterRecorder) Status ¶
func (w *WriterRecorder) Status() int
Status - returns the response status
func (*WriterRecorder) Write ¶
func (w *WriterRecorder) Write(body []byte) (n int, err error)
Write - the body of the response
func (*WriterRecorder) WriteHeader ¶
func (w *WriterRecorder) WriteHeader(status int)
WriteHeader - sorts out the response header status