Change Text, Bytes to FromText, FromBytes
This commit is contained in:
parent
f6556aa57f
commit
87494c014a
10
data/data.go
10
data/data.go
@ -74,9 +74,9 @@ func (mime Mime) String () string {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text returns plain text Data given a string.
|
// FromText returns plain text Data given a string.
|
||||||
func Text (text string) Data {
|
func FromText (text string) Data {
|
||||||
return Bytes(MimePlain(), []byte(text))
|
return FromBytes(MimePlain(), []byte(text))
|
||||||
}
|
}
|
||||||
|
|
||||||
type byteReadCloser struct { *bytes.Reader }
|
type byteReadCloser struct { *bytes.Reader }
|
||||||
@ -87,8 +87,8 @@ type bytesData struct {
|
|||||||
buffer []byte
|
buffer []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bytes constructs a Data given a buffer and a mime type.
|
// FromBytes constructs a Data given a buffer and a mime type.
|
||||||
func Bytes (mime Mime, buffer []byte) Data {
|
func FromBytes (mime Mime, buffer []byte) Data {
|
||||||
return bytesData {
|
return bytesData {
|
||||||
mime: mime,
|
mime: mime,
|
||||||
buffer: buffer,
|
buffer: buffer,
|
||||||
|
Loading…
Reference in New Issue
Block a user