Files
zurg/pkg/dav/response.go
2023-10-17 10:50:10 +02:00

30 lines
579 B
Go

package dav
func Directory(path string) Response {
return Response{
Href: customPathEscape(path),
Propstat: PropStat{
Prop: Prop{
ResourceType: ResourceType{Collection: &struct{}{}},
},
Status: "HTTP/1.1 200 OK",
},
}
}
func File(path string, fileSize int, added string, link string) Response {
return Response{
Href: customPathEscape(path),
Propstat: PropStat{
Prop: Prop{
ContentLength: fileSize,
IsHidden: 0,
CreationDate: added,
LastModified: added,
Link: link,
},
Status: "HTTP/1.1 200 OK",
},
}
}