Documentation
¶
Index ¶
- Variables
- func GetCache(key string) (value.Value, bool)
- func GetDB() *sql.DB
- func InitDB(cfg security.DBConfig) error
- func SetCache(key string, val value.Value, ttl time.Duration)
- type CacheItem
- type DBQuery
- func (q *DBQuery) All() value.Value
- func (q *DBQuery) Avg(column string) value.Value
- func (q *DBQuery) Find(idOrFn any) value.Value
- func (q *DBQuery) First() value.Value
- func (q *DBQuery) From(table string) *DBQuery
- func (q *DBQuery) Get() value.Value
- func (q *DBQuery) Group(columns ...string) *DBQuery
- func (q *DBQuery) Having(args ...value.Value) *DBQuery
- func (q *DBQuery) In(columnOrFn any, vals ...any) *DBQuery
- func (q *DBQuery) Insert(data value.Value) *DBQuery
- func (q *DBQuery) Join(tableOrFn any, args ...value.Value) *DBQuery
- func (q *DBQuery) Last() value.Value
- func (q *DBQuery) LeftJoin(tableOrFn any, args ...value.Value) *DBQuery
- func (q *DBQuery) Like(columnOrFn any, pattern ...string) *DBQuery
- func (q *DBQuery) Limit(n float64) *DBQuery
- func (q *DBQuery) Max(column string) value.Value
- func (q *DBQuery) Min(column string) value.Value
- func (q *DBQuery) NotNull(column string) *DBQuery
- func (q *DBQuery) Null(column string) *DBQuery
- func (q *DBQuery) Offset(n float64) *DBQuery
- func (q *DBQuery) On(args ...value.Value) *DBQuery
- func (q *DBQuery) One() value.Value
- func (q *DBQuery) Or(args ...value.Value) *DBQuery
- func (q *DBQuery) OrderBy(column string, direction ...string) *DBQuery
- func (q *DBQuery) Select(fields ...string) *DBQuery
- func (q *DBQuery) SetExecutor(e LambdaExecutor)
- func (q *DBQuery) Skip(n float64) *DBQuery
- func (q *DBQuery) String() string
- func (q *DBQuery) Sum(column string) value.Value
- func (q *DBQuery) Table(table string) *DBQuery
- func (q *DBQuery) Take(args ...value.Value) value.Value
- func (q *DBQuery) Where(args ...value.Value) *DBQuery
- type HTTPClient
- type LambdaExecutor
- type Route
- type Router
- type SQLProxyHandler
- type StaticRoute
- type Task
- func (t *Task) DB() *DBQuery
- func (t *Task) GetBody() value.Value
- func (t *Task) GetParams() value.Value
- func (t *Task) GetQuery() value.Value
- func (t *Task) HTML(template value.Value, data ...value.Value)
- func (t *Task) HTTP() *HTTPClient
- func (t *Task) JSON(val value.Value)
- func (t *Task) Log(args ...value.Value)
- func (t *Task) Now() value.Value
- func (t *Task) Payload() value.Value
- func (t *Task) Print(args ...value.Value)
- func (t *Task) Reset(w *Work)
- func (t *Task) SetBody(v value.Value)
- func (t *Task) SetQuery(v value.Value)
- func (t *Task) SetRequest(r *http.Request, w http.ResponseWriter)
- type Work
- func (w *Work) Cache(duration any) *Work
- func (w *Work) Delete(args ...value.Value) *Work
- func (w *Work) Get(args ...value.Value) *Work
- func (w *Work) Handle(fn value.Value) *Work
- func (w *Work) LoadFromConfig(data map[string]any)
- func (w *Work) Post(args ...value.Value) *Work
- func (w *Work) Put(args ...value.Value) *Work
- func (w *Work) Retry(times int, _ string) *Work
- func (w *Work) Router(args ...value.Value) *Work
- func (w *Work) Version(v string) *Work
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalRouter = &Router{}
Functions ¶
Types ¶
type DBQuery ¶
type DBQuery struct {
// contains filtered or unexported fields
}
func NewDBQuery ¶
func NewDBQuery() *DBQuery
func (*DBQuery) SetExecutor ¶
func (q *DBQuery) SetExecutor(e LambdaExecutor)
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(t *Task) *HTTPClient
type LambdaExecutor ¶
type Route ¶
type Route struct {
Method string
Path string
Fn *value.ScriptFunction
Work *Work // Exec context
}
type SQLProxyHandler ¶
SQLProxyHandler implements value.ProxyHandler to capture SQL conditions
type StaticRoute ¶
type StaticRoute struct {
Method string
Path string
Handler *value.ScriptFunction
}
StaticRoute đại diện cho một rule điều hướng tĩnh
type Task ¶
type Task struct {
Work *Work
Request *http.Request
Writer http.ResponseWriter
Params map[string]value.Value // URL Path params like :id
Response value.Value
ResType string
Config map[string]string
}
Task đại diện cho một phiên thực thi (Mutable Context)
func (*Task) HTTP ¶
func (t *Task) HTTP() *HTTPClient
func (*Task) SetRequest ¶
func (t *Task) SetRequest(r *http.Request, w http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.