Documentation
¶
Index ¶
- type Component
- type Field
- type JS
- type Module
- type Object
- func (o *Object) Columns() (columns []string)
- 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)
- type Permission
- type Request
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 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
//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
//operaciones permitidas según nivel de acceso ej: 0,1,2,3,4 + Create bool, Update bool, Delete bool
OperationsAllowed map[uint8]Permission
}
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.