Documentation
¶
Index ¶
- func CalcSize(format string) (int, error)
- func CalcSize_old(format string) (int, error)
- func IterUnpack(format string, buffer []byte) (<-chan interface{}, <-chan error)
- func IterUnpack_old(format string, buffer []byte) (<-chan interface{}, <-chan error)
- func Pack(format string, intf ...interface{}) ([]byte, error)
- func PackInto(format string, buffer []byte, offset int, intf ...interface{}) ([]byte, error)
- func PackInto_old(format string, buffer []byte, offset int, intf ...interface{}) ([]byte, error)
- func Pack_old(format string, intf ...interface{}) ([]byte, error)
- func Unpack(format string, buffer []byte) ([]interface{}, error)
- func UnpackFrom(format string, buffer []byte, offset int) ([]interface{}, error)
- func UnpackFrom_old(format string, buffer []byte, offset int) ([]interface{}, error)
- func Unpack_old(format string, buffer []byte) ([]interface{}, error)
- type PyStruct
- func (s *PyStruct) Format() string
- func (s *PyStruct) IterUnpack(buffer []byte) (<-chan interface{}, <-chan error)
- func (s *PyStruct) Pack(intf ...interface{}) ([]byte, error)
- func (s *PyStruct) PackInto(buffer []byte, offset int, intf ...interface{}) ([]byte, error)
- func (s *PyStruct) Size() int
- func (s *PyStruct) Unpack(buffer []byte) ([]interface{}, error)
- func (s *PyStruct) UnpackFrom(buffer []byte, offset int) ([]interface{}, error)
- type Struct_old
- func (s *Struct_old) CalcSize() (int, error)
- func (s *Struct_old) IterUnpack(format string, buffer []byte) (<-chan interface{}, <-chan error)
- func (s *Struct_old) Pack(intf ...interface{}) ([]byte, error)
- func (s *Struct_old) PackInto(buffer []byte, offset int, intf ...interface{}) ([]byte, error)
- func (s *Struct_old) Unpack(buffer []byte) ([]interface{}, error)
- func (s *Struct_old) UnpackFrom(buffer []byte, offset int) ([]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcSize ¶
Return the size of the struct (and hence of the bytes object produced by pack(format, ...)) corresponding to the format string format
func CalcSize_old ¶ added in v0.0.4
Return the size of the struct (and hence of the bytes object produced by pack(format, ...)) corresponding to the format string format
func IterUnpack ¶
Iteratively unpack from the buffer buffer according to the format string format. This function returns an iterator which will read equally sized chunks from the buffer until all its contents have been consumed. The buffer’s size in bytes must be a multiple of the size required by the format, as reflected by CalcSize()
func IterUnpack_old ¶ added in v0.0.4
Iteratively unpack from the buffer buffer according to the format string format. This function returns an iterator which will read equally sized chunks from the buffer until all its contents have been consumed. The buffer’s size in bytes must be a multiple of the size required by the format, as reflected by CalcSize()
func Pack ¶
Return a bytes object containing the values v1, v2, … packed according to the format string format. The arguments must match the values required by the format exactly.
func PackInto ¶ added in v0.0.2
Pack the values v1, v2, … according to the format string format and write the packed bytes into the writable buffer starting at position offset. Note that offset is a required argument.
func PackInto_old ¶ added in v0.0.4
Pack the values v1, v2, … according to the format string format and write the packed bytes into the writable buffer starting at position offset. Note that offset is a required argument.
func Pack_old ¶ added in v0.0.4
Return a bytes object containing the values v1, v2, … packed according to the format string format. The arguments must match the values required by the format exactly.
func Unpack ¶
Unpack from the buffer buffer (presumably packed by Pack(format, ...)) according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes must match the size required by the format, as reflected by CalcSize().
func UnpackFrom ¶
Unpack from buffer starting at position offset, according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes, starting at position offset, must be at least the size required by the format, as reflected by CalcSize().
func UnpackFrom_old ¶ added in v0.0.4
Unpack from buffer starting at position offset, according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes, starting at position offset, must be at least the size required by the format, as reflected by CalcSize().
func Unpack_old ¶ added in v0.0.4
Unpack_old from the buffer buffer (presumably packed by Pack(format, ...)) according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes must match the size required by the format, as reflected by CalcSize().
Types ¶
type PyStruct ¶ added in v0.0.6
type PyStruct struct {
// contains filtered or unexported fields
}
NewStruct(fmt) --> compiled PyStruct object Don't create directly, use NewStruct(fmt) instead
func (*PyStruct) IterUnpack ¶ added in v0.0.6
Iteratively unpack from the buffer buffer according to the format string format. This function returns an iterator which will read equally sized chunks from the buffer until all its contents have been consumed. The buffer’s size in bytes must be a multiple of the size required by the format, as reflected by CalcSize()
func (*PyStruct) Pack ¶ added in v0.0.6
Return a bytes object containing the values v1, v2, … packed according to the format string format. The arguments must match the values required by the format exactly.
func (*PyStruct) PackInto ¶ added in v0.0.6
Pack the values v1, v2, … according to the format string format and write the packed bytes into the writable buffer starting at position offset. Note that offset is a required argument.
func (*PyStruct) Unpack ¶ added in v0.0.6
Unpack from the buffer buffer (presumably packed by Pack(format, ...)) according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes must match the size required by the format, as reflected by CalcSize().
func (*PyStruct) UnpackFrom ¶ added in v0.0.6
Unpack from buffer starting at position offset, according to the format string format. The result is an []interface{} even if it contains exactly one item. The buffer’s size in bytes, starting at position offset, must be at least the size required by the format, as reflected by CalcSize().
type Struct_old ¶ added in v0.0.4
type Struct_old struct {
// contains filtered or unexported fields
}
Struct_old(fmt) --> compiled struct object
func (*Struct_old) CalcSize ¶ added in v0.0.4
func (s *Struct_old) CalcSize() (int, error)
bind method CalcSize for Struct instance
func (*Struct_old) IterUnpack ¶ added in v0.0.4
func (s *Struct_old) IterUnpack(format string, buffer []byte) (<-chan interface{}, <-chan error)
bind method IterUnpack for Struct instance
func (*Struct_old) Pack ¶ added in v0.0.4
func (s *Struct_old) Pack(intf ...interface{}) ([]byte, error)
bind method Pack for Struct instance
func (*Struct_old) PackInto ¶ added in v0.0.4
func (s *Struct_old) PackInto(buffer []byte, offset int, intf ...interface{}) ([]byte, error)
bind method PackInto for Struct instance
func (*Struct_old) Unpack ¶ added in v0.0.4
func (s *Struct_old) Unpack(buffer []byte) ([]interface{}, error)
bind method Unpack for Struct instance
func (*Struct_old) UnpackFrom ¶ added in v0.0.4
func (s *Struct_old) UnpackFrom(buffer []byte, offset int) ([]interface{}, error)
bind method UnpackFrom for Struct instance