fatsecret

package
v0.0.0-...-9c7bcb9 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRequestRetryConfig

type ApiRequestRetryConfig struct {
	Retries     int
	Backoff     time.Duration
	MaxTimeout  time.Duration
	RetryNumber int
}

type DiaryData

type DiaryData struct {
	FromDate          time.Time
	ToDate            time.Time
	AggregatedDayData []FoodEntryDayData
	DiaryData         []FoodEntryData
}

type FatSOauth1Keys

type FatSOauth1Keys struct {
	ConsumerKey    string `json:"consumer_key"`
	ConsumerSecret string `json:"consumer_secret"`
}

type FatSOauth1Service

type FatSOauth1Service struct {
	Keys FatSOauth1Keys
	// contains filtered or unexported fields
}

func NewFatSOauth1Service

func NewFatSOauth1Service(keys FatSOauth1Keys) *FatSOauth1Service

func (*FatSOauth1Service) Authorize

func (s *FatSOauth1Service) Authorize() error

func (*FatSOauth1Service) GetAuthCode

func (s *FatSOauth1Service) GetAuthCode() error

func (*FatSOauth1Service) GetRequestToken

func (s *FatSOauth1Service) GetRequestToken() error

func (*FatSOauth1Service) MakeHttpRequest

func (s *FatSOauth1Service) MakeHttpRequest(reqMethod string, reqUrl string, reqData url.Values) (*http.Response, []byte, error)

type FatSecret

type FatSecret struct {
	// contains filtered or unexported fields
}

func New

func New(keyData []byte, options ...func(s *FatSecret)) (*FatSecret, error)

func (*FatSecret) FoodEntriesGet

func (s *FatSecret) FoodEntriesGet(date time.Time) (*FoodEntriesData, error)

func (*FatSecret) FoodEntriesGetMonth

func (s *FatSecret) FoodEntriesGetMonth(fromDate time.Time) (*FoodEntriesMonthData, error)

func (*FatSecret) GetDiary

func (s *FatSecret) GetDiary(fromDate time.Time, toDate time.Time) (*DiaryData, error)

type FoodEntriesData

type FoodEntriesData struct {
	FoodEntries struct {
		FoodEntry []FoodEntryData
	}
}

func FoodEntriesDataFromRaw

func FoodEntriesDataFromRaw(rawData FoodEntriesDataRaw) (*FoodEntriesData, error)

type FoodEntriesDataRaw

type FoodEntriesDataRaw struct {
	FoodEntries struct {
		FoodEntry []FoodEntryDataRaw     `mapstructure:"food_entry"`
		Other     map[string]interface{} `mapstructure:",remain"`
	} `mapstructure:"food_entries"`
	Other map[string]interface{} `mapstructure:",remain"`
}

type FoodEntriesMonthData

type FoodEntriesMonthData struct {
	Month struct {
		Day         []FoodEntryDayData
		FromDateInt int64
		ToDateInt   int64
		FromDate    time.Time
		ToDate      time.Time
	}
}

func FoodEntriesMonthDataFromRaw

func FoodEntriesMonthDataFromRaw(rawData *FoodEntriesMonthDataRaw) (*FoodEntriesMonthData, error)

type FoodEntriesMonthDataRaw

type FoodEntriesMonthDataRaw struct {
	Month struct {
		Day         []FoodEntryDayDataRaw
		FromDateInt string                 `mapstructure:"from_date_int"`
		ToDateInt   string                 `mapstructure:"to_date_int"`
		Other       map[string]interface{} `mapstructure:",remain"`
	}
	Other map[string]interface{} `mapstructure:",remain"`
}

type FoodEntryData

type FoodEntryData struct {
	DateInt              int64
	Date                 time.Time
	FoodId               int64
	FoodEntryId          int64
	ServingId            int64
	FoodEntryName        string
	FoodEntryDescription string
	NumberOfUnits        float64
	Meal                 string
	Protein              float64
	Calories             float64
	Carbohydrate         float64
	Fat                  float64
	Fiber                float64
	Sugar                float64
	Calcium              float64
	Cholesterol          float64
	Iron                 float64
	MonounsaturatedFat   float64
	PolyunsaturatedFat   float64
	SaturatedFat         float64
	TransFat             float64
	VitaminA             float64
	VitaminC             float64
	Sodium               float64
	Potassium            float64
}

type FoodEntryDataRaw

type FoodEntryDataRaw struct {
	DateInt              string `mapstructure:"date_int"`
	FoodId               string `mapstructure:"food_id"`
	FoodEntryId          string `mapstructure:"food_entry_id"`
	ServingId            string `mapstructure:"serving_id"`
	FoodEntryName        string `mapstructure:"food_entry_name"`
	FoodEntryDescription string `mapstructure:"food_entry_description"`
	NumberOfUnits        string `mapstructure:"number_of_units"`
	Meal                 string
	Protein              string
	Calories             string
	Carbohydrate         string
	Fat                  string
	Fiber                string
	Sugar                string
	Calcium              string
	Cholesterol          string
	Iron                 string
	MonounsaturatedFat   string `mapstructure:"monounsaturated_fat"`
	PolyunsaturatedFat   string `mapstructure:"polyunsaturated_fat"`
	SaturatedFat         string `mapstructure:"saturated_fat"`
	TransFat             string `mapstructure:"trans_fat"`
	VitaminA             string `mapstructure:"vitamin_a"`
	VitaminC             string `mapstructure:"vitamin_c"`
	Sodium               string
	Potassium            string
	Other                map[string]interface{} `mapstructure:",remain"`
}

type FoodEntryDayData

type FoodEntryDayData struct {
	DateInt      int64
	Date         time.Time
	Calories     float64
	Carbohydrate float64
	Fat          float64
	Protein      float64
}

type FoodEntryDayDataRaw

type FoodEntryDayDataRaw struct {
	DateInt      string `mapstructure:"date_int"`
	Calories     string
	Carbohydrate string
	Fat          string
	Protein      string
	Other        map[string]interface{} `mapstructure:",remain"`
}

Jump to

Keyboard shortcuts

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