Documentation ¶
Index ¶
- Constants
- type Connection
- func (conn *Connection) AddFile(name string, file io.Reader)
- func (conn *Connection) Construct(providedStruct *Connection)
- func (conn *Connection) GetNewServer() error
- func (conn *Connection) SetDescription(desc string)
- func (conn *Connection) SetEmail(email string)
- func (conn *Connection) SetExpire(timeStamp time.Time)
- func (conn *Connection) SetPassword(pass string)
- func (conn *Connection) SetTags(tags ...string)
- func (conn *Connection) Upload() (*UploadResponse, error)
- type UploadResponse
Constants ¶
const VERSION = "v0.2"
VERSION represents the version of the library
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { // Upload server name Server string // Map of files, represented by [filename]io.Reader FilesUploaded map[string]io.Reader // Upload email Email string // Upload description Description string // Upload Password Password string // Upload tags provided as string array Tags []string // Expiration date timestamp Expire int64 }
Connection represents a basic Gofile upload struct
func NewConnection ¶
func NewConnection() (*Connection, error)
NewConnection creates a new default connection. Returns a basic connection struct.
func (*Connection) AddFile ¶
func (conn *Connection) AddFile(name string, file io.Reader)
AddFile adds a file to the current connection struct
func (*Connection) Construct ¶
func (conn *Connection) Construct(providedStruct *Connection)
Construct acts as a constructor. Requires a Connection struct.
func (*Connection) GetNewServer ¶
func (conn *Connection) GetNewServer() error
GetNewServer refreshes best server via contacting gofile api
func (*Connection) SetDescription ¶
func (conn *Connection) SetDescription(desc string)
SetDescription sets upload description
func (*Connection) SetEmail ¶
func (conn *Connection) SetEmail(email string)
SetEmail sets upload email
func (*Connection) SetExpire ¶
func (conn *Connection) SetExpire(timeStamp time.Time)
SetExpire sets expiration timestamp as a time.Time object
func (*Connection) SetPassword ¶
func (conn *Connection) SetPassword(pass string)
SetPassword sets upload password
func (*Connection) SetTags ¶
func (conn *Connection) SetTags(tags ...string)
SetTags receives tags as variadic arguments.
func (*Connection) Upload ¶
func (conn *Connection) Upload() (*UploadResponse, error)
Upload files to gofile, using the Connection struct parameters
type UploadResponse ¶
UploadResponse is a struct representing the json response of the Gofile server