Home
Alt + H

LUCAS JOSINO

@hawapi/go-sdk

HawAPI SDK for Golang designed to simplify the integration with the API.

Usage

Installation

Terminal window
go get github.com/HawAPI/go-sdk/hawapi@latest

Importing and Requesting

1
package main
2
3
import (
4
"fmt"
5
6
"github.com/HawAPI/go-sdk/hawapi"
7
)
8
9
func main() {
10
// Create a new client with default options
11
client := hawapi.NewClient()
12
13
// Override options
14
client.WithOpts(hawapi.Options{
15
Endpoint: "http://localhost:8080/api",
16
// When using 'WithOpts' or 'NewClientWithOpts' the value of
17
// 'UseInMemoryCache' will be set to false
18
UseInMemoryCache: true,
19
})
20
21
res, err := client.ListActors()
22
if err != nil {
23
panic(err)
24
}
25
26
fmt.Println(res)
27
fmt.Println(len(res.Data))
28
}

Target

Web, SDK, Library

Type

Project

Status

Active

Language

Typescript

Tags

GolangAPISDKHawAPI
RSS
Tags
Source Code
© 2024 Lucas Josino
Built with Astro