people

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func DataList

func DataList(filename string, r Request) error

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

func Filters

func Filters() []string

Filters is a Role slice for use with the Cobra filterFlag.

func HTML

func HTML(filename string, r Request) error

HTML prints a snippet listing links to each person.

func List

func List(role Role) (people []string, total int, err error)

List people filtered by a role.

func Print

func Print(r Request) error

Print lists people filtered by a role and summaries the results.

func Roles

func Roles() string

Roles or jobs of people.

Types

type Person

type Person struct {
	// ID used in URLs to link to the person.
	ID string
	// Nick of the person.
	Nick string
	// Inject a HR element to separate a collection of groups.
	Hr bool
}

Person data.

type Request

type Request struct {
	// Filter people by category.
	Filter string
	// Counts the person's total files.
	Counts bool
	// Progress counter when requesting database data.
	Progress bool
}

Request flags for people functions.

type Role

type Role int
const (
	Everyone Role = iota
	Artists
	Coders
	Musicians
	Writers
)

func (Role) String

func (r Role) String() string

Jump to

Keyboard shortcuts

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