Gofilego is a simple Golang wrapper around Gofile.io's API. It provides a basic library for uploading files inside your code and an executable to quickly upload files to Gofile.
To install the executable run:
go get -u github.com/0xSteeW/gofilego go install github.com/0xSteeW/gofilego/gofilego-uploadTo run it:
gofilego-upload -f test.fileMake sure you've set your GOPATH properly.
To get a basic help menu:
gofilego-upload -hTo just install the library:
go get -u github.com/0xSteeW/gofilegoThen, import it in your code as follows:
import "github.com/0xSteeW/gofilego"Here is a basic example for uploading a file with email and password:
package main import ( "fmt" "github.com/0xSteeW/gofilego" "os" ) func main() { conn, err := gofilego.NewConnection() if err != nil { fmt.Println(err.Error()) return } uploadStruct := &gofilego.Connection{Email: "example@email.com", Password: "rockyou"} conn.Construct(uploadStruct) // Open a file for uploading reader, _ := os.Open("test.file") conn.AddFile("testfilename", reader) response, err := conn.Upload() if err != nil { fmt.Println(err.Error()) return } fmt.Println(response.Data["code"]) }*Connection* - Struct Serverstring FilesUploaded map[string]io.Reader Emailstring Descriptionstring Passwordstring Expiretime.Time Tags[]string *UploadResponse* - Struct Statusstring Data map[string]interface{} func (conn *Connection): GetNewServer() error NewConnection() (*Connection, error) Construct(providedStruct *Connection) Upload() (*UploadResponse, error) AddFile(fileName string, reader io.Reader) AddEmail(email string) AddDescription(desc string) AddPassword(pass string) AddExpire(tstamp time.Time) AddTags(tags ...string)