Skip to content

Commit

Permalink
More README
Browse files Browse the repository at this point in the history
  • Loading branch information
tuck1s committed Mar 3, 2020
1 parent 2d9d34b commit 4008755
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions cmd/linktool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# linktool
Command-line tool to encode and decode link URLs, useful during testing.

```
./linktool -h
./linktool [encode|decode] encode and decode link URLs
encode
-action string
[open|initial_open|click] (default "open")
-message_id string
message_id (default "0000123456789abcdef0")
-rcpt_to string
rcpt_to (default "any@example.com")
-target_link_url string
URL of your target link (default "https://example.com")
-tracking_url string
URL of your tracking service endpoint (default "http://localhost:8888")
decode url
```

Example: encode a URL
```
./linktool encode -tracking_url http://localhost:8888 -rcpt_to fred@thetucks.com -action click -target_link_url https://thetucks.com -message_id 00000deadbeeff00d1337
http://localhost:8888/eJxUzLEOQiEMRuF3-WciGAaTTr4JwbaIUSKBMhnf_Ybxnv18P2Q2EBgOltb4gFDN-iTvraotfs8Lfxsc2nyml4AQdqJZHqqlhCDXGG9wGNw3VYbK_fT-jwAAAP__f2Mg1g==
```

Decode a URL
```
./linktool decode http://localhost:8888/eJxUzLEOQiEMRuF3-WciGAaTTr4JwbaIUSKBMhnf_Ybxnv18P2Q2EBgOltb4gFDN-iTvraotfs8Lfxsc2nyml4AQdqJZHqqlhCDXGG9wGNw3VYbK_fT-jwAAAP__f2Mg1g==
JSON: {"act":"c","t_url":"https://thetucks.com","msg_id":"00000deadbeeff00d1337","rcpt":"fred@thetucks.com"}
Equivalent to encode -tracking_url http://localhost:8888 -rcpt_to fred@thetucks.com -action click -target_link_url https://thetucks.com -message_id 00000deadbeeff00d1337
```

0 comments on commit 4008755

Please sign in to comment.