util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 15

Documentation

Overview

Package util provides some basic util functions.

Index

Constants

View Source
const (
	POSIX_FADV_NORMAL = iota
	POSIX_FADV_RANDOM
	POSIX_FADV_SEQUENTIAL
	POSIX_FADV_WILLNEED
	POSIX_FADV_DONTNEED
	POSIX_FADV_NOREUSE
)

Variables

This section is empty.

Functions

func Fadvise

func Fadvise(file *os.File, off, length int64, advise uint32) error

func Fdatasync

func Fdatasync(file *os.File) error

func GetUnalignedUint16

func GetUnalignedUint16(u8 []uint8) uint16

func GetUnalignedUint32

func GetUnalignedUint32(u8 []uint8) uint32

func GetUnalignedUint64

func GetUnalignedUint64(u8 []uint8) uint64

func MarshalKVText

func MarshalKVText(kv []KeyValue) []byte

func MarshalUint16

func MarshalUint16(i uint16) []byte

func MarshalUint32

func MarshalUint32(i uint32) []byte

func MarshalUint64

func MarshalUint64(v uint64) []byte

func ParseKVText

func ParseKVText(txt []byte) map[string]string

ParseKVText parses iSCSI key value data.

func StringToByte

func StringToByte(str string, align int, maxlength int) []byte

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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