people

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package people deals with people, person names, aliases and their roles.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cronjob added in v1.6.0

func Cronjob(force bool) error

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

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 Fix

func Fix() error

Fix any malformed group names found in the database.

Example
package main

import (
	"log"
	"os"

	"github.com/Defacto2/df2/pkg/people"
)

func main() {
	// suppress dynamic output for this example
	os.Stdout, _ = os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
	defer os.Stdout.Close()
	if err := people.Fix(); err != nil {
		log.Print(err)
	}
}
Output:

func HTML

func HTML(filename string, r Request) error

HTML prints a snippet listing links to each person.

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.

func Wheres added in v1.6.0

func Wheres() []string

Wheres are group categories.

Types

type Request

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

Request flags for people functions.

func (Request) HTML added in v1.6.0

func (r Request) HTML(name string) error

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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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