github.com/devcamcar/cli@v0.0.0-20181107134215-706a05759d18/objects/context/info.go (about)

     1  package context
     2  
     3  import (
     4  	"github.com/fnproject/cli/config"
     5  )
     6  
     7  // Info holds the information found in the context YAML file
     8  type Info struct {
     9  	Current bool   `json:"current"`
    10  	Name    string `json:"name"`
    11  	*config.ContextFile
    12  }
    13  
    14  // NewInfo creates an instance of the contextInfo
    15  // by parsing the provided context YAML file. This is used
    16  // for outputting the context information
    17  func NewInfo(name string, isCurrent bool, contextFile *config.ContextFile) *Info {
    18  	return &Info{
    19  		Name:        name,
    20  		Current:     isCurrent,
    21  		ContextFile: contextFile,
    22  	}
    23  }