plugindb

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package plugindb contains an interface for performing storage queries over the storage APIs.

Package plugindb contains an interface for performing storage queries over the storage APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB added in v0.12.0

func OpenDB(srv QueryServer) storage.MeshDB

Open opens a new database connection to a plugin query stream.

func OpenKeyVal added in v0.12.0

func OpenKeyVal(srv QueryServer) storage.MeshStorage

OpenKeyVal opens a new key-value store connection to a plugin query stream.

func Serve added in v0.12.0

func Serve(ctx context.Context, db storage.Provider, cli QueryClient) error

Serve serves database operations over a plugin query stream.

Types

type GraphStore added in v0.12.0

type GraphStore struct {
	*PluginDataStore
}

GraphStore implements a mesh graph store over a plugin query stream.

func (*GraphStore) AddEdge added in v0.12.0

func (g *GraphStore) AddEdge(sourceNode, targetNode types.NodeID, edge graph.Edge[types.NodeID]) error

func (*GraphStore) AddVertex added in v0.12.0

func (g *GraphStore) AddVertex(nodeID types.NodeID, node types.MeshNode, props graph.VertexProperties) error

func (*GraphStore) Edge added in v0.12.0

func (g *GraphStore) Edge(sourceNode, targetNode types.NodeID) (edge graph.Edge[types.NodeID], err error)

func (*GraphStore) ListEdges added in v0.12.0

func (g *GraphStore) ListEdges() ([]graph.Edge[types.NodeID], error)

func (*GraphStore) ListVertices added in v0.12.0

func (g *GraphStore) ListVertices() ([]types.NodeID, error)

func (*GraphStore) RemoveEdge added in v0.12.0

func (g *GraphStore) RemoveEdge(sourceNode, targetNode types.NodeID) error

func (*GraphStore) RemoveVertex added in v0.12.0

func (g *GraphStore) RemoveVertex(nodeID types.NodeID) error

func (*GraphStore) Subscribe added in v0.12.0

func (*GraphStore) UpdateEdge added in v0.12.0

func (g *GraphStore) UpdateEdge(sourceNode, targetNode types.NodeID, edge graph.Edge[types.NodeID]) error

func (*GraphStore) Vertex added in v0.12.0

func (g *GraphStore) Vertex(nodeID types.NodeID) (node types.MeshNode, props graph.VertexProperties, err error)

func (*GraphStore) VertexCount added in v0.12.0

func (g *GraphStore) VertexCount() (int, error)

type MeshStateStore added in v0.12.0

type MeshStateStore struct {
	*PluginDataStore
}

MeshStateStore implements a mesh state store over a plugin query stream.

func (*MeshStateStore) GetMeshState added in v0.12.0

func (st *MeshStateStore) GetMeshState(ctx context.Context) (types.NetworkState, error)

func (*MeshStateStore) SetMeshState added in v0.13.12

func (st *MeshStateStore) SetMeshState(ctx context.Context, state types.NetworkState) error

type NetworkingStore added in v0.12.0

type NetworkingStore struct {
	*PluginDataStore
}

NetworkingStore implements a mesh networking store over a plugin query stream.

func (*NetworkingStore) DeleteNetworkACL added in v0.12.0

func (nw *NetworkingStore) DeleteNetworkACL(ctx context.Context, name string) error

func (*NetworkingStore) DeleteRoute added in v0.12.0

func (nw *NetworkingStore) DeleteRoute(ctx context.Context, name string) error

func (*NetworkingStore) GetNetworkACL added in v0.12.0

func (nw *NetworkingStore) GetNetworkACL(ctx context.Context, name string) (types.NetworkACL, error)

func (*NetworkingStore) GetRoute added in v0.12.0

func (nw *NetworkingStore) GetRoute(ctx context.Context, name string) (types.Route, error)

func (*NetworkingStore) GetRoutesByCIDR added in v0.12.0

func (nw *NetworkingStore) GetRoutesByCIDR(ctx context.Context, cidr netip.Prefix) (types.Routes, error)

func (*NetworkingStore) GetRoutesByNode added in v0.12.0

func (nw *NetworkingStore) GetRoutesByNode(ctx context.Context, nodeID types.NodeID) (types.Routes, error)

func (*NetworkingStore) ListNetworkACLs added in v0.12.0

func (nw *NetworkingStore) ListNetworkACLs(ctx context.Context) (types.NetworkACLs, error)

func (*NetworkingStore) ListRoutes added in v0.12.0

func (nw *NetworkingStore) ListRoutes(ctx context.Context) (types.Routes, error)

func (*NetworkingStore) PutNetworkACL added in v0.12.0

func (nw *NetworkingStore) PutNetworkACL(ctx context.Context, acl types.NetworkACL) error

func (*NetworkingStore) PutRoute added in v0.12.0

func (nw *NetworkingStore) PutRoute(ctx context.Context, route types.Route) error

type PluginDataStore added in v0.12.0

type PluginDataStore struct {
	QueryServer
	// contains filtered or unexported fields
}

PluginDataStore implements a mesh data store over a plugin query stream.

func (*PluginDataStore) GraphStore added in v0.12.0

func (pdb *PluginDataStore) GraphStore() storage.GraphStore

GraphStore returns the interface for managing network topology and data about peers.

func (*PluginDataStore) MeshState added in v0.12.0

func (pdb *PluginDataStore) MeshState() storage.MeshState

MeshState returns the interface for querying mesh state.

func (*PluginDataStore) Networking added in v0.12.0

func (pdb *PluginDataStore) Networking() storage.Networking

Networking returns the interface for managing networking in the mesh.

func (*PluginDataStore) RBAC added in v0.12.0

func (pdb *PluginDataStore) RBAC() storage.RBAC

RBAC returns the interface for managing RBAC policies in the mesh.

type PluginMeshStorage added in v0.12.0

type PluginMeshStorage struct {
	QueryServer
	// contains filtered or unexported fields
}

PluginMeshStorage implements a mesh key-value store over a plugin query stream.

func (*PluginMeshStorage) Close added in v0.12.0

func (p *PluginMeshStorage) Close() error

func (*PluginMeshStorage) Delete added in v0.12.0

func (p *PluginMeshStorage) Delete(ctx context.Context, key []byte) error

func (*PluginMeshStorage) GetValue added in v0.12.0

func (p *PluginMeshStorage) GetValue(ctx context.Context, key []byte) ([]byte, error)

GetValue returns the value of a key.

func (*PluginMeshStorage) IterPrefix added in v0.12.0

func (p *PluginMeshStorage) IterPrefix(ctx context.Context, prefix []byte, fn storage.PrefixIterator) error

func (*PluginMeshStorage) ListKeys added in v0.12.0

func (p *PluginMeshStorage) ListKeys(ctx context.Context, prefix []byte) ([][]byte, error)

func (*PluginMeshStorage) PutValue added in v0.12.0

func (p *PluginMeshStorage) PutValue(ctx context.Context, key, value []byte, ttl time.Duration) error

func (*PluginMeshStorage) Subscribe added in v0.12.0

type QueryClient added in v0.12.0

type QueryClient interface {
	// The underlying gRPC stream.
	grpc.ClientStream
	// Send sends a query result to the plugin.
	Send(*v1.QueryResponse) error
	// Recv receives a query request from the plugin.
	Recv() (*v1.QueryRequest, error)
}

QueryClient is the interface for a storage query client.

type QueryServer added in v0.12.0

type QueryServer interface {
	// The underlying gRPC stream.
	grpc.ServerStream
	// Send sends a query request to the plugin.
	Send(*v1.QueryRequest) error
	// Recv receives a query result from the plugin.
	Recv() (*v1.QueryResponse, error)
}

QueryServer is the query server interface.

type RBACStore added in v0.12.0

type RBACStore struct {
	*PluginDataStore
}

RBACStore implements a mesh rbac store over a plugin query stream.

func (*RBACStore) DeleteGroup added in v0.12.0

func (r *RBACStore) DeleteGroup(ctx context.Context, name string) error

func (*RBACStore) DeleteRole added in v0.12.0

func (r *RBACStore) DeleteRole(ctx context.Context, name string) error

func (*RBACStore) DeleteRoleBinding added in v0.12.0

func (r *RBACStore) DeleteRoleBinding(ctx context.Context, name string) error

func (*RBACStore) GetEnabled added in v0.12.0

func (r *RBACStore) GetEnabled(ctx context.Context) (bool, error)

func (*RBACStore) GetGroup added in v0.12.0

func (r *RBACStore) GetGroup(ctx context.Context, name string) (types.Group, error)

func (*RBACStore) GetRole added in v0.12.0

func (r *RBACStore) GetRole(ctx context.Context, name string) (types.Role, error)

func (*RBACStore) GetRoleBinding added in v0.12.0

func (r *RBACStore) GetRoleBinding(ctx context.Context, name string) (types.RoleBinding, error)

func (*RBACStore) ListGroups added in v0.12.0

func (r *RBACStore) ListGroups(ctx context.Context) ([]types.Group, error)

func (*RBACStore) ListNodeRoles added in v0.12.0

func (r *RBACStore) ListNodeRoles(ctx context.Context, nodeID types.NodeID) (types.RolesList, error)

func (*RBACStore) ListRoleBindings added in v0.12.0

func (r *RBACStore) ListRoleBindings(ctx context.Context) ([]types.RoleBinding, error)

func (*RBACStore) ListRoles added in v0.12.0

func (r *RBACStore) ListRoles(ctx context.Context) (types.RolesList, error)

func (*RBACStore) ListUserRoles added in v0.12.0

func (r *RBACStore) ListUserRoles(ctx context.Context, user types.NodeID) (types.RolesList, error)

func (*RBACStore) PutGroup added in v0.12.0

func (r *RBACStore) PutGroup(ctx context.Context, group types.Group) error

func (*RBACStore) PutRole added in v0.12.0

func (r *RBACStore) PutRole(ctx context.Context, role types.Role) error

func (*RBACStore) PutRoleBinding added in v0.12.0

func (r *RBACStore) PutRoleBinding(ctx context.Context, rolebinding types.RoleBinding) error

func (*RBACStore) SetEnabled added in v0.12.0

func (r *RBACStore) SetEnabled(ctx context.Context, enabled bool) error

Jump to

Keyboard shortcuts

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