Atomized the functionality of the base tomo package

This commit is contained in:
2023-02-02 01:47:01 -05:00
parent f71f789b60
commit 04d2ea4767
8 changed files with 486 additions and 6 deletions

20
data/data.go Normal file
View File

@@ -0,0 +1,20 @@
package data
import "io"
// Data represents arbitrary polymorphic data that can be used for data transfer
// between applications.
type Data map[Mime] io.ReadCloser
// Mime represents a MIME type.
type Mime struct {
// Type is the first half of the MIME type, and Subtype is the second
// half. The separating slash is not included in either. For example,
// text/html becomes:
// Mime { Type: "text", Subtype: "html" }
Type, Subtype string
}
var MimePlain = Mime { "text", "plain" }
var MimeFile = Mime { "text", "uri-list" }