googl

package module
v0.0.0-...-569d392 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2015 License: BSD-3-Clause Imports: 7 Imported by: 0

README

googl-shortener

Create shortener url using google shortener api

How to use

Use google-shortener compiled binary. Example :

./google-shortener -target yoururl.com -key yourGoogleApiKey

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortIt

func ShortIt(key, url string) (string, error)

ShortIt is a main function to shorten given url

Types

type GoogleShorten

type GoogleShorten struct {
	Target     string
	BaseURL    string
	Version    string
	ShortenURL string
}

GoogleShorten as string type, so we can put our target url in construction method

func (*GoogleShorten) NewGoogleShorten

func (gs *GoogleShorten) NewGoogleShorten(key, target, version string) GoogleShorten

NewGoogleShorten acts as constructor to create initial values

func (*GoogleShorten) ShortIt

func (gs *GoogleShorten) ShortIt() error

ShortIt create shorten url send request to google api

func (*GoogleShorten) String

func (gs *GoogleShorten) String() string

String used return the value put in the construction type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL