Documentation
¶
Overview ¶
Package genelet is a genelet package for genelet framework.
Package genelet provides the Go runtime for Genelet web applications.
Index ¶
- Variables
- func CheckPasswordHash(password, hash string) error
- func DecodeScoder(text string, CRYPTEXT string) string
- func Digest(key string, message ...string) string
- func Digest64(key string, message ...string) string
- func Digesting(key string, message ...string) string
- func Do(method string, url string, form url.Values, header map[string]string) ([]byte, error)
- func Do_hash(method string, url string, form url.Values, header map[string]string) (map[string]interface{}, error)
- func EncodeScoder(text string, CRYPTEXT string) string
- func EnsurePasswordHash(password string) (string, error)
- func Filtering(vs []string, f func(string) bool) []string
- func Get(url string, form url.Values) ([]byte, error)
- func Get_hash(url string, form url.Values) (map[string]interface{}, error)
- func Grep(vs []string, t string) bool
- func HashPassword(password string) (string, error)
- func Index(vs []string, t string) int
- func Int2ip(ip uint32) string
- func Interface2String(v interface{}) string
- func Invoke(any interface{}, name string, args ...interface{}) []reflect.Value
- func Invoke0(any interface{}, name string, args ...interface{})
- func InvokeError(any interface{}, name string, args ...interface{}) error
- func InvokeOptionalVoid(any interface{}, name string, args ...interface{}) error
- func InvokeVoid(any interface{}, name string, args ...interface{}) error
- func Ip2int(ip string) uint32
- func LogInfo(message string, fields map[string]interface{})
- func Map(vs []string, f func(string) string) []string
- func MultipartRequest(url string, form url.Values, paramName, path string) (*http.Request, error)
- func MultipartUpload(url string, form url.Values, header map[string]string, paramName, path string) ([]byte, error)
- func NormalizeDriver(driver string) string
- func Oauth1Request(method string, uri string, hash map[string]string, items []string, ...) ([]byte, error)
- func Oauth1Sign(method string, uri string, hash map[string]string, items []string, ...) string
- func Post(url string, form url.Values) ([]byte, error)
- func PostFile(url string, fn string, header map[string]string) ([]byte, error)
- func PostFile_hash(url string, fn string, header map[string]string) (map[string]interface{}, error)
- func Post_hash(url string, form url.Values) (map[string]interface{}, error)
- func RebindSQL(driver, query string) string
- func Scoder(text string, CRYPTEXT string) []byte
- func SelectConditionString(extra url.Values, table ...string) (string, []interface{})
- func SelectConditionStringSafe(extra url.Values, table ...string) (string, []interface{}, error)
- func SelectLabelString(selectPars interface{}) (string, []string)
- func SelectLabelStringSafe(selectPars interface{}) (string, []string, error)
- func SingleConditionString(keyname interface{}, ids []interface{}, extra ...url.Values) (string, []interface{})
- func SingleConditionStringSafe(keyname interface{}, ids []interface{}, extra ...url.Values) (string, []interface{}, error)
- func SortMapMd5(secret, md5_name string, q url.Values) string
- func Stripchars(chr, str string) string
- func TableString(currentTables []Table) string
- func TableStringSafe(currentTables []Table) (string, error)
- func To_hash(body []byte) (map[string]interface{}, error)
- func To_slice(body []byte) ([]map[string]interface{}, error)
- func TryInvoke(any interface{}, name string, args ...interface{}) (out []reflect.Value, err error)
- func Unix_timestamp() int
- func ValidSQLIdentifier(name string) bool
- func ValidateComponent(comp *Component) error
- func ValidateSQLIdentifier(kind, name string) error
- func ValidateSQLIdentifierList(kind string, names []string) error
- func ValidateSQLJoinCondition(cond string) error
- func ValidateSQLOrderBy(order string) error
- func ValidateSQLQualifiedIdentifier(kind, name string) error
- func ValidateSQLSelectExpression(expr string) error
- type Access
- type Apns
- type Base
- func (self *Base) CSRFInput() template.HTML
- func (self *Base) CSRFToken() string
- func (self *Base) Fulfill() error
- func (self *Base) GetIP() string
- func (self *Base) GetProvider() string
- func (self *Base) GetRole() Role
- func (self *Base) SendNocache(output string)
- func (self *Base) SendPage(output string)
- func (self *Base) SendStatusPage(status int, output ...string)
- func (self *Base) SetCookie(name string, value string, maxAge ...int)
- func (self *Base) SetCookieExpire(name string)
- func (self *Base) SetCookieSession(name string, value string)
- func (self *Base) ValidateCSRF() error
- type Beacon
- type CGI
- type Chartag
- type Component
- type Config
- type Controller
- type Crud
- func (self *Crud) DeleteHash(keyname interface{}, ids []interface{}, extra ...url.Values) error
- func (self *Crud) EditHash(lists *[]map[string]interface{}, selectPars interface{}, keyname interface{}, ...) error
- func (self *Crud) InsertHash(fieldValues url.Values) error
- func (self *Crud) InsupdHash(fieldValues url.Values, upd_fieldValues url.Values, keyname interface{}, ...) error
- func (self *Crud) InsupdTable(fieldValues url.Values, keyname string, uniques []string, s_hash *string) error
- func (self *Crud) ReplaceHash(fieldValues url.Values) error
- func (self *Crud) TopicsHash(lists *[]map[string]interface{}, selectPars interface{}, extra ...url.Values) error
- func (self *Crud) TopicsHashOrder(lists *[]map[string]interface{}, selectPars interface{}, order string, ...) error
- func (self *Crud) TotalHash(hash map[string]interface{}, label string, extra ...url.Values) error
- func (self *Crud) UpdateHash(fieldValues url.Values, keyname interface{}, ids []interface{}, ...) error
- func (self *Crud) UpdateHashNulls(fieldValues url.Values, keyname interface{}, ids []interface{}, ...) error
- type DBI
- func (self *DBI) DoProc(hash map[string]interface{}, names []string, procName string, ...) error
- func (self *DBI) DoSQL(sql string, args ...interface{}) error
- func (self *DBI) DoSQLReturning(sql string, returnLabel string, args ...interface{}) error
- func (self *DBI) DoSQLs(sql string, args [][]interface{}) error
- func (self *DBI) ExecSQL(sql string) error
- func (self *DBI) GetArgs(ARGS url.Values, sql string, args ...interface{}) error
- func (self *DBI) GetSQL(res map[string]interface{}, sql string, args ...interface{}) error
- func (self *DBI) GetSQLLabel(res map[string]interface{}, sql string, selectLabels []string, ...) error
- func (self *DBI) SelectDoProc(lists *[]map[string]interface{}, hash map[string]interface{}, names []string, ...) error
- func (self *DBI) SelectDoProcLabel(lists *[]map[string]interface{}, hash map[string]interface{}, names []string, ...) error
- func (self *DBI) SelectProc(lists *[]map[string]interface{}, procName string, args ...interface{}) error
- func (self *DBI) SelectProcLabel(lists *[]map[string]interface{}, procName string, selectLabels []string, ...) error
- func (self *DBI) SelectSQL(lists *[]map[string]interface{}, sql string, args ...interface{}) error
- func (self *DBI) SelectSQLLabel(lists *[]map[string]interface{}, sql string, selectLabels []string, ...) error
- func (self *DBI) SetDriver(driver string)
- type Filter
- func (self *Filter) After(model *Model) error
- func (self *Filter) Before(model *Model, extra url.Values, nextextra url.Values) error
- func (self *Filter) GetAll() (map[string][]string, []string)
- func (self *Filter) Initialize(comp *Component, logger ...*zap.Logger)
- func (self *Filter) Preset() error
- func (self *Filter) SetAll(base Base, action string, component string, other *map[string]interface{})
- func (self *Filter) SetLoginAs(roleValue, login, uri string, db *sql.DB) error
- type Gate
- func (self *Gate) Forbid() error
- func (self *Gate) GetAttribute(key string) (string, error)
- func (self *Gate) GetAttributes(ref map[string]string) error
- func (self *Gate) HandleLogout() error
- func (self *Gate) SetAttribute(key string, value string) error
- func (self *Gate) SetAttributes(ref map[string]string) error
- type Gcm
- type Gerror
- type Issuer
- type Model
- func (self *Model) CallNextpage(page map[string]interface{}, extra ...url.Values) error
- func (self *Model) CallOnce(page map[string]interface{}, extra ...url.Values) error
- func (self *Model) Delete(extra ...url.Values) error
- func (self *Model) Edit(extra ...url.Values) error
- func (self *Model) Existing(table string, field string, val interface{}) error
- func (self *Model) GetOrderString() string
- func (self *Model) GetOrderStringChecked() (string, error)
- func (self *Model) Initialize(comp *Component, logger ...*zap.Logger)
- func (self *Model) Insert(extra ...url.Values) error
- func (self *Model) Insupd(extra ...url.Values) error
- func (self *Model) ProcessAfter(action string, extra ...url.Values) error
- func (self *Model) ProperValue(v string, extra url.Values) string
- func (self *Model) ProperValues(vs []string, extra url.Values) []string
- func (self *Model) Randomid(table string, field string, m ...interface{}) error
- func (self *Model) SetDB(db *sql.DB)
- func (self *Model) SetDefaults(args url.Values, lists *[]map[string]interface{}, ...)
- func (self *Model) SetDriver(driver string)
- func (self *Model) Topics(extra ...url.Values) error
- func (self *Model) Update(extra ...url.Values) error
- type Oauth1
- type Oauth2
- func (self *Oauth2) Authenticate(login, password string) error
- func (self *Oauth2) Multipart_upload(uri string, form url.Values, paramName, path string) (map[string]interface{}, error)
- func (self *Oauth2) Multipart_uploads(uri string, form url.Values, paramName, path string) ([]map[string]interface{}, error)
- func (self *Oauth2) Oauth2_api(method string, uri string, form url.Values, h map[string]string) (map[string]interface{}, error)
- func (self *Oauth2) Oauth2_apis(method string, uri string, form url.Values, h map[string]string) ([]map[string]interface{}, error)
- type Pattern
- type PatternCase
- type Procedure
- func (self *Procedure) Authenticate(login, passwd string) error
- func (self *Procedure) Authenticate_as(login string) error
- func (self *Procedure) Callback_address() string
- func (self *Procedure) Fill_provider(back map[string]interface{}) error
- func (self *Procedure) Run_sql(call_name string, in_vals []interface{}) error
- type Role
- type Smtp
- type Smtpssl
- type Table
- type Ticket
- type Tmpl
Constants ¶
This section is empty.
Variables ¶
View Source
var HTTPClient = &http.Client{Timeout: 15 * time.Second}
Functions ¶
func CheckPasswordHash ¶
func DecodeScoder ¶
func EncodeScoder ¶
func EnsurePasswordHash ¶
func HashPassword ¶
func Interface2String ¶
func Interface2String(v interface{}) string
func InvokeError ¶
func InvokeOptionalVoid ¶
func InvokeVoid ¶
func MultipartRequest ¶
func MultipartUpload ¶
func NormalizeDriver ¶
func Oauth1Request ¶
func Oauth1Sign ¶
func PostFile_hash ¶
func SelectConditionString ¶
func SelectLabelString ¶
func SelectLabelStringSafe ¶
func SingleConditionString ¶
func Stripchars ¶
func TableString ¶
func TableStringSafe ¶
func Unix_timestamp ¶
func Unix_timestamp() int
func ValidSQLIdentifier ¶
func ValidateComponent ¶
func ValidateSQLIdentifier ¶
func ValidateSQLOrderBy ¶
Types ¶
type Access ¶
func (*Access) VerifyCookie ¶
type Apns ¶
type Base ¶
type Base struct {
C *Config
W http.ResponseWriter
R *http.Request
RoleValue string
ChartagValue string
}
func (*Base) GetProvider ¶
func (*Base) SendNocache ¶
func (*Base) SendStatusPage ¶
func (*Base) SetCookieExpire ¶
func (*Base) SetCookieSession ¶
func (*Base) ValidateCSRF ¶
type Beacon ¶
type Beacon struct {
Controller
RoleValue string
ChartagValue string
Header http.Header
Code int
Redirect string
Content string
// contains filtered or unexported fields
}
type Chartag ¶
type Chartag struct {
ContentType string
Short string
Case int8
Challenge string
Logged string
Logout string
Failed string
}
func (Chartag) CallChallenge ¶
func (Chartag) CallFailed ¶
func (Chartag) CallLogged ¶
func (Chartag) CallLogout ¶
type Component ¶
type Component struct {
Actions map[string]map[string][]string
Fks map[string][]string
Nextpages map[string][]map[string]interface{}
CurrentTable string `json:"current_table"`
CurrentTables []Table `json:"current_tables"`
CurrentKey string `json:"current_key"`
CurrentKeys []string `json:"current_keys"`
CurrentIDAuto string `json:"current_id_auto"`
KeyIN map[string]string `json:"key_in"`
InsertPars []string `json:"insert_pars"`
EditPars []string `json:"edit_pars"`
UpdatePars []string `json:"update_pars"`
InsupdPars []string `json:"insupd_pars"`
TopicsPars []string `json:"topics_pars"`
TopicsHash map[string]string `json:"topics_hash"`
TotalForce int `json:"total_force"`
Empties string
Fields string
Maxpageno string
Totalno string
Rowcount string
Pageno string
Sortreverse string
Sortby string
}
func LoadComponent ¶
func NewComponent ¶
type Config ¶
type Config struct {
UploadDir string
Template string
Pubrole string
Secret string
ServerURL string
CORSOrigins []string
UploadURL string
ServerPort string
DocumentRoot string
ProjectRoot string
Script string
ComponentName string
ActionName string
DefaultActions map[string]string
RoleName string
Oauth2s []string
Oauth1s []string
LoginName string
LogoutName string
TagName string
ProviderName string
CallbackName string
GoStampName string
GoMD5Name string
GoURIName string
GoProbeName string
GoErrName string
UploadMaxBytes int64
CSRFName string
RequestTimeoutSeconds int
ConnectArray []string
Blks map[string]map[string]string
Roles map[string]Role
Errors map[string]string
Custom map[string]string
Patterns []Pattern
}
func (*Config) DriverName ¶
type Controller ¶
type Controller struct {
C *Config
DB *sql.DB
DBDriver string
Models map[string]interface{}
Filters map[string]interface{}
Storage map[string]interface{}
ModelFactories map[string]func() interface{}
FilterFactories map[string]func() interface{}
StorageFactories map[string]func() interface{}
Logger *zap.Logger
}
func NewController ¶
func (*Controller) Handle ¶
func (self *Controller) Handle(obj string, base Base, method string) error
func (*Controller) ServeHTTP ¶
func (self *Controller) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Crud ¶
type Crud struct {
DBI
CurrentTable string `json:"current_table"`
CurrentTables []Table `json:"current_tables"`
LastIDColumn string
}
func (*Crud) DeleteHash ¶
func (*Crud) InsupdHash ¶
func (*Crud) InsupdTable ¶
func (*Crud) TopicsHash ¶
func (*Crud) TopicsHashOrder ¶
func (*Crud) UpdateHash ¶
type DBI ¶
func (*DBI) DoSQLReturning ¶
func (*DBI) GetSQLLabel ¶
func (*DBI) SelectDoProc ¶
func (*DBI) SelectDoProcLabel ¶
func (*DBI) SelectProc ¶
func (*DBI) SelectProcLabel ¶
func (*DBI) SelectSQLLabel ¶
type Filter ¶
type Filter struct {
Base
Action string
Component string
Actions map[string]map[string][]string
Fks map[string][]string
OTHER *map[string]interface{}
Logger *zap.Logger
}
type Gcm ¶
type Model ¶
type Model struct {
Crud
Context context.Context
ARGS url.Values
LISTS *[]map[string]interface{}
OTHER *map[string]interface{}
SORTBY string
SORTREVERSE string
PAGENO string
ROWCOUNT string
TOTALNO string
MAXPAGENO string
FIELD string
EMPTIES string
Nextpages map[string][]map[string]interface{}
Storage map[string]interface{}
CurrentKey string `json:"current_key"`
CurrentKeys []string `json:"current_keys"`
CurrentIDAuto string `json:"current_id_auto"`
KeyIN map[string]string `json:"key_in"`
InsertPars []string `json:"insert_pars"`
EditPars []string `json:"edit_pars"`
UpdatePars []string `json:"update_pars"`
InsupdPars []string `json:"insupd_pars"`
TopicsPars []string `json:"topics_pars"`
TopicsHashpars map[string]string `json:"topics_hashpars"`
TotalForce int `json:"total_force"`
}
func (*Model) CallNextpage ¶
func (*Model) GetOrderString ¶
func (*Model) GetOrderStringChecked ¶
func (*Model) ProcessAfter ¶
func (*Model) ProperValues ¶
func (*Model) SetDefaults ¶
type Oauth2 ¶
func (*Oauth2) Authenticate ¶
func (*Oauth2) Multipart_upload ¶
func (*Oauth2) Multipart_uploads ¶
func (*Oauth2) Oauth2_api ¶
type Procedure ¶
func NewProcedure ¶
func (*Procedure) Authenticate ¶
func (*Procedure) Authenticate_as ¶
func (*Procedure) Callback_address ¶
func (*Procedure) Fill_provider ¶
type Smtp ¶
type Smtpssl ¶
type Ticket ¶
type Ticket struct {
Access
Uri string
Provider string
Out_hash map[string]interface{}
// each item in condition uri is: variable name, how, variable value, base uri, other variable names wholse values would be passed in the redirect.
// how: t--out hash, u--go uri, p--provider; A--equal, B--not equal, C--match; 0--no sign, 1--sign; 0--no authen cookie, 1--yes authen cookie
// for u and p in 'how', 'variable name' will be go_uri that matches
ConditionURI [][]string
}
func (*Ticket) Authenticate ¶
func (*Ticket) GetAttributes ¶
func (*Ticket) HandlerFields ¶
func (*Ticket) Handler_login ¶
Source Files
¶
- access.go
- apns.go
- audit.go
- base.go
- beacon.go
- blks.go
- chartag.go
- component.go
- config.go
- controller.go
- crud.go
- dbi.go
- dialect.go
- doc.go
- drivers.go
- filter.go
- gate.go
- gcm.go
- gerror.go
- mail.go
- model.go
- oauth1.go
- oauth2.go
- password.go
- procedure.go
- scoder.go
- security.go
- smtp.go
- smtpssl.go
- sql_ident.go
- throttle.go
- ticket.go
- tmpl.go
- utils.go
Click to show internal directories.
Click to hide internal directories.