pluginstore

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package pluginstore is an internal Porter package that implements the plugins.SecretsPlugin interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSecretsPluginConfig

func NewSecretsPluginConfig() pluggable.PluginTypeConfig

NewSecretsPluginConfig for secret sources.

Types

type GClient added in v1.0.1

type GClient struct {
	// contains filtered or unexported fields
}

GClient is a gRPC implementation of the storage client.

func NewClient added in v1.0.1

func NewClient(client proto.SecretsProtocolClient) *GClient

func (*GClient) Create added in v1.0.1

func (m *GClient) Create(ctx context.Context, keyName string, keyValue string, value string) error

func (*GClient) Resolve added in v1.0.1

func (m *GClient) Resolve(ctx context.Context, keyName string, keyValue string) (string, error)

type GServer added in v1.0.1

type GServer struct {
	proto.UnsafeSecretsProtocolServer
	// contains filtered or unexported fields
}

GServer is a gRPC wrapper around a SecretsProtocol plugin

func NewServer added in v1.0.1

func (*GServer) Create added in v1.0.1

func (m *GServer) Create(ctx context.Context, request *proto.CreateRequest) (*proto.CreateResponse, error)

func (*GServer) Resolve added in v1.0.1

func (m *GServer) Resolve(ctx context.Context, request *proto.ResolveRequest) (*proto.ResolveResponse, error)

type Plugin added in v1.0.1

type Plugin struct {
	plugin.Plugin
	// contains filtered or unexported fields
}

Plugin is the shared implementation of a storage plugin wrapper.

func NewPlugin added in v1.0.1

NewPlugin creates an instance of a storage plugin.

func (Plugin) GRPCClient added in v1.0.1

func (p Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)

func (Plugin) GRPCServer added in v1.0.1

func (p Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type Store

type Store struct {
	*config.Config
	// contains filtered or unexported fields
}

Store is a plugin-backed source of secrets. It resolves the appropriate plugin based on Porter's config and implements the plugins.SecretsProtocol interface using the backing plugin.

Connects just-in-time, but you must call Close to release resources.

func NewStore

func NewStore(c *config.Config) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) Connect

func (s *Store) Connect(ctx context.Context) error

Connect initializes the plugin for use. The plugin itself is responsible for ensuring it was called. Close is called automatically when the plugin is used by Porter.

func (*Store) Create added in v1.0.1

func (s *Store) Create(ctx context.Context, keyName string, keyValue string, value string) error

func (*Store) Resolve added in v1.0.1

func (s *Store) Resolve(ctx context.Context, keyName string, keyValue string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL