assets

package
v4.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: AGPL-3.0, AGPL-3.0-or-later Imports: 4 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
}

Stores board-specific loading images

Functions

This section is empty.

Types

type BannerStore

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

Stores multiple files by board in memory

func (*BannerStore) Get

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

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) (id int, mime string, ok bool)

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
}

Contains data and type of a file stored in memory

type FileStore

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

Stores board-specific files in memory

func (*FileStore) Get

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

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