helpers

package
v0.0.0-...-c340371 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package helpers provide helper functions

Index

Constants

This section is empty.

Variables

View Source
var (
	TYPE_BYTES = reflect.TypeOf(([]byte)(nil))
)

Functions

func GetBytes

func GetBytes(i interface{}) ([]byte, error)

func GetValueFromPtr

func GetValueFromPtr(ptr interface{}) interface{}

func IsBytesType

func IsBytesType(obj interface{}) bool

func Md5

func Md5(data []byte) string

func ToUInt16

func ToUInt16(buffer []byte) (uint16, error)

func ToUInt32

func ToUInt32(buffer []byte) (uint32, error)

Types

type Buffer

type Buffer struct {
	bytes.Buffer
}

func NewBuffer

func NewBuffer(data []byte) *Buffer

func (*Buffer) ReadUInt16

func (b *Buffer) ReadUInt16() (uint16, error)

func (*Buffer) ReadUInt32

func (b *Buffer) ReadUInt32() (uint32, error)

func (*Buffer) WriteUInt16

func (b *Buffer) WriteUInt16(i interface{}) (int, error)

func (*Buffer) WriteUInt32

func (b *Buffer) WriteUInt32(i interface{}) (int, error)

type IDGen

type IDGen struct {
	// contains filtered or unexported fields
}

func NewIDGen

func NewIDGen(max uint32) *IDGen

func NewIDGen2

func NewIDGen2(min, max uint32) *IDGen

func (*IDGen) NextID

func (self *IDGen) NextID() uint32

Jump to

Keyboard shortcuts

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