cutkey

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2023 License: MIT Imports: 4 Imported by: 4

README

cutkey

protocolo escrito en go para intercambio de data json sin enviar el nombre de los campos solo funciona con mapa de string (map[string]string)

la idea principal es enviar la menor data posible que no es util.

esta pensado para trabajar con go del lado del cliente compilado a WebAssembly.

se eligió la librería cbor para codificar según la chatGpt es compatible con tinyGo ..no lo he probado aun..

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(models *map[string]model.Object) *cut

Types

type CutData

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

type CutResponse struct {
	//Type,Object,Module,Message
	//ej: ["read","user","Users","ok"]
	CutOptions []string  `json:"o"`
	CutData    []CutData `json:"d"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL