Skip to content

Instantly share code, notes, and snippets.

@EmperorEarth
Forked from sogko/database.go
Last active August 3, 2016 06:01
Show Gist options
  • Save EmperorEarth/5c7a2bc1d9ec5f2a4e7cbe9caa9bb78f to your computer and use it in GitHub Desktop.
Save EmperorEarth/5c7a2bc1d9ec5f2a4e7cbe9caa9bb78f to your computer and use it in GitHub Desktop.
hello-world-relay-part-1 - In-memory database
package data
// Data model structs
type Post struct {
Id string `json:"id"`
Text string `json:"text"`
}
// Mock data
var latestPost = &Post{
Id: "1",
Text: "Hello World",
}
// Data getters/setters
func GetLatestPost() (*Post, error) {
return latestPost, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment