Versions in this module Expand all Collapse all v1 v1.1.2 Nov 24, 2025 Changes in this version + const NoChunked + const OffsetUnknown + const SizeUnknown + var ErrCannotUpload = TusError + var ErrChecksumMismatch = TusError + var ErrOffsetsNotSynced = TusError + var ErrProtocol = TusError + var ErrUnexpectedResponse = TusError + var ErrUnsupportedFeature = TusError + var ErrUploadDoesNotExist = TusError + var ErrUploadTooLarge = TusError + func DecodeMetadata(raw string) (map[string]string, error) + func EncodeMetadata(metadata map[string]string) (string, error) + func UploadSingleFileByConcat(baseUrl string, filePath string, mapping string, chunkSize int64, retries int, ...) error + func UploadSingleFileSequentially(baseUrl string, filePath string, mapping string) error + func UploadWithRetry(dst *UploadStream, src *os.File) error + type Client struct + BaseURL *url.URL + Capabilities *ServerCapabilities + GetRequest GetRequestFunc + ProtocolVersion string + func NewClient(client *http.Client, baseURL *url.URL) *Client + func (c *Client) ConcatenateStreams(final *Upload, streams []*UploadStream, meta map[string]string) (response *http.Response, err error) + func (c *Client) ConcatenateUploads(final *Upload, partials []Upload, meta map[string]string) (response *http.Response, err error) + func (c *Client) CreateUpload(u *Upload, remoteSize int64, partial bool, meta map[string]string) (response *http.Response, err error) + func (c *Client) CreateUploadWithData(u *Upload, data []byte, remoteSize int64, partial bool, meta map[string]string) (uploadedBytes int64, response *http.Response, err error) + func (c *Client) DeleteUpload(u Upload) (response *http.Response, err error) + func (c *Client) GetUpload(u *Upload, location string) (response *http.Response, err error) + func (c *Client) UpdateCapabilities() (response *http.Response, err error) + func (c *Client) WithContext(ctx context.Context) *Client + type GetRequestFunc func(method, url string, body io.Reader, tusClient *Client, httpClient *http.Client) (*http.Request, error) + type ServerCapabilities struct + ChecksumAlgorithms []string + Extensions []string + MaxSize int64 + ProtocolVersions []string + type TusError struct + func (te TusError) Error() string + func (te TusError) Is(e error) bool + func (te TusError) Unwrap() error + func (te TusError) WithErr(err error) TusError + func (te TusError) WithResponse(r *http.Response) TusError + func (te TusError) WithText(s string) TusError + type Upload struct + Location string + Metadata map[string]string + Partial bool + RemoteOffset int64 + RemoteSize int64 + UploadExpired *time.Time + func CreateUploadFromFile(file *os.File, cl *Client, partial bool) *Upload + func CreateUploadFromSize(size int64, cl *Client, partial bool) *Upload + type UploadStream struct + ChunkSize int64 + LastResponse *http.Response + SetUploadSize bool + Upload *Upload + func NewUploadStream(client *Client, upload *Upload) *UploadStream + func (us *UploadStream) Dirty() bool + func (us *UploadStream) ForceClean() + func (us *UploadStream) Len() int64 + func (us *UploadStream) ReadFrom(r io.Reader) (n int64, err error) + func (us *UploadStream) Seek(offset int64, whence int) (int64, error) + func (us *UploadStream) Sync() (response *http.Response, err error) + func (us *UploadStream) Tell() int64 + func (us *UploadStream) WithChecksumAlgorithm(name string) *UploadStream + func (us *UploadStream) WithContext(ctx context.Context) *UploadStream + func (us *UploadStream) Write(p []byte) (n int, err error)