group

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Clean

func Clean(name string, sim bool) (ok bool)

Clean a malformed group name and save the fix to the database.

func CleanS

func CleanS(s string) string

CleanS fixes the malformed string.

func Count

func Count(name string) (int, error)

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

func Format

func Format(s string) string

Format returns a copy of s with custom formatting.

func List

func List(s string) (groups []string, total int, err error)

List all organisations or groups filtered by s.

func SQLFilter

func SQLFilter(f Filter) (string, error)

SQLFilter returns a partial SQL WHERE statement to filter groups.

func SQLSelect

func SQLSelect(f Filter, includeSoftDeletes bool) (string, error)

SQLSelect returns a complete SQL WHERE statement where the groups are filtered.

func SQLWhere

func SQLWhere(f Filter, softDel bool) (string, error)

SQLWhere returns a partial SQL WHERE statement where groups are filtered.

func Slug

func Slug(s string) string

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

func TrimDot

func TrimDot(s string) string

TrimDot removes any trailing dots from s.

func TrimThe

func TrimThe(s string) string

TrimThe removes 'the' prefix from s.

func UseHr

func UseHr(prevLetter, group string) (string, bool)

Use a HR element to mark out the groups alphabetically.

Types

type Filter

type Filter int

Filter group by role or function.

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

func Get

func Get(s string) Filter

Get the Filter type from s.

func (Filter) String

func (f Filter) String() string

type Request

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

Request flags for group functions.

Jump to

Keyboard shortcuts

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