model

package
v0.0.0-...-b8b82af Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Port             int
	DBStringLocation string `json:"DBStringLocation"`
	Path             string
	Production       bool `json:"Production"`
	CSRFString       string
}

Configuration contains all the configurable variables for this app

type Crypto

type Crypto struct {
	gorm.Model
	PostID   int
	Hash     string `json:"Password" gorm:"Column:hash"`
	Salt     string `json:"Salt" gorm:"Column:salt"`
	AuthHash string `json:"authHash" gorm:"-"`
	Key      string `json:"Key" gorm:"Column:key"`
}

Crypto contains the cryptographic aspect of the post

type Data

type Data struct {
	gorm.Model
	PostID    int
	Title     string `json:"Title" gorm:"Column:title"`
	PostPerms int    `json:"PostPerms,string" gorm:"Column:postperms"`
	Content   string `json:"Content" gorm:"Column:text"`
}

Data contains all the info related to the posts

type Edit

type Edit struct {
	EditID int `json:"EditID" gorm:"Column:editid"`
}

Edit is used for editing a post

type M

type M map[string]interface{}

M Generic map[string]interface{} to decode into

type Markdown

type Markdown struct {
	MD      template.HTML `json:"" gorm:"-"`
	TitleMD template.HTML `json:"" gorm:"-"`
	IMG     template.HTML `json:"" gorm:"-"`
}

Markdown Contains the data used for rendering the post on the HTML frontend

type Meta

type Meta struct {
	gorm.Model
	PostID int
	Views  int `json:"Views" gorm:"Column:views"`
}

Meta Contains most of the metadata views timestamps etc

type Post

type Post struct {
	ID       int `json:"ID" gorm:"primary_key"`
	Data     Data
	Meta     Meta
	Edit     Edit     `json:"-"`
	Crypto   Crypto   `json:"-"`
	Markdown Markdown `json:"-"`
}

Post is the "master" struct

type PostCounter

type PostCounter struct {
	Count int    `json:"Count"`
	List  []Meta `json:"List"`
}

PostCounter is used on index to provide some metadata about current posts

type PostNew

type PostNew struct {
	Post
}

PostNew is used for registering a new post

Jump to

Keyboard shortcuts

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