Documentation ¶
Index ¶
- Constants
- func DecodeSignedVarint(input io.Reader, limit int) *big.Int
- func DecodeUnsignedVarint(input io.Reader, limit int) *big.Int
- func EncodeSignedVarint(output io.Writer, x *big.Int)
- func Marshal(v interface{}) ([]byte, error)
- func RandomBigInt(min, max *big.Int) *big.Int
- func RandomDuration(min, max time.Duration) time.Duration
- func RandomIndex(v interface{}) int
- func RandomInt(min, max int) int
- func RandomInt64(min, max int64) int64
- func Unmarshal(b []byte, v interface{}) error
- type Backend
- type Buffer
- func DummyReadSeeker(r io.ReadSeeker) *Buffer
- func DummyReader(r io.Reader, size int64) *Buffer
- func DummyWriter(w io.Writer) *Buffer
- func FileController(path string, readOnly ...bool) (*Buffer, error)
- func FromBase64(s string) *Buffer
- func FromBytes(b []byte) *Buffer
- func FromReadSeeker(sk io.ReadSeeker) *Buffer
- func FromString(b string) *Buffer
- func NewBuffer() *Buffer
- func OfBytes(b []byte) *Buffer
- func (b *Buffer) Attach(f Backend)
- func (b *Buffer) Available() int
- func (b *Buffer) Base64() string
- func (b *Buffer) Bytes() []byte
- func (e *Buffer) Close() error
- func (bf *Buffer) DecodeSignedVarint(limit int) *big.Int
- func (bf *Buffer) DecodeUnsignedVarint(limit int) *big.Int
- func (e *Buffer) Delete() error
- func (b *Buffer) Digest(hs func() hash.Hash) []byte
- func (b *Buffer) EncodeSignedVarint(x *big.Int)
- func (b *Buffer) EncodeUnsignedVarint(c *big.Int)
- func (b *Buffer) Erase() error
- func (b *Buffer) Find(str []byte) (int64, error)
- func (b *Buffer) FlushBits()
- func (b *Buffer) FlushReadBits()
- func (b *Buffer) FlushWriteBits()
- func (b *Buffer) Jump(offset int64)
- func (b *Buffer) Len() int
- func (b *Buffer) Pos() int64
- func (b *Buffer) Read(buf []byte) (int, error)
- func (b *Buffer) ReadAt(p []byte, off int64) (int, error)
- func (b *Buffer) ReadBigInt() *big.Int
- func (b *Buffer) ReadBigInt16() int16
- func (b *Buffer) ReadBigInt32() int32
- func (b *Buffer) ReadBigInt64() int64
- func (b *Buffer) ReadBigUint16() uint16
- func (b *Buffer) ReadBigUint32() uint32
- func (b *Buffer) ReadBigUint64() uint64
- func (b *Buffer) ReadBool() bool
- func (b *Buffer) ReadBoxKey() *[32]byte
- func (b *Buffer) ReadBoxNonce() *[24]byte
- func (b *Buffer) ReadByte() uint8
- func (b *Buffer) ReadBytes(ln int) []byte
- func (b *Buffer) ReadCString() string
- func (b *Buffer) ReadDate() time.Time
- func (b *Buffer) ReadFixedString(i int) string
- func (b *Buffer) ReadFloat32() float32
- func (b *Buffer) ReadFloat64() float64
- func (b *Buffer) ReadInt() int64
- func (b *Buffer) ReadInt16() int16
- func (b *Buffer) ReadInt32() int32
- func (b *Buffer) ReadInt64() int64
- func (b *Buffer) ReadInt8() int8
- func (b *Buffer) ReadInvertedString(l int) string
- func (b *Buffer) ReadLSBit() bool
- func (b *Buffer) ReadLimitedBytes() []byte
- func (b *Buffer) ReadMSBit() bool
- func (b *Buffer) ReadRemainder() []byte
- func (b *Buffer) ReadRune() (rune, int, error)
- func (b *Buffer) ReadString(delimiter byte) (string, error)
- func (b *Buffer) ReadStringUntil(delimiter rune) string
- func (b *Buffer) ReadTime() time.Time
- func (b *Buffer) ReadTypedInt(fixed bool, bits int, signed, big bool, v interface{})
- func (b *Buffer) ReadUString() string
- func (e *Buffer) ReadUUID() UUID
- func (b *Buffer) ReadUint() uint64
- func (b *Buffer) ReadUint16() uint16
- func (b *Buffer) ReadUint32() uint32
- func (b *Buffer) ReadUint64() uint64
- func (b *Buffer) ReadUntilToken(s string) (string, error)
- func (b *Buffer) ReadWChar(ln int) string
- func (b *Buffer) Reverse(offset int64)
- func (b *Buffer) Runes() []rune
- func (b *Buffer) Seek(offset int64, whence int) (int64, error)
- func (e *Buffer) Size() int64
- func (b *Buffer) Start()
- func (b *Buffer) String() string
- func (b *Buffer) ToString() string
- func (b *Buffer) Write(buf []byte) (int, error)
- func (b *Buffer) WriteAt(p []byte, off int64) (int, error)
- func (b *Buffer) WriteBigInt(v *big.Int)
- func (b *Buffer) WriteBigInt16(v int16)
- func (b *Buffer) WriteBigInt32(v int32)
- func (b *Buffer) WriteBigInt64(v int64)
- func (b *Buffer) WriteBigUint16(v uint16)
- func (b *Buffer) WriteBigUint32(v uint32)
- func (b *Buffer) WriteBigUint64(v uint64)
- func (b *Buffer) WriteBool(v bool)
- func (b *Buffer) WriteByte(v uint8)
- func (b *Buffer) WriteCString(v string)
- func (b *Buffer) WriteDate(t time.Time)
- func (b *Buffer) WriteFixedString(i int, v string)
- func (b *Buffer) WriteFloat32(v float32)
- func (b *Buffer) WriteFloat64(v float64)
- func (b *Buffer) WriteInt(v int64)
- func (b *Buffer) WriteInt16(v int16)
- func (b *Buffer) WriteInt32(v int32)
- func (b *Buffer) WriteInt64(v int64)
- func (b *Buffer) WriteInt8(v int8)
- func (b *Buffer) WriteInvertedString(l int, s string)
- func (b *Buffer) WriteLSBit(bit bool)
- func (b *Buffer) WriteLimitedBytes(bf []byte)
- func (b *Buffer) WriteMSBit(bit bool)
- func (b *Buffer) WriteRandom(i int) *Buffer
- func (b *Buffer) WriteRune(r rune)
- func (b *Buffer) WriteTime(t time.Time)
- func (b *Buffer) WriteTypedInt(fixed bool, bits int, signed, big bool, val interface{})
- func (b *Buffer) WriteUString(u string)
- func (e *Buffer) WriteUUID(g UUID)
- func (b *Buffer) WriteUint(v uint64)
- func (b *Buffer) WriteUint16(v uint16)
- func (b *Buffer) WriteUint32(v uint32)
- func (b *Buffer) WriteUint64(v uint64)
- type Decoder
- type DiskStatus
- type Encoder
- type FixedInt16
- type FixedInt16BE
- type FixedInt32
- type FixedInt32BE
- type FixedInt64
- type FixedInt64BE
- type FixedUint16
- type FixedUint16BE
- type FixedUint32
- type FixedUint32BE
- type FixedUint64
- type FixedUint64BE
- type Path
- func (d Path) Concat(s ...string) Path
- func (d Path) DiskStatus() *DiskStatus
- func (d Path) DiskUsed() uint64
- func (d Path) Exists(p string) bool
- func (d Path) ExistsPath(p Path) bool
- func (d Path) Free() uint64
- func (d Path) Get(path string) (*Buffer, error)
- func (d Path) GetSub(p Path) Path
- func (d Path) GetSubFile(path Path) (*Buffer, error)
- func (d Path) GetSubPath(p Path) string
- func (d Path) IsDirectory() bool
- func (d Path) IsExtant() bool
- func (d Path) LRU() (string, error)
- func (d Path) MakeDir() error
- func (d Path) MakeDirPath(path Path) error
- func (d Path) Mkdir(elements ...string) error
- func (d Path) Pop() (string, Path)
- func (d Path) Put(path string, data io.Reader) error
- func (d Path) ReadAll() ([]byte, error)
- func (d Path) Remove() error
- func (d Path) Render() string
- func (d Path) RenderUnix() string
- func (d Path) RenderWin() string
- func (d Path) Size() uint64
- func (d Path) Stat() os.FileInfo
- func (d Path) String() string
- func (d Path) Time() time.Time
- func (d Path) WriteAll(b []byte) error
- type UUID
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
This section is empty.
Functions ¶
func RandomIndex ¶
func RandomIndex(v interface{}) int
func RandomInt64 ¶
Types ¶
type Backend ¶
type Backend interface { Read([]byte) (int, error) Write([]byte) (int, error) Erase() error Seek(offset int64, whence int) (int64, error) Size() int64 Bytes() []byte Close() error }
func MemBackend ¶
func MemBackend() Backend
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func DummyReadSeeker ¶
func DummyReadSeeker(r io.ReadSeeker) *Buffer
func DummyWriter ¶
DummyWriter creates a Buffer using a Backend that can only do simple write operations.
func FromBase64 ¶
func FromReadSeeker ¶
func FromReadSeeker(sk io.ReadSeeker) *Buffer
func FromString ¶
func (*Buffer) EncodeSignedVarint ¶
func (*Buffer) EncodeUnsignedVarint ¶
func (*Buffer) FlushReadBits ¶ added in v0.9.2
func (b *Buffer) FlushReadBits()
func (*Buffer) FlushWriteBits ¶ added in v0.9.2
func (b *Buffer) FlushWriteBits()
func (*Buffer) ReadBigInt ¶
func (*Buffer) ReadBigInt16 ¶
func (*Buffer) ReadBigInt32 ¶
func (*Buffer) ReadBigInt64 ¶
WARNING: Big refers to Big-endian, not as in BigInteger.
func (*Buffer) ReadBigUint16 ¶
func (*Buffer) ReadBigUint32 ¶
func (*Buffer) ReadBigUint64 ¶
func (*Buffer) ReadBoxKey ¶
func (*Buffer) ReadBoxNonce ¶
func (*Buffer) ReadCString ¶
func (*Buffer) ReadFixedString ¶
func (*Buffer) ReadFloat64 ¶
func (*Buffer) ReadInvertedString ¶
func (*Buffer) ReadLimitedBytes ¶
func (*Buffer) ReadMSBit ¶
Etc uses most-significant-bit first encoding of bits. For 8-byte aligned boolean values, refer to ReadBool().
func (*Buffer) ReadRemainder ¶
func (*Buffer) ReadStringUntil ¶
func (*Buffer) ReadTypedInt ¶
Integer functions
func (*Buffer) ReadUString ¶
func (*Buffer) ReadUint16 ¶
func (*Buffer) ReadUint32 ¶
func (*Buffer) ReadUint64 ¶
func (*Buffer) WriteBigInt ¶
func (*Buffer) WriteBigInt16 ¶
WARNING: Big refers to Big-endian, not as in BigInteger.
func (*Buffer) WriteBigInt32 ¶
func (*Buffer) WriteBigInt64 ¶
func (*Buffer) WriteBigUint16 ¶
func (*Buffer) WriteBigUint32 ¶
func (*Buffer) WriteBigUint64 ¶
func (*Buffer) WriteCString ¶
func (*Buffer) WriteFixedString ¶
func (*Buffer) WriteFloat32 ¶
func (*Buffer) WriteFloat64 ¶
func (*Buffer) WriteInt16 ¶
func (*Buffer) WriteInt32 ¶
func (*Buffer) WriteInt64 ¶
func (*Buffer) WriteInvertedString ¶
func (*Buffer) WriteLSBit ¶
func (*Buffer) WriteLimitedBytes ¶
func (*Buffer) WriteMSBit ¶
func (*Buffer) WriteRandom ¶
func (*Buffer) WriteTypedInt ¶
func (*Buffer) WriteUString ¶
func (*Buffer) WriteUint16 ¶
func (*Buffer) WriteUint32 ¶
func (*Buffer) WriteUint64 ¶
type DiskStatus ¶
type DiskStatus struct { All uint64 `json:"all"` Used uint64 `json:"used"` Free uint64 `json:"free"` }
func GetDiskStatus ¶
func GetDiskStatus(path string) (*DiskStatus, error)
type FixedInt16 ¶
type FixedInt16 int16
type FixedInt16BE ¶
type FixedInt16BE int16
type FixedInt32 ¶
type FixedInt32 int32
type FixedInt32BE ¶
type FixedInt32BE int32
type FixedInt64 ¶
type FixedInt64 int64
type FixedInt64BE ¶
type FixedInt64BE int64
type FixedUint16 ¶
type FixedUint16 uint16
type FixedUint16BE ¶
type FixedUint16BE uint16
type FixedUint32 ¶
type FixedUint32 uint32
type FixedUint32BE ¶
type FixedUint32BE uint32
type FixedUint64 ¶
type FixedUint64 uint64
type FixedUint64BE ¶
type FixedUint64BE uint64
type Path ¶
type Path []string
func Gopath ¶
func Gopath() Path
Gopath returns the path of local Go folder. Panics if one cannot be found.
func Goroot ¶
func Goroot() Path
Goroot attempts to finds your Go installation, panics if one cannot be found.
func HomeDirectory ¶
func HomeDirectory() Path
func LocalDirectory ¶
func LocalDirectory() Path
func ParseSystemPath ¶
func ParseUnixPath ¶
func ParseWindowsPath ¶
func TmpDirectory ¶
func TmpDirectory() Path
func (Path) DiskStatus ¶
func (d Path) DiskStatus() *DiskStatus
func (Path) ExistsPath ¶
func (Path) GetSubPath ¶
func (Path) IsDirectory ¶
func (Path) MakeDirPath ¶
func (Path) RenderUnix ¶
type UUID ¶
type UUID [16]byte
var NullUUID UUID
func GenerateRandomUUID ¶
func GenerateRandomUUID() UUID
func (UUID) MarshalJSON ¶
func (UUID) MarshalYAML ¶
func (UUID) UnmarshalJSON ¶
func (UUID) UnmarshalYAML ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.