option.go raw

   1  package opt
   2  
   3  import (
   4  	"github.com/p9c/p9/pkg/opts/meta"
   5  )
   6  
   7  type (
   8  	// Option is an interface to simplify concurrent-safe access to a variety of types of configuration item
   9  	Option interface {
  10  		LoadInput(input string) (o Option, e error)
  11  		ReadInput(input string) (o Option, e error)
  12  		GetMetadata() *meta.Data
  13  		Name() string
  14  		String() string
  15  		MarshalJSON() (b []byte, e error)
  16  		UnmarshalJSON(data []byte) (e error)
  17  		GetAllOptionStrings() []string
  18  		Type() interface{}
  19  		SetName(string)
  20  	}
  21  )
  22