Skip to content

mohan3d/gopenload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopenload

Golang client of the openload.co service.

Build Status Go Report Card GoDoc

Installation

$ go get github.com/mohan3d/gopenload

Usage

implemented API features.

Retrieve account info

package main

import (
	"fmt"

	"github.com/mohan3d/gopenload/openload"
)

func main() {
	// Create a client.
	client := openload.New("<LOGIN>", "<KEY>", nil)

	// Get account info.
	info, err := client.AccountInfo()

	if err != nil {
		panic(err)
	}
	fmt.Println(info.Email)
	fmt.Println(info.SignupAt)
}

Upload file

package main

import (
	"fmt"

	"github.com/mohan3d/gopenload/openload"
)

func main() {
	client := openload.New("<LOGIN>", "<KEY>", nil)
	uploaded, err := client.Upload("/path/dummyfile.txt", "", "", false)

	if err != nil {
		panic(err)
	}
	fmt.Println(uploaded.URL)
	fmt.Println(uploaded.ID)
	fmt.Println(uploaded.Size)
}

Retrieve file info

package main

import (
	"fmt"

	"github.com/mohan3d/gopenload/openload"
)

func main() {
	client := openload.New("<LOGIN>", "<KEY>", nil)
	info, err := client.FileInfo("uxbligkQAiN")

	if err != nil {
		panic(err)
	}
	fmt.Println(info.Name)
	fmt.Println(info.Size)
	fmt.Println(info.Status)
}

About

Golang client of the openload.co service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages