Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions example/simple/simple.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package main

import (
"context"
"fmt"
"os"

synpse "github.com/synpse-hq/synpse-go"
)

func main() {
fmt.Println("Synpse-GO simple client example")
ctx := context.Background()

accessKey := os.Getenv("SYNPSE_ACCESS_KEY")

// Create a new client
client, err := synpse.New(accessKey)
if err != nil {
panic(err)
}

// List projects
projects, err := client.ListProjects(ctx)
if err != nil {
panic(err)
}

// Print projects
for _, p := range projects {
fmt.Printf("Project: %s\n", p.Name)
}

}