Documentation ¶
Overview ¶
Package plugin is an adapter implementation that provides a generic handling of all AccessMethods provided by plugins. It includes a generic AccessType object (responsible for un-/marshaling AccessSpec objects), AccessSpec object and AccessMethod implementation mapping the AccessMethod interface to the plugin interface.
Index ¶
- func NewType(name string, p plugin.Plugin, desc *plugin.AccessMethodDescriptor) accspeccpi.AccessType
- type AccessSpec
- func (s *AccessSpec) AccessMethod(cv cpi.ComponentVersionAccess) (cpi.AccessMethod, error)
- func (s *AccessSpec) Describe(ctx cpi.Context) string
- func (s *AccessSpec) GetMimeType() string
- func (s *AccessSpec) GetReferenceHint(cv cpi.ComponentVersionAccess) string
- func (s *AccessSpec) GlobalAccessSpec(cpi.Context) cpi.AccessSpec
- func (s *AccessSpec) Handler() *PluginHandler
- func (_ *AccessSpec) IsLocal(cpi.Context) bool
- type PluginHandler
- func (p *PluginHandler) AccessMethod(spec *AccessSpec, cv cpi.ComponentVersionAccess) (cpi.AccessMethod, error)
- func (p *PluginHandler) Describe(spec *AccessSpec, ctx cpi.Context) string
- func (p *PluginHandler) GetMimeType(spec *AccessSpec) string
- func (p *PluginHandler) GetReferenceHint(spec *AccessSpec, cv cpi.ComponentVersionAccess) string
- func (p *PluginHandler) Info(spec *AccessSpec) (*ppi.AccessSpecInfo, error)
- func (p *PluginHandler) Validate(spec *AccessSpec) (*ppi.AccessSpecInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewType ¶
func NewType(name string, p plugin.Plugin, desc *plugin.AccessMethodDescriptor) accspeccpi.AccessType
Types ¶
type AccessSpec ¶
type AccessSpec struct { runtime.UnstructuredVersionedTypedObject `json:",inline"` // contains filtered or unexported fields }
func (*AccessSpec) AccessMethod ¶
func (s *AccessSpec) AccessMethod(cv cpi.ComponentVersionAccess) (cpi.AccessMethod, error)
func (*AccessSpec) GetMimeType ¶
func (s *AccessSpec) GetMimeType() string
func (*AccessSpec) GetReferenceHint ¶
func (s *AccessSpec) GetReferenceHint(cv cpi.ComponentVersionAccess) string
func (*AccessSpec) GlobalAccessSpec ¶ added in v0.3.0
func (s *AccessSpec) GlobalAccessSpec(cpi.Context) cpi.AccessSpec
func (*AccessSpec) Handler ¶
func (s *AccessSpec) Handler() *PluginHandler
type PluginHandler ¶
type PluginHandler struct {
// contains filtered or unexported fields
}
PluginHandler is a shared object between the AccessMethod implementation and the AccessSpec implementation. The object knows the actual plugin and can therefore forward the method calls to corresponding cli commands.
func NewPluginHandler ¶
func NewPluginHandler(p plugin.Plugin) *PluginHandler
func (*PluginHandler) AccessMethod ¶
func (p *PluginHandler) AccessMethod(spec *AccessSpec, cv cpi.ComponentVersionAccess) (cpi.AccessMethod, error)
func (*PluginHandler) Describe ¶
func (p *PluginHandler) Describe(spec *AccessSpec, ctx cpi.Context) string
func (*PluginHandler) GetMimeType ¶
func (p *PluginHandler) GetMimeType(spec *AccessSpec) string
func (*PluginHandler) GetReferenceHint ¶
func (p *PluginHandler) GetReferenceHint(spec *AccessSpec, cv cpi.ComponentVersionAccess) string
func (*PluginHandler) Info ¶
func (p *PluginHandler) Info(spec *AccessSpec) (*ppi.AccessSpecInfo, error)
func (*PluginHandler) Validate ¶
func (p *PluginHandler) Validate(spec *AccessSpec) (*ppi.AccessSpecInfo, error)
Click to show internal directories.
Click to hide internal directories.