Documentation
¶
Index ¶
- type Base64Tool
- type CSVTool
- type ColorTool
- type CronTool
- type DiffTool
- type GZipTool
- type HTMLEntityTool
- type HashTool
- type JSONTool
- type JWTDecodeResult
- type JWTTool
- type LoremTool
- type NumberBaseTool
- type PasswordTool
- type RegexTool
- type Result
- func Base64Decode(input string, urlSafe bool) Result
- func Base64Encode(input string, urlSafe bool, noPadding bool) Result
- func CSVToJSON(input string, delimiter string) Result
- func ColorConvert(input string) Result
- func CronParse(expression string) Result
- func DiffText(textA, textB string) Result
- func GZipCompress(input string) Result
- func GZipDecompress(input string) Result
- func HTMLEntityDecode(input string) Result
- func HTMLEntityEncode(input string) Result
- func Hash(input string, algorithm string, uppercase bool) Result
- func JSONFormat(input string, indent int, sortKeys bool, useTabs bool) Result
- func JSONMinify(input string) Result
- func JSONToCSV(input string, delimiter string) Result
- func JSONToYAML(input string) Result
- func JSONValidate(input string) Result
- func JWTValidate(token string) Result
- func LoremGenerate(words int, sentences int, paragraphs int) Result
- func NumberBaseConvert(input string) Result
- func PasswordGenerate(length int, uppercase bool, lowercase bool, digits bool, symbols bool, ...) Result
- func RegexTest(pattern string, input string, global bool) Result
- func TextCaseConvert(input string, mode string) Result
- func TextEscape(input string) Result
- func TextStats(input string) Result
- func TextUnescape(input string) Result
- func TimestampFromUnix(input string, tz string) Result
- func TimestampNow(tz string) Result
- func TimestampToUnix(input string, millis bool) Result
- func URLDecode(input string) Result
- func URLEncode(input string, component bool) Result
- func UUIDGenerate(version int, uppercase bool, noHyphens bool) Result
- func UUIDValidate(input string) Result
- func XMLFormat(input string) Result
- func XMLMinify(input string) Result
- func YAMLToJSON(input string, compact bool) Result
- type TextEscapeTool
- type TextStatsTool
- type TimestampTool
- type Tool
- type URLParseResult
- type URLTool
- type UUIDParseResult
- type UUIDTool
- type XMLTool
- type YAMLTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base64Tool ¶
type Base64Tool struct{}
Base64Tool provides metadata for the Base64 encode/decode tool.
func (Base64Tool) Category ¶
func (b Base64Tool) Category() string
func (Base64Tool) Description ¶
func (b Base64Tool) Description() string
func (Base64Tool) DetectFromClipboard ¶
func (b Base64Tool) DetectFromClipboard(s string) bool
DetectFromClipboard returns true if s looks like a valid Base64-encoded string. Requires standard alphabet only, minimum 4 characters, and length divisible by 4.
func (Base64Tool) ID ¶
func (b Base64Tool) ID() string
func (Base64Tool) Keywords ¶
func (b Base64Tool) Keywords() []string
func (Base64Tool) Name ¶
func (b Base64Tool) Name() string
type CSVTool ¶
type CSVTool struct{}
CSVTool provides metadata for the JSON/CSV converter tool.
func (CSVTool) Description ¶
func (CSVTool) DetectFromClipboard ¶
DetectFromClipboard always returns false — conversion requires explicit action.
type ColorTool ¶
type ColorTool struct{}
ColorTool provides metadata for the Color Converter tool.
func (ColorTool) Description ¶
func (ColorTool) DetectFromClipboard ¶
DetectFromClipboard returns true if s looks like a color value.
type CronTool ¶
type CronTool struct{}
CronTool provides metadata for the Cron Expression Parser tool.
func (CronTool) Description ¶
func (CronTool) DetectFromClipboard ¶
DetectFromClipboard returns true if s looks like a 5-field cron expression.
type DiffTool ¶
type DiffTool struct{}
DiffTool provides metadata for the Text Diff tool.
func (DiffTool) Description ¶
func (DiffTool) DetectFromClipboard ¶
DetectFromClipboard always returns false because diff requires two inputs.
type GZipTool ¶
type GZipTool struct{}
GZipTool provides metadata for the GZip Compress / Decompress tool.
func (GZipTool) Description ¶
func (GZipTool) DetectFromClipboard ¶
DetectFromClipboard always returns false because binary gzip detection from clipboard text is unreliable.
type HTMLEntityTool ¶
type HTMLEntityTool struct{}
HTMLEntityTool provides metadata for the HTML Entity Encoder tool.
func (HTMLEntityTool) Category ¶
func (h HTMLEntityTool) Category() string
func (HTMLEntityTool) Description ¶
func (h HTMLEntityTool) Description() string
func (HTMLEntityTool) DetectFromClipboard ¶
func (h HTMLEntityTool) DetectFromClipboard(s string) bool
DetectFromClipboard returns true if s contains HTML entity patterns such as &, <, >, ", or &#-prefixed sequences.
func (HTMLEntityTool) ID ¶
func (h HTMLEntityTool) ID() string
func (HTMLEntityTool) Keywords ¶
func (h HTMLEntityTool) Keywords() []string
func (HTMLEntityTool) Name ¶
func (h HTMLEntityTool) Name() string
type HashTool ¶
type HashTool struct{}
HashTool provides metadata for the Hash Generator tool.
func (HashTool) Description ¶
func (HashTool) DetectFromClipboard ¶
DetectFromClipboard always returns false for the hash tool.
type JSONTool ¶
type JSONTool struct{}
JSONTool provides JSON formatting, minification, and validation.
func (JSONTool) Description ¶
func (JSONTool) DetectFromClipboard ¶
type JWTDecodeResult ¶
type JWTDecodeResult struct {
Header string
Payload string
Signature string
Output string
Error string
}
JWTDecodeResult holds the decoded components of a JWT.
func JWTDecode ¶
func JWTDecode(token string) JWTDecodeResult
JWTDecode splits a JWT into its three parts, base64url-decodes the header and payload, and pretty-prints the JSON.
type JWTTool ¶
type JWTTool struct{}
JWTTool provides metadata for the JWT Decoder tool.
func (JWTTool) Description ¶
func (JWTTool) DetectFromClipboard ¶
DetectFromClipboard returns true if the string looks like a JWT (3 dot-separated non-empty segments).
type LoremTool ¶
type LoremTool struct{}
LoremTool provides metadata for the Lorem Ipsum Generator tool.
func (LoremTool) Description ¶
func (LoremTool) DetectFromClipboard ¶
DetectFromClipboard always returns false for the lorem tool (generative tool).
type NumberBaseTool ¶
type NumberBaseTool struct{}
NumberBaseTool provides metadata for the Number Base converter tool.
func (NumberBaseTool) Category ¶
func (n NumberBaseTool) Category() string
func (NumberBaseTool) Description ¶
func (n NumberBaseTool) Description() string
func (NumberBaseTool) DetectFromClipboard ¶
func (n NumberBaseTool) DetectFromClipboard(s string) bool
DetectFromClipboard returns true if s has a 0x, 0b, or 0o prefix.
func (NumberBaseTool) ID ¶
func (n NumberBaseTool) ID() string
func (NumberBaseTool) Keywords ¶
func (n NumberBaseTool) Keywords() []string
func (NumberBaseTool) Name ¶
func (n NumberBaseTool) Name() string
type PasswordTool ¶
type PasswordTool struct{}
PasswordTool provides metadata for the Password Generator tool.
func (PasswordTool) Category ¶
func (p PasswordTool) Category() string
func (PasswordTool) Description ¶
func (p PasswordTool) Description() string
func (PasswordTool) DetectFromClipboard ¶
func (p PasswordTool) DetectFromClipboard(_ string) bool
DetectFromClipboard always returns false for the password tool. Password generation is a generative tool with no meaningful clipboard detection.
func (PasswordTool) ID ¶
func (p PasswordTool) ID() string
func (PasswordTool) Keywords ¶
func (p PasswordTool) Keywords() []string
func (PasswordTool) Name ¶
func (p PasswordTool) Name() string
type RegexTool ¶
type RegexTool struct{}
RegexTool provides metadata for the Regex Tester tool.
func (RegexTool) Description ¶
func (RegexTool) DetectFromClipboard ¶
DetectFromClipboard always returns false for the regex tool. Regex patterns are too ambiguous to detect reliably.
type Result ¶
Result is the standard return type for tool operations. Success is indicated by Error == "".
func Base64Decode ¶
Base64Decode decodes a Base64-encoded string. If urlSafe is true, RFC 4648 section 5 URL-safe decoding is used. It first tries decoding with padding, then without (stripping trailing =). On failure, it returns a Result with Error set.
func Base64Encode ¶
Base64Encode encodes the input string to Base64. If urlSafe is true, RFC 4648 section 5 URL-safe encoding is used. If noPadding is true, padding characters (=) are omitted.
func CSVToJSON ¶
CSVToJSON converts CSV text to a JSON array of objects. The first row is treated as headers. The delimiter parameter controls the field separator (default ",").
func ColorConvert ¶
ColorConvert auto-detects the color format and converts to all formats.
func CronParse ¶
CronParse parses a 5-field cron expression and returns a human-readable description.
func DiffText ¶
DiffText computes a unified diff between textA and textB using a longest common subsequence (LCS) algorithm. Lines present only in A are prefixed with "-", lines only in B with "+", and common lines with " ".
func GZipCompress ¶
GZipCompress compresses the input string using gzip and returns the result as a base64-encoded string (since gzip output is binary).
func GZipDecompress ¶
GZipDecompress base64-decodes the input, then decompresses it with gzip. Returns the decompressed plaintext string.
func HTMLEntityDecode ¶
HTMLEntityDecode decodes HTML entities in input using html.UnescapeString.
func HTMLEntityEncode ¶
HTMLEntityEncode encodes special HTML characters in input using html.EscapeString.
func Hash ¶
Hash computes the hash digest of input using the specified algorithm. Supported algorithms: md5, sha1, sha256, sha512 (case-insensitive). If uppercase is true, the hex-encoded output is returned in uppercase.
func JSONFormat ¶
JSONFormat pretty-prints JSON. When sortKeys is true, keys are sorted recursively. When useTabs is true, indentation uses tabs instead of spaces. Without sortKeys, json.Indent is used to preserve original key order.
func JSONMinify ¶
JSONMinify removes all whitespace from JSON using json.Compact.
func JSONToCSV ¶
JSONToCSV converts a JSON array of objects to CSV text. The delimiter parameter controls the field separator (default ","). Keys are sorted alphabetically to produce deterministic output. Nested values are stringified as JSON.
func JSONValidate ¶
JSONValidate checks whether the input is valid JSON. Returns Output "valid" on success, or Error with details on failure.
func JWTValidate ¶
JWTValidate checks whether a token string is a structurally valid JWT. It verifies 3 dot-separated segments, valid base64url encoding, and valid JSON in the header and payload. Returns Output:"valid" on success or an Error.
func LoremGenerate ¶
LoremGenerate generates lorem ipsum placeholder text. Exactly one of words, sentences, or paragraphs must be > 0.
func NumberBaseConvert ¶
NumberBaseConvert auto-detects the number base from the input prefix and converts it to all four representations: decimal, hex, octal, binary. Prefixes: 0x = hex, 0b = binary, 0o = octal, else decimal.
func PasswordGenerate ¶
func PasswordGenerate(length int, uppercase bool, lowercase bool, digits bool, symbols bool, symbolSet string) Result
PasswordGenerate creates a random password of the specified length using the selected character types. It uses crypto/rand for secure randomness. If symbolSet is empty, the default symbol set is used.
func RegexTest ¶
RegexTest compiles pattern and tests it against input. If global is true, all matches are returned via FindAllString. If global is false, only the first match is returned via FindString.
func TextCaseConvert ¶
TextCaseConvert converts the input text to the specified case mode. Supported modes: lower, upper, title, camel, snake, kebab.
func TextEscape ¶
TextEscape escapes special characters in the input string. It uses strconv.Quote and strips the surrounding quotes.
func TextStats ¶
TextStats computes statistics about the input text: character count, word count, line count, sentence count, and byte count.
func TextUnescape ¶
TextUnescape unescapes escape sequences in the input string. It replaces literal \n, \t, etc. with the actual characters. Uses strconv.Unquote, wrapping the input in quotes if needed.
func TimestampFromUnix ¶
TimestampFromUnix converts a unix timestamp (seconds or milliseconds) to a human-readable datetime in the specified timezone. If tz is empty, UTC is used. Input of 10 digits is treated as seconds, 13 digits as milliseconds.
func TimestampNow ¶
TimestampNow returns the current time in multiple formats. If tz is empty, UTC is used.
func TimestampToUnix ¶
TimestampToUnix parses a datetime string in RFC3339 or common formats and returns the unix timestamp. If millis is true, returns milliseconds.
func URLEncode ¶
URLEncode percent-encodes the input string. If component is true, url.QueryEscape is used (spaces become +). If component is false, url.PathEscape is used (spaces become %20).
func UUIDGenerate ¶
UUIDGenerate creates a new UUID of the specified version. Supported versions: 4 (random), 7 (time-ordered). If uppercase is true, the output is uppercased. If noHyphens is true, hyphens are removed from the output.
func UUIDValidate ¶
UUIDValidate checks whether the input is a valid UUID. Returns "valid (version N)" on success or an Error.
func XMLFormat ¶
XMLFormat pretty-prints XML with 2-space indentation. It decodes all tokens from the input and re-encodes them with indentation.
func XMLMinify ¶
XMLMinify removes all unnecessary whitespace from XML. It decodes and re-encodes tokens with no indentation.
func YAMLToJSON ¶
YAMLToJSON converts a YAML string to JSON. If compact is true, the JSON output has no indentation.
type TextEscapeTool ¶
type TextEscapeTool struct{}
TextEscapeTool provides metadata for the Text Escape / Unescape tool.
func (TextEscapeTool) Category ¶
func (t TextEscapeTool) Category() string
func (TextEscapeTool) Description ¶
func (t TextEscapeTool) Description() string
func (TextEscapeTool) DetectFromClipboard ¶
func (t TextEscapeTool) DetectFromClipboard(s string) bool
DetectFromClipboard returns true if s contains literal escape sequences such as \n, \t, \r, \\, or \".
func (TextEscapeTool) ID ¶
func (t TextEscapeTool) ID() string
func (TextEscapeTool) Keywords ¶
func (t TextEscapeTool) Keywords() []string
func (TextEscapeTool) Name ¶
func (t TextEscapeTool) Name() string
type TextStatsTool ¶
type TextStatsTool struct{}
TextStatsTool provides metadata for the Text Analyzer tool.
func (TextStatsTool) Category ¶
func (t TextStatsTool) Category() string
func (TextStatsTool) Description ¶
func (t TextStatsTool) Description() string
func (TextStatsTool) DetectFromClipboard ¶
func (t TextStatsTool) DetectFromClipboard(_ string) bool
DetectFromClipboard always returns false for the text stats tool.
func (TextStatsTool) ID ¶
func (t TextStatsTool) ID() string
func (TextStatsTool) Keywords ¶
func (t TextStatsTool) Keywords() []string
func (TextStatsTool) Name ¶
func (t TextStatsTool) Name() string
type TimestampTool ¶
type TimestampTool struct{}
TimestampTool provides metadata for the Timestamp converter tool.
func (TimestampTool) Category ¶
func (ts TimestampTool) Category() string
func (TimestampTool) Description ¶
func (ts TimestampTool) Description() string
func (TimestampTool) DetectFromClipboard ¶
func (ts TimestampTool) DetectFromClipboard(s string) bool
DetectFromClipboard returns true if s is exactly 10 or 13 digits (unix seconds or millis).
func (TimestampTool) ID ¶
func (ts TimestampTool) ID() string
func (TimestampTool) Keywords ¶
func (ts TimestampTool) Keywords() []string
func (TimestampTool) Name ¶
func (ts TimestampTool) Name() string
type Tool ¶
type Tool interface {
Name() string
ID() string
Description() string
Category() string
Keywords() []string
DetectFromClipboard(s string) bool
}
Tool defines the metadata interface for tool discovery and routing. Tool logic lives in standalone functions, NOT on this interface.
type URLParseResult ¶
type URLParseResult struct {
Scheme string
Host string
Port string
Path string
Query string
Fragment string
Params map[string][]string
Output string
Error string
}
URLParseResult holds the parsed components of a URL.
func URLParse ¶
func URLParse(input string) URLParseResult
URLParse parses a URL string into its components. Returns an error for empty input or URLs without a scheme.
type URLTool ¶
type URLTool struct{}
URLTool provides metadata for the URL encode/decode/parse tool.
func (URLTool) Description ¶
func (URLTool) DetectFromClipboard ¶
DetectFromClipboard returns true if s looks like an HTTP or HTTPS URL.
type UUIDParseResult ¶
type UUIDParseResult struct {
UUID string
Version int
Variant string
Timestamp string
Output string
Error string
}
UUIDParseResult holds the parsed components of a UUID.
func UUIDParse ¶
func UUIDParse(input string) UUIDParseResult
UUIDParse parses a UUID string and returns its components.
type UUIDTool ¶
type UUIDTool struct{}
UUIDTool provides metadata for the UUID Generate / Validate / Parse tool.
func (UUIDTool) Description ¶
func (UUIDTool) DetectFromClipboard ¶
DetectFromClipboard returns true if the string looks like a UUID.
type XMLTool ¶
type XMLTool struct{}
XMLTool provides metadata for the XML Formatter tool.
func (XMLTool) Description ¶
func (XMLTool) DetectFromClipboard ¶
DetectFromClipboard returns true if the input looks like XML — starts with '<' and contains '>'.
type YAMLTool ¶
type YAMLTool struct{}
YAMLTool provides metadata for the JSON / YAML converter tool.
func (YAMLTool) Description ¶
func (YAMLTool) DetectFromClipboard ¶
DetectFromClipboard returns true if s looks like YAML (but not JSON). It tries to unmarshal as YAML, and rejects inputs that start with { or [ to avoid detecting JSON as YAML.