core

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(h Handler, noun string) (*lambgoAPI, error)

Router defines all the endpoints of the app

func NewRestClient added in v0.2.0

func NewRestClient(url string, headers http.Header, exec Executor) client

Types

type Executor added in v0.2.0

type Executor interface {
	Do(req *http.Request) (*http.Response, error)
}

Client - basic http client

type Handler

type Handler struct {
	Creator interface {
		Create(c any) (any, error)
	}
	Reader interface {
		Read(id any) (any, error)
		ReadAll(limit, marker any) ([]any, error)
	}
	Updater interface {
		Update(r any) (any, error)
	}
	Deleter interface {
		Delete(id any) error
	}
	Executor interface {
		Execute(e any) (any, error)
		Action() string
	}
}

func (Handler) BasicCheck

func (h Handler) BasicCheck(c echo.Context) error

BasicCheck - basic health check response

func (Handler) Create

func (h Handler) Create(c echo.Context) error

Create - creater lambgo

func (Handler) Delete

func (h Handler) Delete(c echo.Context) error

Delete - deleter lambgo

func (Handler) Execute

func (h Handler) Execute(c echo.Context) error

Executor - executor lambgo

func (Handler) Read

func (h Handler) Read(c echo.Context) error

Read - readr lambgo

func (Handler) ReadAll

func (h Handler) ReadAll(c echo.Context) error

ReadAll - read all lambgo

func (Handler) Update

func (h Handler) Update(c echo.Context) error

Update - updater lambgo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL