Documentation ¶
Index ¶
- Constants
- func GenID() int64
- func GenID2() int64
- func GenID3() int64
- func GenerateMachineCode(bits int8) (code int, err error)
- func GetLocalIP() (ip string, err error)
- func ResolveID(id int64, oid *ID) (timestamp int64, counter uint32)
- func ResolveID2(id int64, oid *ID2) (timestamp int64, counter uint32)
- func ResolveID3(id int64, oid *ID3) (timestamp int64, counter uint16)
- type ID
- func (i *ID) Generate() int64
- func (i *ID) GetDelta() uint32
- func (i *ID) GetMaxBacktrackWait() time.Duration
- func (i *ID) GetNTPServer() string
- func (i *ID) GetNode() (node uint32, nodeBits uint8)
- func (i *ID) GetRandomDelta() uint32
- func (i *ID) SetDelta(d uint32)
- func (i *ID) SetMaxBacktrackWait(d time.Duration)
- func (i *ID) SetNTPServer(s string)
- func (i *ID) SetNode(node uint32, nodeBits uint8)
- func (i *ID) SetRandomDelta(r uint32)
- type ID2
- func (i *ID2) Generate() int64
- func (i *ID2) GetDelta() uint32
- func (i *ID2) GetMaxBacktrackWait() time.Duration
- func (i *ID2) GetNode() (node uint32, nodeBits uint8)
- func (i *ID2) GetRandomDelta() uint32
- func (i *ID2) SetDelta(d uint32)
- func (i *ID2) SetMaxBacktrackWait(d time.Duration)
- func (i *ID2) SetNTPServer(s string)
- func (i *ID2) SetNode(node uint32, nodeBits uint8)
- func (i *ID2) SetRandomDelta(r uint32)
- type ID3
- func (i *ID3) Generate() int64
- func (i *ID3) GetDelta() uint16
- func (i *ID3) GetNode() (node uint16, nodeBits uint8)
- func (i *ID3) GetRandomDelta() uint16
- func (i *ID3) SetBits(bits uint8)
- func (i *ID3) SetDelta(d uint16)
- func (i *ID3) SetNode(node uint16, nodeBits uint8)
- func (i *ID3) SetRandomDelta(r uint16)
Constants ¶
View Source
const (
MaxBits = 53
)
Variables ¶
This section is empty.
Functions ¶
func GenerateMachineCode ¶ added in v1.0.3
func GetLocalIP ¶ added in v1.0.3
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
func (*ID) GetMaxBacktrackWait ¶ added in v1.0.2
func (*ID) GetNTPServer ¶ added in v1.0.2
func (*ID) GetRandomDelta ¶
func (*ID) SetMaxBacktrackWait ¶ added in v1.0.2
func (*ID) SetNTPServer ¶ added in v1.0.2
func (*ID) SetRandomDelta ¶
type ID2 ¶
type ID2 struct {
// contains filtered or unexported fields
}
func (*ID2) GetMaxBacktrackWait ¶ added in v1.0.2
func (*ID2) GetRandomDelta ¶
func (*ID2) SetMaxBacktrackWait ¶ added in v1.0.2
func (*ID2) SetNTPServer ¶ added in v1.0.2
func (*ID2) SetRandomDelta ¶
type ID3 ¶
type ID3 struct {
// contains filtered or unexported fields
}
func (*ID3) GetRandomDelta ¶
func (*ID3) SetRandomDelta ¶
Click to show internal directories.
Click to hide internal directories.