This fork attempts to follow Official Pterodactyl API Docs @Dashflo as closely as possible, but is not maintained by Pterodactyl team.
go get -u github.com/m41denx/alligator
*Including support for extended struct fields
- Example for List Users endpoint
package main
import (
gator "github.com/m41denx/alligator"
"github.com/m41denx/alligator/options"
)
func main() {
app, _ := gator.NewApp("https://panel.pterodactyl.io", "ApplicationKeyYouCreated")
// Fetch some users
users, err := app.ListUsers(options.ListUsersOptions{
Include: options.IncludeUsers{
Servers: true,
},
Filters: options.FiltersUsers{
Username: "example",
},
SortBy: options.ListUsersSort_UUID_DESC, // Same as "-uuid"
})
if err != nil {
fmt.Printf("%#v", err)
return
}
// options are optional btw
// users, err := app.ListUsers() // <- is also valid
for _, u := range users {
fmt.Printf("%d: %s\n", u.ID, u.Username)
}
}
More examples at 📁 _examples
- App API
- Options
- Database endpoint support
- Extended databases details (password, host)
- Nests endpoint support
- Extended nest details (eggs, servers)
- Eggs endpoint support
- Extended eggs details (nest, servers, variables)
- Extended user details (servers)
- Extended nodes details (allocations, location, servers)
- Extended allocations details (node, server)
- Extended location details (nodes, servers)
- Extended servers details (allocations+, user+, subusers+, nest+, egg+, variables+, location+, node+)
- Extended servers details (databases)
- Additional methods like
/{server}/reinstall
and/{server}/force
- Client API
- What is this goofy ahh infinite documentation...
- Pagination (50 servers limit is a pain tbh)
- Godoc