gofileioupload

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 10 Imported by: 0

README

gofileioupload

A simple package to upload files to gofile.io (Work in Porgress)

Documentation

Overview

Package gofileioupload contains tools to upload files to gofile.io.

Package gofileioupload contains tools to upload files to gofile.io.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client contains details to remember Client / folder ID.

func NewClient

func NewClient() *Client

NewClient creates a new instance of Client. client gets the account token and folderID from the first file uploaded to gofile.

func (*Client) AddFolderID

func (c *Client) AddFolderID(id string) *Client

AddFolderID takes a FolderID and adds it to the client. all the files uploaded using client would be uploaded to this folder.

func (*Client) AddToken

func (c *Client) AddToken(token string) *Client

AddToken takes an account token / guest token and add it to the Client.

func (*Client) BestServer added in v0.1.1

func (c *Client) BestServer() (string, error)

BestServer returns the best server on gofile to upload file to.

func (*Client) SetRegion added in v0.1.1

func (c *Client) SetRegion(region Region) *Client

func (*Client) UploadFile

func (c *Client) UploadFile(filePath, server string) (*FileData, error)

UploadFile takes path a file and a server to upload the file to, then it uploads the file to that perticular server of gofile.io.

type FileData

type FileData struct {
	DownloadPage string `json:"downloadPage"`
	Code         string `json:"code"`
	ParentFolder string `json:"parentFolder"`
	GuestToken   string `json:"guestToken"`
	FileID       string `json:"fileId"`
	FileName     string `json:"fileName"`
	Md5          string `json:"md5"`
}

type Region added in v0.1.1

type Region int
const (
	Europe Region
	NorthAmerica
)

Jump to

Keyboard shortcuts

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