github.com/haraldrudell/parl@v0.4.176/go-entity-id.go (about)

     1  /*
     2  © 2023–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package parl
     7  
     8  import "strconv"
     9  
    10  // GoEntityID is a unique named type for Go objects
    11  //   - GoEntityID is required becaue for Go objects, the thread ID is not available
    12  //     prior to the go statement and GoGroups do not have any other unique ID
    13  //   - GoEntityID is suitable as a map key
    14  //   - GoEntityID uniquely identifies any Go-thread GoGroup, SubGo or SubGroup
    15  type GoEntityID uint64
    16  
    17  // GoEntityIDs is a generator for Go Object IDs
    18  var GoEntityIDs UniqueIDTypedUint64[GoEntityID]
    19  
    20  func (i GoEntityID) String() (s string) {
    21  	return strconv.FormatUint(uint64(i), 10)
    22  }