tools

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Unlicense Imports: 15 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 BuildMisfinURL added in v1.2.0

func BuildMisfinURL(senders []string, subject, body string) string

func CheckTempPassword

func CheckTempPassword(password string) error

func ClearTempPasswords added in v1.2.0

func ClearTempPasswords(username 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 CropToLastEncodedBoundary added in v1.2.0

func CropToLastEncodedBoundary(urlStr string, maxLength int) string

CropToLastEncodedBoundary ensures the URL string doesn't cut off in the middle of a percent-encoded sequence.

func CustomQueryEscape added in v1.2.0

func CustomQueryEscape(input string) string

CustomQueryEscape ensures that spaces are encoded as %20 instead of +.

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)

GetMessageLinkLine 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 PrependPrefixToLines added in v1.2.0

func PrependPrefixToLines(body string) string

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

Untag 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