filter

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package filter returns the groups based on a role or activity filter.

Index

Constants

This section is empty.

Variables

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

Functions

func Count

func Count(db *sql.DB, name string) (int, error)

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

func List

func List(db *sql.DB, w io.Writer, name string) ([]string, int, error)

List all organisations or groups filtered by the named string.

func SQLFilter

func SQLFilter(f Filter) (string, error)

SQLFilter returns a partial SQL WHERE statement to filter groups.

func SQLSelect

func SQLSelect(w io.Writer, f Filter, includeSoftDeletes bool) (string, error)

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

func SQLWhere

func SQLWhere(w io.Writer, f Filter, includeSoftDeletes 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 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