Documentation
¶
Index ¶
Constants ¶
View Source
const (
ShortenCommandName = "shorten"
)
Variables ¶
View Source
var Command = &cli.Command{ Name: ShortenCommandName, Usage: "Shorten a URL", Flags: shortenflgs.GetShortenFlags(), Action: func(ctx *cli.Context) error { serviceUrl, err := shortenflgs.GetShortenServiceUrl(ctx) if err != nil { return cli.Exit(err.Error(), 1) } ShortenCommandParams := &request.ShortenUrlRequest{ Url: ctx.String(shortenflgs.URLFlag), CustomShort: ctx.String(shortenflgs.ShortFlag), Expiration: ctx.String(shortenflgs.TtlFlag), } resp, err := shortenURL(ShortenCommandParams, serviceUrl) if err != nil { return cli.Exit(err.Error(), 1) } fmt.Printf("%v\n", resp.String()) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.