diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-09-19 22:12:03 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-09-19 22:12:03 -0700 |
commit | 3bbfb755411768fe8557b1e36ec10d65a351793f (patch) | |
tree | 8ea7a4e640510d313eec7c0c2758c5e63eacd1a3 /content | |
parent | 00968e11ea5ad0574ca2760d8fc8d9604e620176 (diff) |
changed Post fields from []byte to string for json decoding - complained about base64 encoded data ([]byte)
Diffstat (limited to 'content')
-rw-r--r-- | content/post.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/content/post.go b/content/post.go index 65ea88f..1dfb8fb 100644 --- a/content/post.go +++ b/content/post.go @@ -4,29 +4,28 @@ import ( "fmt" "github.com/nilslice/cms/management/editor" - "github.com/nilslice/cms/system/db" ) // Post is the generic content struct type Post struct { - db.Item + Item editor editor.Editor - Title []byte `json:"title"` - Content []byte `json:"content"` - Author []byte `json:"author"` - Timestamp []byte `json:"timestamp"` + Title string `json:"title"` + Content string `json:"content"` + Author string `json:"author"` + Timestamp string `json:"timestamp"` } func init() { - Types["Post"] = Post{} + Types["Post"] = &Post{} } // ContentID partially implements editor.Editable -func (p Post) ContentID() int { return p.ID } +func (p *Post) ContentID() int { return p.ID } // Editor partially implements editor.Editable -func (p Post) Editor() *editor.Editor { return &p.editor } +func (p *Post) Editor() *editor.Editor { return &p.editor } // MarshalEditor writes a buffer of html to edit a Post and partially implements editor.Editable func (p Post) MarshalEditor() ([]byte, error) { |