tools

package
v0.0.0-...-6ebd40e Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Overview

Package tools holds various utility functions that can be used for multiple purposes as well as constant values to be used elsewhere in the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBase64

func FromBase64(b64 string, s interface{}) error

FromBase64 takes a base64 string and converts it into a struct representation, if possible, first decoding into a gob and then an interface passed in. Returns an error if something goes wrong.

func LowerAndStripNonAlphaNumeric

func LowerAndStripNonAlphaNumeric(s string) string

LowerAndStripNonAlphaNumeric strips any Unicode-defined characters that are not letters from an input string and then sets all alpha characters to their lowercase form. It also replaces hyphens with spaces. This is search-specific, so that portions of a hyphenated word do not get stuck together.

func ToBase64

func ToBase64(s interface{}) (string, error)

ToBase64 takes an interface struct and converts it to a base64 string encoding a gob representation of the struct passed. Reference encoding/gob and encoding/base64 for more information. Returns an error if anything went wrong during the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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