Documentation ¶
Overview ¶
Package ppi provides the plugin programming interface. The ppi can be used by plugin developers as support. It reduces the command line interface to a corresponding Go interface. In other words, if the developer implements this Go plugin interface, the ppi automatically provides a corresponding command line interface.
Index ¶
- Variables
- type AccessMethod
- type AccessMethodBase
- type AccessMethodDescriptor
- type AccessSpec
- type AccessSpecInfo
- type AccessSpecProvider
- type Action
- type ActionResult
- type ActionSpec
- type ActionSpecInfo
- type CLIOption
- type Config
- type ContentVersionIdentityProvider
- type Descriptor
- type DownloadResultProvider
- type Downloader
- type DownloaderDescriptor
- type DownloaderKey
- type Options
- type Plugin
- type UploadFormats
- type UploadTargetSpec
- type UploadTargetSpecInfo
- type Uploader
- type UploaderBase
- type UploaderDescriptor
- type UploaderKey
- type Value
- type ValueMergeData
- type ValueMergeHandler
- type ValueMergeResult
- type ValueSet
- type ValueSetBase
- type ValueSetInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var REALM = descriptor.REALM
Functions ¶
This section is empty.
Types ¶
type AccessMethod ¶
type AccessMethod interface { runtime.TypedObjectDecoder[AccessSpec] Name() string Version() string // Options provides the list of CLI options supported to compose the access // specification. Options() []options.OptionType // Description provides a general description for the access mehod kind. Description() string // Format describes the attributes of the dedicated version. Format() string ValidateSpecification(p Plugin, spec AccessSpec) (info *AccessSpecInfo, err error) Reader(p Plugin, spec AccessSpec, creds credentials.Credentials) (io.ReadCloser, error) ComposeAccessSpecification(p Plugin, opts Config, config Config) error }
type AccessMethodBase ¶
type AccessMethodBase struct {
// contains filtered or unexported fields
}
func MustNewAccessMethodBase ¶
func MustNewAccessMethodBase(name, version string, proto AccessSpec, desc string, format string) AccessMethodBase
func (*AccessMethodBase) Description ¶
func (b *AccessMethodBase) Description() string
func (*AccessMethodBase) Format ¶
func (b *AccessMethodBase) Format() string
func (*AccessMethodBase) Version ¶
func (b *AccessMethodBase) Version() string
type AccessMethodDescriptor ¶
type AccessMethodDescriptor = descriptor.AccessMethodDescriptor
type AccessSpec ¶
type AccessSpec = runtime.TypedObject
type AccessSpecInfo ¶
type AccessSpecInfo = internal.AccessSpecInfo
type AccessSpecProvider ¶
type AccessSpecProvider func() AccessSpec
type Action ¶
type Action interface { Name() string Description() string DefaultSelectors() []string ConsumerType() string Execute(p Plugin, spec ActionSpec, creds credentials.DirectCredentials) (result ActionResult, err error) }
type ActionResult ¶
type ActionResult = action.ActionResult
type ActionSpec ¶
type ActionSpec = action.ActionSpec
type ActionSpecInfo ¶
type ActionSpecInfo = internal.ActionSpecInfo
type CLIOption ¶
type CLIOption = descriptor.CLIOption
type Config ¶
type Config map[string]interface{}
Config is a generic structured config stored in a string map.
func (Config) ConvertFor ¶
func (c Config) ConvertFor(list ...options.OptionType) error
type ContentVersionIdentityProvider ¶
type ContentVersionIdentityProvider interface {
GetInexpensiveContentVersionIdentity(p Plugin, spec AccessSpec, creds credentials.Credentials) (string, error)
}
ContentVersionIdentityProvider is an optional interface an AccessMethod may additionally implement to provide an inexpensive content version identity which might be derived from the access specification with cheap operations on the storage backend.
type Descriptor ¶
type Descriptor = descriptor.Descriptor
type DownloadResultProvider ¶
type Downloader ¶
type DownloaderDescriptor ¶
type DownloaderDescriptor = descriptor.DownloaderDescriptor
type DownloaderKey ¶
type DownloaderKey = descriptor.DownloaderKey
type Options ¶
type Options struct {
Config json.RawMessage
}
type Plugin ¶
type Plugin interface { Name() string Version() string Descriptor() descriptor.Descriptor SetDescriptorTweaker(func(descriptor descriptor.Descriptor) descriptor.Descriptor) SetShort(s string) SetLong(s string) SetConfigParser(config func(raw json.RawMessage) (interface{}, error)) RegisterDownloader(arttype, mediatype string, u Downloader) error GetDownloader(name string) Downloader GetDownloaderFor(arttype, mediatype string) Downloader RegisterUploader(arttype, mediatype string, u Uploader) error GetUploader(name string) Uploader GetUploaderFor(arttype, mediatype string) Uploader DecodeUploadTargetSpecification(data []byte) (UploadTargetSpec, error) RegisterAccessMethod(m AccessMethod) error DecodeAccessSpecification(data []byte) (AccessSpec, error) GetAccessMethod(name string, version string) AccessMethod RegisterAction(a Action) error DecodeAction(data []byte) (ActionSpec, error) GetAction(name string) Action RegisterValueMergeHandler(h ValueMergeHandler) error GetValueMergeHandler(name string) ValueMergeHandler RegisterValueSet(h ValueSet) error DecodeValueSet(purpose string, data []byte) (runtime.TypedObject, error) GetValueSet(purpose, name, version string) ValueSet GetOptions() *Options GetConfig() (interface{}, error) }
type UploadFormats ¶
type UploadFormats runtime.KnownTypes[runtime.TypedObject, runtime.TypedObjectDecoder[runtime.TypedObject]]
type UploadTargetSpec ¶
type UploadTargetSpec = runtime.TypedObject
type UploadTargetSpecInfo ¶
type UploadTargetSpecInfo = internal.UploadTargetSpecInfo
type Uploader ¶
type Uploader interface { Decoders() UploadFormats Name() string Description() string ValidateSpecification(p Plugin, spec UploadTargetSpec) (info *UploadTargetSpecInfo, err error) Writer(p Plugin, arttype, mediatype string, hint string, spec UploadTargetSpec, creds credentials.Credentials) (io.WriteCloser, AccessSpecProvider, error) }
type UploaderBase ¶
type UploaderBase = nameDescription
func MustNewUploaderBase ¶
func MustNewUploaderBase(name, desc string) UploaderBase
type UploaderDescriptor ¶
type UploaderDescriptor = descriptor.UploaderDescriptor
type UploaderKey ¶
type UploaderKey = descriptor.UploaderKey
type ValueMergeData ¶
type ValueMergeHandler ¶
type ValueMergeHandler interface { Name() string Description() string Execute(p Plugin, local Value, inbound Value, config json.RawMessage) (result ValueMergeResult, err error) }
type ValueMergeResult ¶
type ValueSet ¶
type ValueSet interface { runtime.TypedObjectDecoder[AccessSpec] Name() string Version() string // Purposes describes the purposes the set should be ued for. // So far, only the purpose PURPOSE_ROUTINGSLIP is defined. Purposes() []string // Options provides the list of CLI options supported to compose the access // specification. Options() []options.OptionType // Description provides a general description for the access mehod kind. Description() string // Format describes the attributes of the dedicated version. Format() string ValidateSpecification(p Plugin, spec runtime.TypedObject) (info *ValueSetInfo, err error) ComposeSpecification(p Plugin, opts Config, config Config) error }
type ValueSetBase ¶
type ValueSetBase struct {
// contains filtered or unexported fields
}
func MustNewValueSetBase ¶
func MustNewValueSetBase(name, version string, proto runtime.TypedObject, purposes []string, desc string, format string) ValueSetBase
func (*ValueSetBase) Description ¶
func (b *ValueSetBase) Description() string
func (*ValueSetBase) Format ¶
func (b *ValueSetBase) Format() string
func (*ValueSetBase) Purposes ¶
func (b *ValueSetBase) Purposes() []string
func (*ValueSetBase) Version ¶
func (b *ValueSetBase) Version() string
type ValueSetInfo ¶
type ValueSetInfo = internal.ValueSetInfo
Click to show internal directories.
Click to hide internal directories.