Documentation
¶
Index ¶
- type Component
- type CssGlobal
- type CssPrivate
- type CutData
- type CutResponse
- type Field
- type Input
- type JsGlobal
- type JsListeners
- type JsPrivate
- type Module
- type Object
- func (o Object) Columns() (columns []string)
- func (o Object) DataDecode(cut_data ...CutData) ([]map[string]string, error)
- func (o Object) DataEncode(data map[string]string) CutData
- func (o Object) FieldExist(field_name string) (Field, bool)
- func (o Object) FilterField(nameRequired string) (fielsOut Field)
- func (o Object) FilterFields(namesRequired ...string) (fielsOut []Field)
- func (o Object) FilterRemoveFields(namesToRemove ...string) (fielsOut []Field)
- func (o Object) GetFieldByName(nameRq string) (fielOut Field)
- func (o Object) GetID(data_search map[string]string) string
- func (o Object) GetRepresentativeTextField(data_element map[string]string) (values string)
- func (o Object) MainName() string
- func (o Object) PrimaryKeyName() string
- func (o Object) RenderFields() (fielsOut []Field)
- func (o Object) RequiredFields() (fielsOut []Field)
- func (o Object) ValidateData(validate_all_fields bool, all_data ...map[string]string) (string, bool)
- type Path
- type Permission
- type Request
- type Response
- type Tag
- type TestData
- type UI
- type User
- type Validate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
//ej: search_footer,datalist,form
Name string
// CssGlobal() string | Css Global ej: .mi-style{background:black;}
CssGlobal
// CssPrivate() string | Css Privado
CssPrivate
// JsGlobal() string | Js Global
JsGlobal
// JsPrivate() string | Js Privado Modulo ej: MyFunction(e){console.log("hello ",e)};
JsPrivate
// JsListeners() string | ej: btn.addEventListener('click', MyFunction);
JsListeners
//ej: func (Component) FolderPath() string {
// _, filename, _, _ := runtime.Caller(0)
// dir := filepath.Dir(filename)
// return filepath.ToSlash(dir)
// }
Path
}
type CssPrivate ¶ added in v0.0.5
type CssPrivate interface {
CssPrivate() string
}
type CutData ¶ added in v0.0.19
type CutData struct {
// ej Modelo Objeto: usuario := Object{Name: "Usuario",Fields: []Field{
// {Name: "name"}, //0
// {Name: "email"},//1
// {Name: "phone"},//2
// },}
// ej data normal con todos los campos: {"name":"John Doe","email":"johndoe@example.com","phone":"555"}
// version recortada Data: {"John Doe","johndoe@example.com","555"}
// Index al codificar = {"0:0","1:1","2:2"}
// ej no mail: {"marcel", "777"}
// Index al codificar = {"0:0","1:2"}
Index map[uint8]uint8 `json:"i"`
//Data ej en mapa: "Data":[{"id":"222","name":"manzana","valor":"1200"}]
// ahora: "Data":["222","manzana","1200"]
Data []string `json:"d"`
}
type CutResponse ¶ added in v0.0.19
type CutResponse struct {
//Type,Object,Module,Message
//ej: ["create","user","ModuleUsers","ok"]
CutOptions []string `json:"o"`
CutData []CutData `json:"d"`
}
func (*CutResponse) CutResponseDecode ¶ added in v0.0.21
func (cr *CutResponse) CutResponseDecode(data []map[string]string) (out Response)
type Field ¶
type Field struct {
// si el campo comienza com id_ se considera como único y perteneciente a una tabla específica ej: id_user su tabla es user
// otros ej: id_usuario, apellido, address, city etc
Name string
Unique bool //campo único en db
Inalterable bool //la data en el campo sera inalterable después de la creación (¡no se puede modificar!)
Legend string //como se mostrara al usuario el campo en el encabezado ej: "name" por "Nombre Usuario"
Input
SkipValidation bool //sin validar
SkipCompletionAllowed bool //si el campo es requerido obligatoriamente o no
NotRenderHtml bool // si no se necesita en formulario html
}
type JsListeners ¶ added in v0.0.5
type JsListeners interface {
JsListeners() string
}
type Module ¶
type Module struct {
//nombre modulo ej: chat,patient,user
Name string
//Titulo que vera el usuario ej: "Modulo Fotografía"
Title string
// icono según sprite svg ej: "icon-camera"
Icon string
UI
//areas soportadas por el modulo ej: 'a','t','x'
Areas []byte
// ui/components que usa el modulo ej: form,datalist,search....
Components []Component
// objetos que contiene el modulo ej: patient,user
Objects []Object
}
type Object ¶
type Object struct {
Name string //nombre del objeto o tabla
TextFieldNames []string //nombre de campos mas representativos del objeto o tabla ej: nombre, apellido
Fields []Field //campos del objeto
}
func (Object) DataDecode ¶ added in v0.0.19
func (Object) DataEncode ¶ added in v0.0.19
DataEncode quita los nombres de los campos de la data según modelo del objeto
func (Object) FieldExist ¶ added in v0.0.16
func (Object) FilterField ¶
func (Object) FilterFields ¶
func (Object) FilterRemoveFields ¶
func (Object) GetFieldByName ¶
func (Object) GetRepresentativeTextField ¶
func (Object) PrimaryKeyName ¶
func (Object) RenderFields ¶
func (Object) RequiredFields ¶
type Permission ¶
type Response ¶
type Response struct {
Type string `json:"t,omitempty"` //tipo solicitud respuesta: create, read, update, delete o error
Object string `json:"o,omitempty"` //nombre de la tabla u objeto controlador hacia donde va la solicitud
Module string `json:"m,omitempty"` //nombre del module controlador hacia donde va la solicitud
Message string `json:"g,omitempty"` //mensaje para el usuario de la solicitud
Data []map[string]string `json:"d,omitempty"` //data entrada y respuesta json
SkipMeInResponse bool `json:"-"` // saltarme al difundir
Recipients []string `json:"-"` // lista de ip, token o ids según app para el reenvió al finalizar solicitud
TargetArea bool `json:"-"` // si es falso el destino por defecto es publico de lo contrario sera para todos quines tengan la misma area del usuario solicitante
}
type User ¶
type User struct {
Token string // token de sesión solicitante
Ip string
Name string
Area byte //0 sin area.. un que byte y uint8 son lo mismo en go la idea que aca sea un valor de carácter ej: a,s,p...
AccessLevel uint8 // aquí valor numérico 0 a 255
Packages chan []Response
LastConnection time.Time
}
Click to show internal directories.
Click to hide internal directories.