package
1.5.0
Repository: https://github.com/cognusion/go-jar.git
Documentation: pkg.go.dev

# README

tus

import "github.com/cognusion/go-jar/tus"

Overview

Index

Package files

config.go tus.go

Constants

const (
    // ErrBadTargetPrefix is returned by HandleFinisher if the requested TUS targetURL prefix does not exist
    ErrBadTargetPrefix = Error("requested targetURI prefix is not valid")
)

Variables

var (
    // DebugOut is a log.Logger for debug messages
    DebugOut = log.New(io.Discard, "[DEBUG] ", 0)
    // ErrorOut is a log.Logger for error messages
    ErrorOut = log.New(io.Discard, "[ERROR] ", 0)
)

type Config

type Config struct {
    // TargetURI is a `file://` or `s3://` URI to designate where the upload should go
    TargetURI string
    // AppendFilename renames (COPY,DELETE) the file after upload to append `-filename.ext`. This can result in
    // increased costs for paid storage services
    AppendFilename bool
    // S3Client is an s3.S3 to be used if TargetURI is an `s3://`
    S3Client *s3.S3
}

Config encapsulates various options passable to New

type Error

type Error string

Error is an error type

func (Error) Error

func (e Error) Error() string

Error returns the stringified version of Error

type TUS

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

TUS is a Finisher implementing the tus.io Open Protocol for Resumable Uploads

func New

func New(basePath string, config Config) (*TUS, error)

New returns an initialized TUS. WARNING: Do not set Config.S3Client unless you're using S3 as the target.

func (*TUS) ServeHTTP

func (t *TUS) ServeHTTP(w http.ResponseWriter, r *http.Request)

Generated by godoc2md

# Functions

New returns an initialized TUS.

# Constants

ErrBadTargetPrefix is returned by HandleFinisher if the requested TUS targetURL prefix does not exist.

# Variables

DebugOut is a log.Logger for debug messages.
ErrorOut is a log.Logger for error messages.

# Structs

Config encapsulates various options passable to New.
TUS is a Finisher implementing the tus.io Open Protocol for Resumable Uploads.

# Type aliases

Error is an error type.