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

     1  /*
     2  © 2022–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package g0
     7  
     8  import (
     9  	"github.com/haraldrudell/parl"
    10  )
    11  
    12  // goEntityID is an unexported unique ID for a parl.Go object
    13  //   - every Go object has this identifier
    14  //   - private promotable field with public method
    15  type goEntityID struct {
    16  	id parl.GoEntityID
    17  }
    18  
    19  // newGoEntityID returns a new goEntityID that uniquely identifies a Go object
    20  func newGoEntityID() (g0EntityID *goEntityID) {
    21  	return &goEntityID{id: parl.GoEntityIDs.ID()}
    22  }
    23  
    24  // EntityID returns GoEntityID, an internal unique idntifier
    25  func (i *goEntityID) EntityID() (id parl.GoEntityID) {
    26  	return i.id
    27  }