journalskill

package module
v0.0.0-...-42aae50 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 16 Imported by: 0

README

My Journal Alexa Skill

This is the source code for my Alexa skill that allows you to maintain a personal journal. It's available as:

Documentation

Index

Constants

View Source
const (
	DayDate = iota
	MonthDate
	YearDate
	Invalid
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BeSuccinct                     bool
	ShouldExplainAboutSuccinctMode bool
}

type ConfigService

type ConfigService interface {
	GetConfig(userID string) Config
	PersistConfig(userID string, config Config)
}

type DateType

type DateType int

func DateFrom

func DateFrom(dateString string) (dayDate date.Date, monthDate string, dateType DateType)

type ErrorInterpreter

type ErrorInterpreter interface {
	Interpret(error, Localizer) string
}

type ErrorReporter

type ErrorReporter interface {
	ReportPanic(e interface{}, requestEnv *alexa.RequestEnvelope)
	ReportError(e error)
}

type JournalProvider

type JournalProvider interface {
	Get(accessToken string, spreadsheetName string) (j.Journal, error)
}

type JournalSkill

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

func NewJournalSkill

func NewJournalSkill(journalProvider JournalProvider,
	errorInterpreter ErrorInterpreter,
	log *zap.SugaredLogger,
	errorReporter ErrorReporter,
	i18nBundle *i18n.Bundle,
	configService ConfigService,
) *JournalSkill

func (*JournalSkill) ProcessRequest

func (h *JournalSkill) ProcessRequest(requestEnv *alexa.RequestEnvelope) (responseEnv *alexa.ResponseEnvelope)

type Localizer

type Localizer interface {
	Get(ids ...resources.StringID) string
	GetTemplated(id resources.StringID, templateData interface{}) string
	Month(m int) string
}

type SessionAttributes

type SessionAttributes struct {
	Drafts   map[string][]string `json:"drafts"`
	Drafting bool                `json:"drafting"`
}

Directories

Path Synopsis
cmd
Code generated by pegomock.
Code generated by pegomock.
search

Jump to

Keyboard shortcuts

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