request

package
v1.11.9 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package request obtains and writes the data of the group to various formats.

Index

Constants

This section is empty.

Variables

View Source
var ErrPointer = errors.New("pointer value cannot be nil")

Functions

func Print

func Print(db *sql.DB, w io.Writer, r Flags) (int, error)

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

Types

type Flags

type Flags 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.
}

Flags for group functions.

func (Flags) DataList

func (r Flags) DataList(db *sql.DB, w, dest io.Writer) error

DataList saves an auto-complete list for HTML input elements to the dest file path.

func (Flags) Files

func (r Flags) Files(db *sql.DB, name string) (int, error)

Files returns the number of files associated with the named group.

func (Flags) HTML

func (r Flags) HTML(db *sql.DB, w, dest io.Writer) error

HTML prints a snippet listing links to each group, with an optional file count. If dest is empty the results will be send to stdout.

func (Flags) Initialism

func (r Flags) Initialism(db *sql.DB, name string) (string, error)

Initialism returns the initialism of the named filter.

func (Flags) Parse

func (r Flags) Parse(db *sql.DB, w, dest io.Writer, tmpl string) error

Parse the group template and save it to the named file. If the dest is empty, the results will be sent to stdout. The HTML returned to stdout is different to the markup saved to a file.

type Result

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

Result on a group.

Jump to

Keyboard shortcuts

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