assets

package
v0.0.0-...-1a9902f Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Banners by board stored in memory
	Banners = BannerStore{
		// contains filtered or unexported fields
	}
)
View Source
var Loading = FileStore{
	// contains filtered or unexported fields
}

Loading stores board-specific loading images

Functions

func GetVideoNames

func GetVideoNames() []string

GetVideoNames fetches videoNames behind a mutex

func WatchVideoDir

func WatchVideoDir()

WatchVideoDir watches the www/videos directory for changes.

Types

type BannerStore

type BannerStore struct {
	// contains filtered or unexported fields
}

BannerStore stores multiple files by board in memory

func (*BannerStore) FileTypes

func (s *BannerStore) FileTypes(board string) []uint16

FileTypes returns file types of banners for a specific board

func (*BannerStore) Get

func (s *BannerStore) Get(board string, id int) (file File, ok bool)

Get returns the banner specified by board and ID. If none found, ok == false. file should not be mutted.

func (*BannerStore) Random

func (s *BannerStore) Random(board string) (int, string, bool)

Random returns a random banner for the board. If none found, ok == false.

func (*BannerStore) Set

func (s *BannerStore) Set(board string, files []File)

Set files stored for a certain board. Technically deleting a board would leak memory, but it's so rare and little.

type File

type File struct {
	Data       []byte
	Mime, Hash string
}

File contains data and type of a file stored in memory

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore stores board-specific files in memory

func (*FileStore) Get

func (s *FileStore) Get(board string) (file File)

Get returns the file specified by board. If none found, default is returned. file should not be mutted.

func (*FileStore) Set

func (s *FileStore) Set(board string, file File)

Set file stored for a certain board. If file is a zero struct, previous file is deleted. Technically deleting a board would leak memory, but it's so rare and little.

Jump to

Keyboard shortcuts

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