tripwire/types.go
2022-06-22 20:47:00 -04:00

65 lines
1.7 KiB
Go

package main
type YggError struct {
Code int `json:"-"`
Error string `json:"error"`
ErrorMessage string `json:"errorMessage"`
// Cause string `json:"cause"`
}
type MCProfile struct {
Name string `json:"name"`
Id string `json:"id"`
}
type MCAgent struct {
Name string `json:"name"`
Version int `json:"version"`
}
type AuthPayload struct {
Agent MCAgent `json:"agent"`
Username string `json:"username"`
Password string `json:"password"`
ClientToken string `json:"clientToken"`
RequestUser bool `json:"requestUser"`
}
type AuthResponse struct {
ClientToken string `json:"clientToken"`
AccessToken string `json:"accessToken"`
AvailableProfiles []MCProfile `json:"availableProfiles"`
SelectedProfile MCProfile `json:"selectedProfile"`
}
type RefreshPayload struct {
AccessToken string `json:"accessToken"`
ClientToken string `json:"clientToken"`
}
type UserCredentials struct {
Username string `json:"username"`
Password string `json:"password"`
}
type YggdrasilInfo struct {
Status string `json:"Status"`
RuntimeMode string `json:"Runtime-Mode"`
AppAuthor string `json:"Application-Author"`
AppDescription string `json:"Application-Description"`
SpecVersion string `json:"Specification-Version"`
AppName string `json:"Application-Name"`
ImplVersion string `json:"Implementation-Version"`
AppOwner string `json:"Application-Owner"`
}
type NotFoundError struct{}
func (m *NotFoundError) Error() string {
return "Not found"
}
type InvalidCredentialsError struct{}
func (m *InvalidCredentialsError) Error() string {
return "Invalid credentials"
}