gacor

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Unlicense Imports: 4 Imported by: 0

README

Gacor

NOTE:

I'm to lazy to start it from scratch .. so i build this only for me not for you!
BUT if you want to know then just folk this repo and try to figure out what is it by yourself. Thanks!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StorageEngines = struct {
	Postgres string
}{
	Postgres: "POSTGRES",
}

StorageEngines enum

Functions

func EchoStart

func EchoStart(app App) error

EchoStart func

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

func Application

func Application(cfg Config) App

Application func

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 Config

type Config interface {
	Set(k string, v interface{})
	Get(k string) interface{}
}

Config interface

type ConfigContext

type ConfigContext struct {
	Echo echo.Context
}

ConfigContext struct

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 Context

type Context interface {
	Echo() echo.Context
}

Context interface

func NewContext

func NewContext(cx ConfigContext) Context

NewContext func

type HTTPServer

type HTTPServer interface {
	Start() App
	Shutdown() error
}

HTTPServer interface

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 Request

type Request interface {
	EchoBinder(c echo.Context) (err error)
	GetInstance() interface{}
}

Request interface

type Rest

type Rest interface {
	Mount(routes interface{})
	Path() string
}

Rest interface

type Result

type Result struct {
	Data    interface{} `json:"data"`
	Error   error       `json:"error"`
	Message string      `json:"message"`
	Code    int         `json:"code"`
}

Result struct

type Storage

type Storage interface {
	Postgres() (db *gorm.DB)
	Begin(storageEngine string) (db *gorm.DB)
}

Storage interface

type Usecase

type Usecase interface {
	Exec(c Context, d interface{}) Result
}

Usecase interface

Jump to

Keyboard shortcuts

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