github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/runtime/entity.go (about)

     1  package runtime
     2  
     3  import (
     4  	"database/sql"
     5  	"time"
     6  )
     7  
     8  // Runtime struct represents database entity for Runtime
     9  type Runtime struct {
    10  	ID                   string         `db:"id"`
    11  	Name                 string         `db:"name"`
    12  	Description          sql.NullString `db:"description"`
    13  	StatusCondition      string         `db:"status_condition"`
    14  	StatusTimestamp      time.Time      `db:"status_timestamp"`
    15  	CreationTimestamp    time.Time      `db:"creation_timestamp"`
    16  	ApplicationNamespace sql.NullString `db:"application_namespace"`
    17  }
    18  
    19  // GetID returns ID of the runtime
    20  func (e *Runtime) GetID() string {
    21  	return e.ID
    22  }
    23  
    24  // DecorateWithTenantID decorates the entity with the given tenant ID.
    25  func (e *Runtime) DecorateWithTenantID(tenant string) interface{} {
    26  	return struct {
    27  		*Runtime
    28  		TenantID string `db:"tenant_id"`
    29  	}{
    30  		Runtime:  e,
    31  		TenantID: tenant,
    32  	}
    33  }