Documentation
¶
Overview ¶
Package pgfc holds pg functions call methods
Index ¶
Constants ¶
View Source
const ( // SQLMethod is the SQL query for fetching method list // Results: err = rows.Scan(&r.Name, &r.Class, &r.Func, &r.Anno, &r.Sample, &r.Result, &r.IsRO, &r.IsSet, &r.IsStruct) SQLMethod = "select code, nspname, proname, anno, sample, result, is_ro, is_set, is_struct from %s($1)" // SQLInArgs is the SQL query for fetching method arguments definition // Results: err = rows.Scan(&r.Name, &r.Type, &r.Required, &r.Default, &r.Anno) SQLInArgs = "select arg, type, required, def_val, anno from %s($1)" // SQLOutArgs is the SQL query for fetching method results definition // Results: err = rows.Scan(&r.Name, &r.Type, &r.Anno) SQLOutArgs = "select arg, type, anno from %s($1)" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Schema string `long:"db_schema" default:"" description:"Database functions schema name or comma delimited list"`
Debug bool `long:"db_debug" description:"Debug DB operations"`
InDefFunc string `long:"db_indef" default:"func_args" description:"Argument definition function"`
OutDefFunc string `long:"db_outdef" default:"func_result" description:"Result row definition function"`
IndexFunc string `long:"db_index" default:"index" description:"Available functions list"`
ArgSyntax string `long:"db_arg_syntax" default:":=" description:"Default named args syntax (:= or =>)"`
ArgTrimPrefix string `long:"db_arg_prefix" default:"a_" description:"Trim prefix from arg name"`
}
Config defines local application flags
type InDef ¶
type InDef struct {
Name string
Type string
Required bool
// Check string `json:"check,omitempty" sql:"-"` // validate argument
Default *string `json:",omitempty"`
Anno *string `json:",omitempty"`
}
InDef holds function argument attributes
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger holds database logging via given logger
type Method ¶
type Method struct {
Name string
Class string
Func string
Anno string
IsRO bool
IsSet bool
IsStruct bool
Sample *string `json:",omitempty"`
Result *string `json:",omitempty"`
In *map[string]InDef `json:",omitempty"`
Out *[]OutDef `json:",omitempty"`
}
Method holds method attributes
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds RPC methods
func (*Server) Call ¶
func (srv *Server) Call(r *http.Request, method string, args *map[string]interface{}, ) (interface{}, error)
Call postgresql stored function
func (*Server) MethodIsRO ¶
MethodIsRO returns true if method exists and read-only
Click to show internal directories.
Click to hide internal directories.
