blogchad

package
v0.0.0-...-fdbb991 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArticlePost

func ArticlePost(w http.ResponseWriter, r *http.Request)

posting an article to a database

func CommentPost

func CommentPost(w http.ResponseWriter, r *http.Request)

post a comment to a database

func VotePost

func VotePost(w http.ResponseWriter, r *http.Request)

Posting a vote to database

func WallGet

func WallGet(userID string) ([]byte, error)

get global wall

Types

type Article

type Article struct {
	ID        string
	Title     string
	Date      string
	Username  string
	UserID    string
	Text      string
	Image     string
	Upvotes   []string
	Downvotes []string
	Comments  []Comment
}

func ArticleGet

func ArticleGet(id string) (Article, error)

get article from database by id

type Comment

type Comment struct {
	ID       string
	Username string
	UserID   string
	Text     string
	Date     string
}

type NewArticle

type NewArticle struct {
	Title  string
	UserID string
	Text   string
	ID     string
}

type Vote

type Vote struct {
	ArticleID string `json:"articleID"`
	UserID    string
	Vote      string `json:"vote"`
}

Jump to

Keyboard shortcuts

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