Change Text, Bytes to FromText, FromBytes

This commit is contained in:
Sasha Koshka 2024-07-19 15:26:03 -04:00
parent f6556aa57f
commit 87494c014a

View File

@ -74,9 +74,9 @@ func (mime Mime) String () string {
return out
}
// Text returns plain text Data given a string.
func Text (text string) Data {
return Bytes(MimePlain(), []byte(text))
// FromText returns plain text Data given a string.
func FromText (text string) Data {
return FromBytes(MimePlain(), []byte(text))
}
type byteReadCloser struct { *bytes.Reader }
@ -87,8 +87,8 @@ type bytesData struct {
buffer []byte
}
// Bytes constructs a Data given a buffer and a mime type.
func Bytes (mime Mime, buffer []byte) Data {
// FromBytes constructs a Data given a buffer and a mime type.
func FromBytes (mime Mime, buffer []byte) Data {
return bytesData {
mime: mime,
buffer: buffer,