vgy

package module
v0.0.0-...-6f1b61a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 9 Imported by: 0

README

vgy

vgy

Simple Post image file to vgy.me

Important

We are not affiliated to vgy.me

vgy API doc

VGY.ME API doc is here

MIT Licence

Frontware

Maintainability

Doc

Doc online is on godoc

Usage


import "github.com/Frontware/vgy"
import "fmt"

func main () {

    // Get your user key here: https://vgy.me/account/details#userkeys
    vgy.UserKey = "PUT YOUR VGY USER KEY HERE"
    // You must have the file "image.png" in current folder
    info, err := vgy.UploadImageFile("image.png")
    if err!=nil {
        fmt.Fatal("Upload failed ",err)
    }
    fmt.Println("Upload to "+info.URL)
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserKey string

UserKey must be created at https://vgy.me/account/details It's not mandatory. But if you don't set it you won't get the uploaded image attached to your vgy.me account

Functions

This section is empty.

Types

type Response

type Response struct {
	Error      bool
	URL        string // direct URL of the image
	Image      string
	Extension  string
	Filesize   int64    // File size in bytes
	DeleteURL  string   `json:"delete"`      // URL to delete the image from vgy.me hosting
	UploadList []string `json:"upload_list"` // List of URL when upload several images
}

Response returned information from vgy.me after posting an image

func UploadImageFile

func UploadImageFile(fileName string) (response Response, err error)

UploadImageFile uploads an image (.png, .jpg) to vgy.me

func (Response) Print

func (r Response) Print() string

Print returns string formated Response

Jump to

Keyboard shortcuts

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