Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parcel ¶
type Parcel interface {
Bytes() []byte
Reader() io.Reader
Runes() []rune
String() string
WriteTo(w io.Writer) (int64, error)
Then(func(Parcel) Parcel) Parcel
}
func ParcelFromBytes ¶
ParcelFromBytes returns a new Parcel whose contents is the value of the []byte. Note that the contents the input []byte 'b' is copied, and the new Parcel is not attached to the original backing memory.
Example
parcel := parcels.ParcelFromBytes( []byte{72, 69, 76, 76, 79} )
asBytes := parcel.Bytes()
asReader := parcel.Reader()
asRunes := parcel.Runes()
asString := parcel.String()
n, err := parcel.WriteTo(writer)
func ParcelFromRune ¶
ParcelFromRune returns a new Parcel whose contents is the value of the rune.
Example
parcel := parcels.ParcelFromRune('۵')
asBytes := parcel.Bytes()
asReader := parcel.Reader()
asRunes := parcel.Runes()
asString := parcel.String()
n, err := parcel.WriteTo(writer)
func ParcelFromString ¶
ParcelFromString returns a new Parcel whose contents is the value of the string.
Example
parcel := parcels.ParcelFromString("This is some text.")
asBytes := parcel.Bytes()
asReader := parcel.Reader()
asRunes := parcel.Runes()
asString := parcel.String()
n, err := parcel.WriteTo(writer)
Click to show internal directories.
Click to hide internal directories.