service

package
v0.0.0-...-6b19993 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

* mrthn API * * One login for all your fitness data needs. * * API version: 0.1.0

* mrthn API * * One login for all your fitness data needs. * * API version: 0.1.0

* mrthn API * * One login for all your fitness data needs. * * API version: 0.1.0

* mrthn API * * One login for all your fitness data needs. * * API version: 0.1.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(log *logrus.Logger, next http.Handler, name string) http.Handler

func NewRouter

func NewRouter(db *sql.DB, logger *logrus.Logger, authTypes auth.Types, mrthnWebsiteURL string) *mux.Router

func SendErrorToClient

func SendErrorToClient(w http.ResponseWriter, log *logrus.Logger)

func SetupLogger

func SetupLogger(logToStderr bool) *logrus.Logger

Types

type Api

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

func NewApi

func NewApi(db *sql.DB, logger *logrus.Logger, authTypes auth.Types) Api

func (*Api) Callback

func (api *Api) Callback(w http.ResponseWriter, r *http.Request)

func (*Api) GetClientCallback

func (api *Api) GetClientCallback(w http.ResponseWriter, r *http.Request)

func (*Api) GetToken

func (api *Api) GetToken(w http.ResponseWriter, r *http.Request)

func (*Api) GetValueDaily

func (api *Api) GetValueDaily(w http.ResponseWriter, r *http.Request)

func (*Api) GetValueOverPeriod

func (api *Api) GetValueOverPeriod(w http.ResponseWriter, r *http.Request)

func (*Api) Index

func (api *Api) Index(w http.ResponseWriter, r *http.Request)

func (*Api) Login

func (api *Api) Login(w http.ResponseWriter, r *http.Request)

func (*Api) SignIn

func (api *Api) SignIn(w http.ResponseWriter, r *http.Request)

func (*Api) SignUp

func (api *Api) SignUp(w http.ResponseWriter, r *http.Request)

func (*Api) UpdateClientCallback

func (api *Api) UpdateClientCallback(w http.ResponseWriter, r *http.Request)

type CallbackUpdateResponse

type CallbackUpdateResponse struct {
	Success         bool   `json:"success"`
	Error           string `json:"error,omitempty"`
	UpdatedCallback string `json:"updatedCallback,omitempty"`
}

type ClientSignInResponse

type ClientSignInResponse struct {
	Success  bool   `json:"success"`
	ClientID int    `json:"clientID,omitempty"`
	Error    string `json:"error,omitempty"`
}

type ClientSignUpResponse

type ClientSignUpResponse struct {
	Success    bool   `json:"success"`
	ClientID   int    `json:"clientID"`
	ClientName string `json:"clientName"`
	Error      string `json:"error,omitempty"`
}

type GetCallbackResponse

type GetCallbackResponse struct {
	Success  bool   `json:"success"`
	Error    string `json:"error,omitempty"`
	Callback string `json:"callback,omitempty"`
}

type GetValueResponse

type GetValueResponse struct {
	ID     int                 `json:"id,omitempty"`
	Result []model.ValueResult `json:"result,omitempty"`
}

type Route

type Route struct {
	Name             string
	Method           string
	Pattern          string
	Secure           bool
	MrthnWebsiteOnly bool
	HandlerFunc      http.HandlerFunc
}

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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