forked from TripwireTeam/tripwire
55 lines
1.2 KiB
Go
55 lines
1.2 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 NotFoundError struct{}
|
||
|
|
||
|
func (m *NotFoundError) Error() string {
|
||
|
return "Not found"
|
||
|
}
|
||
|
|
||
|
type InvalidCredentialsError struct{}
|
||
|
|
||
|
func (m *InvalidCredentialsError) Error() string {
|
||
|
return "Invalid credentials"
|
||
|
}
|