Skip to content

sliplane/datapacket-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial DataPacket Go SDK

Go Reference

Go client for the DataPacket API.

Installation

go get github.com/sliplane/datapacket-go

Usage

client := datapacket.New("your-api-key")
ctx := context.Background()

// Get account info
account, err := client.Account(ctx)

// List all servers
for server, err := range client.ServerIterator(ctx, nil) {
    fmt.Printf("%s (%s)\n", server.Name, server.Location.Name)
}

// Error handling
server, err := client.Server(ctx, datapacket.ServerInput{Name: ptr("DP-99999")})
if apiErr, ok := err.(datapacket.APIError); ok && apiErr.IsNotFound() {
    // handle not found
}

License

MIT

About

Unofficial Go SDK for datapacket.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages