tools

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserHash

func AddUserHash(username string) error

func Authenticate

func Authenticate() (string, error)

func CheckTempPassword

func CheckTempPassword(password string) error

func CountTags

func CountTags(tagName, username string) (string, error)

CountTags counts the number of symlinks in the directory for a given tag. It returns the count as a string in the format "(n)" or an empty string if the directory is empty.

func FormatSender

func FormatSender(sender string) string

func GenerateFilename

func GenerateFilename(timestamp time.Time, sender string) string

func GenerateID

func GenerateID(timestamp time.Time, sender string) string

func GenerateOneTimePassword

func GenerateOneTimePassword(username string) (string, error)

GenerateOneTimePassword generates a one-time use password, writes its hash to a YAML file along with the username, and returns the generated password.

func GetMailPreview

func GetMailPreview(message Skymail) (string, error)

func GetMessageLinkLine

func GetMessageLinkLine(message Skymail, msgid, username string) (string, error)

Create message link line

func HasTag

func HasTag(msgid, tagName, username string) (bool, error)

func IsolateAddress

func IsolateAddress(input string) string

func ListTags

func ListTags(username string) ([]string, error)

func PrintLinkAndPreview

func PrintLinkAndPreview(msgid, username string, space bool) (string, time.Time, error)

func Tag

func Tag(msgid, tagName, username string, sync bool) error

func Untag

func Untag(msgid, tagName, username string, sync bool) error

RemoveSymlink removes the symlink from ../tags/tagName/msgid.msfn

func UntagAll

func UntagAll(msgID, username string) error

func WalkTag

func WalkTag(tagName, username string, space bool, n ...int) error

Types

type Preview

type Preview struct {
	Text      string
	Timestamp time.Time
}

type Skymail

type Skymail struct {
	Senders     []string
	Recipients  []string
	Timestamps  []time.Time
	Subject     string
	MessageBody string
}

func ParseSkymail

func ParseSkymail(skymailFilename string) (Skymail, error)

type UserHashes

type UserHashes map[string]string

Jump to

Keyboard shortcuts

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