Documentation ¶
Overview ¶
Package trees provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Package trees 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
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type CreateJSONBody
- type CreateJSONRequestBody
- type EchoRouter
- type Error
- type ListParams
- type PGX
- func (P PGX) Count() (int32, error)
- func (P PGX) Create(object Tree) (*Tree, error)
- func (P PGX) Delete(id int32) error
- func (P PGX) Exist(id int32) bool
- func (P PGX) Get(id int32) (*Tree, error)
- func (P PGX) GetMaxId() (int32, error)
- func (P PGX) IsTreeActive(id int32) bool
- func (P PGX) List(offset, limit int) ([]*TreeList, error)
- func (P PGX) SearchTreesByName(pattern string) ([]*TreeList, error)
- func (P PGX) Update(id int32, object Tree) (*Tree, error)
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) Create(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Delete(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Get(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) List(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Update(ctx echo.Context) error
- type Service
- func (s Service) Create(ctx echo.Context) error
- func (s Service) Delete(ctx echo.Context, objectId int32) error
- func (s Service) Get(ctx echo.Context, objectId int32) error
- func (s Service) List(ctx echo.Context, params ListParams) error
- func (s Service) Update(ctx echo.Context, objectId int32) error
- type Storage
- type Tree
- type TreeList
Constants ¶
const (
JWTAuthScopes = "JWTAuth.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 CreateJSONRequestBody ¶
type CreateJSONRequestBody = CreateJSONBody
CreateJSONRequestBody defines body for Create for application/json ContentType.
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 ListParams ¶
type ListParams struct { // maximum number of results to return Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` }
ListParams defines parameters for List.
type ServerInterface ¶
type ServerInterface interface { // List returns a list of trees // (GET /trees) List(ctx echo.Context, params ListParams) error // Create will create a new tree // (POST /trees) Create(ctx echo.Context) error // Delete allows to delete a specific treeId // (DELETE /trees/{treeId}) Delete(ctx echo.Context, treeId int32) error // Get will retrieve in backend all information about a specific treeId // (GET /trees/{treeId}) Get(ctx echo.Context, treeId int32) error // Update allows to modify information about a specific treeId // (PUT /trees/{treeId}) Update(ctx echo.Context, treeId int32) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) Create ¶
func (w *ServerInterfaceWrapper) Create(ctx echo.Context) error
Create converts echo context to params.
func (*ServerInterfaceWrapper) Delete ¶
func (w *ServerInterfaceWrapper) Delete(ctx echo.Context) error
Delete converts echo context to params.
func (*ServerInterfaceWrapper) Get ¶
func (w *ServerInterfaceWrapper) Get(ctx echo.Context) error
Get converts echo context to params.
func (*ServerInterfaceWrapper) List ¶
func (w *ServerInterfaceWrapper) List(ctx echo.Context) error
List converts echo context to params.
func (*ServerInterfaceWrapper) Update ¶
func (w *ServerInterfaceWrapper) Update(ctx echo.Context) error
Update converts echo context to params.
type Service ¶
type Service struct { Log *log.Logger Store Storage JwtSecret []byte JwtDuration int // contains filtered or unexported fields }
func (Service) List ¶
func (s Service) List(ctx echo.Context, params ListParams) error
type Storage ¶
type Storage interface { // List returns the list of existing objects with the given offset and limit. List(offset, limit int) ([]*TreeList, error) // Get returns the object with the specified objects ID. Get(id int32) (*Tree, error) // GetMaxId returns the maximum value of objects id existing in store. GetMaxId() (int32, error) // Exist returns true only if a objects with the specified id exists in store. Exist(id int32) bool // Count returns the total number of objects. Count() (int32, error) // Create saves a new objects in the storage. Create(object Tree) (*Tree, error) // Update updates the objects with given ID in the storage. Update(id int32, object Tree) (*Tree, error) // Delete removes the objects with given ID from the storage. Delete(id int32) error // SearchTreesByName list of existing objects where the name contains the given search pattern or err if not found SearchTreesByName(pattern string) ([]*TreeList, error) // IsTreeActive returns true if the object with the specified id has the is_active attribute set to true IsTreeActive(id int32) bool }
Storage is an interface to different implementation of persistence for Trees
type Tree ¶
type Tree struct { Comment *string `json:"comment,omitempty"` CreateTime time.Time `json:"create_time"` Creator int32 `json:"creator"` Description *string `json:"description,omitempty"` ExternalId *int32 `json:"external_id,omitempty"` Id int32 `json:"id"` IdValidator *int32 `json:"id_validator,omitempty"` InactivationReason *string `json:"inactivation_reason,omitempty"` InactivationTime *time.Time `json:"inactivation_time,omitempty"` IsActive bool `json:"is_active"` IsValidated *bool `json:"is_validated,omitempty"` LastModificationTime *time.Time `json:"last_modification_time,omitempty"` LastModificationUser *int32 `json:"last_modification_user,omitempty"` Name string `json:"name"` }
Tree defines model for Tree.
type TreeList ¶
type TreeList struct { CreateTime time.Time `json:"create_time"` Creator int32 `json:"creator"` Description *string `json:"description,omitempty"` ExternalId *int32 `json:"external_id,omitempty"` Id int32 `json:"id"` IsActive bool `json:"is_active"` Name string `json:"name"` }
TreeList defines model for TreeList.