api

package
v0.0.0-...-d6367f7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts *Options) error

Types

type API

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

func (*API) HandleAPIDeleteReadingSessions

func (api *API) HandleAPIDeleteReadingSessions(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIGetGoodreadsReviews

func (api *API) HandleAPIGetGoodreadsReviews(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIGetReadingSessions

func (api *API) HandleAPIGetReadingSessions(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIGetUser

func (api *API) HandleAPIGetUser(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPILogin

func (api *API) HandleAPILogin(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIPostGoodreadsProgress

func (api *API) HandleAPIPostGoodreadsProgress(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIPostReadingSessions

func (api *API) HandleAPIPostReadingSessions(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIPutPassword

func (api *API) HandleAPIPutPassword(w http.ResponseWriter, r *http.Request)

func (*API) HandleAPIRegister

func (api *API) HandleAPIRegister(w http.ResponseWriter, r *http.Request)

func (*API) HandleAuth

func (api *API) HandleAuth(w http.ResponseWriter, r *http.Request)

func (*API) HandleGoodreadsAuth

func (api *API) HandleGoodreadsAuth(w http.ResponseWriter, r *http.Request)

func (*API) HandleGoodreadsCallback

func (api *API) HandleGoodreadsCallback(w http.ResponseWriter, r *http.Request)

func (*API) HandleLaunchSubscribe

func (api *API) HandleLaunchSubscribe(w http.ResponseWriter, r *http.Request)

func (*API) HandleLogout

func (api *API) HandleLogout(w http.ResponseWriter, r *http.Request)

func (*API) HandleRoot

func (api *API) HandleRoot(w http.ResponseWriter, r *http.Request)

func (*API) WithAuth

func (api *API) WithAuth(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

WithAuth wraps a handler with authentication checks.

func (*API) WithGoodreadsCredentials

func (api *API) WithGoodreadsCredentials(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

func (*API) WithGoodreadsUserID

func (api *API) WithGoodreadsUserID(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)

type GoodreadsBook

type GoodreadsBook struct {
	ID       int      `json:"id"`
	Title    string   `json:"title"`
	ImageURL string   `json:"image_url"`
	Authors  []string `json:"authors"`
	NumPages int      `json:"num_pages"`
	Progress struct {
		Page    int `json:"page"`
		Percent int `json:"percent"`
	} `json:"progress"`
}

type Options

type Options struct {
	Listen          string
	DBConnString    string
	RecaptchaSecret string
	MailgunKey      string
	AuthSecret      string
	GoodreadsKey    string
	GoodreadsSecret string
	DevMode         bool
}

type ReadingSession

type ReadingSession struct {
	Timestamp int64 `json:"timestamp"`
	Duration  int   `json:"duration"`
}

Jump to

Keyboard shortcuts

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