fileslice

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fileslice provides functions that return model FileSlices, which are multiple artifact records.

Index

Constants

This section is empty.

Variables

View Source
var ErrCategory = errors.New("unknown artifacts categories")

Functions

func FileInfo

func FileInfo(uri string) (string, string, string)

FileInfo is a helper function for Files that returns the page title, h1 title and lead text.

func Records

func Records(ctx context.Context, exec boil.ContextExecutor, uri string, page, limit int) (models.FileSlice, error)

Records returns the records for the artifacts category URI. Note that the record statistics and counts get cached.

func RecordsSub

func RecordsSub(uri string) string

RecordsSub returns the records for the artifacts category URI.

func Valid

func Valid(path string) bool

Valid returns true if path is a valid URI for the list of files.

Types

type Stats

type Stats struct {
	IntroW    model.IntroWindows
	Record    model.Artifacts
	Ansi      model.Ansi
	AnsiBBS   model.AnsiBBS
	BBS       model.BBS
	BBSText   model.BBSText
	BBStro    model.BBStro
	Demoscene model.Demoscene
	MsDos     model.MsDos
	Intro     model.Intro
	IntroD    model.IntroMsDos
	Installer model.Installer
	Java      model.Java
	Linux     model.Linux
	Magazine  model.Magazine
	Macos     model.Macos
	Nfo       model.Nfo
	NfoTool   model.NfoTool
	Proof     model.Proof
	Script    model.Script
	Text      model.Text
	Windows   model.Windows
}

Stats are the database statistics for the artifacts categories.

func Counter

func Counter(db *sql.DB) (Stats, error)

Counter returns the statistics for the artifacts categories.

func Statistics

func Statistics() Stats

Statistics returns the empty database statistics for the artifacts categories.

func (*Stats) Get

func (s *Stats) Get(ctx context.Context, exec boil.ContextExecutor) error

Get and store the database statistics for the artifacts categories.

type URI

type URI int

URI is a type for the files URI path.

const (
	Deletions URI

	ForApproval

	NewUpdates
	NewUploads

	Unwanted
)

func Match

func Match(path string) URI

Match path to a URI type or return -1 if not found.

func (URI) String

func (u URI) String() string

Jump to

Keyboard shortcuts

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