Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcmeSnooper ¶
type AcmeSnooper struct {
// contains filtered or unexported fields
}
An AcmeSnooper snoops on acme events and listens for custom action requests over TCP. This allows for richer reuse of existing acme wrappers from acme.go
func NewAcmeSnooper ¶
func NewAcmeSnooper(debug bool) *AcmeSnooper
NewAcmeSnooper inits an acme snooper and grabs the /+snoop window so that we can send messages back to acme in a consistent way.
func (*AcmeSnooper) Snoop ¶
func (a *AcmeSnooper) Snoop(chSignals chan os.Signal)
Snoop kicks off our local server and starts listening in on acme events.
type FileType ¶
type FileType struct { Tools []Tool // contains filtered or unexported fields }
A FileType defines a set of Tools and an associated file type to run them on. If the files support a unix shebang then we try to parse that as well if the extension is missing.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
A Listener runs the event loop that owns our TCP socket and routes incoming messages to their relevant handlers.
func NewListener ¶
NewListener initialises a new Listener without any handlers
func (*Listener) HandleIncomingConnections ¶
func (l *Listener) HandleIncomingConnections()
HandleIncomingConnections binds to a tcp socket and serves handler responses for incoming connections. Runs in a goroutine.
func (*Listener) Register ¶
func (l *Listener) Register(route string, handler MessageHandler)
Register registers a new message handler with a given route
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
A Message is a simple RPC message format to allow for very simple scripts that pass simple string messages to the snooper for it to process. Ideally this should be exposed as a 9fs file system in the same way as acme itself but for now this will have to do.
func NewMessage ¶
NewMessage constructs a new Message from a string that we received over the network. At this stage we are not guaranteed that this message is valid, only that we were able to split it into a handler and content.
type MessageHandler ¶
A MessageHandler is a function that knows how to parse a given message type