Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Authenticate(ctx context.Context) error
- func (c *Client) GetAccessToken() (string, error)
- func (c *Client) GetGymAttendance(gymId ...int) (*types.GymAttendanceResponse, error)
- func (c *Client) GetMemberInfo() (*types.MemberResponse, error)
- func (c *Client) SetAccessToken(token string) error
- func (c *Client) SetHomeGym() error
Constants ¶
View Source
const ( AUTH_URL = "https://auth.puregym.com/connect/token" GYM_API_URL = "https://capi.puregym.com/api/v1/gyms" MEMBER_API_URL = "https://capi.puregym.com/api/v1/member" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the PureGym API Client
func (*Client) Authenticate ¶
Authenticate against the PureGym API via OAuth2 to return an Access Token
func (*Client) GetAccessToken ¶
Returns the access token that was set during authentication. The client will error if no access token is set.
func (*Client) GetGymAttendance ¶
func (c *Client) GetGymAttendance(gymId ...int) (*types.GymAttendanceResponse, error)
Get the attendance information for the users Home Gym, or any ID provided
func (*Client) GetMemberInfo ¶
func (c *Client) GetMemberInfo() (*types.MemberResponse, error)
Get member information
func (*Client) SetAccessToken ¶
Set an access token. If a token is already obtained, it can be re-used here.
func (*Client) SetHomeGym ¶
Set the home gym in the Client for the user
Click to show internal directories.
Click to hide internal directories.