Skip to content

propeldata/go-client

Repository files navigation

Propel Go client

Installing

Use go get to add it to your project's Go module dependencies.

go get github.com/propeldata/go-client

Usage

  1. Import the Propel go client package
import (
	"github.com/propeldata/go-client"
)
  1. Generate an OAuth token. This step requires having a Propel account and an application. Learn more about the API authentication here.
oauthClient := client.NewOauthClient()

oauthToken, err := oauthClient.OAuthToken(ctx, "APPLICATION_ID", "APPLICATION_SECRET")
if err != nil {
    return errors.New("Invalid Propel credentials")
}
  1. Initialize the Propel client with the retrieved token.
apiClient := client.NewApiClient(oauthToken.AccessToken)
  1. Perform any API request.
dataSource, err := apiClient.FetchDataSource(ctx, "dataSourceUniqueName")
if err != nil {
	return err
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages