Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7b4f91c4
Commit
7b4f91c4
authored
Sep 09, 2015
by
hurf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc fix for admission/plugin.go
Complete unfinished doc, changed some comments to be more readable.
parent
9351ef36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
plugins.go
pkg/admission/plugins.go
+6
-7
No files found.
pkg/admission/plugins.go
View file @
7b4f91c4
...
@@ -37,7 +37,7 @@ var (
...
@@ -37,7 +37,7 @@ var (
plugins
=
make
(
map
[
string
]
Factory
)
plugins
=
make
(
map
[
string
]
Factory
)
)
)
// GetPlugins enumerates the
// GetPlugins enumerates the
names of all registered plugins.
func
GetPlugins
()
[]
string
{
func
GetPlugins
()
[]
string
{
pluginsMutex
.
Lock
()
pluginsMutex
.
Lock
()
defer
pluginsMutex
.
Unlock
()
defer
pluginsMutex
.
Unlock
()
...
@@ -48,7 +48,7 @@ func GetPlugins() []string {
...
@@ -48,7 +48,7 @@ func GetPlugins() []string {
return
keys
return
keys
}
}
// RegisterPlugin registers a plugin Factory by name.
This
// RegisterPlugin registers a plugin Factory by name. This
// is expected to happen during app startup.
// is expected to happen during app startup.
func
RegisterPlugin
(
name
string
,
plugin
Factory
)
{
func
RegisterPlugin
(
name
string
,
plugin
Factory
)
{
pluginsMutex
.
Lock
()
pluginsMutex
.
Lock
()
...
@@ -61,11 +61,10 @@ func RegisterPlugin(name string, plugin Factory) {
...
@@ -61,11 +61,10 @@ func RegisterPlugin(name string, plugin Factory) {
plugins
[
name
]
=
plugin
plugins
[
name
]
=
plugin
}
}
// GetPlugin creates an instance of the named plugin, or nil if
// GetPlugin creates an instance of the named plugin, or nil if the name is not
// the name is not known. The error return is only used if the named provider
// known. The error is returned only when the named provider was known but failed
// was known but failed to initialize. The config parameter specifies the
// to initialize. The config parameter specifies the io.Reader handler of the
// io.Reader handler of the configuration file for the cloud provider, or nil
// configuration file for the cloud provider, or nil for no configuration.
// for no configuration.
func
GetPlugin
(
name
string
,
client
client
.
Interface
,
config
io
.
Reader
)
(
Interface
,
error
)
{
func
GetPlugin
(
name
string
,
client
client
.
Interface
,
config
io
.
Reader
)
(
Interface
,
error
)
{
pluginsMutex
.
Lock
()
pluginsMutex
.
Lock
()
defer
pluginsMutex
.
Unlock
()
defer
pluginsMutex
.
Unlock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment