cmd

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplicationVersion = ""

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func RestRequest

func RestRequest(method string, uri string, apiKey string, timeout time.Duration, body io.Reader) ([]byte, time.Duration, error)

RestRequest returns data from a REST endpoint

Types

type APIResponse

type APIResponse struct {
	Title  string `json:"title"`
	Type   string `json:"type"`
	Detail string `json:"detail"`
	Status int    `json:"status"`
}

type ShortUrls

type ShortUrls struct {
	SU struct {
		Data []struct {
			ShortCode      string `json:"shortCode"`
			ShortUrl       string `json:"shortUrl"`
			LongUrl        string `json:"longUrl"`
			DeviceLongUrls struct {
				Android interface{} `json:"android"`
				Ios     interface{} `json:"ios"`
				Desktop interface{} `json:"desktop"`
			} `json:"deviceLongUrls"`
			DateCreated   string `json:"dateCreated"`
			VisitsSummary struct {
				Total   int `json:"total"`
				NonBots int `json:"nonBots"`
				Bots    int `json:"bots"`
			} `json:"visitsSummary"`
			Tags []string `json:"tags"`
			Meta struct {
				ValidSince string      `json:"validSince"`
				ValidUntil interface{} `json:"validUntil"`
				MaxVisits  interface{} `json:"maxVisits"`
			} `json:"meta"`
			Domain    interface{} `json:"domain"`
			Title     interface{} `json:"title"`
			Crawlable bool        `json:"crawlable"`
		} `json:"data"`
	} `json:"shortUrls"`
	Pagination struct {
		CurrentPage        int `json:"currentPage"`
		PagesCount         int `json:"pagesCount"`
		ItemsPerPage       int `json:"itemsPerPage"`
		ItemsInCurrentPage int `json:"itemsInCurrentPage"`
		TotalItems         int `json:"totalItems"`
	} `json:"pagination"`
}

Jump to

Keyboard shortcuts

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