mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 09:12:25 +00:00
update annotations
This commit is contained in:
@@ -4,46 +4,51 @@
|
|||||||
---@alias AnyTable table<string, Any>
|
---@alias AnyTable table<string, Any>
|
||||||
|
|
||||||
--- Global session module interface
|
--- Global session module interface
|
||||||
|
---@class SessionIn
|
||||||
|
---@field params AnyTable Request parameters
|
||||||
|
|
||||||
|
---@class SessionOut
|
||||||
|
---@field result Any|string? Result payload (table or primitive)
|
||||||
|
---@field error { code: integer, message: string, data: Any }? Optional error info
|
||||||
|
|
||||||
---@class SessionModule
|
---@class SessionModule
|
||||||
---@field in AnyTable Input context (read-only)
|
---@field in SessionIn Input context (read-only)
|
||||||
---@field in.params AnyTable Request parameters
|
---@field out SessionOut Output context (write results/errors)
|
||||||
---@field out AnyTable Output context (write results/errors)
|
|
||||||
---@field out.result Any|string? Result payload (table or primitive)
|
|
||||||
---@field out.error { code: integer, message: string }? Optional error info
|
|
||||||
|
|
||||||
--- Global log module interface
|
--- Global log module interface
|
||||||
---@class LogModule
|
---@class LogModule
|
||||||
---@field info fun(msg: string) Log informational message
|
---@field info fun(msg: string) Log informational message
|
||||||
---@field debug fun(msg: string) Log debug message
|
---@field debug fun(msg: string) Log debug message
|
||||||
---@field error fun(msg: string) Log error message
|
---@field error fun(msg: string) Log error message
|
||||||
---@field warn fun(msg: string) Log warning message
|
---@field warn fun(msg: string) Log warning message
|
||||||
---@field event fun(msg: string) Log event (generic)
|
---@field event fun(msg: string) Log event (generic)
|
||||||
---@field event_error fun(msg: string) Log event error
|
---@field event_error fun(msg: string) Log event error
|
||||||
---@field event_warn fun(msg: string) Log event warning
|
---@field event_warn fun(msg: string) Log event warning
|
||||||
|
|
||||||
--- Global net module interface
|
--- Global net module interface
|
||||||
---@class HttpResponse
|
---@class HttpResponse
|
||||||
---@field status integer HTTP status code
|
---@field status integer HTTP status code
|
||||||
---@field status_text string HTTP status text
|
---@field status_text string HTTP status text
|
||||||
---@field body string Response body
|
---@field body string Response body
|
||||||
---@field content_length integer Content length
|
---@field content_length integer Content length
|
||||||
---@field headers AnyTable Map of headers
|
---@field headers AnyTable Map of headers
|
||||||
|
|
||||||
---@class HttpModule
|
---@class HttpModule
|
||||||
---@field get fun(log: boolean, url: string): HttpResponse, string? Perform GET
|
---@field get fun(log: boolean, url: string): HttpResponse, string? Perform GET
|
||||||
---@field post fun(log: boolean, url: string, content_type: string, payload: string): HttpResponse, string? Perform POST
|
---@field post fun(log: boolean, url: string, content_type: string, payload: string): HttpResponse, string? Perform POST
|
||||||
|
|
||||||
---@class NetModule
|
---@class NetModule
|
||||||
---@field http HttpModule HTTP client functions
|
---@field http HttpModule HTTP client functions
|
||||||
|
|
||||||
--- Global session variable
|
--- Global variables declaration
|
||||||
|
---@global
|
||||||
---@type SessionModule
|
---@type SessionModule
|
||||||
_G.session = _G.session or {}
|
_G.session = session or {}
|
||||||
|
|
||||||
--- Global log variable
|
---@global
|
||||||
---@type LogModule
|
---@type LogModule
|
||||||
_G.log = _G.log or {}
|
_G.log = log or {}
|
||||||
|
|
||||||
--- Global net variable
|
---@global
|
||||||
---@type NetModule
|
---@type NetModule
|
||||||
_G.net = _G.net or {}
|
_G.net = net or {}
|
||||||
Reference in New Issue
Block a user