Documentation ¶
Index ¶
- Constants
- 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)
- func SupervisorWithNewProcessFunc(bundle *model.BundleInfo, ...) (plugin.Supervisor, error)
- type APIAddChannelMemberArgs
- type APIChannelMemberReply
- type APIChannelReply
- type APIDeleteChannelMemberArgs
- type APIErrorReply
- type APIGetChannelByNameArgs
- type APIGetChannelMemberArgs
- type APIGetDirectChannelArgs
- type APIGetGroupChannelArgs
- type APIKeyValueStoreReply
- type APIKeyValueStoreSetArgs
- type APIPostReply
- type APITeamReply
- type APIUnregisterCommandArgs
- type APIUpdateChannelMemberNotificationsArgs
- type APIUpdateChannelMemberRolesArgs
- type APIUserReply
- type HooksExecuteCommandReply
- type LocalAPI
- func (api *LocalAPI) AddChannelMember(args *APIAddChannelMemberArgs, reply *APIChannelMemberReply) error
- func (api *LocalAPI) CreateChannel(args *model.Channel, reply *APIChannelReply) error
- func (api *LocalAPI) CreatePost(args *model.Post, reply *APIPostReply) error
- func (api *LocalAPI) CreateTeam(args *model.Team, reply *APITeamReply) error
- func (api *LocalAPI) CreateUser(args *model.User, reply *APIUserReply) error
- func (api *LocalAPI) DeleteChannel(args string, reply *APIErrorReply) error
- func (api *LocalAPI) DeleteChannelMember(args *APIDeleteChannelMemberArgs, reply *APIErrorReply) error
- func (api *LocalAPI) DeletePost(args string, reply *APIErrorReply) error
- func (api *LocalAPI) DeleteTeam(args string, reply *APIErrorReply) error
- func (api *LocalAPI) DeleteUser(args string, reply *APIErrorReply) error
- func (api *LocalAPI) GetChannel(args string, reply *APIChannelReply) error
- func (api *LocalAPI) GetChannelByName(args *APIGetChannelByNameArgs, reply *APIChannelReply) error
- func (api *LocalAPI) GetChannelMember(args *APIGetChannelMemberArgs, reply *APIChannelMemberReply) error
- func (api *LocalAPI) GetDirectChannel(args *APIGetDirectChannelArgs, reply *APIChannelReply) error
- func (api *LocalAPI) GetGroupChannel(args *APIGetGroupChannelArgs, reply *APIChannelReply) error
- func (api *LocalAPI) GetPost(args string, reply *APIPostReply) error
- func (api *LocalAPI) GetTeam(args string, reply *APITeamReply) error
- func (api *LocalAPI) GetTeamByName(args string, reply *APITeamReply) error
- func (api *LocalAPI) GetUser(args string, reply *APIUserReply) error
- func (api *LocalAPI) GetUserByEmail(args string, reply *APIUserReply) error
- func (api *LocalAPI) GetUserByUsername(args string, reply *APIUserReply) error
- func (api *LocalAPI) KeyValueStoreDelete(args string, reply *APIErrorReply) error
- func (api *LocalAPI) KeyValueStoreGet(args string, reply *APIKeyValueStoreReply) error
- func (api *LocalAPI) KeyValueStoreSet(args *APIKeyValueStoreSetArgs, reply *APIErrorReply) error
- func (api *LocalAPI) LoadPluginConfiguration(args struct{}, reply *[]byte) error
- func (api *LocalAPI) RegisterCommand(args *model.Command, reply *APITeamReply) error
- func (api *LocalAPI) UnregisterCommand(args *APIUnregisterCommandArgs, reply *APITeamReply) error
- func (api *LocalAPI) UpdateChannel(args *model.Channel, reply *APIChannelReply) error
- func (api *LocalAPI) UpdateChannelMemberNotifications(args *APIUpdateChannelMemberNotificationsArgs, reply *APIChannelMemberReply) error
- func (api *LocalAPI) UpdateChannelMemberRoles(args *APIUpdateChannelMemberRolesArgs, reply *APIChannelMemberReply) error
- func (api *LocalAPI) UpdatePost(args *model.Post, reply *APIPostReply) error
- func (api *LocalAPI) UpdateTeam(args *model.Team, reply *APITeamReply) error
- func (api *LocalAPI) UpdateUser(args *model.User, reply *APIUserReply) 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
- func (h *LocalHooks) ExecuteCommand(args *model.CommandArgs, reply *HooksExecuteCommandReply) error
- func (h *LocalHooks) Implemented(args struct{}, reply *[]string) error
- func (h *LocalHooks) OnActivate(args int64, reply *struct{}) error
- func (h *LocalHooks) OnConfigurationChange(args, reply *struct{}) error
- func (h *LocalHooks) OnDeactivate(args, reply *struct{}) (err error)
- func (h *LocalHooks) ServeHTTP(args ServeHTTPArgs, reply *struct{}) error
- type Muxer
- type Process
- type RemoteAPI
- func (api *RemoteAPI) AddChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)
- func (h *RemoteAPI) Close() error
- func (api *RemoteAPI) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) CreatePost(post *model.Post) (*model.Post, *model.AppError)
- func (api *RemoteAPI) CreateTeam(team *model.Team) (*model.Team, *model.AppError)
- func (api *RemoteAPI) CreateUser(user *model.User) (*model.User, *model.AppError)
- func (api *RemoteAPI) DeleteChannel(channelId string) *model.AppError
- func (api *RemoteAPI) DeleteChannelMember(channelId, userId string) *model.AppError
- func (api *RemoteAPI) DeletePost(postId string) *model.AppError
- func (api *RemoteAPI) DeleteTeam(teamId string) *model.AppError
- func (api *RemoteAPI) DeleteUser(userId string) *model.AppError
- func (api *RemoteAPI) GetChannel(channelId string) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) GetChannelByName(name, teamId string) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) GetChannelMember(channelId, userId string) (*model.ChannelMember, *model.AppError)
- func (api *RemoteAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) GetPost(postId string) (*model.Post, *model.AppError)
- func (api *RemoteAPI) GetTeam(teamId string) (*model.Team, *model.AppError)
- func (api *RemoteAPI) GetTeamByName(name string) (*model.Team, *model.AppError)
- func (api *RemoteAPI) GetUser(userId string) (*model.User, *model.AppError)
- func (api *RemoteAPI) GetUserByEmail(email string) (*model.User, *model.AppError)
- func (api *RemoteAPI) GetUserByUsername(name string) (*model.User, *model.AppError)
- func (api *RemoteAPI) KeyValueStore() plugin.KeyValueStore
- func (api *RemoteAPI) LoadPluginConfiguration(dest interface{}) error
- func (api *RemoteAPI) RegisterCommand(command *model.Command) error
- func (api *RemoteAPI) UnregisterCommand(teamId, trigger string) error
- func (api *RemoteAPI) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
- func (api *RemoteAPI) UpdateChannelMemberNotifications(channelId, userId string, notifications map[string]string) (*model.ChannelMember, *model.AppError)
- func (api *RemoteAPI) UpdateChannelMemberRoles(channelId, userId, newRoles string) (*model.ChannelMember, *model.AppError)
- func (api *RemoteAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError)
- func (api *RemoteAPI) UpdateTeam(team *model.Team) (*model.Team, *model.AppError)
- func (api *RemoteAPI) UpdateUser(user *model.User) (*model.User, *model.AppError)
- type RemoteHTTPResponseWriter
- type RemoteHooks
- func (h *RemoteHooks) Close() error
- func (h *RemoteHooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
- func (h *RemoteHooks) Implemented() (impl []string, err error)
- func (h *RemoteHooks) OnActivate(api plugin.API) error
- func (h *RemoteHooks) OnConfigurationChange() error
- func (h *RemoteHooks) OnDeactivate() error
- func (h *RemoteHooks) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type RemoteIOReader
- type RemoteKeyValueStore
- type ServeHTTPArgs
- type Supervisor
Constants ¶
const (
MaxProcessRestarts = 3
)
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)
func SupervisorWithNewProcessFunc ¶
func SupervisorWithNewProcessFunc(bundle *model.BundleInfo, newProcess func(context.Context) (Process, io.ReadWriteCloser, error)) (plugin.Supervisor, error)
Types ¶
type APIAddChannelMemberArgs ¶
type APIChannelMemberReply ¶
type APIChannelMemberReply struct { ChannelMember *model.ChannelMember Error *model.AppError }
type APIErrorReply ¶
type APIGetChannelByNameArgs ¶
type APIGetChannelMemberArgs ¶
type APIGetDirectChannelArgs ¶
type APIGetGroupChannelArgs ¶
type APIGetGroupChannelArgs struct {
UserIds []string
}
type APIKeyValueStoreReply ¶
type APIKeyValueStoreSetArgs ¶
type HooksExecuteCommandReply ¶
type HooksExecuteCommandReply struct { Response *model.CommandResponse Error *model.AppError }
type LocalAPI ¶
type LocalAPI struct {
// contains filtered or unexported fields
}
func (*LocalAPI) AddChannelMember ¶
func (api *LocalAPI) AddChannelMember(args *APIAddChannelMemberArgs, reply *APIChannelMemberReply) error
func (*LocalAPI) CreateChannel ¶
func (api *LocalAPI) CreateChannel(args *model.Channel, reply *APIChannelReply) error
func (*LocalAPI) CreatePost ¶
func (api *LocalAPI) CreatePost(args *model.Post, reply *APIPostReply) error
func (*LocalAPI) CreateTeam ¶
func (api *LocalAPI) CreateTeam(args *model.Team, reply *APITeamReply) error
func (*LocalAPI) CreateUser ¶
func (api *LocalAPI) CreateUser(args *model.User, reply *APIUserReply) error
func (*LocalAPI) DeleteChannel ¶
func (api *LocalAPI) DeleteChannel(args string, reply *APIErrorReply) error
func (*LocalAPI) DeleteChannelMember ¶
func (api *LocalAPI) DeleteChannelMember(args *APIDeleteChannelMemberArgs, reply *APIErrorReply) error
func (*LocalAPI) DeletePost ¶
func (api *LocalAPI) DeletePost(args string, reply *APIErrorReply) error
func (*LocalAPI) DeleteTeam ¶
func (api *LocalAPI) DeleteTeam(args string, reply *APIErrorReply) error
func (*LocalAPI) DeleteUser ¶
func (api *LocalAPI) DeleteUser(args string, reply *APIErrorReply) error
func (*LocalAPI) GetChannel ¶
func (api *LocalAPI) GetChannel(args string, reply *APIChannelReply) error
func (*LocalAPI) GetChannelByName ¶
func (api *LocalAPI) GetChannelByName(args *APIGetChannelByNameArgs, reply *APIChannelReply) error
func (*LocalAPI) GetChannelMember ¶
func (api *LocalAPI) GetChannelMember(args *APIGetChannelMemberArgs, reply *APIChannelMemberReply) error
func (*LocalAPI) GetDirectChannel ¶
func (api *LocalAPI) GetDirectChannel(args *APIGetDirectChannelArgs, reply *APIChannelReply) error
func (*LocalAPI) GetGroupChannel ¶
func (api *LocalAPI) GetGroupChannel(args *APIGetGroupChannelArgs, reply *APIChannelReply) error
func (*LocalAPI) GetTeamByName ¶
func (api *LocalAPI) GetTeamByName(args string, reply *APITeamReply) error
func (*LocalAPI) GetUserByEmail ¶
func (api *LocalAPI) GetUserByEmail(args string, reply *APIUserReply) error
func (*LocalAPI) GetUserByUsername ¶
func (api *LocalAPI) GetUserByUsername(args string, reply *APIUserReply) error
func (*LocalAPI) KeyValueStoreDelete ¶
func (api *LocalAPI) KeyValueStoreDelete(args string, reply *APIErrorReply) error
func (*LocalAPI) KeyValueStoreGet ¶
func (api *LocalAPI) KeyValueStoreGet(args string, reply *APIKeyValueStoreReply) error
func (*LocalAPI) KeyValueStoreSet ¶
func (api *LocalAPI) KeyValueStoreSet(args *APIKeyValueStoreSetArgs, reply *APIErrorReply) error
func (*LocalAPI) LoadPluginConfiguration ¶
func (*LocalAPI) RegisterCommand ¶
func (api *LocalAPI) RegisterCommand(args *model.Command, reply *APITeamReply) error
func (*LocalAPI) UnregisterCommand ¶
func (api *LocalAPI) UnregisterCommand(args *APIUnregisterCommandArgs, reply *APITeamReply) error
func (*LocalAPI) UpdateChannel ¶
func (api *LocalAPI) UpdateChannel(args *model.Channel, reply *APIChannelReply) error
func (*LocalAPI) UpdateChannelMemberNotifications ¶
func (api *LocalAPI) UpdateChannelMemberNotifications(args *APIUpdateChannelMemberNotificationsArgs, reply *APIChannelMemberReply) error
func (*LocalAPI) UpdateChannelMemberRoles ¶
func (api *LocalAPI) UpdateChannelMemberRoles(args *APIUpdateChannelMemberRolesArgs, reply *APIChannelMemberReply) error
func (*LocalAPI) UpdatePost ¶
func (api *LocalAPI) UpdatePost(args *model.Post, reply *APIPostReply) error
func (*LocalAPI) UpdateTeam ¶
func (api *LocalAPI) UpdateTeam(args *model.Team, reply *APITeamReply) error
func (*LocalAPI) UpdateUser ¶
func (api *LocalAPI) UpdateUser(args *model.User, reply *APIUserReply) error
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) ExecuteCommand ¶
func (h *LocalHooks) ExecuteCommand(args *model.CommandArgs, reply *HooksExecuteCommandReply) error
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) OnConfigurationChange ¶
func (h *LocalHooks) OnConfigurationChange(args, 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) AddChannelMember ¶
func (*RemoteAPI) CreateChannel ¶
func (*RemoteAPI) CreatePost ¶
func (*RemoteAPI) CreateTeam ¶
func (*RemoteAPI) CreateUser ¶
func (*RemoteAPI) DeleteChannel ¶
func (*RemoteAPI) DeleteChannelMember ¶
func (*RemoteAPI) GetChannel ¶
func (*RemoteAPI) GetChannelByName ¶
func (*RemoteAPI) GetChannelMember ¶
func (*RemoteAPI) GetDirectChannel ¶
func (*RemoteAPI) GetGroupChannel ¶
func (*RemoteAPI) GetTeamByName ¶
func (*RemoteAPI) GetUserByEmail ¶
func (*RemoteAPI) GetUserByUsername ¶
func (*RemoteAPI) KeyValueStore ¶
func (api *RemoteAPI) KeyValueStore() plugin.KeyValueStore
func (*RemoteAPI) LoadPluginConfiguration ¶
func (*RemoteAPI) RegisterCommand ¶
func (*RemoteAPI) UnregisterCommand ¶
func (*RemoteAPI) UpdateChannel ¶
func (*RemoteAPI) UpdateChannelMemberNotifications ¶
func (*RemoteAPI) UpdateChannelMemberRoles ¶
func (*RemoteAPI) UpdatePost ¶
func (*RemoteAPI) UpdateTeam ¶
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, pluginId string) (*RemoteHooks, error)
func ConnectMain ¶
func ConnectMain(muxer *Muxer, pluginId string) (*RemoteHooks, error)
Returns the hooks being served by a call to Main.
func (*RemoteHooks) Close ¶
func (h *RemoteHooks) Close() error
func (*RemoteHooks) ExecuteCommand ¶
func (h *RemoteHooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
func (*RemoteHooks) Implemented ¶
func (h *RemoteHooks) Implemented() (impl []string, err error)
func (*RemoteHooks) OnActivate ¶
func (h *RemoteHooks) OnActivate(api plugin.API) error
func (*RemoteHooks) OnConfigurationChange ¶
func (h *RemoteHooks) OnConfigurationChange() 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 RemoteKeyValueStore ¶
type RemoteKeyValueStore struct {
// contains filtered or unexported fields
}
func (*RemoteKeyValueStore) Delete ¶
func (s *RemoteKeyValueStore) Delete(key string) *model.AppError
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 exits, the supervisor will relaunch it after a short delay, but will only restart a plugin at most three times.
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.