An open API service indexing awesome lists of open source software.

https://github.com/blockdaemon/tipe-go

Tipe Golang SDK
https://github.com/blockdaemon/tipe-go

tipe

Last synced: 4 months ago
JSON representation

Tipe Golang SDK

Awesome Lists containing this project

README

        

# tipe-go

[![GoDoc](https://godoc.org/github.com/Blockdaemon/tipe-go?status.svg)](https://godoc.org/github.com/Blockdaemon/tipe-go)

Tipe Golang SDK

```bash
go get github.com/Blockdaemon/tipe-go
```

## Example

```go
import (
"context"
"fmt"

"github.com/Blockdaemon/tipe-go"
)

type Document struct {
CreatedBy tipe.CreatedBy `json:"createdBy"`
Fields struct {
Description tipe.TextField `json:"description"`
} `json:"fields"`
ID string `json:"id"`
Template tipe.Template `json:"template"`
}

func main() {
client := tipe.New(
tipe.Project("test"),
tipe.Key(""),
tipe.Offline(true),
tipe.Port(8000),
)

doc := &Document{}

if err := client.Documents.Get(
context.Background(),
doc,
tipe.GetDocumentOptions{
SkuID: "MySkuID",
},
); err != nil {
panic(err)
}

fmt.Println(doc.Fields.Description.Value)
}
```