net

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAcceptRanges               = "Accept-Ranges"
	HeaderAccessControlAllowHeaders  = "Access-Control-Allow-Headers"
	HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers"
	HeaderContentDisposistion        = "Content-Disposition"
	HeaderContentLength              = "Content-Length"
	HeaderContentRange               = "Content-Range"
	HeaderContentType                = "Content-Type"
	HeaderETag                       = "ETag"
	HeaderLastModified               = "Last-Modified"
	HeaderLocation                   = "Location"
	HeaderRange                      = "Range"
	HeaderIfMatch                    = "If-Match"
)

Common HTTP headers.

webdav headers

View Source
const (
	HeaderOCFileID             = "OC-FileId"
	HeaderOCETag               = "OC-ETag"
	HeaderOCChecksum           = "OC-Checksum"
	HeaderOCPermissions        = "OC-Perm"
	HeaderTusResumable         = "Tus-Resumable"
	HeaderTusVersion           = "Tus-Version"
	HeaderTusExtension         = "Tus-Extension"
	HeaderTusChecksumAlgorithm = "Tus-Checksum-Algorithm"
	HeaderTusUploadExpires     = "Upload-Expires"
	HeaderUploadChecksum       = "Upload-Checksum"
	HeaderUploadLength         = "Upload-Length"
	HeaderUploadMetadata       = "Upload-Metadata"
	HeaderUploadOffset         = "Upload-Offset"
	HeaderOCMtime              = "X-OC-Mtime"
	HeaderExpectedEntityLength = "X-Expected-Entity-Length"
	HeaderLitmus               = "X-Litmus"
)

Non standard HTTP headers.

View Source
const (
	// CtxKeyBaseURI is the key of the base URI context field
	CtxKeyBaseURI ctxKey = iota

	// NsDav is the Dav ns
	NsDav = "DAV:"
	// NsOwncloud is the owncloud ns
	NsOwncloud = "http://owncloud.org/ns"
	// NsOCS is the OCS ns
	NsOCS = "http://open-collaboration-services.org/ns"

	// RFC1123 time that mimics oc10. time.RFC1123 would end in "UTC", see https://github.com/golang/go/issues/13781
	RFC1123 = "Mon, 02 Jan 2006 15:04:05 GMT"

	// PropQuotaUnknown is the quota unknown property
	PropQuotaUnknown = "-2"
	// PropOcFavorite is the favorite ns property
	PropOcFavorite = "http://owncloud.org/ns/favorite"

	// DepthZero represents the webdav zero depth value
	DepthZero Depth = "0"
	// DepthOne represents the webdav one depth value
	DepthOne Depth = "1"
	// DepthInfinity represents the webdav infinity depth value
	DepthInfinity Depth = "infinity"
)

Variables

This section is empty.

Functions

func EncodePath

func EncodePath(path string) string

EncodePath encodes the path of a url.

slashes (/) are treated as path-separators. ported from https://github.com/sabre-io/http/blob/bb27d1a8c92217b34e778ee09dcf79d9a2936e84/lib/functions.php#L369-L379

func IsCurrentUserOwner

func IsCurrentUserOwner(ctx context.Context, owner *userv1beta1.UserId) bool

IsCurrentUserOwner returns whether the context user is the given owner or not

Types

type Depth

type Depth string

Depth is a type representing the webdav depth header value

func ParseDepth

func ParseDepth(s string) (Depth, error)

ParseDepth parses the depth header value defined in https://tools.ietf.org/html/rfc4918#section-9.1 Valid values are "0", "1" and "infinity". An empty string will be parsed to "1". For all other values this method returns an error.

func (Depth) String

func (d Depth) String() string

String returns the string representation of the webdav depth value

Jump to

Keyboard shortcuts

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