Skip to content

golang pterodactyl terminal aplication and api interface

License

Notifications You must be signed in to change notification settings

m41denx/alligator

 
 

Repository files navigation

🐊 Alligator Go Client for Pterodactyl

This fork attempts to follow Official Pterodactyl API Docs @Dashflo as closely as possible, but is not maintained by Pterodactyl team.

Installation

go get -u github.com/m41denx/alligator

🔥 So, what's new?

✨ Support for Filters, Include and Endpoint-specific parameters

*Including support for extended struct fields

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

📝 What's done?

  • 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

About

golang pterodactyl terminal aplication and api interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%