{"modulePath":"github.com/ascendsoftware/oapi-codegen","version":"v1.0.12","isLatest":false,"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/ascendsoftware/oapi-codegen version (devel) DO NOT EDIT.\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 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 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 PetStore struct {\n\tPets   map[int64]models.Pet\n\tNextId int64\n\tLock   sync.Mutex\n}\n```\n\n```go\nfunc NewPetStore() *PetStore\n```\n\n```go\nfunc (p *PetStore) AddPet(ctx echo.Context) error\n```\n\n```go\nfunc (p *PetStore) DeletePet(ctx echo.Context, id int64) error\n```\n\n```go\nfunc (p *PetStore) FindPetByID(ctx echo.Context, petId int64) error\n```\n\n```go\nfunc (p *PetStore) FindPets(ctx echo.Context, params models.FindPetsParams) error\n```\nFindPets implements all the handlers in the ServerInterface\n\n```go\ntype ServerInterface interface {\n\t// Returns all pets\n\t// (GET /pets)\n\tFindPets(ctx echo.Context, params FindPetsParams) error\n\t// Creates a new pet\n\t// (POST /pets)\n\tAddPet(ctx echo.Context) error\n\t// Deletes a pet by ID\n\t// (DELETE /pets/{id})\n\tDeletePet(ctx echo.Context, id int64) error\n\t// Returns a pet by ID\n\t// (GET /pets/{id})\n\tFindPetByID(ctx echo.Context, id int64) 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) AddPet(ctx echo.Context) error\n```\nAddPet converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) DeletePet(ctx echo.Context) error\n```\nDeletePet converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) FindPetByID(ctx echo.Context) error\n```\nFindPetByID converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) FindPets(ctx echo.Context) error\n```\nFindPets converts echo context to params.\n\n","path":"github.com/ascendsoftware/oapi-codegen/examples/petstore-expanded/echo/api","name":"api","synopsis":"Package api provides primitives to interact with the openapi HTTP API.","isRedistributable":true}
