Documentation
¶
Index ¶
- Variables
- func ExtractHeaderAndPayload(data []byte) (*object.Object, []byte, error)
- func GetAttribute(hdr object.Object, attr string) string
- func GetIndexAttribute(hdr object.Object, attr string) (int, error)
- func GetIntAttribute(hdr object.Object, attr string) (int, error)
- func ReadHeaderPrefix(r io.Reader) (*object.Object, []byte, error)
- func SetAttribute(dst *object.Object, attr, val string)
- func SetIntAttribute(dst *object.Object, attr string, val int)
- func WriteWithoutPayload(w io.Writer, obj object.Object) error
Constants ¶
This section is empty.
Variables ¶
var ErrAttributeNotFound = errors.New("attribute not found")
ErrAttributeNotFound is returned when some object attribute not found.
Functions ¶
func ExtractHeaderAndPayload ¶
ExtractHeaderAndPayload extracts the header of an object from the given byte slice and also returns payload prefix.
func GetAttribute ¶
GetAttribute looks up for specified attribute in the given object header. Returns empty string if the attribute is missing.
GetIntAttribute ignores all attribute values except the first.
func GetIndexAttribute ¶
GetIndexAttribute looks up for specified index attribute in the given object header. Returns -1 if the attribute is missing.
GetIndexAttribute ignores all attribute values except the first.
Note that if attribute exists but negative, GetIndexAttribute returns error.
func GetIntAttribute ¶
GetIntAttribute looks up for specified int attribute in the given object header. Returns ErrAttributeNotFound if the attribute is missing.
GetIntAttribute ignores all attribute values except the first.
func ReadHeaderPrefix ¶
ReadHeaderPrefix reads up to object.MaxHeaderLen bytes and extracts header and the payload prefix.
func SetAttribute ¶
SetAttribute sets value for the object attribute. If the attribute already exists, SetAttribute overwrites its value.
func SetIntAttribute ¶
SetIntAttribute sets int value for the object attribute. If the attribute already exists, SetIntAttribute overwrites its value.
Types ¶
This section is empty.