helper

package
v0.0.0-...-8654c45 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B

func B(x int64) *big.Int

func FromRange

func FromRange(from, to int) []byte

func GetHashFunctionByLowerCaseName

func GetHashFunctionByLowerCaseName(hashName string) (crypto.Hash, error)

func GetRSAPrivateKey

func GetRSAPrivateKey(size int) *rsa.PrivateKey

func GetRSAPublicKey

func GetRSAPublicKey(size int) *rsa.PublicKey

func GetTmpEmptyDir

func GetTmpEmptyDir() string

create a tmp dir and return its path. If failing, the method will panic

func GetTmpEmptyFile

func GetTmpEmptyFile() *os.File

return a tmp file in the default tmp directory. If fails, the function will panic

func GetTmpFileName

func GetTmpFileName() string

returns a path that can be safely use as tmp file

func GetTmpFileWithText

func GetTmpFileWithText(text string) *os.File

returned a closed tmp file with text in it.

func JoinAsError

func JoinAsError(msg []string) error

func JoinErrors

func JoinErrors(errs []error) error

func Range

func Range(length int) []byte

Types

type MockIoWriter

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

func NewMockIoWriter

func NewMockIoWriter() *MockIoWriter

func (*MockIoWriter) Bytes

func (this *MockIoWriter) Bytes() []byte

func (*MockIoWriter) IsValidJson

func (this *MockIoWriter) IsValidJson() bool

func (*MockIoWriter) Length

func (this *MockIoWriter) Length() int

func (*MockIoWriter) Reader

func (this *MockIoWriter) Reader() io.Reader

func (*MockIoWriter) ReaderAt

func (this *MockIoWriter) ReaderAt() io.ReaderAt

func (*MockIoWriter) String

func (this *MockIoWriter) String() string

func (*MockIoWriter) Write

func (this *MockIoWriter) Write(p []byte) (n int, err error)

type MockRandomReader

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

func NewMockRandomReader

func NewMockRandomReader() *MockRandomReader

func (*MockRandomReader) GetRandomBytes

func (this *MockRandomReader) GetRandomBytes(size int) []byte

func (*MockRandomReader) GetReadLength

func (this *MockRandomReader) GetReadLength() int

func (*MockRandomReader) Read

func (this *MockRandomReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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