pluginstore

package
v1.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pluginstore is an internal Porter package that implements the plugins.StorageProtocol interface via the hashicorp/go-plugins library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStoragePluginConfig

func NewStoragePluginConfig() pluggable.PluginTypeConfig

NewStoragePluginConfig for porter home storage.

Types

type Client

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

func (*Client) Aggregate

func (g *Client) Aggregate(opts plugins.AggregateOptions) ([]bson.Raw, error)

func (*Client) Count

func (g *Client) Count(opts plugins.CountOptions) (int64, error)

func (*Client) EnsureIndex

func (g *Client) EnsureIndex(opts plugins.EnsureIndexOptions) error

func (*Client) Find

func (g *Client) Find(opts plugins.FindOptions) ([]bson.Raw, error)

func (*Client) Insert

func (g *Client) Insert(opts plugins.InsertOptions) error

func (*Client) Patch

func (g *Client) Patch(opts plugins.PatchOptions) error

func (*Client) Remove

func (g *Client) Remove(opts plugins.RemoveOptions) error

func (*Client) Update

func (g *Client) Update(opts plugins.UpdateOptions) error

type Plugin added in v1.0.1

type Plugin struct {
	Impl plugins.StorageProtocol
}

Plugin is a generic type of plugin for working with any implementation of a crud store.

func (Plugin) Client

func (Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (interface{}, error)

type Server

type Server struct {
	Impl plugins.StorageProtocol
}

func (*Server) Aggregate

func (s *Server) Aggregate(args map[string]interface{}, resp *[]bson.Raw) error

func (*Server) Count

func (s *Server) Count(args map[string]interface{}, resp *int64) error

func (*Server) EnsureIndex

func (s *Server) EnsureIndex(args map[string]interface{}, _ *interface{}) error

func (*Server) Find

func (s *Server) Find(args map[string]interface{}, resp *[]bson.Raw) error

func (*Server) Insert

func (s *Server) Insert(args map[string]interface{}, _ *interface{}) error

func (*Server) Patch

func (s *Server) Patch(args map[string]interface{}, _ *interface{}) error

func (*Server) Remove

func (s *Server) Remove(args map[string]interface{}, _ *interface{}) error

func (*Server) Update

func (s *Server) Update(args map[string]interface{}, _ *interface{}) error

type Store

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

Store is a plugin-backed source of storage. It resolves the appropriate plugin based on Porter's config and implements the plugins.StorageProtocol 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) Aggregate added in v1.0.1

func (s *Store) Aggregate(opts plugins.AggregateOptions) ([]bson.Raw, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Connect

func (s *Store) Connect() error

func (*Store) Count added in v1.0.1

func (s *Store) Count(opts plugins.CountOptions) (int64, error)

func (*Store) EnsureIndex added in v1.0.1

func (s *Store) EnsureIndex(opts plugins.EnsureIndexOptions) error

func (*Store) Find added in v1.0.1

func (s *Store) Find(opts plugins.FindOptions) ([]bson.Raw, error)

func (*Store) Insert added in v1.0.1

func (s *Store) Insert(opts plugins.InsertOptions) error

func (*Store) Patch added in v1.0.1

func (s *Store) Patch(opts plugins.PatchOptions) error

func (*Store) Remove added in v1.0.1

func (s *Store) Remove(opts plugins.RemoveOptions) error

func (*Store) Update added in v1.0.1

func (s *Store) Update(opts plugins.UpdateOptions) error

Jump to

Keyboard shortcuts

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