Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxBytesReader ¶
func MaxBytesReader(r io.ReadCloser, maxBytes int64, err error) io.ReadCloser
MaxBytesReader is similar to net/http.MaxBytesReader, but lets us choose how to handle an overflow by providing an error. net/http.MaxBytesReader uses net/http internals to render a naff error message. There are other discrepancies with how this detects overflows. Not sure if that will cause issues. If you want to use it as part of an HTTP server, it's probably best to change it so you can provide a callback func, which renders your error message, as returning an error into the middle of the net/http server will not be useful.
Types ¶
type Plugin ¶
type Plugin struct { xfer.PluginSpec // contains filtered or unexported fields }
Plugin is the implementation of a plugin. It is responsible for doing the plugin handshake, gathering reports, etc.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maintains a list of available plugins by name.
func NewRegistry ¶
func NewRegistry(rootPath, apiVersion string, handshakeMetadata map[string]string) (*Registry, error)
NewRegistry creates a new registry which watches the given dir root for new plugins, and adds them.
func (*Registry) Close ¶
func (r *Registry) Close()
Close shuts down the registry. It can still be used after this, but will be out of date.
func (*Registry) Implementers ¶
Implementers walks the available plugins fulfilling the given interface