-
-
Save EmperorEarth/5c7a2bc1d9ec5f2a4e7cbe9caa9bb78f to your computer and use it in GitHub Desktop.
hello-world-relay-part-1 - In-memory database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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