anonfile

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 10 Imported by: 1

README

go-anonfile

go-anonfile is a toolkit to help upload files to anonfiles.

Installation

The simplest, cross-platform way is to download from GitHub Releases and place the executable file in your PATH.

Via Golang package get command

go get -u github.com/wabarc/go-anonfile/cmd/anonfile

From gobinaries.com:

$ curl -sf https://gobinaries.com/wabarc/go-anonfile | sh

Usage

Command-line:

$ anonfile
A CLI tool help upload files to anonfiles.

Usage:

  anonfile [options] [file1] ... [fileN]

Go package:

import (
        "fmt"

        "github.com/wabarc/go-anonfile"
)

func main() {
        if url, err := anonfile.NewAnonfile(nil).Upload(path); err != nil {
            fmt.Fprintf(os.Stderr, "anonfiles: %v\n", err)
        } else {
            fmt.Fprintf(os.Stdout, "%s  %s\n", url, path)
        }
}

License

This software is released under the terms of the MIT. See the LICENSE file for details.

Documentation

Index

Constants

View Source
const (
	ENDPOINT = "https://api.anonfiles.com/upload"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Anonfile

type Anonfile struct {
	Client *http.Client
}

func NewAnonfile

func NewAnonfile(client *http.Client) *Anonfile

func (*Anonfile) Info

func (anon *Anonfile) Info(path string) (string, error)

func (*Anonfile) Upload

func (anon *Anonfile) Upload(path string) (*Anonfiles, error)

type Anonfiles

type Anonfiles struct {
	Data   data
	Status bool
	Error  erro
}

func (*Anonfiles) Full

func (anon *Anonfiles) Full() string

func (*Anonfiles) Short

func (anon *Anonfiles) Short() string

Directories

Path Synopsis
cmd
anonfile command

Jump to

Keyboard shortcuts

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