ohdiary

package module
v0.0.0-...-2b3b22d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2015 License: MIT Imports: 24 Imported by: 0

README

diary

An OhLife clone because that great service is shutting down and I wanted to try out the Go programming language

Start server locally

Run $ goapp serve

Deploy updated version

Run $ goapp deploy

Documentation

Index

Constants

View Source
const REPLY_TO_ADDRESS string = "%s@commanigy-diary.appspotmail.com"

Variables

View Source
var AppHelpers = template.FuncMap{
	"menu_css_class": func(actualName string, templateName string) (string, error) {
		if actualName == templateName {
			return "active", nil
		}

		return "", nil
	},
	"formattedDiaryEntryDate": func(diaryEntryDate time.Time) (string, error) {
		return diaryEntryDate.Format("Monday, January 2"), nil
	},
	"authenticated": func(username string) (bool, error) {
		return len(username) > 0, nil
	},
	"dict": func(values ...interface{}) (map[string]interface{}, error) {
		if len(values)%2 != 0 {
			return nil, errors.New("invalid dict call")
		}
		dict := make(map[string]interface{}, len(values)/2)
		for i := 0; i < len(values); i += 2 {
			key, ok := values[i].(string)
			if !ok {
				return nil, errors.New("dict keys must be strings")
			}
			dict[key] = values[i+1]
		}
		return dict, nil
	},
}

Functions

func DiariesControllerIndex

func DiariesControllerIndex(r render.Render, req *http.Request)

func PagesControllerIndex

func PagesControllerIndex(r render.Render, req *http.Request)

Types

type AppConfiguration

type AppConfiguration struct {
	SendGridUser string
	SendGridKey  string
}

type Diary

type Diary struct {
	CreatedAt  time.Time
	Author     string
	Token      string
	TimeZone   string // "Europe/Berlin"
	TimeOffset int    // 10
}

type DiaryEntry

type DiaryEntry struct {
	CreatedAt time.Time
	Content   string `datastore:",noindex"`
}

Jump to

Keyboard shortcuts

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