buf

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2018 License: Unlicense, Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buf

type Buf interface {
	Data(...interface{}) interface{}
	Copy(interface{}) Buf
	Free() Buf
	Null() Buf
}

Buf provides the basic services of storing, outputting, freeing and wiping buffers

type Byte

type Byte struct {
	Buf    byte
	Status string
	Coding string
}

Byte is a simple buffer that just stores one byte

func NewByte

func NewByte() *Byte

NewByte makes a new Byte

func (*Byte) Copy

func (r *Byte) Copy(b interface{}) Buf

Copy accepts a parameter and copies the (first) byte in it into its buffer

func (*Byte) Data

func (r *Byte) Data(out ...interface{}) interface{}

Data returns the content of the buffer

func (*Byte) Elem

func (r *Byte) Elem(e int) interface{}

Elem returns a byte of 1 or 0 representing a bit

func (*Byte) Error

func (r *Byte) Error() string

Error is

func (*Byte) Free

func (r *Byte) Free() Buf

Free doesn't really do anything but other buffers will need it

func (*Byte) Freeze

func (r *Byte) Freeze() (S string)

Freeze writes the current data structure into a string that format as content of a JSON struct node

func (*Byte) GetCoding

func (r *Byte) GetCoding() string

GetCoding is

func (*Byte) Len

func (r *Byte) Len() int

Len is 1, though we can also read the bits

func (*Byte) ListCodings

func (r *Byte) ListCodings() []string

ListCodings is

func (*Byte) Null

func (r *Byte) Null() Buf

Null is

func (*Byte) SetCoding

func (r *Byte) SetCoding(s string) coding.Coding

SetCoding is

func (*Byte) SetElem

func (r *Byte) SetElem(e int, val interface{}) arr.Array

SetElem is

func (*Byte) SetStatus

func (r *Byte) SetStatus(s string) status.Status

SetStatus sets the error state

func (*Byte) SetStatusIf

func (r *Byte) SetStatusIf(err error) status.Status

SetStatusIf sets an error from a standard error interface variable if it is set

func (*Byte) String

func (r *Byte) String() (S string)

String is

func (*Byte) Thaw

func (r *Byte) Thaw(s string) interface{}

Thaw is

func (*Byte) UnsetStatus

func (r *Byte) UnsetStatus() status.Status

UnsetStatus emptys the error state

type Bytes

type Bytes struct {
	Buf    *[]byte
	Status string
	Coding string
}

Bytes is a simple buffer for slices of bytes and can ingest almost any other kind of data if one were so inclined.

func NewBytes

func NewBytes() *Bytes

NewBytes makes a new Bytes

func (*Bytes) Copy

func (r *Bytes) Copy(b interface{}) Buf

Copy accepts a parameter and copies the (first) byte in it into its buffer

func (*Bytes) Data

func (r *Bytes) Data(out ...interface{}) (R interface{})

Data returns the buffer as *[]byte and also loads a pointer passed, copying for integers and referencing for buffers

func (*Bytes) Elem

func (r *Bytes) Elem(e int) interface{}

Elem returns a byte of 1 or 0 representing a bit

func (*Bytes) Error

func (r *Bytes) Error() string

Error is

func (*Bytes) Free

func (r *Bytes) Free() Buf

Free doesn't really do anything but other buffers will need it

func (*Bytes) Freeze

func (r *Bytes) Freeze() (S string)

Freeze writes the current data structure into a string that format as content of a JSON struct node

func (*Bytes) GetCoding

func (r *Bytes) GetCoding() string

GetCoding is

func (*Bytes) Len

func (r *Bytes) Len() int

Len is 1, though we can also read the bits

func (*Bytes) ListCodings

func (r *Bytes) ListCodings() []string

ListCodings is

func (*Bytes) Null

func (r *Bytes) Null() Buf

Null is

func (*Bytes) SetCoding

func (r *Bytes) SetCoding(s string) coding.Coding

SetCoding is

func (*Bytes) SetElem

func (r *Bytes) SetElem(e int, val interface{}) arr.Array

SetElem is

func (*Bytes) SetStatus

func (r *Bytes) SetStatus(s string) status.Status

SetStatus sets the error state

func (*Bytes) SetStatusIf

func (r *Bytes) SetStatusIf(err error) status.Status

SetStatusIf sets an error from a standard error interface variable if it is set

func (*Bytes) String

func (r *Bytes) String() (S string)

String is

func (*Bytes) Thaw

func (r *Bytes) Thaw(s string) interface{}

Thaw is

func (*Bytes) UnsetStatus

func (r *Bytes) UnsetStatus() status.Status

UnsetStatus emptys the error state

type Secure

type Secure struct {
	Buf    *[]byte
	Status string
	Coding string
	// contains filtered or unexported fields
}

Secure is a simple buffer for slices of bytes and can ingest almost any other kind of data if one were so inclined.

func NewSecure

func NewSecure() *Secure

NewSecure makes a new Secure

func (*Secure) Copy

func (r *Secure) Copy(b interface{}) Buf

Copy accepts a parameter and copies the (first) byte in it into its buffer

func (*Secure) Data

func (r *Secure) Data(out ...interface{}) interface{}

Data returns the content of the buffer

func (*Secure) Elem

func (r *Secure) Elem(e int) interface{}

Elem returns a byte of 1 or 0 representing a bit

func (*Secure) Error

func (r *Secure) Error() string

Error is

func (*Secure) Free

func (r *Secure) Free() Buf

Free destroys the buffer, wiping it as well

func (*Secure) Freeze

func (r *Secure) Freeze() (S string)

Freeze writes the current data structure into a string that format as content of a JSON struct node

func (*Secure) GetCoding

func (r *Secure) GetCoding() string

GetCoding is

func (*Secure) Len

func (r *Secure) Len() int

Len is 1, though we can also read the bits

func (*Secure) ListCodings

func (r *Secure) ListCodings() []string

ListCodings is

func (*Secure) MarshalJSON

func (r *Secure) MarshalJSON() ([]byte, error)

MarshalJSON renders the data as JSON

func (*Secure) Null

func (r *Secure) Null() Buf

Null sets all the bytes in the buffer to zero

func (*Secure) SetCoding

func (r *Secure) SetCoding(s string) coding.Coding

SetCoding is

func (*Secure) SetElem

func (r *Secure) SetElem(e int, val interface{}) arr.Array

SetElem is

func (*Secure) SetStatus

func (r *Secure) SetStatus(s string) status.Status

SetStatus sets the error state

func (*Secure) SetStatusIf

func (r *Secure) SetStatusIf(err error) status.Status

SetStatusIf sets an error from a standard error interface variable if it is set

func (*Secure) String

func (r *Secure) String() (S string)

String is

func (*Secure) Thaw

func (r *Secure) Thaw(s string) interface{}

Thaw takes a frozen Secure buffer and returns the structure it represents

func (*Secure) UnsetStatus

func (r *Secure) UnsetStatus() status.Status

UnsetStatus emptys the error state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL