package services import ( "fmt" "log" "ticket-pimp/internal/domain" "time" ) type Coda struct { *CommonClient } type ICoda interface { ListDocs() CreateApp(task domain.CodaIssue) } func NewCodaClient(token string) *Coda { client := NewClient(). SetTimeout(5 * time.Second). SetCommonBearerAuthToken(token). SetBaseURL("https://coda.io/apis/v1") return &Coda{ CommonClient: &CommonClient{ client, }, } } func (c *Coda) ListDocs() { const tableID = "grid-obBN3tWdeh" const docID = "Ic3IZpQ3Wk" //var i []RespObj resp, _ := c.R(). SetQueryParam("tableTypes", "table"). //SetSuccessResult(&i). Get("/docs/" + docID + "/tables/" + tableID + "/rows") if resp.Err != nil { log.Print(resp.Err) return } log.Print(resp) } func (c *Coda) CreateApp(task domain.CodaIssue) { resp, _ := c.R(). SetBody(task). SetContentType("application/json"). Post("/docs/Ic3IZpQ3Wk/hooks/automation/grid-auto-NlUwM7F7Cr") fmt.Print(resp) }