Documentation ¶
Index ¶
- func PrintOne(colNames []string, rows *sql.Rows, w http.ResponseWriter)
- func ProcessStr(str string) string
- type JwtToken
- type SQL
- func (db *SQL) Connect(config *core.Config)
- func (db *SQL) Delete(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Insert(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Login(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Register(handlers *core.Handlers)
- func (db *SQL) Select(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Show(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Status(w http.ResponseWriter, r *http.Request)
- func (db *SQL) Update(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintOne ¶
func PrintOne(colNames []string, rows *sql.Rows, w http.ResponseWriter)
PrintOne : function to print one row from a table
func ProcessStr ¶
ProcessStr : format the str to match sql request
Types ¶
type SQL ¶
SQL :
func (*SQL) Delete ¶
func (db *SQL) Delete(w http.ResponseWriter, r *http.Request)
Delete : delete entry from table
func (*SQL) Insert ¶
func (db *SQL) Insert(w http.ResponseWriter, r *http.Request)
Insert : insert value in table
func (*SQL) Select ¶
func (db *SQL) Select(w http.ResponseWriter, r *http.Request)
Select : Select entry from table ** {GET} /sql/{table}/ ** ** {table} in the URL indicate which table to select in (mandatory) ** ** | NAME | TYPE | DESCRIPTION | EXAMPLE ** @apiParam | field | Array[string] | field to select | field=id ** @apiParam | ijoin | Array[string] | inner join tables | ijoin=table2-id-id ** -> ijoin={table_to_join}-{field_table_to_join}-{field_current_table} ** @apiParam | ojoin | Array[string] | outer join tables | ojoin=table2-id-id ** @apiParam | order | Array[string] | fields used to sort | order=date ** @apiParam | desc | Bool | order by descending if true | desc=true ** @apiParam | where | Array[string] | select only matching param | where=id=1 ** @apiParam | offset | Int | offset (default: 0) | offset=10 ** @apiParam | limit | Int | limit (default: 20) | limit=40
func (*SQL) Show ¶
func (db *SQL) Show(w http.ResponseWriter, r *http.Request)
Show : describe a table