client

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MFPClient

type MFPClient struct {
	AuthSignKey     []byte                      // signing key which has to be decoded first
	ClientKeys      *models.ClientKeyResponse   // client keys for creating and signing jwts
	AccessToken     *models.AccessTokenResponse // access tokens for communicating with identity api
	IDTokenResponse *models.TokenResponse       // tokens for communicating with general api
	Username        string                      // email/username from mfp acc
	Password        string                      // password from mfp acc
	JWT             string                      // own generated & signed jwt for login
	MFPCallbackCode string                      // callback code for login process
	MFPUserID       string                      // user id for login process
	UserID          string                      // domain user id for api requests
}

MFPClient offers methods to get food products from MyFitnessPal

func (*MFPClient) InitialLoad

func (m *MFPClient) InitialLoad() error

InitialLoad does the initial login part starts at getting clientkeys till creating JWTs for login

func (*MFPClient) RefreshToken

func (m *MFPClient) RefreshToken() error

Refreshes the user token

func (*MFPClient) SearchFoodWithoutAuth

func (m *MFPClient) SearchFoodWithoutAuth(foodName string, offset int, page int) (*models.FoodSearchResponseWithoutAuth, error)

It could be possible that this endpoint won't work in the future

func (*MFPClient) SearchFoodWithoutPagination

func (m *MFPClient) SearchFoodWithoutPagination(foodName string) (*models.FoodSearchResponse, error)

Any food product that you like

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL