forked from TripwireTeam/tripwire
111 lines
2.6 KiB
Go
111 lines
2.6 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 Property struct {
|
|
Name string `json:"name"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type ProfileResponse struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
Properties []Property `json:"properties"`
|
|
}
|
|
|
|
type ProfileTextureMetadata struct {
|
|
Timestamp int `json:"timestamp"`
|
|
Id string `json:"profileId"`
|
|
Name string `json:"profileName"`
|
|
Textures ProfileTextures `json:"textures"`
|
|
}
|
|
|
|
type SkinTexture struct {
|
|
Url string `json:"url"`
|
|
Metadata SkinMetadata `json:"metadata"`
|
|
}
|
|
|
|
type SkinMetadata struct {
|
|
Model string `json:"model"`
|
|
}
|
|
|
|
type ProfileTextures struct {
|
|
Skin SkinTexture `json:"SKIN"`
|
|
}
|
|
|
|
type Empty struct{}
|
|
|
|
type NotFoundError struct{}
|
|
|
|
func (m *NotFoundError) Error() string {
|
|
return "Not found"
|
|
}
|
|
|
|
type InvalidCredentialsError struct{}
|
|
|
|
func (m *InvalidCredentialsError) Error() string {
|
|
return "Invalid credentials"
|
|
}
|
|
|
|
type AlreadyExistsError struct{}
|
|
|
|
func (m *AlreadyExistsError) Error() string {
|
|
return "The specified item already exists"
|
|
}
|
|
|
|
type TooLargeError struct{}
|
|
|
|
func (m *TooLargeError) Error() string {
|
|
return "The sent payload is too large."
|
|
}
|