Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StorageEngines = struct { Postgres string }{ Postgres: "POSTGRES", }
StorageEngines enum
Functions ¶
Types ¶
type API ¶
type API interface {
Connect() error
WhenDown(func()) error
WhenUp(func()) error
Post(p *APIParam) Result
Put(p *APIParam) Result
Get(p *APIParam) Result
Delete(p *APIParam) Result
Option(p *APIParam) Result
}
API interface
type APIParam ¶
type APIParam struct {
Headers map[string]string
Data map[string]interface{}
Path string
Binder interface{}
URL *string
}
APIParam struct
type App ¶
type App interface {
Start() App
Config() Config
Exit()
Storage() Storage
SetStorage(Storage)
Register(cu *ConfigUsecase)
Usecases() []*ConfigUsecase
AddCRepository(name string, rp CRepository)
AddRepository(name string, rp Repository)
GetCRepository(name string) CRepository
GetRepository(name string) Repository
Repositories() map[string]Repository
CRepositories() map[string]CRepository
RegisterHelper(h interface{})
Helper() interface{}
}
App interface
type CAPI ¶
type CAPI interface {
Connect() error
WhenDown(func()) error
WhenUp(func()) error
Post(p *APIParam) <-chan Result
Put(p *APIParam) <-chan Result
Get(p *APIParam) <-chan Result
Delete(p *APIParam) <-chan Result
Option(p *APIParam) <-chan Result
}
CAPI interface
type CRepository ¶
type CRepository interface {
Get(rp *RepoParam) <-chan Result
Create(rp *RepoParam) <-chan Result
Update(rp *RepoParam) <-chan Result
Delete(rp *RepoParam) <-chan Result
CustomFunc(rp *RepoParam) <-chan Result
}
CRepository interface
type ConfigUsecase ¶
type ConfigUsecase struct {
RestPath string
Topics []string
Usecase func(c Context, request interface{}) Result
RequestParser func() Request
Version string
Enable bool
HTTPMethod string
Middleware *Middleware
}
ConfigUsecase struct
type Middleware ¶
type Middleware struct {
Echo func(c echo.HandlerFunc) echo.HandlerFunc
}
Middleware struct
type RepoParam ¶
type RepoParam struct {
Fn string
Data interface{}
UniqueID interface{}
Context Context
Binder interface{}
Transaction *gorm.DB
}
RepoParam struct
type Repository ¶
type Repository interface {
Get(rp *RepoParam) Result
Create(rp *RepoParam) Result
Update(rp *RepoParam) Result
Delete(rp *RepoParam) Result
CustomFunc(rp *RepoParam) Result
}
Repository interface
type Result ¶
type Result struct {
Data interface{} `json:"data"`
Error error `json:"error"`
Message string `json:"message"`
Code int `json:"code"`
}
Result struct
Click to show internal directories.
Click to hide internal directories.