Easy-to-use api for uploadgram written in Go

uploadgramApiGo

Easy to use uploadgram.me api

Go Reference

Already done:

  • Upload Files

  • Download Files + Files info

  • Delete files

  • Rename files

How install it?

$ go get github.com/noarainstorm/uploadgramApiGo

How use it?

Init the module

package main
import (
    "fmt"
    uploadgram "github.com/noarainstorm/uploadgramApiGo"
)

func main() {
    api := uploadgram.New("", "")
...

Upload file

...
    err := api.Upload("file name")
    if err != nil {
        panic(err)
    }
    link, token := api.Response.Url, api.Response.Token
...

Download file

...
    file, err := api.Download("url here")
    if err != nil {
        panic(err)
    }
   // you can save "file" to file with os
...

Delete file

...
    err := api.Delete(token)
    if err != nil {
        panic(err)
    }
...

Rename file

...
    err := api.Rename(token, newName)
    if err != nil {
        panic(err)
...

Simple example

package main
import (
	ug "github.com/noarainstorm/uploadgramApiGo"
	"fmt"
	"os"
)

func main() {
	api := ug.New("","")
	err := api.Upload("Downloads/hello.txt")
	if err != nil {
		panic(err)
	}
	fmt.Printf("File uploaded! %s :: link, %s token\n", api.Response.Url, api.Response.Token)
	fileData, err := api.Download(api.Response.Url)
	if err != nil {
		panic(err)
	}
	file, err := os.Create(api.DownloadInfo.Filename)
	if err != nil {
		panic(err)
	}
	file.Write(fileData)
	fmt.Println("File downloaded!")
	err = api.Rename(api.Response.Token, "WOW")
	if err != nil {
		panic(err)
	}
	fmt.Println("File renamed!")
	err = api.Delete(api.Response.Token)
	if err != nil {
		panic(err)
	}
	fmt.Println("File deleted from servers!")
}
Similar Resources

Rewritten glusterfs csi driver to use with heketi API

Rewritten glusterfs csi driver to use with heketi API

Glusterfs-Heketi CSI driver The CSI (Container Storage Interface) is a universal way to provide storage for the applications. This version of the plug

Dec 8, 2022

Our library to use the sendcloud API endpoints in golang.

gosendcloud With this library it should be possible to interact with the endpoints of the sendcloud API via golang functions. Since we can not impleme

Dec 3, 2021

Elastos.ELA.Rosetta.API - How to write a Rosetta server and use either the Client package or Fetcher package to communicate

Examples This folder demonstrates how to write a Rosetta server and how to use e

Jan 17, 2022

Clusterpedia-client - clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Jan 7, 2022

Client-go - Clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Dec 5, 2022

Getting presigned urls for S3 with AWS SDK Go V2. Easy deploy with Velcel CLI.

S3-Presigned-Urls-Vercel-Serverless Setup yarn install && yarn setup Run(Local) yarn start You need to set environment variables with os.setenv for lo

Jan 14, 2022

Easy creation of review tasks for the Jira with a Discord notifications.

easy-jira-task-review Easy creation of review tasks for the Jira with a Discord notifications. Any ideas and help are welcome Installation Install go

Dec 1, 2022

Support for Usagi API developed by @DanielaGC. The library is written in Go Lang

📦 Usagi API - Wrapper This library is simple and easy to use and was developed entirely for Usagi API written in Go Lang. 👨‍🏫 Example package main

Oct 18, 2021

A small, fast, reliable pastemyst API wrapper written in Golang

A small, fast, reliable pastemyst API wrapper written in Golang. Official pastemyst API docs found here.

Dec 12, 2022
Easy to use API for Twitch emotes including 7TV, BetterTTV and FFZ

tEmotes API Easy to use API for Twitch emotes We support: Twitch 7TV BetterTTV F

Dec 23, 2022
Go api infra - Infrastructure for making api on golang so easy

Go Infra Api Infrastructre methods and types for make api simple Response abstra

Jun 18, 2022
An easy-to-use unofficial SDK for Feishu and Lark Open Platform

go-lark go-lark is an easy-to-use unofficial SDK for Feishu and Lark Open Platform. go-lark implements messaging APIs, with full-fledged supports on b

Jan 2, 2023
Mailctl - A non-TUI, easy-to-use, fun, modern console-based email app

mailctl (in alpha) modern console-based email app (not TUI!) Thanks for checking

Oct 5, 2022
go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

Dec 15, 2022
A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021
Lol-champions-api - A REST API app for CRUD' ing informations related to League of Legends champions, written with Go

LOL-CHAMPIONS-API Just a REST API app for CRUD' ing informations related to Leag

Mar 17, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Go library to use the imgur.com API

go-imgur Go library to use the imgur.com API. At the moment only the anonymous part of the API is supported, but that is used in a production environm

Sep 27, 2022
Use Google REST api to extract your personal Photo Library

Photo Go A better approach to extracting your photos from Google to your personal cloud. I'm moving my photos out of Google to a Synology NAS. create

Dec 7, 2021