github.com/andy2046/gopie@v0.7.0/pkg/sequence/iceflake.go (about)

     1  package sequence
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // Iceflake is the interface for snowflake similar sequence generator.
     8  type Iceflake interface {
     9  	Sequencer
    10  	// StartTime defines the time since which
    11  	// the Iceflake time is defined as the elapsed time.
    12  	StartTime() time.Time
    13  	// BitLenSequence defines the bit length of sequence number,
    14  	// and the bit length of time is 63 - BitLenSequence().
    15  	BitLenSequence() uint8
    16  }