db

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInstanceToInactive

func AddInstanceToInactive(instance string) error

func CheckInactive

func CheckInactive()

func CheckInactiveInstances

func CheckInactiveInstances() (map[string]string, error)

func Close

func Close() error

func CloseLocalReport

func CloseLocalReport(id string, board string) error

func Connect

func Connect() error

func CreateLocalDelete

func CreateLocalDelete(id string, _type string) error

func CreateLocalReport

func CreateLocalReport(id string, board string, reason string) error

func CreateNewBoard

func CreateNewBoard(actor activitypub.Actor) (activitypub.Actor, error)

func DeleteInstanceFromInactive

func DeleteInstanceFromInactive(instance string) error

func DeleteNewsItem

func DeleteNewsItem(timestamp int) error

func GetAdminAuth

func GetAdminAuth() (string, string, error)

func GetLocalReport

func GetLocalReport(board string) (map[string]Reports, error)

func GetPostIDFromNum

func GetPostIDFromNum(num string) (string, error)

func GetReplyOP

func GetReplyOP(link string) (string, error)

func InitInstance

func InitInstance() error

func IsHashBanned

func IsHashBanned(hash string) (bool, error)

func IsInactiveTimestamp

func IsInactiveTimestamp(timeStamp string) bool

func IsReplyToOP

func IsReplyToOP(op string, link string) (string, bool, error)

func PrintAdminAuth

func PrintAdminAuth() error

func RemovePreviewFromFile

func RemovePreviewFromFile(id string) error

func RunDatabaseSchema

func RunDatabaseSchema() error

func WriteNews

func WriteNews(news NewsItem) error

Types

type NewsItem

type NewsItem struct {
	Title   string
	Content template.HTML
	Time    int
}

func GetNews

func GetNews(limit int) ([]NewsItem, error)

if limit less than 1 return all news items

func GetNewsItem

func GetNewsItem(timestamp int) (NewsItem, error)

type Removed

type Removed struct {
	ID    string
	Type  string
	Board string
}

func GetLocalDelete

func GetLocalDelete() ([]Removed, error)

type Report

type Report struct {
	ID     string
	Reason string
}

type Reports

type Reports struct {
	ID     string
	Count  int
	Actor  activitypub.Actor
	Object activitypub.ObjectBase
	OP     string
	Reason []string
}

type ReportsSortDesc

type ReportsSortDesc []Reports

func (ReportsSortDesc) Len

func (a ReportsSortDesc) Len() int

func (ReportsSortDesc) Less

func (a ReportsSortDesc) Less(i, j int) bool

func (ReportsSortDesc) Swap

func (a ReportsSortDesc) Swap(i, j int)

Jump to

Keyboard shortcuts

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