Lint on pkg/* packages
- pkg/useragent - pkg/units - pkg/ulimit - pkg/truncindex - pkg/timeoutconn - pkg/term - pkg/tarsum - pkg/tailfile - pkg/systemd - pkg/stringutils - pkg/stringid - pkg/streamformatter - pkg/sockets - pkg/signal - pkg/proxy - pkg/progressreader - pkg/pools - pkg/plugins - pkg/pidfile - pkg/parsers - pkg/parsers/filters - pkg/parsers/kernel - pkg/parsers/operatingsystem Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
a922d62168
commit
9bcb3cba83
56 changed files with 455 additions and 195 deletions
|
@ -12,22 +12,28 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
// ErrNotFound plugin not found
|
||||
ErrNotFound = errors.New("Plugin not found")
|
||||
socketsPath = "/run/docker/plugins"
|
||||
specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"}
|
||||
)
|
||||
|
||||
// Registry defines behavior of a registry of plugins.
|
||||
type Registry interface {
|
||||
// Plugins lists all plugins.
|
||||
Plugins() ([]*Plugin, error)
|
||||
// Plugin returns the plugin registered with the given name (or returns an error).
|
||||
Plugin(name string) (*Plugin, error)
|
||||
}
|
||||
|
||||
// LocalRegistry defines a registry that is local (using unix socket).
|
||||
type LocalRegistry struct{}
|
||||
|
||||
func newLocalRegistry() LocalRegistry {
|
||||
return LocalRegistry{}
|
||||
}
|
||||
|
||||
// Plugin returns the plugin registered with the given name (or returns an error).
|
||||
func (l *LocalRegistry) Plugin(name string) (*Plugin, error) {
|
||||
socketpaths := pluginPaths(socketsPath, name, ".sock")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue