Skip to content

symbiosis-cloud/symbiosis-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symbiosis Golang SDK


Coverage Status

Installation

symbiosis-go is compatible with modern Go releases in module mode, with Go installed:

go get github.com/symbiosis-cloud/symbiosis-go

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/symbiosis-cloud/symbiosis-go"

and run go get without parameters.

Usage

Creating the client

You can easily instantiate the API client by providing it with a valid API key:

client, err := symbiosis.NewClientFromAPIKey(os.Getenv("SYMBIOSIS_API_KEY"))

Customizing client

ClientOptions can be passed to symbiosis.NewClientFromAPIKey()

for example:

// Changing the symbiosis API endpoint
client, err := symbiosis.NewClientFromAPIKey(os.Getenv("SYMBIOSIS_API_KEY"), symbiosis.WithEndpoint("https://some-other-url"))

// Setting a default timeout
client, err := symbiosis.NewClientFromAPIKey(os.Getenv("SYMBIOSIS_API_KEY"), symbiosis.WithTimeout(time.Second * 30)))

Inviting team members:

members, err := client.InviteTeamMembers([]string{"[email protected]", "[email protected]"}, symbiosis.RoleAdmin)

Valid roles can be obtained by using the symbiosis.GetValidRoles() function which returns a map[string]bool of valid roles.

Running tests

go test

Generating mocks

Mocks can be generated by running (requires Docker):

docker run -v "$PWD":/src -w /src vektra/mockery --all

TODO:

  • Expand readme
  • Add single node creation call
  • Public docs
  • Add integration tests