Documentation ¶
Overview ¶
Package bingo is a pastebin-like where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using AES.
Index ¶
Constants ¶
View Source
const ( ERROR = 1 << iota WARN INFO TRACE )
Variables ¶
Functions ¶
Types ¶
type ByExpire ¶
type ByExpire []indexEntry
ByExpire implements sort.Interface for []indexEntry based on the expire field.
type Comment ¶
type Comment struct { Id string `json:"id"` Author string `json:"author"` Avatar string `json:"avatar"` Data string `json:"data"` Postdate time.Time `json:"postdate"` Highlight bool `json:"highlight"` Parent string `json:"parent"` }
A comment.
- Id: comment id
- Author: comment author (encrypted)
- Avatar: author avatar
- Data: comment (encrypted) data
- Postdate: comment creation date
- Highlight: whether to enable syntax highlighting
- Parent: parent comment, if any
type CommentsByDate ¶
type CommentsByDate []Comment
CommentsByDate implements sort.Interface for []Comment based on the Postdate field.
func (CommentsByDate) Len ¶
func (a CommentsByDate) Len() int
func (CommentsByDate) Less ¶
func (a CommentsByDate) Less(i, j int) bool
func (CommentsByDate) Swap ¶
func (a CommentsByDate) Swap(i, j int)
type Conf ¶
type Conf struct { Root string `json:"root"` Views string `json:"views"` Static string `json:"static"` Log string `json:"log"` Stdout bool `json:"stdout"` Verbosity int `json:"verbosity"` Port int `json:"port"` Depth int `json:"depth"` FloodThreshold int `json:"floodThreshold"` CleanThreshold int `json:"cleanThreshold"` }
Application configuration.
- Root: data folder path
- Views: html templates folder
- Static: static assets (js, css) folder
- Log: log file
- Stdout: when a log file is given, iset to true to still log on stdout
- Verbosity: log verbosity mask
- Port: webapp port
- Depth: number of subfolders in data hierarchy (the more, the more folders, the fewer files per folder)
- FloodThreshold: min delay (in seconds) between two posts for a single user
- CleanThreshold: delete expired pasted from database once in that many seconds
type Dbm ¶
type Dbm struct {
// contains filtered or unexported fields
}
Deterministic byte machine.
type Paste ¶
type Paste struct { Id string `json:"id"` Data string `json:"data"` Expire time.Time `json:"expire"` Postdate time.Time `json:"postdate"` Burn bool `json:"burn"` Highlight bool `json:"highlight"` Discussion bool `json:"discussion"` Comments []Comment `json:"comments"` }
A paste.
- Id: paste id
- Data: paste (encrypted) data
- Expire: paste expiration date
- Postdate: paste creation date
- Burn: whether this paste must be deleted once read
- Highlight: whether to enable syntax highlighting
- Discussion: whether discussions are enabled
- Comments: paste comments
type Postdata ¶
type Postdata struct { Data string `json:"data"` Author string `json:"author"` Expire int `json:"expire"` Burn bool `json:"burn"` Highlight bool `json:"highlight"` Discussion bool `json:"discussion"` Paste string `json="paste"` Parent string `json="parent"` Comment bool `json="comment"` }
Postdata contains the json data sent by the client.
- Data: paste (encrypted) data
- Author: author (encrypted)
- Expire: expiration date
- Burn: whether this paste must be deleted once read
- Highlight: whether to enable syntax highlighting
- Discussion: whether discussions are enabled
- Paste: parent paste, if any (for comments)
- Parent: parent comment, if any (for comments)
- Comments: whether this is a comment (true) or a regular paste (false)
type Postresponse ¶
type Postresponse struct { Id string `json:"id"` Postdate time.Time `json:"postdate"` Expire time.Time `json:"expire"` Delete string `json:"delete"` Avatar string `json:"avatar"` }
Postresponse contains the json response sent to the client.
- Id: paste id
- Postdate: paste creation date
- Expire: expiration date
- Delete: delete token
- Avatar: author's avatar (comments only)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.