design

package
v0.0.0-...-5a969d9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTUSResumable = Type("ErrInvalidTUSResumable", func() {
	Description("ErrInvalidTUSResumable describes the error returned when a non-supported Tus-Resumable header is provided by the client.")
	Attribute("tusVersion", String, "Comma separated list of supported versions.", func() {
		Enum("1.0.0")
	})
	Required("tusVersion")
})
View Source
var TUSCoreHeaders = Type("TUSCoreHeaders", func() {
	Description("TUSCoreHeaders defines the tus core protocol headers used in both requests and responses.")
	Attribute("uploadOffset", Int64, "uploadOffset represents a byte offset within a resource.")
	Attribute("uploadLength", Int64, "uploadLength represents the size of the entire upload in bytes.")
	Attribute("tusResumable", String, "tusResumable represents a tus protocol version.", func() {
		Pattern(`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$`)
		Example("1.0.0")
	})
	Required("tusResumable")
})
View Source
var TUSCoreRequestHeaders = Type("TUSCoreRequestHeaders", func() {
	Description("TUSCoreRequestHeaders defines the tus core protocol request headers.")
	Extend(TUSCoreHeaders)
})
View Source
var TUSCoreResponseHeaders = Type("TUSCoreResponseHeaders", func() {
	Description("TUSCoreResponseHeaders defines the tus core protocol response headers.")
	Extend(TUSCoreHeaders)
	Attribute("tusVersion", String, "tusVersion is a comma separated list of protocol versions supported by the server. This implementation only supports 1.0.0.", func() {
		Enum("1.0.0")
	})
	Attribute("tusExtension", String, "tusExtension is a comma separated list of extensions supported by the server. This implementation supports the creation, creation-with-upload, expiration, checksum and termination extensions", func() {
		Enum("creation,creation-with-upload,creation-defer-length,expiration,checksum,termination")
	})
	Attribute("tusMaxSize", Int64, "tusMaxSize represents the maximum allowed size of an entire upload in bytes.")
})
View Source
var TUSExtensionHeaders = Type("TUSExtensionHeaders", func() {
	Description("TUSExtensionHeaders defines the suppoterd tus protocol extension headers used in both requests and responses.")
	Attribute("uploadDeferLength", Int, "The Upload-Defer-Length request and response header indicates that the size of the upload is not known currently and will be transferred later.", func() {
		Enum(1)
	})
	Attribute("uploadMetadata", String, "The Client MAY supply the Upload-Metadata header to add additional metadata to the upload creation request.", func() {
		Example("key1 val1,key2 val2")
	})
	Attribute("uploadExpires", String, "The Upload-Expires response header indicates the time after which the unfinished upload expires.", func() {
		Example("Wed, 25 Jun 2014 16:00:00 GMT")
	})
	Attribute("uploadChecksum", String, "A Client MAY include the Upload-Checksum header in a PATCH request. Once the entire request has been received, the Server MUST verify the uploaded chunk against the provided checksum using the specified algorithm.", func() {
		Example("sha1 Kq5sNclPz7QV2+lfQIuc6R7oRu0=")
	})
	Attribute("tusChecksumAlgorithm", String, "A Client MAY include the Upload-Checksum header in a PATCH request. Once the entire request has been received, the Server MUST verify the uploaded chunk against the provided checksum using the specified algorithm.", func() {
		Enum("md5,sha1,crc32")
	})
})

Functions

func ErrorResponse

func ErrorResponse(name string, code int, fn ...func())

ErrorResponse defines a response with an empty body.

func ID

func ID()

ID is the attribute used to represent upload identifiers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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