Documentation ¶
Index ¶
- Constants
- func BytesToInt64(b []byte) uint64
- func CreateDirAll(dir string) error
- func Exist(name string) bool
- func Int64ToBytes(n uint64) []byte
- func IsDirWriteable(dir string) error
- func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error
- func ReadDirInc(d string) ([]string, error)
- func TouchDirAll(dir string) error
- type SnowflakeIDGenerator
Constants ¶
View Source
const (
// PrivateFileMode grants owner to read/write a wal.
PrivateFileMode = 0600
)
Variables ¶
This section is empty.
Functions ¶
func CreateDirAll ¶
func IsDirWriteable ¶
func ReadDirInc ¶
func TouchDirAll ¶
Types ¶
type SnowflakeIDGenerator ¶
type SnowflakeIDGenerator struct {
// contains filtered or unexported fields
}
SnowflakeIDGenerator is a thread-safe ID generator with semantic ID
func NewSnowflakeIDGenerator ¶
func NewSnowflakeIDGenerator(nodeID uint64) *SnowflakeIDGenerator
NewSnowflakeIDGenerator creates a new ID generator with a node ID
func (*SnowflakeIDGenerator) GenerateID ¶
func (g *SnowflakeIDGenerator) GenerateID() uint64
GenerateID generates a unique and ordered ID with time, node, and sequence
Click to show internal directories.
Click to hide internal directories.