Documentation
¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Index ¶
- Constants
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type EchoRouter
- type Page
- type PageCreateJSONRequestBody
- type PageListParams
- type PageUpdateJSONRequestBody
- type Pages
- type PaginatedList
- type Post
- type PostCreateJSONRequestBody
- type PostListParams
- type PostUpdateJSONRequestBody
- type Posts
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) PageCreate(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PageFindBySlug(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PageList(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PageUpdate(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Ping(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostCreate(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostFindBySlug(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostList(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostUpdate(ctx echo.Context) error
Constants ¶
const (
CookieAuthScopes = "cookieAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This 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
type Page ¶
type Page struct { CreatedAt *time.Time `json:"created_at,omitempty"` Html *string `json:"html,omitempty"` Id *openapi_types.UUID `json:"id,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` Slug string `json:"slug"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Page defines model for Page.
type PageCreateJSONRequestBody ¶
type PageCreateJSONRequestBody = Page
PageCreateJSONRequestBody defines body for PageCreate for application/json ContentType.
type PageListParams ¶
type PageListParams struct { PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` Page *int `form:"page,omitempty" json:"page,omitempty"` IncludeDrafts *bool `form:"include_drafts,omitempty" json:"include_drafts,omitempty"` }
PageListParams defines parameters for PageList.
type PageUpdateJSONRequestBody ¶
type PageUpdateJSONRequestBody = Page
PageUpdateJSONRequestBody defines body for PageUpdate for application/json ContentType.
type Pages ¶
type Pages struct { // NextPageToken is empty if there's no next page NextPageToken string `json:"next_page_token"` Pages []Page `json:"pages"` TotalSize int `json:"total_size"` }
Pages defines model for Pages.
type PaginatedList ¶
type PaginatedList struct { // NextPageToken is empty if there's no next page NextPageToken string `json:"next_page_token"` TotalSize int `json:"total_size"` }
PaginatedList defines model for PaginatedList.
type Post ¶
type Post struct { Content string `json:"content"` CreatedAt *time.Time `json:"created_at,omitempty"` Id *openapi_types.UUID `json:"id,omitempty"` Namespace *string `json:"namespace,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` Slug string `json:"slug"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Post defines model for Post.
type PostCreateJSONRequestBody ¶
type PostCreateJSONRequestBody = Post
PostCreateJSONRequestBody defines body for PostCreate for application/json ContentType.
type PostListParams ¶
type PostListParams struct { PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"` Page *int `form:"page,omitempty" json:"page,omitempty"` IncludeDrafts *bool `form:"include_drafts,omitempty" json:"include_drafts,omitempty"` }
PostListParams defines parameters for PostList.
type PostUpdateJSONRequestBody ¶
type PostUpdateJSONRequestBody = Post
PostUpdateJSONRequestBody defines body for PostUpdate for application/json ContentType.
type Posts ¶
type Posts struct { // NextPageToken is empty if there's no next page NextPageToken string `json:"next_page_token"` Posts []Post `json:"posts"` TotalSize int `json:"total_size"` }
Posts defines model for Posts.
type ServerInterface ¶
type ServerInterface interface { // lists all pages // (GET /pages/{namespace}) PageList(ctx echo.Context, namespace string, params PageListParams) error // Creates a new page // (POST /pages/{namespace}) PageCreate(ctx echo.Context, namespace string) error // Updates an existing page // (PUT /pages/{namespace}/{id}) PageUpdate(ctx echo.Context, namespace string, id string) error // Returns page content for a given slug // (GET /pages/{namespace}/{slug}) PageFindBySlug(ctx echo.Context, namespace string, slug string) error // Checks if service is responsive // (GET /ping) Ping(ctx echo.Context) error // lists all posts // (GET /posts/{namespace}) PostList(ctx echo.Context, namespace string, params PostListParams) error // Creates a new post // (POST /posts/{namespace}) PostCreate(ctx echo.Context, namespace string) error // Updates an existing post // (PUT /posts/{namespace}/{id}) PostUpdate(ctx echo.Context, namespace string, id string) error // Returns page content for a given slug // (GET /posts/{namespace}/{slug}) PostFindBySlug(ctx echo.Context, namespace string, slug string) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) PageCreate ¶
func (w *ServerInterfaceWrapper) PageCreate(ctx echo.Context) error
PageCreate converts echo context to params.
func (*ServerInterfaceWrapper) PageFindBySlug ¶
func (w *ServerInterfaceWrapper) PageFindBySlug(ctx echo.Context) error
PageFindBySlug converts echo context to params.
func (*ServerInterfaceWrapper) PageList ¶
func (w *ServerInterfaceWrapper) PageList(ctx echo.Context) error
PageList converts echo context to params.
func (*ServerInterfaceWrapper) PageUpdate ¶
func (w *ServerInterfaceWrapper) PageUpdate(ctx echo.Context) error
PageUpdate converts echo context to params.
func (*ServerInterfaceWrapper) Ping ¶
func (w *ServerInterfaceWrapper) Ping(ctx echo.Context) error
Ping converts echo context to params.
func (*ServerInterfaceWrapper) PostCreate ¶
func (w *ServerInterfaceWrapper) PostCreate(ctx echo.Context) error
PostCreate converts echo context to params.
func (*ServerInterfaceWrapper) PostFindBySlug ¶
func (w *ServerInterfaceWrapper) PostFindBySlug(ctx echo.Context) error
PostFindBySlug converts echo context to params.
func (*ServerInterfaceWrapper) PostList ¶
func (w *ServerInterfaceWrapper) PostList(ctx echo.Context) error
PostList converts echo context to params.
func (*ServerInterfaceWrapper) PostUpdate ¶
func (w *ServerInterfaceWrapper) PostUpdate(ctx echo.Context) error
PostUpdate converts echo context to params.