Documentation ¶
Overview ¶
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 the Heptio Ark contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func NewLogger() logrus.FieldLogger
- type BackupItemActionGRPCClient
- type BackupItemActionGRPCServer
- type BackupItemActionPlugin
- type BlockStoreGRPCClient
- func (c *BlockStoreGRPCClient) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error)
- func (c *BlockStoreGRPCClient) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)
- func (c *BlockStoreGRPCClient) DeleteSnapshot(snapshotID string) error
- func (c *BlockStoreGRPCClient) GetVolumeID(pv runtime.Unstructured) (string, error)
- func (c *BlockStoreGRPCClient) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
- func (c *BlockStoreGRPCClient) Init(config map[string]string) error
- func (c *BlockStoreGRPCClient) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
- type BlockStoreGRPCServer
- func (s *BlockStoreGRPCServer) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotRequest) (*proto.CreateSnapshotResponse, error)
- func (s *BlockStoreGRPCServer) CreateVolumeFromSnapshot(ctx context.Context, req *proto.CreateVolumeRequest) (*proto.CreateVolumeResponse, error)
- func (s *BlockStoreGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.DeleteSnapshotRequest) (*proto.Empty, error)
- func (s *BlockStoreGRPCServer) GetVolumeID(ctx context.Context, req *proto.GetVolumeIDRequest) (*proto.GetVolumeIDResponse, error)
- func (s *BlockStoreGRPCServer) GetVolumeInfo(ctx context.Context, req *proto.GetVolumeInfoRequest) (*proto.GetVolumeInfoResponse, error)
- func (s *BlockStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.Empty, error)
- func (s *BlockStoreGRPCServer) SetVolumeID(ctx context.Context, req *proto.SetVolumeIDRequest) (*proto.SetVolumeIDResponse, error)
- type BlockStorePlugin
- type ClientDispenser
- type CloseFunc
- type HandlerInitializer
- type Interface
- type Manager
- type ObjectStoreGRPCClient
- func (c *ObjectStoreGRPCClient) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error)
- func (c *ObjectStoreGRPCClient) DeleteObject(bucket, key string) error
- func (c *ObjectStoreGRPCClient) GetObject(bucket, key string) (io.ReadCloser, error)
- func (c *ObjectStoreGRPCClient) Init(config map[string]string) error
- func (c *ObjectStoreGRPCClient) ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)
- func (c *ObjectStoreGRPCClient) ListObjects(bucket, prefix string) ([]string, error)
- func (c *ObjectStoreGRPCClient) PutObject(bucket, key string, body io.Reader) error
- type ObjectStoreGRPCServer
- func (s *ObjectStoreGRPCServer) CreateSignedURL(ctx context.Context, req *proto.CreateSignedURLRequest) (*proto.CreateSignedURLResponse, error)
- func (s *ObjectStoreGRPCServer) DeleteObject(ctx context.Context, req *proto.DeleteObjectRequest) (*proto.Empty, error)
- func (s *ObjectStoreGRPCServer) GetObject(req *proto.GetObjectRequest, stream proto.ObjectStore_GetObjectServer) error
- func (s *ObjectStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.Empty, error)
- func (s *ObjectStoreGRPCServer) ListCommonPrefixes(ctx context.Context, req *proto.ListCommonPrefixesRequest) (*proto.ListCommonPrefixesResponse, error)
- func (s *ObjectStoreGRPCServer) ListObjects(ctx context.Context, req *proto.ListObjectsRequest) (*proto.ListObjectsResponse, error)
- func (s *ObjectStoreGRPCServer) PutObject(stream proto.ObjectStore_PutObjectServer) error
- type ObjectStorePlugin
- type PluginIdentifier
- type PluginKind
- type PluginLister
- type PluginListerGRPCClient
- type PluginListerGRPCServer
- type PluginListerPlugin
- type Process
- type ProcessFactory
- type ReceiveFunc
- type Registry
- type RestartableProcess
- type RestartableProcessFactory
- type RestoreItemActionGRPCClient
- type RestoreItemActionGRPCServer
- type RestoreItemActionPlugin
- type Server
- type StreamReadCloser
Constants ¶
This section is empty.
Variables ¶
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "ARK_PLUGIN",
MagicCookieValue: "hello",
}
Handshake is configuration information that allows go-plugin clients and servers to perform a handshake.
TODO(ncdc): this should probably be a function so it can't be mutated, and we should probably move it to handshake.go.
Functions ¶
func NewLogger ¶
func NewLogger() logrus.FieldLogger
NewLogger returns a logger that is suitable for use within an Velero plugin.
Types ¶
type BackupItemActionGRPCClient ¶
type BackupItemActionGRPCClient struct {
// contains filtered or unexported fields
}
BackupItemActionGRPCClient implements the backup/ItemAction interface and uses a gRPC client to make calls to the plugin server.
func (*BackupItemActionGRPCClient) AppliesTo ¶
func (c *BackupItemActionGRPCClient) AppliesTo() (velerobackup.ResourceSelector, error)
func (*BackupItemActionGRPCClient) Execute ¶
func (c *BackupItemActionGRPCClient) Execute(item runtime.Unstructured, backup *api.Backup) (runtime.Unstructured, []velerobackup.ResourceIdentifier, error)
type BackupItemActionGRPCServer ¶
type BackupItemActionGRPCServer struct {
// contains filtered or unexported fields
}
BackupItemActionGRPCServer implements the proto-generated BackupItemActionServer interface, and accepts gRPC calls and forwards them to an implementation of the pluggable interface.
func (*BackupItemActionGRPCServer) AppliesTo ¶
func (s *BackupItemActionGRPCServer) AppliesTo(ctx context.Context, req *proto.AppliesToRequest) (*proto.AppliesToResponse, error)
func (*BackupItemActionGRPCServer) Execute ¶
func (s *BackupItemActionGRPCServer) Execute(ctx context.Context, req *proto.ExecuteRequest) (*proto.ExecuteResponse, error)
type BackupItemActionPlugin ¶
type BackupItemActionPlugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
BackupItemActionPlugin is an implementation of go-plugin's Plugin interface with support for gRPC for the backup/ItemAction interface.
func NewBackupItemActionPlugin ¶
func NewBackupItemActionPlugin(options ...pluginOption) *BackupItemActionPlugin
NewBackupItemActionPlugin constructs a BackupItemActionPlugin.
func (*BackupItemActionPlugin) GRPCClient ¶
func (p *BackupItemActionPlugin) GRPCClient(c *grpc.ClientConn) (interface{}, error)
GRPCClient returns a clientDispenser for BackupItemAction gRPC clients.
func (*BackupItemActionPlugin) GRPCServer ¶
func (p *BackupItemActionPlugin) GRPCServer(s *grpc.Server) error
GRPCServer registers a BackupItemAction gRPC server.
type BlockStoreGRPCClient ¶
type BlockStoreGRPCClient struct {
// contains filtered or unexported fields
}
BlockStoreGRPCClient implements the cloudprovider.BlockStore interface and uses a gRPC client to make calls to the plugin server.
func (*BlockStoreGRPCClient) CreateSnapshot ¶
func (c *BlockStoreGRPCClient) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error)
CreateSnapshot creates a snapshot of the specified block volume, and applies the provided set of tags to the snapshot.
func (*BlockStoreGRPCClient) CreateVolumeFromSnapshot ¶
func (c *BlockStoreGRPCClient) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)
CreateVolumeFromSnapshot creates a new block volume, initialized from the provided snapshot, and with the specified type and IOPS (if using provisioned IOPS).
func (*BlockStoreGRPCClient) DeleteSnapshot ¶
func (c *BlockStoreGRPCClient) DeleteSnapshot(snapshotID string) error
DeleteSnapshot deletes the specified volume snapshot.
func (*BlockStoreGRPCClient) GetVolumeID ¶
func (c *BlockStoreGRPCClient) GetVolumeID(pv runtime.Unstructured) (string, error)
func (*BlockStoreGRPCClient) GetVolumeInfo ¶
func (c *BlockStoreGRPCClient) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for a specified block volume.
func (*BlockStoreGRPCClient) Init ¶
func (c *BlockStoreGRPCClient) Init(config map[string]string) error
Init prepares the BlockStore for usage using the provided map of configuration key-value pairs. It returns an error if the BlockStore cannot be initialized from the provided config.
func (*BlockStoreGRPCClient) SetVolumeID ¶
func (c *BlockStoreGRPCClient) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
type BlockStoreGRPCServer ¶
type BlockStoreGRPCServer struct {
// contains filtered or unexported fields
}
BlockStoreGRPCServer implements the proto-generated BlockStoreServer interface, and accepts gRPC calls and forwards them to an implementation of the pluggable interface.
func (*BlockStoreGRPCServer) CreateSnapshot ¶
func (s *BlockStoreGRPCServer) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotRequest) (*proto.CreateSnapshotResponse, error)
CreateSnapshot creates a snapshot of the specified block volume, and applies the provided set of tags to the snapshot.
func (*BlockStoreGRPCServer) CreateVolumeFromSnapshot ¶
func (s *BlockStoreGRPCServer) CreateVolumeFromSnapshot(ctx context.Context, req *proto.CreateVolumeRequest) (*proto.CreateVolumeResponse, error)
CreateVolumeFromSnapshot creates a new block volume, initialized from the provided snapshot, and with the specified type and IOPS (if using provisioned IOPS).
func (*BlockStoreGRPCServer) DeleteSnapshot ¶
func (s *BlockStoreGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.DeleteSnapshotRequest) (*proto.Empty, error)
DeleteSnapshot deletes the specified volume snapshot.
func (*BlockStoreGRPCServer) GetVolumeID ¶
func (s *BlockStoreGRPCServer) GetVolumeID(ctx context.Context, req *proto.GetVolumeIDRequest) (*proto.GetVolumeIDResponse, error)
func (*BlockStoreGRPCServer) GetVolumeInfo ¶
func (s *BlockStoreGRPCServer) GetVolumeInfo(ctx context.Context, req *proto.GetVolumeInfoRequest) (*proto.GetVolumeInfoResponse, error)
GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for a specified block volume.
func (*BlockStoreGRPCServer) Init ¶
func (s *BlockStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.Empty, error)
Init prepares the BlockStore for usage using the provided map of configuration key-value pairs. It returns an error if the BlockStore cannot be initialized from the provided config.
func (*BlockStoreGRPCServer) SetVolumeID ¶
func (s *BlockStoreGRPCServer) SetVolumeID(ctx context.Context, req *proto.SetVolumeIDRequest) (*proto.SetVolumeIDResponse, error)
type BlockStorePlugin ¶
type BlockStorePlugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
BlockStorePlugin is an implementation of go-plugin's Plugin interface with support for gRPC for the cloudprovider/BlockStore interface.
func NewBlockStorePlugin ¶
func NewBlockStorePlugin(options ...pluginOption) *BlockStorePlugin
NewBlockStorePlugin constructs a BlockStorePlugin.
func (*BlockStorePlugin) GRPCClient ¶
func (p *BlockStorePlugin) GRPCClient(c *grpc.ClientConn) (interface{}, error)
GRPCClient returns a BlockStore gRPC client.
func (*BlockStorePlugin) GRPCServer ¶
func (p *BlockStorePlugin) GRPCServer(s *grpc.Server) error
GRPCServer registers a BlockStore gRPC server.
type ClientDispenser ¶ added in v0.10.0
type ClientDispenser interface {
// contains filtered or unexported methods
}
type CloseFunc ¶
type CloseFunc func() error
CloseFunc is used to signal to the source of data that the StreamReadCloser has been closed.
type HandlerInitializer ¶ added in v0.10.0
type HandlerInitializer func(logger logrus.FieldLogger) (interface{}, error)
HandlerInitializer is a function that initializes and returns a new instance of one of Velero's plugin interfaces (ObjectStore, BlockStore, BackupItemAction, RestoreItemAction).
type Manager ¶
type Manager interface { // GetObjectStore returns the ObjectStore plugin for name. GetObjectStore(name string) (cloudprovider.ObjectStore, error) // GetBlockStore returns the BlockStore plugin for name. GetBlockStore(name string) (cloudprovider.BlockStore, error) // GetBackupItemActions returns all backup item action plugins. GetBackupItemActions() ([]backup.ItemAction, error) // GetBackupItemAction returns the backup item action plugin for name. GetBackupItemAction(name string) (backup.ItemAction, error) // GetRestoreItemActions returns all restore item action plugins. GetRestoreItemActions() ([]restore.ItemAction, error) // GetRestoreItemAction returns the restore item action plugin for name. GetRestoreItemAction(name string) (restore.ItemAction, error) // CleanupClients terminates all of the Manager's running plugin processes. CleanupClients() }
Manager manages the lifecycles of plugins.
func NewManager ¶
NewManager constructs a manager for getting plugins.
type ObjectStoreGRPCClient ¶
type ObjectStoreGRPCClient struct {
// contains filtered or unexported fields
}
ObjectStoreGRPCClient implements the cloudprovider.ObjectStore interface and uses a gRPC client to make calls to the plugin server.
func (*ObjectStoreGRPCClient) CreateSignedURL ¶
func (c *ObjectStoreGRPCClient) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error)
CreateSignedURL creates a pre-signed URL for the given bucket and key that expires after ttl.
func (*ObjectStoreGRPCClient) DeleteObject ¶
func (c *ObjectStoreGRPCClient) DeleteObject(bucket, key string) error
DeleteObject removes object with the specified key from the given bucket.
func (*ObjectStoreGRPCClient) GetObject ¶
func (c *ObjectStoreGRPCClient) GetObject(bucket, key string) (io.ReadCloser, error)
GetObject retrieves the object with the given key from the specified bucket in object storage.
func (*ObjectStoreGRPCClient) Init ¶
func (c *ObjectStoreGRPCClient) Init(config map[string]string) error
Init prepares the ObjectStore for usage using the provided map of configuration key-value pairs. It returns an error if the ObjectStore cannot be initialized from the provided config.
func (*ObjectStoreGRPCClient) ListCommonPrefixes ¶
func (c *ObjectStoreGRPCClient) ListCommonPrefixes(bucket, prefix, delimiter string) ([]string, error)
ListCommonPrefixes gets a list of all object key prefixes that come after the provided prefix and before the provided delimiter (this is often used to simulate a directory hierarchy in object storage).
func (*ObjectStoreGRPCClient) ListObjects ¶
func (c *ObjectStoreGRPCClient) ListObjects(bucket, prefix string) ([]string, error)
ListObjects gets a list of all objects in bucket that have the same prefix.
type ObjectStoreGRPCServer ¶
type ObjectStoreGRPCServer struct {
// contains filtered or unexported fields
}
ObjectStoreGRPCServer implements the proto-generated ObjectStoreServer interface, and accepts gRPC calls and forwards them to an implementation of the pluggable interface.
func (*ObjectStoreGRPCServer) CreateSignedURL ¶
func (s *ObjectStoreGRPCServer) CreateSignedURL(ctx context.Context, req *proto.CreateSignedURLRequest) (*proto.CreateSignedURLResponse, error)
CreateSignedURL creates a pre-signed URL for the given bucket and key that expires after ttl.
func (*ObjectStoreGRPCServer) DeleteObject ¶
func (s *ObjectStoreGRPCServer) DeleteObject(ctx context.Context, req *proto.DeleteObjectRequest) (*proto.Empty, error)
DeleteObject removes object with the specified key from the given bucket.
func (*ObjectStoreGRPCServer) GetObject ¶
func (s *ObjectStoreGRPCServer) GetObject(req *proto.GetObjectRequest, stream proto.ObjectStore_GetObjectServer) error
GetObject retrieves the object with the given key from the specified bucket in object storage.
func (*ObjectStoreGRPCServer) Init ¶
func (s *ObjectStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (*proto.Empty, error)
Init prepares the ObjectStore for usage using the provided map of configuration key-value pairs. It returns an error if the ObjectStore cannot be initialized from the provided config.
func (*ObjectStoreGRPCServer) ListCommonPrefixes ¶
func (s *ObjectStoreGRPCServer) ListCommonPrefixes(ctx context.Context, req *proto.ListCommonPrefixesRequest) (*proto.ListCommonPrefixesResponse, error)
ListCommonPrefixes gets a list of all object key prefixes that start with the specified prefix and stop at the next instance of the provided delimiter (this is often used to simulate a directory hierarchy in object storage).
func (*ObjectStoreGRPCServer) ListObjects ¶
func (s *ObjectStoreGRPCServer) ListObjects(ctx context.Context, req *proto.ListObjectsRequest) (*proto.ListObjectsResponse, error)
ListObjects gets a list of all objects in bucket that have the same prefix.
func (*ObjectStoreGRPCServer) PutObject ¶
func (s *ObjectStoreGRPCServer) PutObject(stream proto.ObjectStore_PutObjectServer) error
PutObject creates a new object using the data in body within the specified object storage bucket with the given key.
type ObjectStorePlugin ¶
type ObjectStorePlugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
ObjectStorePlugin is an implementation of go-plugin's Plugin interface with support for gRPC for the cloudprovider/ObjectStore interface.
func NewObjectStorePlugin ¶
func NewObjectStorePlugin(options ...pluginOption) *ObjectStorePlugin
NewObjectStorePlugin construct an ObjectStorePlugin.
func (*ObjectStorePlugin) GRPCClient ¶
func (p *ObjectStorePlugin) GRPCClient(c *grpc.ClientConn) (interface{}, error)
GRPCClient returns an ObjectStore gRPC client.
func (*ObjectStorePlugin) GRPCServer ¶
func (p *ObjectStorePlugin) GRPCServer(s *grpc.Server) error
GRPCServer registers an ObjectStore gRPC server.
type PluginIdentifier ¶ added in v0.10.0
type PluginIdentifier struct { Command string Kind PluginKind Name string }
PluginIdenitifer uniquely identifies a plugin by command, kind, and name.
type PluginKind ¶
type PluginKind string
PluginKind is a type alias for a string that describes the kind of a Velero-supported plugin.
const ( // PluginKindObjectStore represents an object store plugin. PluginKindObjectStore PluginKind = "ObjectStore" // PluginKindBlockStore represents a block store plugin. PluginKindBlockStore PluginKind = "BlockStore" // PluginKindBackupItemAction represents a backup item action plugin. PluginKindBackupItemAction PluginKind = "BackupItemAction" // PluginKindRestoreItemAction represents a restore item action plugin. PluginKindRestoreItemAction PluginKind = "RestoreItemAction" // PluginKindPluginLister represents a plugin lister plugin. PluginKindPluginLister PluginKind = "PluginLister" )
type PluginLister ¶ added in v0.10.0
type PluginLister interface {
ListPlugins() ([]PluginIdentifier, error)
}
PluginLister lists plugins.
func NewPluginLister ¶ added in v0.10.0
func NewPluginLister(plugins ...PluginIdentifier) PluginLister
NewPluginLister returns a new PluginLister for plugins.
type PluginListerGRPCClient ¶ added in v0.10.0
type PluginListerGRPCClient struct {
// contains filtered or unexported fields
}
PluginListerGRPCClient implements PluginLister and uses a gRPC client to make calls to the plugin server.
func (*PluginListerGRPCClient) ListPlugins ¶ added in v0.10.0
func (c *PluginListerGRPCClient) ListPlugins() ([]PluginIdentifier, error)
ListPlugins uses the gRPC client to request the list of plugins from the server. It translates the protobuf response to []PluginIdentifier.
type PluginListerGRPCServer ¶ added in v0.10.0
type PluginListerGRPCServer struct {
// contains filtered or unexported fields
}
PluginListerGRPCServer implements the proto-generated PluginLister gRPC service interface. It accepts gRPC calls, forwards them to impl, and translates the responses to protobuf.
func (*PluginListerGRPCServer) ListPlugins ¶ added in v0.10.0
func (s *PluginListerGRPCServer) ListPlugins(ctx context.Context, req *proto.Empty) (*proto.ListPluginsResponse, error)
ListPlugins returns a list of registered plugins, delegating to s.impl to perform the listing.
type PluginListerPlugin ¶ added in v0.10.0
type PluginListerPlugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
PluginListerPlugin is a go-plugin Plugin for a PluginLister.
func NewPluginListerPlugin ¶ added in v0.10.0
func NewPluginListerPlugin(impl PluginLister) *PluginListerPlugin
NewPluginListerPlugin creates a new PluginListerPlugin with impl as the server-side implementation.
func (*PluginListerPlugin) GRPCClient ¶ added in v0.10.0
func (p *PluginListerPlugin) GRPCClient(c *grpc.ClientConn) (interface{}, error)
GRPCClient returns a PluginLister gRPC client.
func (*PluginListerPlugin) GRPCServer ¶ added in v0.10.0
func (p *PluginListerPlugin) GRPCServer(s *grpc.Server) error
GRPCServer registers a PluginLister gRPC server.
type Process ¶ added in v0.10.0
type Process interface {
// contains filtered or unexported methods
}
type ProcessFactory ¶ added in v0.10.0
type ProcessFactory interface {
// contains filtered or unexported methods
}
type ReceiveFunc ¶
ReceiveFunc is a function that either returns a slice of an arbitrary number of bytes OR an error. Returning an io.EOF means there is no more data to be read; any other error is considered an actual error.
type Registry ¶ added in v0.10.0
type Registry interface { // DiscoverPlugins discovers all available plugins. DiscoverPlugins() error // List returns all PluginIdentifiers for kind. List(kind PluginKind) []PluginIdentifier // Get returns the PluginIdentifier for kind and name. Get(kind PluginKind, name string) (PluginIdentifier, error) }
Registry manages information about available plugins.
func NewRegistry ¶ added in v0.10.0
NewRegistry returns a new registry.
type RestartableProcess ¶ added in v0.10.0
type RestartableProcess interface {
// contains filtered or unexported methods
}
type RestartableProcessFactory ¶ added in v0.10.0
type RestartableProcessFactory interface {
// contains filtered or unexported methods
}
type RestoreItemActionGRPCClient ¶
type RestoreItemActionGRPCClient struct {
// contains filtered or unexported fields
}
RestoreItemActionGRPCClient implements the backup/ItemAction interface and uses a gRPC client to make calls to the plugin server.
func (*RestoreItemActionGRPCClient) AppliesTo ¶
func (c *RestoreItemActionGRPCClient) AppliesTo() (restore.ResourceSelector, error)
func (*RestoreItemActionGRPCClient) Execute ¶
func (c *RestoreItemActionGRPCClient) Execute(item runtime.Unstructured, restore *api.Restore) (runtime.Unstructured, error, error)
type RestoreItemActionGRPCServer ¶
type RestoreItemActionGRPCServer struct {
// contains filtered or unexported fields
}
RestoreItemActionGRPCServer implements the proto-generated RestoreItemActionServer interface, and accepts gRPC calls and forwards them to an implementation of the pluggable interface.
func (*RestoreItemActionGRPCServer) AppliesTo ¶
func (s *RestoreItemActionGRPCServer) AppliesTo(ctx context.Context, req *proto.AppliesToRequest) (*proto.AppliesToResponse, error)
func (*RestoreItemActionGRPCServer) Execute ¶
func (s *RestoreItemActionGRPCServer) Execute(ctx context.Context, req *proto.RestoreExecuteRequest) (*proto.RestoreExecuteResponse, error)
type RestoreItemActionPlugin ¶
type RestoreItemActionPlugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
RestoreItemActionPlugin is an implementation of go-plugin's Plugin interface with support for gRPC for the restore/ItemAction interface.
func NewRestoreItemActionPlugin ¶
func NewRestoreItemActionPlugin(options ...pluginOption) *RestoreItemActionPlugin
NewRestoreItemActionPlugin constructs a RestoreItemActionPlugin.
func (*RestoreItemActionPlugin) GRPCClient ¶
func (p *RestoreItemActionPlugin) GRPCClient(c *grpc.ClientConn) (interface{}, error)
GRPCClient returns a RestoreItemAction gRPC client.
func (*RestoreItemActionPlugin) GRPCServer ¶
func (p *RestoreItemActionPlugin) GRPCServer(s *grpc.Server) error
GRPCServer registers a RestoreItemAction gRPC server.
type Server ¶ added in v0.10.0
type Server interface { // RegisterBackupItemAction registers a backup item action. RegisterBackupItemAction(name string, initializer HandlerInitializer) Server // RegisterBackupItemActions registers multiple backup item actions. RegisterBackupItemActions(map[string]HandlerInitializer) Server // RegisterBlockStore registers a block store. RegisterBlockStore(name string, initializer HandlerInitializer) Server // RegisterBlockStores registers multiple block stores. RegisterBlockStores(map[string]HandlerInitializer) Server // RegisterObjectStore registers an object store. RegisterObjectStore(name string, initializer HandlerInitializer) Server // RegisterObjectStores registers multiple object stores. RegisterObjectStores(map[string]HandlerInitializer) Server // RegisterRestoreItemAction registers a restore item action. RegisterRestoreItemAction(name string, initializer HandlerInitializer) Server // RegisterRestoreItemActions registers multiple restore item actions. RegisterRestoreItemActions(map[string]HandlerInitializer) Server // Server runs the plugin server. Serve() }
Server serves registered plugin implementations.
func NewServer ¶ added in v0.10.0
func NewServer(log logrus.FieldLogger) Server
NewServer returns a new Server
type StreamReadCloser ¶
type StreamReadCloser struct {
// contains filtered or unexported fields
}
StreamReadCloser wraps a ReceiveFunc and a CloseSendFunc to implement io.ReadCloser.
func (*StreamReadCloser) Close ¶
func (s *StreamReadCloser) Close() error
Source Files ¶
- backup_item_action.go
- block_store.go
- client_builder.go
- client_dispenser.go
- interface.go
- logger.go
- logrus_adapter.go
- manager.go
- object_store.go
- plugin_base.go
- plugin_kinds.go
- plugin_lister.go
- process.go
- registry.go
- restartable_backup_item_action.go
- restartable_block_store.go
- restartable_object_store.go
- restartable_process.go
- restartable_restore_item_action.go
- restore_item_action.go
- server.go
- server_mux.go
- stream_reader.go