Documentation ¶
Index ¶
Constants ¶
View Source
const ( // opCreate represents a create operation for short link OpCreate Op = "create" // opDelete represents a delete operation for short link OpDelete = "delete" // opUpdate represents a update operation for short link OpUpdate = "update" // opFetch represents a fetch operation for short link OpFetch = "fetch" )
Variables ¶
View Source
var ( Validity = regexp.MustCompile(`^[\w\-][\w\-. \/]+$`) ErrInvalidAlias = errors.New("invalid alias pattern") )
Functions ¶
func DumpFile ¶
func DumpFile(fname string)
DumpFile dumps the redir data into a given file in YAML format.
func Edit ¶
Edit edits the datastore for a given alias in a given operation. if the operation is create, then the alias is not necessary. if the operation is update/fetch/delete, then the alias is used to match the existing aliases, meaning that alias can be changed.
func ImportFile ¶
func ImportFile(fname string)
ImportFile parses and imports the given file into redir database.
Types ¶
Click to show internal directories.
Click to hide internal directories.