Documentation
¶
Index ¶
- type Command
- type Ifaces
- type Options
- type Permissions
- type QueryOptions
- type ScriptPlugin
- type Service
- func (s *Service) LoadScript(ctx context.Context, filename string) (*ScriptPlugin, error)
- func (s *Service) LookupCommand(name string) *Command
- func (s *Service) LookupKeyBinding(key string) (string, *Command)
- func (s *Service) RebindKeyBinding(keyBinding string, newKey string) error
- func (s *Service) RunAdHocScript(ctx context.Context, filename string) chan error
- func (s *Service) SetDefaultOptions(options Options)
- func (s *Service) SetIFaces(ifaces Ifaces)
- func (s *Service) SetLookupPaths(fs []fs.FS)
- func (s *Service) StartAdHocScript(ctx context.Context, filename string, errChan chan error) error
- func (s *Service) UnbindKey(key string)
- type ServiceOption
- type SessionService
- type UIService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ifaces ¶
type Ifaces struct {
UI UIService
Session SessionService
}
type Options ¶
type Options struct {
// OSExecShell is the shell to use for calls to 'os.exec'. If not defined,
// it will use the value of the SHELL environment variable, otherwise it will
// default to '/bin/bash'
OSExecShell string
// Permissions are the permissions the script can execute in
Permissions Permissions
}
type Permissions ¶
type Permissions struct {
// AllowShellCommands determines whether or not a script can execute shell commands.
AllowShellCommands bool
// AllowEnv determines whether or not a script can access environment variables
AllowEnv bool
}
Permissions control the set of permissions of a script
type QueryOptions ¶
type ScriptPlugin ¶
type ScriptPlugin struct {
// contains filtered or unexported fields
}
func (*ScriptPlugin) Name ¶
func (sp *ScriptPlugin) Name() string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...ServiceOption) *Service
func (*Service) LoadScript ¶
func (*Service) LookupCommand ¶
LookupCommand looks up a command defined by a script. TODO: Command should probably accept/return a chan error to indicate that this will run in a separate goroutine
func (*Service) LookupKeyBinding ¶
func (*Service) RebindKeyBinding ¶
func (*Service) RunAdHocScript ¶
func (*Service) SetDefaultOptions ¶
func (*Service) SetLookupPaths ¶
func (*Service) StartAdHocScript ¶
type ServiceOption ¶
type ServiceOption func(srv *Service)
func WithFS ¶
func WithFS(fs ...fs.FS) ServiceOption
type SessionService ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.