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.
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/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 |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Create a Log Service | v1 | ExternalLoggingCreateService |
Retrieve Log Service Details | v1 | ExternalLoggingDetailsService |
Update a Log Service | v1 | ExternalLoggingModifyService |
Delete a Log Service | v1 | ExternalLoggingDeleteService |
Run Log Service Setup Tests | v1 | ExternalLoggingSetupTestsService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Retrieve schema metadata | v1 | MetadataSchemaListService |
Retrieve table metadata | v1 | MetadataTablesListService |
Retrieve column metadata | v1 | MetadataColumnListService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Create account webhook | v1 | WebhookAccountCreateService |
Create group webhook | v1 | WebhookGroupCreateService |
Retrieve webhook details | v1 | WebhookDetailsService |
Update webhook | v1 | WebhookModifyService |
Delete webhook | v1 | WebhookDeleteService |
Retrieve the list of webhooks | v1 | WebhookListService |
Test webhook | v1 | WebhookTestService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
List all roles | v1 | RolesListService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
List all teams | v1 | TeamsListService |
Retrieve team details | v1 | TeamsDetailsService |
Create a team | v1 | TeamsCreateService |
Modify a team | v1 | TeamsModifyService |
Delete a team role in the account | v1 | TeamsDeleteRoleInAccountService |
Delete a team | v1 | TeamsDeleteService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
List all user memberships | v1 | TeamUserMembershipsListService |
Retrieve user membership | v1 | TeamUserMembershipDetailsService |
Add a user to a team | v1 | TeamUserMembershipCreateService |
Modify a user membership | v1 | TeamUserMembershipModifyService |
Delete a user from a team | v1 | TeamUserMembershipDeleteService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
List all group memberships | v1 | TeamGroupMembershipsService |
Retrieve group membership | v1 | TeamGroupMembershipDetailsService |
Add group membership | v1 | TeamGroupMembershipCreateService |
Update group membership | v1 | TeamGroupMembershipModifyService |
Delete group membership | v1 | TeamGroupMembershipDeleteService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Create a Private Link | v1 | PrivateLinksCreateService |
List all Private Links within Account | v1 | PrivateLinkListService |
Retrieve Private Link Details | v1 | PrivateLinksDetailsService |
Update a Private Link | v1 | PrivateLinksModifyService |
Delete a Private Link | v1 | PrivateLinksDeleteService |
REST API Endpoint | REST API Version | SDK Service/Config |
---|---|---|
Create a Proxy Agent | v1 | ProxyCreateService |
List all Proxy Agents | v1 | ProxyListService |
Retrieve Proxy Agent Details | v1 | ProxyDetailsService |
Delete a Proxy Agent | v1 | ProxyDeleteService |
Return all connections attached to the proxy agent | v1 | ProxyConnectionMembershipsListService |
Please get in touch with us through our Support Portal if you have any comments, suggestions, support requests, or bug reports.