putlib

package module
v0.0.0-...-76af178 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: GPL-3.0 Imports: 13 Imported by: 4

Documentation

Overview

putlib document

putlib project main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitKey

func InitKey() []byte

func ValidateURL

func ValidateURL(url string, status *Status) string

Types

type Info

type Info struct {
	Hash      string
	MediaType string
}

type PutConfig

type PutConfig struct {
	PathToWorkdir           bool
	JsonOutput              bool
	ForceGenerateThumbnails bool
	// contains filtered or unexported fields
}

func (*PutConfig) AddressOf

func (pc *PutConfig) AddressOf(input io.Reader) (string, error)

func (*PutConfig) AddressOfFile

func (pc *PutConfig) AddressOfFile(file string) (string, error)

func (*PutConfig) UploadFile

func (pc *PutConfig) UploadFile(url string, path string) StatusItem

func (*PutConfig) UploadMultipart

func (pc *PutConfig) UploadMultipart(url string, f io.Reader, path string) StatusItem

func (*PutConfig) Validate

func (pc *PutConfig) Validate(localhash string, uploadStatus StatusItem, status *Status)

type Status

type Status struct {
	LastItem      StatusItem
	UploadedItems []StatusItem
	ErrorMsg      string
}

func Upload

func Upload(url string, file string, config PutConfig) *Status

func UploadNoHash

func UploadNoHash(url string, file io.Reader, config PutConfig) *Status

Upload without calculating hash on the client

type StatusItem

type StatusItem struct {
	Hash      string
	MediaType string
	Filename  string
	ErrorMsg  string
}

Jump to

Keyboard shortcuts

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