rowutil

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByTagPrefix

func ByTagPrefix(tagPrefix string, ascending bool) types.RowSorter

func MapToStrings

func MapToStrings(mapper func(*types.Row) string, rows types.Rows) []string

MapToStrings applies mapper to every *Row in rows

func SaveAsFile

func SaveAsFile(r *types.Row, dir string) (filepath string, err error)

SaveAsFile saves the given *Row r to the given directory dir, introspecting r to determine a reasonable filename (either the filename if r contains a file, or r's unique ID). If dir is empty, r is stored in the "decrypted" directory within cryptag.TrustedBasePath ($HOME/.cryptag by default).

func TagWithPrefix

func TagWithPrefix(r *types.Row, prefixes ...string) string

TagWithPrefix iterates over r's plaintags to grab the data stored in said tags, preferring the prefixes in the order they are passed in.

Example use: TagWithPrefix(r, "filename:", "id:"), which will try to return r's filename, then try to return its ID, and if both fail, will return empty string.

func TagWithPrefixStripped

func TagWithPrefixStripped(r *types.Row, prefixes ...string) string

TagWithPrefixStripped does the same thing as TagWithPrefix except it also strips off the prefix from the tags found with said prefix. (Ya get me?)

func TagsWithPrefix

func TagsWithPrefix(r *types.Row, prefix string) []string

TagsWithPrefix returns r's PlainTags that begin with prefix.

func TagsWithPrefixStripped

func TagsWithPrefixStripped(r *types.Row, prefix string) []string

TagsWithPrefixStripped does the same thing as TagsWithPrefix, except it also strips off the prefix from each of the PlainTags found with said prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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