tchan

package
v0.0.0-...-7693fda Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	Name            string `json:"name"`
	Descr           string `json:"description"`
	Style           string `json:"style"`
	ThreadsMax      int    `json:"maxThreads,omitempty"`
	ThreadLengthMax int    `json:"maxThreadLength,omitempty"`
	PostBytesMax    int    `json:"maxPostBytes,omitempty"`
}

Board contains the configured settings for a board.

func (Board) MaxPostBytes

func (b Board) MaxPostBytes() int

MaxPostBytes returns the maximum length (in bytes) for post content on this board.

func (Board) MaxThreadLength

func (b Board) MaxThreadLength() int

MaxThreadLength returns the maximum number of posts a thread can have and be considered active.

func (Board) MaxThreads

func (b Board) MaxThreads() int

MaxThreads returns the maximum number of active threads to be displayed on this board.

type BoardOverview

type BoardOverview struct {
	Board                   // embedded
	Threads []ThreadSummary `json:"threads"`
}

BoardOverview contains superficial board data.

type Post

type Post struct {
	ID        int64     `json:"id"`
	Author    string    `json:"author"`
	Timestamp time.Time `json:"timestamp"`
	Content   string    `json:"content"`
}

Post contains all data of a single post.

type Thread

type Thread struct {
	Board Board  `json:"board"`
	Topic string `json:"topic"`
	Posts []Post `json:"posts"`
}

Thread contains all data of a single thread.

func (Thread) ID

func (t Thread) ID() int64

ID returns the thread's associated ID, i.e. the OP's post ID.

func (Thread) NumReplies

func (t Thread) NumReplies() int

NumReplies returns the number of replies this thread has received.

type ThreadSummary

type ThreadSummary struct {
	Topic      string    `json:"topic"`
	OP         Post      `json:"op"`
	NumReplies int       `json:"numReplies"`
	Active     time.Time `json:"active"`
}

ThreadSummary contains superficial thread data.

func (ThreadSummary) ID

func (t ThreadSummary) ID() int64

ID returns the thread's associated ID, i.e. the OP's post ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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