tinyurl

Crates.iotinyurl
lib.rstinyurl
version0.1.1
sourcesrc
created_at2021-03-22 19:33:43.344674
updated_at2021-03-22 19:41:34.94432
descriptionAn abstraction on top the tinyurl API in rust for quickly generating short urls.
homepage
repositoryhttps://github.com/collinsmuriuki/tinyurl
max_upload_size
id372265
size34,993
Collins Muriuki (c12i)

documentation

README

tinyurl

Version tinyurl travis-ci Documentation

An abstraction on top the tinyurl API in rust for quickly generating short urls.

Library

  • Builder
use tinyurl::TinyURL;
 // without alias
let short = TinyURL::new("https://example.com").build();
assert!(short.is_ok());

 // with alias
let aliased = TinyURL::new("https://example.com")
            .alias("some-random-nickname")
            .build();
assert!(aliased.is_ok());
  • Macro
use tinyurl::tiny;

 // without alias
let short = tiny!("https://github.com");
assert!(short.is_ok());

// with alias
let short = tiny!("https://github.com", alias = "random-random-alias");
assert!(short.is_ok());

CLI

  • Install
cargo install tinyurl
  • Usage
tinyurl 0.1.0
Collins Muriuki <murerwacollins@gmail.com>
An abstraction on top the tinyurl API in rust for quickly generating short urls.

USAGE:
    tinyurl [OPTIONS] <uri>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -a, --alias <alias>    Optional unique url alias

ARGS:
    <uri>    The uri to be shortened

Commit count: 7

cargo fmt