Skip to content

fpmoles/astra-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

astra-go

A wrapper for gocql to use DataStax Astra

DataStax Astra is an offering of DataStax Enterprise Cassandra as a Service on major cloud providers. They offer various tiers of operation including a free tier that is free forever. Part of the delivery of that offering includes MTLS certificate authentication for the drivers. While DataStax itself supports many drivers, the gocql driver is not one of them, so there is no specific inherent support for the secure connect bundle and MTLS authentication. This wrapper provides a path to unpack the Secure Connect Bundle (SCB) and pass it to gocql to get a session to work with.

Requirements

  • DataStax Astra cluster. Any tier will work.
  • Download the SCB and unpack it
  • Know your database username and password

Steps to use

  • hostname from cqlshrc in SCB
  • port from cqlshr in SCB
  • filepath where the ca.crt, key, and cert files from the SCB are stored. This is absolute file path with respect to your application's runtime
  • database username is the username you used when you created the Astra database
  • database password is the password you used when you created the Astra database

Example:

config := NewClusterConfig(host, port, username, password, filepath)
clusterConnection, _ := NewClusterConnection(config)
clusterConnection.Session()...

About

A wrapper for gocql to use DataStax Astra

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages