Documentation ¶
Index ¶
- Constants
- Variables
- func MustOpen(name string, flag int, perm uint32) *os.File
- func NewLogger(format string, a ...interface{}) *log.Logger
- func Packi64(b []byte, n int64)
- func RandBytes(b []byte)
- func RandHexString(bits int) string
- func RandId() string
- func Unpacki64(b []byte) (n int64)
- type NullWriter
Constants ¶
View Source
const IdBits = 64
Sufficient for 10**6 simultaneous IDs with probability of collision less than 10**-7.
Variables ¶
View Source
var (
LogWriter io.Writer = NullWriter{}
)
Logging
Functions ¶
func MustOpen ¶
MustOpen is like os.Open but panics if the file cannot be opened. It simplifies safe initialization of global variables holding file descriptors.
func RandHexString ¶
Types ¶
type NullWriter ¶
type NullWriter struct{}
Click to show internal directories.
Click to hide internal directories.