routes

package
v0.0.0-...-c37b867 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-2.0, GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ANON_REACTIONS int = 6

Variables

View Source
var IsTimeGuarded = false

Whether to mandate a 2 hour delay between posts or not

Functions

func AddPost

func AddPost(c *gin.Context)
Adds a Post contained in the request body to database, subject to

validation

func AddReaction

func AddReaction(c *gin.Context)
Adds a Reaction contained in the request body to databse, subject to

validation Input reaction should be of the format: {postId, descriptor, gravitasHash}

func Clear

func Clear() bool

Allowing test database to be cleared by integration tests

func GetHtmlChain

func GetHtmlChain(c *gin.Context)

Gets HTML markup for the frontend chain, dependent on current backup data

func GetHtmlReactions

func GetHtmlReactions(c *gin.Context)

Gets html reactions that will be passed to frontend

func GetRawChain

func GetRawChain(c *gin.Context)
Gets the chain stored in backend as JSON. This inlcudes all posts and the

top 3 reactions for each post

func SetupDatabase

func SetupDatabase()

Establishes database connection and controller object, else panics

Types

This section is empty.

Jump to

Keyboard shortcuts

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