go-fivetran
is the official Fivetran SDK for the Go programming language.
Checkout our CHANGELOG for information about the latest bug fixes, updates, and features added to the SDK.
Make sure you read the Fivetran REST API documentation before using the SDK.
NOTE: go-fivetran
is still in ALPHA development stage. Future versions may introduce breaking changes.
go get github.com/fivetran/go-fivetran
import (
"github.com/fivetran/go-fivetran"
)
Initialize a new Fivetran client:
// get apiKey and apiSecret from environment variables
apiKey := os.Getenv("FIVETRAN_APIKEY")
apiSecret := os.Getenv("FIVETRAN_APISECRET")
// initialize a new client
client := fivetran.New(apiKey, apiSecret)
Each REST API endpoint has a service. Initialize a new Service:
// initialize a new UsersList service
svc := client.NewUsersList()
Call the API:
// call the REST API
resp, err := svc.Do(context.Background())
if err != nil {
...
}
Or you can simply call API in chain style. Call Do()
at the end to send an HTTP request to the REST API:
resp, err := client.NewUsersList().
Limit(3).
Do(context.Background())
You can find examples for all services in the examples directory.
The following Fivetran REST API endpoints are implemented by the Fivetran SDK for Go:
REST API Endpoint | REST API Version | SDK Service |
---|---|---|
List all Users | v1 | UsersListService |
Retrieve user details | v1 | UserDetailsService |
Invite a user | v1 | UserInviteService |
Modify a user | v1 | UserModifyService |
Delete a user | v1 | UserDeleteService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Create a destination | v1 | DestinationCreateService |
Retrieve destination details | v1 | DestinationDetailsService |
Modify a destination | v1 | DestinationModifyService |
Run destination setup tests | v1 | DestinationSetupTestsService |
Delete a destination | v1 | DestinationDeleteService |
Destination Config | v1 | DestinationConfig |
Please get in touch with us through our Support Portal if you have any comments, suggestions, support requests, or bug reports.