From c79c4764739b1ff5121fab49b340682cf3e2607e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Sim=C3=A3o?= Date: Sat, 13 Nov 2021 16:30:02 -0300 Subject: [PATCH] fronted + nats --- api/frontend/lib.go | 29 +++++++++++++++++++++++++++++ api/http/lib.go | 12 ++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 api/frontend/lib.go create mode 100644 api/http/lib.go diff --git a/api/frontend/lib.go b/api/frontend/lib.go new file mode 100644 index 0000000..c0f2383 --- /dev/null +++ b/api/frontend/lib.go @@ -0,0 +1,29 @@ +package frontend + +import "go.digitalcircle.com.br/open/replaycli-go/api" + +type Cli struct { +} + +type HttpRes struct { + Headers map[string]string + Body []byte +} + +type HttpReq struct { + Url string + Headers map[string]string + Body []byte +} + +func (c *Cli) Get(req *HttpReq, copts ...*api.CallOpts) (*HttpRes, error) { + res := &HttpRes{} + //err := c.HttpCli().JsonPost("/ipc/ocr/", opts, res) + err := api.Call("ocr.ocr", req, &res, copts...) + return res, err +} + +func NewCli() *Cli { + ret := &Cli{} + return ret +} diff --git a/api/http/lib.go b/api/http/lib.go new file mode 100644 index 0000000..1707225 --- /dev/null +++ b/api/http/lib.go @@ -0,0 +1,12 @@ +package http + +type HttpRes struct { + Headers map[string]string + Body []byte +} + +type HttpReq struct { + Url string + Headers map[string]string + Body []byte +}