webshare

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: GPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

webshare

A simple client library in go for webshare.cz.

Install

go get github.com/pulpe/webshare

Usage

package main

import "github.com/pulpe/webshare"

func main() {
    w := webshare.NewClient()

    err := w.Login("username", "password")
    if err != nil {
        log.Fatalln(err)
    }

    directLink, err := w.GetLink("https://webshare.cz/#/file/omzkNrc7Pp/debian-11-5-0-amd64-netinst-iso")
    if err != nil {
        log.Fatalln(err)
    }

    log.Println(directLink)

    w.Logout()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token string
}

func NewClient

func NewClient() *Client

func (*Client) GetInfo added in v0.1.3

func (c *Client) GetInfo(wurl string) (FileInfo, error)

func (*Client) GetInfoWithPassword added in v0.1.3

func (c *Client) GetInfoWithPassword(wurl, password string) (FileInfo, error)
func (c *Client) GetLink(wurl string) (string, error)

func (*Client) GetLinkWithPassword added in v0.1.3

func (c *Client) GetLinkWithPassword(wurl, password string) (string, error)

func (*Client) Login added in v0.1.3

func (c *Client) Login(username, password string) error

func (*Client) Logout added in v0.1.3

func (c *Client) Logout() error

type FileInfo added in v0.1.5

type FileInfo struct {
	Name        string
	Description string
	Type        string
	Size        int
}

type XMLResponse

type XMLResponse struct {
	XMLName     xml.Name `xml:"response"`
	Status      string   `xml:"status"`
	Message     string   `xml:"message"`
	Link        string   `xml:"link"`
	Name        string   `xml:"name"`
	Description string   `xml:"description"`
	Type        string   `xml:"type"`
	Size        int      `xml:"size"`
	Salt        string   `xml:"salt"`
	Token       string   `xml:"token"`
}

Jump to

Keyboard shortcuts

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