{"modulePath":"github.com/romulets/oapi-codegen","version":"v1.11.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\nPackage api provides primitives to interact with the openapi HTTP API.\n\nCode generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT.\n\n## Constants\n\n```go\nconst (\n\tBearerAuthScopes = \"BearerAuth.Scopes\"\n)\n```\n\n## Functions\n\n```go\nfunc GetSwagger() (swagger *openapi3.T, err error)\n```\nGetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to \"import-mapping\" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.\n\n```go\nfunc NewAddThingRequest(server string, body AddThingJSONRequestBody) (*http.Request, error)\n```\nNewAddThingRequest calls the generic AddThing builder with application/json body\n\n```go\nfunc NewAddThingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)\n```\nNewAddThingRequestWithBody generates requests for AddThing with any type of body\n\n```go\nfunc NewListThingsRequest(server string) (*http.Request, error)\n```\nNewListThingsRequest generates requests for ListThings\n\n```go\nfunc PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)\n```\nConstructs a synthetic filesystem for resolving external references when loading openapi specifications.\n\n```go\nfunc RegisterHandlers(router EchoRouter, si ServerInterface)\n```\nRegisterHandlers adds each server route to the EchoRouter.\n\n```go\nfunc RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)\n```\nRegisters handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.\n\n## Types\n\n```go\ntype AddThingJSONRequestBody = Thing\n```\nAddThingJSONRequestBody defines body for AddThing for application/json ContentType.\n\n```go\ntype AddThingResponse struct {\n\tBody         []byte\n\tHTTPResponse *http.Response\n\tJSON201      *[]ThingWithID\n}\n```\n\n```go\nfunc ParseAddThingResponse(rsp *http.Response) (*AddThingResponse, error)\n```\nParseAddThingResponse parses an HTTP response from a AddThingWithResponse call\n\n```go\nfunc (r AddThingResponse) Status() string\n```\nStatus returns HTTPResponse.Status\n\n```go\nfunc (r AddThingResponse) StatusCode() int\n```\nStatusCode returns HTTPResponse.StatusCode\n\n```go\ntype Client struct {\n\t// The endpoint of the server conforming to this interface, with scheme,\n\t// https://api.deepmap.com for example. This can contain a path relative\n\t// to the server, such as https://api.deepmap.com/dev-test, and all the\n\t// paths in the swagger spec will be appended to the server.\n\tServer string\n\n\t// Doer for performing requests, typically a *http.Client with any\n\t// customized settings, such as certificate chains.\n\tClient HttpRequestDoer\n\n\t// A list of callbacks for modifying requests which are generated before sending over\n\t// the network.\n\tRequestEditors []RequestEditorFn\n}\n```\nClient which conforms to the OpenAPI3 specification for this service.\n\n```go\nfunc NewClient(server string, opts ...ClientOption) (*Client, error)\n```\nCreates a new Client, with reasonable defaults\n\n```go\nfunc (c *Client) AddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)\n```\n\n```go\nfunc (c *Client) AddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)\n```\n\n```go\nfunc (c *Client) ListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)\n```\n\n```go\ntype ClientInterface interface {\n\t// ListThings request\n\tListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)\n\n\t// AddThing request with any body\n\tAddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)\n\n\tAddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)\n}\n```\nThe interface specification for the client above.\n\n```go\ntype ClientOption func(*Client) error\n```\nClientOption allows setting custom parameters during construction\n\n```go\nfunc WithBaseURL(baseURL string) ClientOption\n```\nWithBaseURL overrides the baseURL.\n\n```go\nfunc WithHTTPClient(doer HttpRequestDoer) ClientOption\n```\nWithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.\n\n```go\nfunc WithRequestEditorFn(fn RequestEditorFn) ClientOption\n```\nWithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.\n\n```go\ntype ClientWithResponses struct {\n\tClientInterface\n}\n```\nClientWithResponses builds on ClientInterface to offer response payloads\n\n```go\nfunc NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)\n```\nNewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling\n\n```go\nfunc (c *ClientWithResponses) AddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error)\n```\nAddThingWithBodyWithResponse request with arbitrary body returning \\*AddThingResponse\n\n```go\nfunc (c *ClientWithResponses) AddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error)\n```\n\n```go\nfunc (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error)\n```\nListThingsWithResponse request returning \\*ListThingsResponse\n\n```go\ntype ClientWithResponsesInterface interface {\n\t// ListThings request\n\tListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error)\n\n\t// AddThing request with any body\n\tAddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error)\n\n\tAddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error)\n}\n```\nClientWithResponsesInterface is the interface specification for the client with responses above.\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 Error struct {\n\t// Code Error code\n\tCode int32 `json:\"code\"`\n\n\t// Message Error message\n\tMessage string `json:\"message\"`\n}\n```\nError defines model for Error.\n\n```go\ntype HttpRequestDoer interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n```\nDoer performs HTTP requests.\n\nThe standard http.Client implements this interface.\n\n```go\ntype ListThingsResponse struct {\n\tBody         []byte\n\tHTTPResponse *http.Response\n\tJSON200      *[]ThingWithID\n}\n```\n\n```go\nfunc ParseListThingsResponse(rsp *http.Response) (*ListThingsResponse, error)\n```\nParseListThingsResponse parses an HTTP response from a ListThingsWithResponse call\n\n```go\nfunc (r ListThingsResponse) Status() string\n```\nStatus returns HTTPResponse.Status\n\n```go\nfunc (r ListThingsResponse) StatusCode() int\n```\nStatusCode returns HTTPResponse.StatusCode\n\n```go\ntype RequestEditorFn func(ctx context.Context, req *http.Request) error\n```\nRequestEditorFn  is the function signature for the RequestEditor callback function\n\n```go\ntype ServerInterface interface {\n\n\t// (GET /things)\n\tListThings(ctx echo.Context) error\n\n\t// (POST /things)\n\tAddThing(ctx echo.Context) error\n}\n```\nServerInterface represents all server handlers.\n\n```go\ntype ServerInterfaceWrapper struct {\n\tHandler ServerInterface\n}\n```\nServerInterfaceWrapper converts echo contexts to parameters.\n\n```go\nfunc (w *ServerInterfaceWrapper) AddThing(ctx echo.Context) error\n```\nAddThing converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) ListThings(ctx echo.Context) error\n```\nListThings converts echo context to params.\n\n```go\ntype Thing struct {\n\tName string `json:\"name\"`\n}\n```\nThing defines model for Thing.\n\n```go\ntype ThingWithID struct {\n\tId   int64  `json:\"id\"`\n\tName string `json:\"name\"`\n}\n```\nThingWithID defines model for ThingWithID.\n\n","path":"github.com/romulets/oapi-codegen/examples/authenticated-api/echo/api","name":"api","synopsis":"Package api provides primitives to interact with the openapi HTTP API.","isRedistributable":true}
