Documentation ¶
Overview ¶
Code generated by gen_pages_const; DO NOT EDIT.
Index ¶
Constants ¶
View Source
const (
URLParamHabitID = "habitID"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator interface { Authenticate(ctx context.Context, session string) (context.Context, error) DeleteUser(ctx context.Context, uid auth.UserID) error GetUser(ctx context.Context, uid auth.UserID) (*firebase.UserRecord, error) SessionCookie(ctx context.Context, idToken string) (string, error) }
type DynamoRepository ¶
type DynamoRepository interface { AllArchivedHabits(ctx context.Context, uid auth.UserID) ([]*repository.DynamoHabit, error) AllHabits(ctx context.Context, uid auth.UserID) ([]*repository.DynamoHabit, error) ArchiveHabit(ctx context.Context, uid auth.UserID, hid string) error CreateCheck(ctx context.Context, uid auth.UserID, hid, date string) (*repository.DynamoCheck, error) CreateHabit(ctx context.Context, uid auth.UserID, title string) (*repository.DynamoHabit, error) DeleteCheck(ctx context.Context, uid auth.UserID, hid, date string) error DeleteHabit(ctx context.Context, uid auth.UserID, hid string) error FindArchivedHabit(ctx context.Context, uid auth.UserID, hid string) (*repository.DynamoHabit, error) FindHabit(ctx context.Context, uid auth.UserID, hid string) (*repository.DynamoHabit, error) ListLastWeekChecksInAllHabits(ctx context.Context, uid auth.UserID) ([]*repository.DynamoCheck, error) ListLatestChecksWithLimit(ctx context.Context, uid auth.UserID, hid string, limit int32) ([]*repository.DynamoCheck, error) UnarchiveHabit(ctx context.Context, uid auth.UserID, hid string) error UpdateHabit(ctx context.Context, in *repository.DynamoRepositoryUpdateHabitInput) error }
type HTTPHandler ¶
type HTTPHandler struct { Authenticator Authenticator Repository DynamoRepository Secure bool // contains filtered or unexported fields }
func NewHTTPHandler ¶
func NewHTTPHandler(in *NewHTTPHandlerInput) *HTTPHandler
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Middleware ¶
func NewAuthMiddleware ¶
func NewAuthMiddleware(authenticator *auth.FirebaseAuthenticator) Middleware
func NewCSRFMiddleware ¶
func NewCSRFMiddleware(key []byte, secure bool) Middleware
type NewHTTPHandlerInput ¶
type NewHTTPHandlerInput struct { AuthMiddleware Middleware CSRFMiddleware Middleware Authenticator Authenticator Repository DynamoRepository Secure bool }
type TypeTemplatePage ¶
type TypeTemplatePage string
const TemplatePageHabit TypeTemplatePage = "habit.html"
const TemplatePageLogin TypeTemplatePage = "login.html"
const TemplatePageTop TypeTemplatePage = "top.html"
Source Files ¶
Click to show internal directories.
Click to hide internal directories.