Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CommitHash string BuildTime string Tag string )
View Source
var Alias, Channel, Event string
View Source
var RootCmd = &cobra.Command{ Use: "bjk URL SHORTCODE", Short: "a URL Shortening service and corresponding command line tool", Long: `bjk is a URL shortening service that automatically appends the appropriate tracking tags to a URL. The command line tool can be used to submit a new link using personalized values.`, Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { fmt.Println("url", args[0]) fmt.Println("short_code", args[1]) err := submit(args[0], args[1]) if err != nil { fmt.Println("Error: ", err) } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
type Database ¶
type Database interface { Get(shortcode string) (string, error) Save(shortcode, url string) (string, error) List() ([]Response, error) }
Database interface
type Submission ¶
Click to show internal directories.
Click to hide internal directories.