Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 posts
Octocat-spinner-32 scripts
Octocat-spinner-32 static
Octocat-spinner-32 views
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING
Octocat-spinner-32 README
Octocat-spinner-32 blog.go
Octocat-spinner-32 comment.go
Octocat-spinner-32 misc.go
Octocat-spinner-32 post.go
README
This project is marked for a do-over. Don't use it.

This is a very simple blog application for my homepage. It is my first
web application with Go.

In includes usage of HTTP basic authentication with abbot's 'go-http-auth'
package, CAPTCHA with dchest's 'captcha' package, URL routing with
gorilla's 'mux' package and Markdown parsing with russross' 'blackfriday'
package.

The basic approach here is to keep cached copies of all views, blog posts
and comments and update them as new ones are added. Namely, when new comments
are added, the comment cache for that post is updated. The views and blog posts
caches can be updated by visiting blog.burntsushi.net/refresh. (Of course, a 
user name and password are required; you didn't take me for an idiot, now did 
you? :P)

There is also an example of piping a text templates output into the standard 
input of the 'mailx' program (so that I get email notifications whenever a new 
comment is posted). Go's Reader/Writer interfaces made this stupidly simple.

It bares mentioning that the sync package's RWMutex and Mutex types 
keep everything thread safe. goroutines and channels didn't seem to fit with 
the 'many readers OR a single writer' model.

Many thanks to manveru, whose own blog application greatly inspired mine:
https://github.com/manveru/manveru.name
Something went wrong with that request. Please try again.