Refactor and pull back single app functionality #290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
There are a lot of refactoring changes applied to better support sharing of common logic, clarify intent and in general cleanup the code. Admittedly this would have been better managed by separate smaller PRs but I was "on a roll" and didn't find a good stopping place until I was finished drafting test cases (separate PR).
New functionality has been added to the
cmd/eslg
app to assist with testdata generation.Further refactoring is needed once I've had enough time to distance myself from recent changes and can look at the code with fresh eyes.
Added
Encode Randomly
button tocmd/eslg
appQueryEscape
button tocmd/eslg
appQueryEscape Randomly
button tocmd/eslg
appChanged
cmd/usl/output
ReadURLsFromInput
ProcessInputURLs
cmd/eslg
encodeInput
func tointernal/safelinks/EncodeInput
cmd/dslg
decodeInput
func tointernal/safelinks/DecodeInput
Encode
button toEncode All
incmd/eslg
appcmd/eslg
app no longer explicitly setslight
themecmd/dslg
currently doesCleanURL
now removes leading/trailing periodstrimEnclosingURLCharacters
func handles this task and the existing angle brackets removal taskGetURL*
funcs (and callers) to optionally match non-HTTPS prefixed URLs. This is primarily done to support generating (encoding) testdata files.newQueryEscapeButton
andnewEncodeButton
funcs to separatenewProcessInputButton
helper funcFixed
ErrNoURLsFound
errorTrimmed
method to return a "clean" version of the original URL pattern