Documentation ¶
Index ¶
- func ConnectIOReader(conn io.ReadWriteCloser) io.ReadCloser
- func InheritedIPC(fd0, fd1 uintptr) (io.ReadWriteCloser, error)
- func InheritedProcessIPC() (io.ReadWriteCloser, error)
- func Main(hooks interface{})
- func NewIPC() (io.ReadWriteCloser, []*os.File, error)
- func NewReadWriteCloser(r io.ReadCloser, w io.WriteCloser) io.ReadWriteCloser
- func ServeAPI(api plugin.API, conn io.ReadWriteCloser, muxer *Muxer)
- func ServeHTTPResponseWriter(w http.ResponseWriter, conn io.ReadWriteCloser)
- func ServeHooks(hooks interface{}, conn io.ReadWriteCloser, muxer *Muxer)
- func ServeIOReader(r io.Reader, conn io.ReadWriteCloser)
- func SupervisorProvider(bundle *model.BundleInfo) (plugin.Supervisor, error)
- type APIChannelReply
- type APIGetChannelByNameArgs
- type APIPostReply
- type APITeamReply
- type APIUserReply
- type LocalAPI
- func (api *LocalAPI) CreatePost(args *model.Post, reply *APIPostReply) error
- func (api *LocalAPI) GetChannelByName(args *APIGetChannelByNameArgs, reply *APIChannelReply) error
- func (api *LocalAPI) GetTeamByName(args string, reply *APITeamReply) error
- func (api *LocalAPI) GetUserByUsername(args string, reply *APIUserReply) error
- func (api *LocalAPI) LoadPluginConfiguration(args struct{}, reply *[]byte) error
- type LocalHTTPResponseWriter
- func (w *LocalHTTPResponseWriter) Header(args struct{}, reply *http.Header) error
- func (w *LocalHTTPResponseWriter) SyncHeader(args http.Header, reply *struct{}) error
- func (w *LocalHTTPResponseWriter) Write(args []byte, reply *struct{}) error
- func (w *LocalHTTPResponseWriter) WriteHeader(args int, reply *struct{}) error
- type LocalHooks
- type Muxer
- type Process
- type RemoteAPI
- func (h *RemoteAPI) Close() error
- func (api *RemoteAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError)
- func (api *RemoteAPI) GetChannelByName(name, teamId string) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) GetTeamByName(name string) (*model.Team, *model.AppError)
- func (api *RemoteAPI) GetUserByUsername(name string) (*model.User, *model.AppError)
- func (api *RemoteAPI) LoadPluginConfiguration(dest interface{}) error
- type RemoteHTTPResponseWriter
- type RemoteHooks
- type RemoteIOReader
- type ServeHTTPArgs
- type Supervisor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectIOReader ¶
func ConnectIOReader(conn io.ReadWriteCloser) io.ReadCloser
func InheritedIPC ¶
func InheritedIPC(fd0, fd1 uintptr) (io.ReadWriteCloser, error)
Returns the IPC instance inherited by the process from its parent.
func InheritedProcessIPC ¶
func InheritedProcessIPC() (io.ReadWriteCloser, error)
When called on a process launched with NewProcess, returns the inherited IPC.
func Main ¶
func Main(hooks interface{})
Makes a set of hooks available via RPC. This function never returns.
func NewIPC ¶
func NewIPC() (io.ReadWriteCloser, []*os.File, error)
Returns a new IPC for the parent process and a set of files to pass on to the child.
The returned files must be closed after the child process is started.
func NewReadWriteCloser ¶
func NewReadWriteCloser(r io.ReadCloser, w io.WriteCloser) io.ReadWriteCloser
func ServeHTTPResponseWriter ¶
func ServeHTTPResponseWriter(w http.ResponseWriter, conn io.ReadWriteCloser)
func ServeHooks ¶
func ServeHooks(hooks interface{}, conn io.ReadWriteCloser, muxer *Muxer)
func ServeIOReader ¶
func ServeIOReader(r io.Reader, conn io.ReadWriteCloser)
func SupervisorProvider ¶
func SupervisorProvider(bundle *model.BundleInfo) (plugin.Supervisor, error)
Types ¶
type APIGetChannelByNameArgs ¶
type LocalAPI ¶
type LocalAPI struct {
// contains filtered or unexported fields
}
func (*LocalAPI) CreatePost ¶
func (api *LocalAPI) CreatePost(args *model.Post, reply *APIPostReply) error
func (*LocalAPI) GetChannelByName ¶
func (api *LocalAPI) GetChannelByName(args *APIGetChannelByNameArgs, reply *APIChannelReply) error
func (*LocalAPI) GetTeamByName ¶
func (api *LocalAPI) GetTeamByName(args string, reply *APITeamReply) error
func (*LocalAPI) GetUserByUsername ¶
func (api *LocalAPI) GetUserByUsername(args string, reply *APIUserReply) error
func (*LocalAPI) LoadPluginConfiguration ¶
type LocalHTTPResponseWriter ¶
type LocalHTTPResponseWriter struct {
// contains filtered or unexported fields
}
func (*LocalHTTPResponseWriter) Header ¶
func (w *LocalHTTPResponseWriter) Header(args struct{}, reply *http.Header) error
func (*LocalHTTPResponseWriter) SyncHeader ¶
func (w *LocalHTTPResponseWriter) SyncHeader(args http.Header, reply *struct{}) error
func (*LocalHTTPResponseWriter) Write ¶
func (w *LocalHTTPResponseWriter) Write(args []byte, reply *struct{}) error
func (*LocalHTTPResponseWriter) WriteHeader ¶
func (w *LocalHTTPResponseWriter) WriteHeader(args int, reply *struct{}) error
type LocalHooks ¶
type LocalHooks struct {
// contains filtered or unexported fields
}
func (*LocalHooks) Implemented ¶
func (h *LocalHooks) Implemented(args struct{}, reply *[]string) error
Implemented replies with the names of the hooks that are implemented.
func (*LocalHooks) OnActivate ¶
func (h *LocalHooks) OnActivate(args int64, reply *struct{}) error
func (*LocalHooks) OnDeactivate ¶
func (h *LocalHooks) OnDeactivate(args, reply *struct{}) (err error)
func (*LocalHooks) ServeHTTP ¶
func (h *LocalHooks) ServeHTTP(args ServeHTTPArgs, reply *struct{}) error
type Muxer ¶
type Muxer struct {
// contains filtered or unexported fields
}
Muxer allows multiple bidirectional streams to be transmitted over a single connection.
Muxer is safe for use by multiple goroutines.
Streams opened on the muxer must be periodically drained in order to reclaim read buffer memory. In other words, readers must consume incoming data as it comes in.
func NewMuxer ¶
func NewMuxer(conn io.ReadWriteCloser, parity bool) *Muxer
Creates a new Muxer.
conn must be safe for simultaneous reads by one goroutine and writes by another.
For two muxers communicating with each other via a connection, parity must be true for exactly one of them.
func (*Muxer) Connect ¶
func (m *Muxer) Connect(id int64) io.ReadWriteCloser
Opens a remotely opened stream.
func (*Muxer) Read ¶
Calling Read on the muxer directly performs a read on a dedicated, always-open channel.
type Process ¶
type Process interface { // Waits for the process to exit and returns an error if a problem occurred or the process exited // with a non-zero status. Wait() error }
func NewProcess ¶
NewProcess launches an RPC executable in a new process and returns an IPC that can be used to communicate with it.
type RemoteAPI ¶
type RemoteAPI struct {
// contains filtered or unexported fields
}
func ConnectAPI ¶
func ConnectAPI(conn io.ReadWriteCloser, muxer *Muxer) *RemoteAPI
func (*RemoteAPI) CreatePost ¶
func (*RemoteAPI) GetChannelByName ¶
func (*RemoteAPI) GetTeamByName ¶
func (*RemoteAPI) GetUserByUsername ¶
func (*RemoteAPI) LoadPluginConfiguration ¶
type RemoteHTTPResponseWriter ¶
type RemoteHTTPResponseWriter struct {
// contains filtered or unexported fields
}
func ConnectHTTPResponseWriter ¶
func ConnectHTTPResponseWriter(conn io.ReadWriteCloser) *RemoteHTTPResponseWriter
func (*RemoteHTTPResponseWriter) Close ¶
func (h *RemoteHTTPResponseWriter) Close() error
func (*RemoteHTTPResponseWriter) Header ¶
func (w *RemoteHTTPResponseWriter) Header() http.Header
func (*RemoteHTTPResponseWriter) Write ¶
func (w *RemoteHTTPResponseWriter) Write(b []byte) (int, error)
func (*RemoteHTTPResponseWriter) WriteHeader ¶
func (w *RemoteHTTPResponseWriter) WriteHeader(statusCode int)
type RemoteHooks ¶
type RemoteHooks struct {
// contains filtered or unexported fields
}
func ConnectHooks ¶
func ConnectHooks(conn io.ReadWriteCloser, muxer *Muxer) (*RemoteHooks, error)
func ConnectMain ¶
func ConnectMain(muxer *Muxer) (*RemoteHooks, error)
Returns the hooks being served by a call to Main.
func (*RemoteHooks) Close ¶
func (h *RemoteHooks) Close() error
func (*RemoteHooks) Implemented ¶
func (h *RemoteHooks) Implemented() (impl []string, err error)
func (*RemoteHooks) OnActivate ¶
func (h *RemoteHooks) OnActivate(api plugin.API) error
func (*RemoteHooks) OnDeactivate ¶
func (h *RemoteHooks) OnDeactivate() error
func (*RemoteHooks) ServeHTTP ¶
func (h *RemoteHooks) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RemoteIOReader ¶
type RemoteIOReader struct {
// contains filtered or unexported fields
}
func (*RemoteIOReader) Close ¶
func (r *RemoteIOReader) Close() error
type ServeHTTPArgs ¶
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
Supervisor implements a plugin.Supervisor that launches the plugin in a separate process and communicates via RPC.
If the plugin unexpectedly exists, the supervisor will relaunch it after a short delay.
func (*Supervisor) Hooks ¶
func (s *Supervisor) Hooks() plugin.Hooks
Returns the hooks used to communicate with the plugin. The hooks may change if the plugin is restarted, so the return value should not be cached.
func (*Supervisor) Start ¶
func (s *Supervisor) Start() error
Starts the plugin. This method will block until the plugin is successfully launched for the first time and will return an error if the plugin cannot be launched at all.