github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/directory/dev.go (about)

     1  package directory
     2  
     3  import (
     4  	"github.com/hashicorp/otto/helper/uuid"
     5  )
     6  
     7  // Dev represents a development environment of an app.
     8  type Dev struct {
     9  	// Lookup information for the Deploy. AppID is all that is required.
    10  	Lookup
    11  
    12  	// These fields should be set for Put and will be populated on Get
    13  	State DevState // State of the dev environment
    14  
    15  	// Private fields. These are usually set on Get or Put.
    16  	//
    17  	// DO NOT MODIFY THESE.
    18  	ID string
    19  }
    20  
    21  func (d *Dev) IsReady() bool {
    22  	return d != nil && d.State == DevStateReady
    23  }
    24  
    25  func (d *Dev) MarkReady() {
    26  	d.State = DevStateReady
    27  }
    28  
    29  func (d *Dev) setId() {
    30  	d.ID = uuid.GenerateUUID()
    31  }