groups

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package groups deals with group names and their initialisms.

Index

Constants

This section is empty.

Variables

View Source
var ErrFilter = errors.New("invalid filter used")

Functions

func Count

func Count(name string) (int, error)

Count returns the number of file entries associated with a named group.

func Cronjob

func Cronjob(force bool) error

Cronjob is used for system automation to generate dynamic HTML pages.

func Fix

func Fix(simulate bool) error

Fix any malformed group names found in the database.

func Initialism

func Initialism(name string) (string, error)

Initialism returns a named group initialism or acronym.

func MakeSlug

func MakeSlug(s string) string

MakeSlug takes a string and makes it into a URL friendly slug.

func Print

func Print(r Request) (total int, err error)

Print list organisations or groups filtered by a name and summaries the results.

func Variations

func Variations(name string) ([]string, error)

Variations creates format variations for a named group.

func Wheres

func Wheres() []string

Wheres are group categories.

Types

type Filter

type Filter int

Filter group by role or function.

const (
	// None returns all groups.
	None Filter = iota
	// BBS boards.
	BBS
	// FTP sites.
	FTP
	// Group generic roles.
	Group
	// Magazine publishers.
	Magazine
)

func (Filter) String

func (f Filter) String() string

type Request

type Request struct {
	// Filter groups by category.
	Filter string
	// Counts the group's total files.
	Counts bool
	// Initialisms and acronyms for groups.
	Initialisms bool
	// Progress counter when requesting database data.
	Progress bool
}

Request flags for group functions.

func (Request) DataList

func (r Request) DataList(filename string) error

DataList prints an auto-complete list for HTML input elements.

func (Request) HTML

func (r Request) HTML(filename string) error

HTML prints a snippet listing links to each group, with an optional file count.

type Result

type Result struct {
	// ID used in URLs to link to the group.
	ID string
	// Name of the group.
	Name string
	// Count file totals.
	Count int
	// Initialism or acronym.
	Initialism string
	// Inject a HR element to separate a collection of groups.
	Hr bool
}

Result on a group.

Jump to

Keyboard shortcuts

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