Documentation ¶
Index ¶
- Constants
- type LLLULoginResponseAuthTicket
- type LLUConnection
- type LLUConnectionsGraphResponse
- type LLUConnectionsGraphResponseData
- type LLUConnectionsResponse
- type LLUGlucoseDataPoint
- type LLUGlucoseMeasurement
- type LLULoginError
- type LLULoginResponse
- type LLULoginResponseData
- type LLUTimestamp
- type LibreLinkUpClient
- func (llu *LibreLinkUpClient) Connections(ticket LLLULoginResponseAuthTicket) (*LLUConnectionsResponse, error)
- func (llu *LibreLinkUpClient) Graph(ticket LLLULoginResponseAuthTicket, patientID string) (*LLUConnectionsGraphResponse, error)
- func (llu *LibreLinkUpClient) Login() (*LLULoginResponse, error)
Constants ¶
const ( LLUUrl = "https://api.libreview.io" LLULoginEndpoint = "llu/auth/login" LLUConnectionsEndpoint = "llu/connections" LLUGraphEndpoint = "llu/connections/%s/graph" )
const (
LLUTimestampFormat = "1/2/2006 3:04:05 PM"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLLULoginResponseAuthTicket ¶
func (*LLLULoginResponseAuthTicket) DaysToExpiry ¶
func (ticket *LLLULoginResponseAuthTicket) DaysToExpiry(from time.Time) int32
type LLUConnection ¶
type LLUConnection struct { ID string PatientID string Country string Status int64 FirstName string LastName string GlucoseMeasurement LLUGlucoseMeasurement GlucoseItem LLUGlucoseMeasurement }
type LLUConnectionsGraphResponse ¶
type LLUConnectionsGraphResponse struct { Status int64 Data LLUConnectionsGraphResponseData `json:"data"` Ticket LLLULoginResponseAuthTicket }
type LLUConnectionsGraphResponseData ¶
type LLUConnectionsGraphResponseData struct { Connection LLUConnection GraphData []LLUGlucoseDataPoint }
type LLUConnectionsResponse ¶
type LLUConnectionsResponse struct { Status int64 Data []LLUConnection `json:"data"` Ticket LLLULoginResponseAuthTicket }
type LLUGlucoseDataPoint ¶
type LLUGlucoseDataPoint struct { FactoryTimestamp LLUTimestamp `json:"FactoryTimestamp"` Timestamp LLUTimestamp `json:"Timestamp"` Type int64 ValueInMgPerDl int64 `json:"ValueInMgPerDl"` MeasurementColor int64 `json:"MeasurementColor"` GlucoseUnits int64 `json:"GlucoseUnits"` Value int64 `json:"Value"` IsHigh bool IsLow bool }
type LLUGlucoseMeasurement ¶
type LLULoginError ¶
type LLULoginError struct {
Message string
}
type LLULoginResponse ¶
type LLULoginResponse struct { Status int64 Data LLULoginResponseData Error *LLULoginError }
type LLULoginResponseData ¶
type LLULoginResponseData struct {
AuthTicket LLLULoginResponseAuthTicket
}
type LLUTimestamp ¶
func (*LLUTimestamp) String ¶
func (lts *LLUTimestamp) String() string
func (*LLUTimestamp) UnmarshalJSON ¶
func (lts *LLUTimestamp) UnmarshalJSON(b []byte) error
UnmarshalJSON implements a custom date unmarshaler for the time format used by LibreLinkup
type LibreLinkUpClient ¶
type LibreLinkUpClient struct {
// contains filtered or unexported fields
}
LibreLinkUpClient represents a LibreLinkUp API client, which needs an email address and password to make calls. It depends on the primary URL and endpoint URLs identified in the const section. It also depends on the addCommonHeaders() function to add the common headers needed to make the API calls
func NewLibreLinkUpClient ¶
func NewLibreLinkUpClient(email, password string) LibreLinkUpClient
NewLibreLinkUpClient creates a new instance of LibreLinkUpClient
func (*LibreLinkUpClient) Connections ¶
func (llu *LibreLinkUpClient) Connections(ticket LLLULoginResponseAuthTicket) (*LLUConnectionsResponse, error)
Connections makes the connections API calls that is used to discover all the device connections available to the user. It can also be used to get the latest value for all the sensors exposed to the user.
func (*LibreLinkUpClient) Graph ¶
func (llu *LibreLinkUpClient) Graph(ticket LLLULoginResponseAuthTicket, patientID string) (*LLUConnectionsGraphResponse, error)
func (*LibreLinkUpClient) Login ¶
func (llu *LibreLinkUpClient) Login() (*LLULoginResponse, error)
Login performs the login API call and returns a response struct containing the bearer token that needs to be referenced to in the subsequent calls