board

package
v0.0.0-...-1596960 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBoardURL = "https://www.maniac-forum.de/forum/"

DefaultBoardURL is the default base url of the forum

View Source
var Logger *log.Logger

Logger is a logger for the board

Functions

func ClearCache

func ClearCache()

func IsMessageRead

func IsMessageRead(id string) bool

IsMessageRead checks if a message has been read

func SetMessageAsRead

func SetMessageAsRead(id string)

SetMessageAsRead sets a message as read

Types

type Board

type Board struct {
	ID      string
	Threads []Thread
	Title   string
}

Board in forum, like Smalltalk, O/T, etc.

type Forum

type Forum struct {
	Boards []Board
	URL    string
	// contains filtered or unexported fields
}

Forum represents the whole forum

func GetForum

func GetForum(forumUrl string, ignoreSSL bool) (*Forum, error)

GetForum returns the forum

func (*Forum) GetBoard

func (f *Forum) GetBoard(boardID string) Board

GetBoard fetches a Board like Smalltalk and the list of threads

func (*Forum) GetMessage

func (f *Forum) GetMessage(resource string) (Message, error)

GetMessage fetches a message based on it's resource string

func (*Forum) GetThread

func (f *Forum) GetThread(threadID string, boardID string) Thread

GetThread fetches a Thread based on a Thread id

type Message

type Message struct {
	ID              string
	Content         string
	Link            string
	Topic           string
	Date            string
	EnrichedContent string
	Links           []string
	Hierarchy       int
	Author          User
	Read            bool
	Thread          *Thread
	Board           *Board
}

Message contains information about a Maniac Forum Message. Single response to a Thread.

type Thread

type Thread struct {
	ID             string
	Title          string
	Link           string
	Author         string
	Date           string
	Answers        int
	IsSticky       bool
	LastAnswerDate string
	LastAnswerLink string
	Messages       []Message
	Board          *Board
}

Thread contains information about a Maniac Forum Thread

type User

type User struct {
	Name string
	ID   int
}

User contains User data

Jump to

Keyboard shortcuts

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