Documentation ¶
Index ¶
- Constants
- Variables
- func NewBackend(ctx context.Context, pluginName string, pluginType consts.PluginType, ...) (logical.Backend, error)
- func NewPluginClient(ctx context.Context, sys pluginutil.RunnerUtil, ...) (logical.Backend, error)
- func Serve(opts *ServeOpts) error
- type BackendPlugin
- type BackendPluginClient
- type CachingDisabledReply
- type DefaultLeaseTTLReply
- type EntityInfoArgs
- type EntityInfoReply
- type GRPCBackendPlugin
- type GRPCStorageClient
- func (s *GRPCStorageClient) Delete(ctx context.Context, key string) error
- func (s *GRPCStorageClient) Get(ctx context.Context, key string) (*logical.StorageEntry, error)
- func (s *GRPCStorageClient) List(ctx context.Context, prefix string) ([]string, error)
- func (s *GRPCStorageClient) Put(ctx context.Context, entry *logical.StorageEntry) error
- type GRPCStorageServer
- func (s *GRPCStorageServer) Delete(ctx context.Context, args *pb.StorageDeleteArgs) (*pb.StorageDeleteReply, error)
- func (s *GRPCStorageServer) Get(ctx context.Context, args *pb.StorageGetArgs) (*pb.StorageGetReply, error)
- func (s *GRPCStorageServer) List(ctx context.Context, args *pb.StorageListArgs) (*pb.StorageListReply, error)
- func (s *GRPCStorageServer) Put(ctx context.Context, args *pb.StoragePutArgs) (*pb.StoragePutReply, error)
- type HandleExistenceCheckArgs
- type HandleExistenceCheckReply
- type HandleRequestArgs
- type HandleRequestReply
- type LocalMountReply
- type LoggerArgs
- type LoggerReply
- type LoggerServer
- func (l *LoggerServer) Debug(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) Error(args *LoggerArgs, reply *LoggerReply) error
- func (l *LoggerServer) Info(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) IsDebug(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsInfo(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsTrace(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) IsWarn(args interface{}, reply *LoggerReply) error
- func (l *LoggerServer) Log(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) SetLevel(args int, _ *struct{}) error
- func (l *LoggerServer) Trace(args *LoggerArgs, _ *struct{}) error
- func (l *LoggerServer) Warn(args *LoggerArgs, reply *LoggerReply) error
- type MaxLeaseTTLReply
- type MlockEnabledReply
- type NOOPStorage
- func (s *NOOPStorage) Delete(_ context.Context, key string) error
- func (s *NOOPStorage) Get(_ context.Context, key string) (*logical.StorageEntry, error)
- func (s *NOOPStorage) List(_ context.Context, prefix string) ([]string, error)
- func (s *NOOPStorage) Put(_ context.Context, entry *logical.StorageEntry) error
- type PluginEnvReply
- type ReplicationStateReply
- type ResponseWrapDataArgs
- type ResponseWrapDataReply
- type ServeOpts
- type SetupArgs
- type SetupReply
- type SpecialPathsReply
- type StorageClient
- func (s *StorageClient) Delete(_ context.Context, key string) error
- func (s *StorageClient) Get(_ context.Context, key string) (*logical.StorageEntry, error)
- func (s *StorageClient) List(_ context.Context, prefix string) ([]string, error)
- func (s *StorageClient) Put(_ context.Context, entry *logical.StorageEntry) error
- type StorageDeleteReply
- type StorageGetReply
- type StorageListReply
- type StoragePutReply
- type StorageServer
- func (s *StorageServer) Delete(key string, reply *StorageDeleteReply) error
- func (s *StorageServer) Get(key string, reply *StorageGetReply) error
- func (s *StorageServer) List(prefix string, reply *StorageListReply) error
- func (s *StorageServer) Put(entry *logical.StorageEntry, reply *StoragePutReply) error
- type SudoPrivilegeArgs
- type SudoPrivilegeReply
- type SystemReply
- type SystemViewClient
- func (s *SystemViewClient) CachingDisabled() bool
- func (s *SystemViewClient) DefaultLeaseTTL() time.Duration
- func (s *SystemViewClient) EntityInfo(entityID string) (*logical.Entity, error)
- func (s *SystemViewClient) HasFeature(feature license.Features) bool
- func (s *SystemViewClient) LocalMount() bool
- func (s *SystemViewClient) LookupPlugin(_ context.Context, _ string, _ consts.PluginType) (*pluginutil.PluginRunner, error)
- func (s *SystemViewClient) MaxLeaseTTL() time.Duration
- func (s *SystemViewClient) MlockEnabled() bool
- func (s *SystemViewClient) PluginEnv(_ context.Context) (*logical.PluginEnvironment, error)
- func (s *SystemViewClient) ReplicationState() consts.ReplicationState
- func (s *SystemViewClient) ResponseWrapData(ctx context.Context, data map[string]interface{}, ttl time.Duration, jwt bool) (*wrapping.ResponseWrapInfo, error)
- func (s *SystemViewClient) SudoPrivilege(ctx context.Context, path string, token string) bool
- func (s *SystemViewClient) Tainted() bool
- type SystemViewServer
- func (s *SystemViewServer) CachingDisabled(_ interface{}, reply *CachingDisabledReply) error
- func (s *SystemViewServer) DefaultLeaseTTL(_ interface{}, reply *DefaultLeaseTTLReply) error
- func (s *SystemViewServer) EntityInfo(args *EntityInfoArgs, reply *EntityInfoReply) error
- func (s *SystemViewServer) LocalMount(_ interface{}, reply *LocalMountReply) error
- func (s *SystemViewServer) MaxLeaseTTL(_ interface{}, reply *MaxLeaseTTLReply) error
- func (s *SystemViewServer) MlockEnabled(_ interface{}, reply *MlockEnabledReply) error
- func (s *SystemViewServer) PluginEnv(_ interface{}, reply *PluginEnvReply) error
- func (s *SystemViewServer) ReplicationState(_ interface{}, reply *ReplicationStateReply) error
- func (s *SystemViewServer) ResponseWrapData(args *ResponseWrapDataArgs, reply *ResponseWrapDataReply) error
- func (s *SystemViewServer) SudoPrivilege(args *SudoPrivilegeArgs, reply *SudoPrivilegeReply) error
- func (s *SystemViewServer) Tainted(_ interface{}, reply *TaintedReply) error
- type TLSProviderFunc
- type TaintedReply
- type TypeReply
Constants ¶
const BackendPluginName = "backend"
BackendPluginName is the name of the plugin that can be dispensed from the plugin server.
Variables ¶
var (
ErrClientInMetadataMode = errors.New("plugin client can not perform action while in metadata mode")
)
var ErrPluginShutdown = errors.New("plugin is shut down")
var (
ErrServerInMetadataMode = errors.New("plugin server can not perform action while in metadata mode")
)
Functions ¶
func NewBackend ¶
func NewBackend(ctx context.Context, pluginName string, pluginType consts.PluginType, sys pluginutil.LookRunnerUtil, conf *logical.BackendConfig, isMetadataMode bool) (logical.Backend, error)
NewBackend will return an instance of an RPC-based client implementation of the backend for external plugins, or a concrete implementation of the backend if it is a builtin backend. The backend is returned as a logical.Backend interface. The isMetadataMode param determines whether the plugin should run in metadata mode.
func NewPluginClient ¶
func NewPluginClient(ctx context.Context, sys pluginutil.RunnerUtil, pluginRunner *pluginutil.PluginRunner, logger log.Logger, isMetadataMode bool) (logical.Backend, error)
Types ¶
type BackendPlugin ¶
type BackendPlugin struct {
*GRPCBackendPlugin
}
BackendPlugin is the plugin.Plugin implementation
type BackendPluginClient ¶
type BackendPluginClient struct { sync.Mutex logical.Backend // contains filtered or unexported fields }
BackendPluginClient is a wrapper around backendPluginClient that also contains its plugin.Client instance. It's primarily used to cleanly kill the client on Cleanup()
func (*BackendPluginClient) Cleanup ¶
func (b *BackendPluginClient) Cleanup(ctx context.Context)
Cleanup calls the RPC client's Cleanup() func and also calls the go-plugin's client Kill() func
type CachingDisabledReply ¶
type CachingDisabledReply struct {
CachingDisabled bool
}
type DefaultLeaseTTLReply ¶
type EntityInfoArgs ¶
type EntityInfoArgs struct {
EntityID string
}
type EntityInfoReply ¶
type GRPCBackendPlugin ¶
type GRPCBackendPlugin struct { Factory logical.Factory MetadataMode bool Logger log.Logger // Embeding this will disable the netRPC protocol plugin.NetRPCUnsupportedPlugin }
GRPCBackendPlugin is the plugin.Plugin implementation that only supports GRPC transport
func (*GRPCBackendPlugin) GRPCClient ¶
func (b *GRPCBackendPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (GRPCBackendPlugin) GRPCServer ¶
func (b GRPCBackendPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCStorageClient ¶
type GRPCStorageClient struct {
// contains filtered or unexported fields
}
GRPCStorageClient is an implementation of logical.Storage that communicates over RPC.
func (*GRPCStorageClient) Delete ¶
func (s *GRPCStorageClient) Delete(ctx context.Context, key string) error
func (*GRPCStorageClient) Get ¶
func (s *GRPCStorageClient) Get(ctx context.Context, key string) (*logical.StorageEntry, error)
func (*GRPCStorageClient) Put ¶
func (s *GRPCStorageClient) Put(ctx context.Context, entry *logical.StorageEntry) error
type GRPCStorageServer ¶
type GRPCStorageServer struct {
// contains filtered or unexported fields
}
StorageServer is a net/rpc compatible structure for serving
func (*GRPCStorageServer) Delete ¶
func (s *GRPCStorageServer) Delete(ctx context.Context, args *pb.StorageDeleteArgs) (*pb.StorageDeleteReply, error)
func (*GRPCStorageServer) Get ¶
func (s *GRPCStorageServer) Get(ctx context.Context, args *pb.StorageGetArgs) (*pb.StorageGetReply, error)
func (*GRPCStorageServer) List ¶
func (s *GRPCStorageServer) List(ctx context.Context, args *pb.StorageListArgs) (*pb.StorageListReply, error)
func (*GRPCStorageServer) Put ¶
func (s *GRPCStorageServer) Put(ctx context.Context, args *pb.StoragePutArgs) (*pb.StoragePutReply, error)
type HandleExistenceCheckArgs ¶
HandleExistenceCheckArgs is the args for HandleExistenceCheck method.
type HandleExistenceCheckReply ¶
HandleExistenceCheckReply is the reply for HandleExistenceCheck method.
type HandleRequestArgs ¶
HandleRequestArgs is the args for HandleRequest method.
type HandleRequestReply ¶
HandleRequestReply is the reply for HandleRequest method.
type LocalMountReply ¶
type LocalMountReply struct {
Local bool
}
type LoggerArgs ¶
type LoggerReply ¶
LoggerReply contains the RPC reply. Not all fields may be used for a particular RPC call.
type LoggerServer ¶
type LoggerServer struct {
// contains filtered or unexported fields
}
func (*LoggerServer) Debug ¶
func (l *LoggerServer) Debug(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) Error ¶
func (l *LoggerServer) Error(args *LoggerArgs, reply *LoggerReply) error
func (*LoggerServer) Info ¶
func (l *LoggerServer) Info(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) IsDebug ¶
func (l *LoggerServer) IsDebug(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsInfo ¶
func (l *LoggerServer) IsInfo(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsTrace ¶
func (l *LoggerServer) IsTrace(args interface{}, reply *LoggerReply) error
func (*LoggerServer) IsWarn ¶
func (l *LoggerServer) IsWarn(args interface{}, reply *LoggerReply) error
func (*LoggerServer) Log ¶
func (l *LoggerServer) Log(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) SetLevel ¶
func (l *LoggerServer) SetLevel(args int, _ *struct{}) error
func (*LoggerServer) Trace ¶
func (l *LoggerServer) Trace(args *LoggerArgs, _ *struct{}) error
func (*LoggerServer) Warn ¶
func (l *LoggerServer) Warn(args *LoggerArgs, reply *LoggerReply) error
type MaxLeaseTTLReply ¶
type MlockEnabledReply ¶
type MlockEnabledReply struct {
MlockEnabled bool
}
type NOOPStorage ¶
type NOOPStorage struct{}
NOOPStorage is used to deny access to the storage interface while running a backend plugin in metadata mode.
func (*NOOPStorage) Get ¶
func (s *NOOPStorage) Get(_ context.Context, key string) (*logical.StorageEntry, error)
func (*NOOPStorage) Put ¶
func (s *NOOPStorage) Put(_ context.Context, entry *logical.StorageEntry) error
type PluginEnvReply ¶
type PluginEnvReply struct { PluginEnvironment *logical.PluginEnvironment Error error }
type ReplicationStateReply ¶
type ReplicationStateReply struct {
ReplicationState consts.ReplicationState
}
type ResponseWrapDataArgs ¶
type ResponseWrapDataReply ¶
type ResponseWrapDataReply struct { ResponseWrapInfo *wrapping.ResponseWrapInfo Error error }
type ServeOpts ¶
type ServeOpts struct { BackendFactoryFunc logical.Factory TLSProviderFunc TLSProviderFunc Logger log.Logger }
type SetupArgs ¶
type SetupArgs struct { StorageID uint32 LoggerID uint32 SysViewID uint32 Config map[string]string BackendUUID string }
SetupArgs is the args for Setup method.
type SpecialPathsReply ¶
SpecialPathsReply is the reply for SpecialPaths method.
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
StorageClient is an implementation of logical.Storage that communicates over RPC.
func (*StorageClient) Get ¶
func (s *StorageClient) Get(_ context.Context, key string) (*logical.StorageEntry, error)
func (*StorageClient) Put ¶
func (s *StorageClient) Put(_ context.Context, entry *logical.StorageEntry) error
type StorageDeleteReply ¶
type StorageDeleteReply struct {
Error error
}
type StorageGetReply ¶
type StorageGetReply struct { StorageEntry *logical.StorageEntry Error error }
type StorageListReply ¶
type StoragePutReply ¶
type StoragePutReply struct {
Error error
}
type StorageServer ¶
type StorageServer struct {
// contains filtered or unexported fields
}
StorageServer is a net/rpc compatible structure for serving
func (*StorageServer) Delete ¶
func (s *StorageServer) Delete(key string, reply *StorageDeleteReply) error
func (*StorageServer) Get ¶
func (s *StorageServer) Get(key string, reply *StorageGetReply) error
func (*StorageServer) List ¶
func (s *StorageServer) List(prefix string, reply *StorageListReply) error
func (*StorageServer) Put ¶
func (s *StorageServer) Put(entry *logical.StorageEntry, reply *StoragePutReply) error
type SudoPrivilegeArgs ¶
type SudoPrivilegeReply ¶
type SudoPrivilegeReply struct {
Sudo bool
}
type SystemReply ¶
type SystemReply struct { SystemView logical.SystemView Error error }
SystemReply is the reply for System method.
type SystemViewClient ¶
type SystemViewClient struct {
// contains filtered or unexported fields
}
func (*SystemViewClient) CachingDisabled ¶
func (s *SystemViewClient) CachingDisabled() bool
func (*SystemViewClient) DefaultLeaseTTL ¶
func (s *SystemViewClient) DefaultLeaseTTL() time.Duration
func (*SystemViewClient) EntityInfo ¶
func (s *SystemViewClient) EntityInfo(entityID string) (*logical.Entity, error)
func (*SystemViewClient) HasFeature ¶
func (s *SystemViewClient) HasFeature(feature license.Features) bool
func (*SystemViewClient) LocalMount ¶
func (s *SystemViewClient) LocalMount() bool
func (*SystemViewClient) LookupPlugin ¶
func (s *SystemViewClient) LookupPlugin(_ context.Context, _ string, _ consts.PluginType) (*pluginutil.PluginRunner, error)
func (*SystemViewClient) MaxLeaseTTL ¶
func (s *SystemViewClient) MaxLeaseTTL() time.Duration
func (*SystemViewClient) MlockEnabled ¶
func (s *SystemViewClient) MlockEnabled() bool
func (*SystemViewClient) PluginEnv ¶
func (s *SystemViewClient) PluginEnv(_ context.Context) (*logical.PluginEnvironment, error)
func (*SystemViewClient) ReplicationState ¶
func (s *SystemViewClient) ReplicationState() consts.ReplicationState
func (*SystemViewClient) ResponseWrapData ¶
func (s *SystemViewClient) ResponseWrapData(ctx context.Context, data map[string]interface{}, ttl time.Duration, jwt bool) (*wrapping.ResponseWrapInfo, error)
func (*SystemViewClient) SudoPrivilege ¶
func (*SystemViewClient) Tainted ¶
func (s *SystemViewClient) Tainted() bool
type SystemViewServer ¶
type SystemViewServer struct {
// contains filtered or unexported fields
}
func (*SystemViewServer) CachingDisabled ¶
func (s *SystemViewServer) CachingDisabled(_ interface{}, reply *CachingDisabledReply) error
func (*SystemViewServer) DefaultLeaseTTL ¶
func (s *SystemViewServer) DefaultLeaseTTL(_ interface{}, reply *DefaultLeaseTTLReply) error
func (*SystemViewServer) EntityInfo ¶
func (s *SystemViewServer) EntityInfo(args *EntityInfoArgs, reply *EntityInfoReply) error
func (*SystemViewServer) LocalMount ¶
func (s *SystemViewServer) LocalMount(_ interface{}, reply *LocalMountReply) error
func (*SystemViewServer) MaxLeaseTTL ¶
func (s *SystemViewServer) MaxLeaseTTL(_ interface{}, reply *MaxLeaseTTLReply) error
func (*SystemViewServer) MlockEnabled ¶
func (s *SystemViewServer) MlockEnabled(_ interface{}, reply *MlockEnabledReply) error
func (*SystemViewServer) PluginEnv ¶
func (s *SystemViewServer) PluginEnv(_ interface{}, reply *PluginEnvReply) error
func (*SystemViewServer) ReplicationState ¶
func (s *SystemViewServer) ReplicationState(_ interface{}, reply *ReplicationStateReply) error
func (*SystemViewServer) ResponseWrapData ¶
func (s *SystemViewServer) ResponseWrapData(args *ResponseWrapDataArgs, reply *ResponseWrapDataReply) error
func (*SystemViewServer) SudoPrivilege ¶
func (s *SystemViewServer) SudoPrivilege(args *SudoPrivilegeArgs, reply *SudoPrivilegeReply) error
func (*SystemViewServer) Tainted ¶
func (s *SystemViewServer) Tainted(_ interface{}, reply *TaintedReply) error
type TLSProviderFunc ¶
type TaintedReply ¶
type TaintedReply struct {
Tainted bool
}
type TypeReply ¶
type TypeReply struct {
Type logical.BackendType
}
TypeReply is the reply for the Type method.