github.com/kristofferahl/go-centry@v1.5.0/internal/pkg/shell/types.go (about)

     1  package shell
     2  
     3  import "github.com/kristofferahl/go-centry/internal/pkg/cmd"
     4  import "github.com/kristofferahl/go-centry/internal/pkg/io"
     5  
     6  // Executable defines the interface of an executable program
     7  type Executable interface {
     8  	Run(io io.InputOutput, args []string) error
     9  }
    10  
    11  // Function defines a function
    12  type Function struct {
    13  	Name        string
    14  	Description string
    15  	Help        string
    16  	Hidden      bool
    17  	Options     *cmd.OptionsSet
    18  }
    19  
    20  // Script defines the interface of a script file
    21  type Script interface {
    22  	Language() string
    23  	Executable() Executable
    24  	FullPath() string
    25  	RelativePath() string
    26  	Functions() (funcs []*Function, err error)
    27  	FunctionNamespace(name string) string
    28  	FunctionNamespaceSplitChar() string
    29  }