Documentation ¶
Overview ¶
Package txt provides text validation types, null terminated strings and a human readable textual struct tag.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Is ¶
Is denotes a string that should always contain values of the specified type. The type's pointer reciever should implement encoding.TextUnmarshaler or 'Parse(string) (*T, error)'
type Pointer ¶
type Pointer struct {
// contains filtered or unexported fields
}
Pointer to a null-terminated string. May point to memory not managed by the Go runtime. May or may not be mutable.
func Import ¶
Import null-terminated text from the specified null-terminated memory address, if length is provided, no more than length bytes will be read from the address. The free function will be called when the [Ptr.Free] method is called. If [edit] is true, the string will be internally marked as mutable and will be copied when [Ptr.String] is called. If the size is not known, pass -1.
func New ¶
New returns a new pointer to a null-terminated string containing the first null-terminated string in s, if s is not already null-terminated, New will append the termination.
func (Pointer) Bytes ¶
Bytes returns the byte slice value of the pointer. If the pointer is not marked as mutable, a copy will be returned.
func (Pointer) Free ¶
func (ptr Pointer) Free()
Free any foreign memory associated with the pointer setting it to nil. Future usage of the [Ptr] may result in a panic.
func (Pointer) SetUnsafePointer ¶
SetUnsafePointer modifies the pointer to the specified address, only valid when the pointer was previously created with Import.
func (Pointer) String ¶
String returns the string value of the pointer. If the pointer is not marked as mutable, a copy will be returned.
func (Pointer) UnsafePointer ¶
UnsafePointer takes ownership of the pointer and returns a pointer to the underlying memory.
Directories ¶
Path | Synopsis |
---|---|
std
|
|
human
Package human provides standard way to reference people by name.
|
Package human provides standard way to reference people by name. |
markdown
Package markdown provide markdown types.
|
Package markdown provide markdown types. |
src/js
Package js provides a way to represent JavaScript strings.
|
Package js provides a way to represent JavaScript strings. |