Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProblemsAsJSON ¶
ProblemsAsJSON takes an array of Problem and returns the JSON representation of those problems. Errors are returned if it fails to marshal the object.
Types ¶
type AuthToken ¶
AuthToken contains the values of the cookie required to be used as authentication against the website.
type HoldSetup ¶
type HoldSetup struct {
ID int `json:"Id"`
Description string `json:"Description"`
Setby interface{} `json:"Setby"`
DateInserted interface{} `json:"DateInserted"`
DateUpdated interface{} `json:"DateUpdated"`
DateDeleted interface{} `json:"DateDeleted"`
IsLocked bool `json:"IsLocked"`
Holdsets interface{} `json:"Holdsets"`
MoonBoardConfigurations interface{} `json:"MoonBoardConfigurations"`
HoldLayoutID int `json:"HoldLayoutId"`
AllowClimbMethods bool `json:"AllowClimbMethods"`
}
type MbResponse ¶
type MoonBoard ¶
type MoonBoard struct {
// contains filtered or unexported fields
}
MoonBoard contains all the AuthTokens (cookies) required
func (MoonBoard) GetProblems ¶
func (m MoonBoard) GetProblems(query Query) (MbResponse, error)
GetProblems can be called on a session object to return all problems that match the provided critieria from the Query passed in. It requires the session to provide the _MoonBoard and __RequestVerificationToken AuthToken errors are retuned if these are missing or the session has expired.
type MoonBoardApi ¶
type MoonBoardApi interface {
Login(username string, password string) error
GetProblems(query Query) (MbResponse, error)
Auth() []AuthToken
SetAuth(authTokens []AuthToken)
}
MoonBoardApi provides methods for interacting with the website
type MoonBoardConfiguration ¶
type Problem ¶
type Problem struct {
Method string `json:"Method"`
Name string `json:"Name"`
Grade string `json:"Grade"`
UserGrade interface{} `json:"UserGrade"`
MoonBoardConfiguration MoonBoardConfiguration `json:"MoonBoardConfiguration"`
MoonBoardConfigurationID int `json:"MoonBoardConfigurationId"`
Setter Setter `json:"Setter"`
FirstAscender bool `json:"FirstAscender"`
Rating int `json:"Rating"`
UserRating int `json:"UserRating"`
Repeats int `json:"Repeats"`
Attempts int `json:"Attempts"`
Holdsetup HoldSetup `json:"Holdsetup"`
IsBenchmark bool `json:"IsBenchmark"`
Moves []struct {
ID int `json:"Id"`
Description string `json:"Description"`
IsStart bool `json:"IsStart"`
IsEnd bool `json:"IsEnd"`
} `json:"Moves"`
Holdsets interface{} `json:"Holdsets"`
Locations []struct {
ID int `json:"Id"`
Holdset interface{} `json:"Holdset"`
Description interface{} `json:"Description"`
X int `json:"X"`
Y int `json:"Y"`
Color string `json:"Color"`
Rotation int `json:"Rotation"`
Type int `json:"Type"`
HoldNumber interface{} `json:"HoldNumber"`
Direction int `json:"Direction"`
DirectionString string `json:"DirectionString"`
} `json:"Locations"`
RepeatText string `json:"RepeatText"`
NumberOfTries interface{} `json:"NumberOfTries"`
NameForURL string `json:"NameForUrl"`
ID int `json:"Id"`
APIID int `json:"ApiId"`
DateInserted string `json:"DateInserted"`
DateUpdated interface{} `json:"DateUpdated"`
DateDeleted interface{} `json:"DateDeleted"`
DateTimeString string `json:"DateTimeString"`
}