parkervcp / crocgodyl Goto Github PK
View Code? Open in Web Editor NEWgolang pterodactyl terminal aplication and api interface
License: MIT License
golang pterodactyl terminal aplication and api interface
License: MIT License
The filenames should drop the "app" prefix, as according to the official naming convention (https://golang.org/doc/effective_go.html#names). Some variables do not follow the "go-code-convention" guideline (https://github.com/unknwon/go-code-convention/blob/master/en-US/naming_rules.md).
I think that crocgodyl's state should not be global, as this makes utilizing the library in projects which need to connect to multiple panels at the same time pretty much impossible out of the box.
Reproducing:
if servers, err := crocgodyl.GetServers(); err == nil {
for server := range servers.Server {
zap.L().Info("found server", zap.Reflect("server", server))
}
} else {
zap.L().Fatal("failed to communicate with the panel", zap.Error(err))
}
And you should get error:
json: cannot unmarshal array into Go struct field Pagination.meta.pagination.links of type crocgodyl.Links
Starting Croc configurations results in a Null-Pointer panic under all and any valid value.
The underlying problem is a call to an attribute in an empty "config" pointer inside the function. I will add a PR with a fix.
The full error is:
json: cannot unmarshal object into Go struct field Pagination.meta.pagination.links of type []crocgodyl.Links
The JSON provides a Links compatible object as the response, yet Croc will try to unmarshal it into the []Links slice.
PR #9 provides a fix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.