googl

package module
v0.0.0-...-9952895 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: MIT Imports: 4 Imported by: 2

README

googl


A library (and CLI) for Google Url Shortener service.

Installation

To install the library:

go get github.com/dimoreira/googl

To install the library with the CLI:

go get github.com/dimoreira/googl/cli/googl

Usage

// Shorten an url
googl shorten -k <your-api-key> <url-to-be-shortened>

// Expand an url
googl expand -k <your-api-key> <url-to-be-expanded>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Googl

type Googl struct {
	Key string
}

func NewClient

func NewClient(key string) *Googl

func (*Googl) Expand

func (c *Googl) Expand(shortUrl string) (*LongMsg, error)

func (*Googl) Shorten

func (c *Googl) Shorten(url string) (*ShortMsg, error)

type LongMsg

type LongMsg struct {
	Kind    string `json:"kind"`
	Id      string `json:"id"`
	LongUrl string `json:"longUrl"`
	Status  string `json:"status"`
}

type ShortMsg

type ShortMsg struct {
	Kind    string `json:"kind"`
	Id      string `json:"id"`
	LongUrl string `json:"longUrl"`
}

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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