Documentation ¶
Overview ¶
Package listeners is a service for creating and managing Listener objects
Index ¶
- func WithHTTPMemoryListenerRepository() http.Repository
- func WithHTTPMemoryServerRepository() httpServer.Repository
- func WithSMBMemoryListenerRepository() smb.Repository
- func WithTCPMemoryListenerRepository() tcp.Repository
- func WithUDPMemoryListenerRepository() udp.Repository
- type ListenerService
- func (ls *ListenerService) CLICompleter() func(string) []string
- func (ls *ListenerService) DefaultOptions(protocol string) (options map[string]string, err error)
- func (ls *ListenerService) List() func(string) []string
- func (ls *ListenerService) Listener(id uuid.UUID) (listeners.Listener, error)
- func (ls *ListenerService) ListenerByName(name string) (listeners.Listener, error)
- func (ls *ListenerService) ListenerNames() (names []string)
- func (ls *ListenerService) ListenerTypes() (types []string)
- func (ls *ListenerService) Listeners() (listenerList []listeners.Listener)
- func (ls *ListenerService) ListenersByType(protocol int) (listenerList []listeners.Listener)
- func (ls *ListenerService) NewListener(options map[string]string) (listener listeners.Listener, er error)
- func (ls *ListenerService) Remove(id uuid.UUID) error
- func (ls *ListenerService) Restart(id uuid.UUID) error
- func (ls *ListenerService) SetOption(id uuid.UUID, option, value string) error
- func (ls *ListenerService) Start(id uuid.UUID) error
- func (ls *ListenerService) Stop(id uuid.UUID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithHTTPMemoryListenerRepository ¶
func WithHTTPMemoryListenerRepository() http.Repository
WithHTTPMemoryListenerRepository retrieves an in-memory HTTP Listener repository interface used to manage Listener objects
func WithHTTPMemoryServerRepository ¶
func WithHTTPMemoryServerRepository() httpServer.Repository
WithHTTPMemoryServerRepository retrieves an in-memory HTTP Server repository interface used to manage Server objects
func WithSMBMemoryListenerRepository ¶
func WithSMBMemoryListenerRepository() smb.Repository
WithSMBMemoryListenerRepository retrieves an in-memory TCP Listener repository interface used to manage Listener objects
func WithTCPMemoryListenerRepository ¶
func WithTCPMemoryListenerRepository() tcp.Repository
WithTCPMemoryListenerRepository retrieves an in-memory TCP Listener repository interface used to manage Listener objects
func WithUDPMemoryListenerRepository ¶
func WithUDPMemoryListenerRepository() udp.Repository
Types ¶
type ListenerService ¶
type ListenerService struct {
// contains filtered or unexported fields
}
ListenerService is a structure that implements the service methods holding references to Listener & Server repositories
func NewListenerService ¶
func NewListenerService() (ls ListenerService)
NewListenerService is a factory to create and return a ListenerService
func (*ListenerService) CLICompleter ¶
func (ls *ListenerService) CLICompleter() func(string) []string
CLICompleter returns a list of Listener & Server types that Merlin supports for CLI tab completion
func (*ListenerService) DefaultOptions ¶
func (ls *ListenerService) DefaultOptions(protocol string) (options map[string]string, err error)
DefaultOptions gets the default configurable options for both the listener and the infrastructure layer server (if applicable)
func (*ListenerService) List ¶
func (ls *ListenerService) List() func(string) []string
List returns a list of Listener names that exist and is used for command line tab completion
func (*ListenerService) ListenerByName ¶
func (ls *ListenerService) ListenerByName(name string) (listeners.Listener, error)
ListenerByName returns the first Listener object that matches the input name
func (*ListenerService) ListenerNames ¶
func (ls *ListenerService) ListenerNames() (names []string)
ListenerNames returns a list of Listener names as a string
func (*ListenerService) ListenerTypes ¶
func (ls *ListenerService) ListenerTypes() (types []string)
ListenerTypes returns a list of Listener types as a string (e.g. HTTP, SMB, TCP, UDP)
func (*ListenerService) Listeners ¶
func (ls *ListenerService) Listeners() (listenerList []listeners.Listener)
Listeners returns a list of stored Listener objects
func (*ListenerService) ListenersByType ¶
func (ls *ListenerService) ListenersByType(protocol int) (listenerList []listeners.Listener)
ListenersByType returns a list of all stored listeners for the provided listener
func (*ListenerService) NewListener ¶
func (ls *ListenerService) NewListener(options map[string]string) (listener listeners.Listener, er error)
NewListener is a factory that takes in a map of options used to configure a Listener, adds the Listener to its respective repository, and returns a copy created Listener object
func (*ListenerService) Remove ¶
func (ls *ListenerService) Remove(id uuid.UUID) error
Remove deletes the Listener from its repository
func (*ListenerService) Restart ¶
func (ls *ListenerService) Restart(id uuid.UUID) error
Restart terminates a Listener's embedded Server object (if applicable) and then starts it again
func (*ListenerService) SetOption ¶
func (ls *ListenerService) SetOption(id uuid.UUID, option, value string) error
SetOption updates an existing Listener's configurable option with the value provided