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 ¶
- func OpenDB(srv QueryServer) storage.MeshDB
- func OpenKeyVal(srv QueryServer) storage.MeshStorage
- func Serve(ctx context.Context, db storage.Provider, cli QueryClient) error
- type GraphStore
- func (g *GraphStore) AddEdge(sourceNode, targetNode types.NodeID, edge graph.Edge[types.NodeID]) error
- func (g *GraphStore) AddVertex(nodeID types.NodeID, node types.MeshNode, props graph.VertexProperties) error
- func (g *GraphStore) Edge(sourceNode, targetNode types.NodeID) (edge graph.Edge[types.NodeID], err error)
- func (g *GraphStore) ListEdges() ([]graph.Edge[types.NodeID], error)
- func (g *GraphStore) ListVertices() ([]types.NodeID, error)
- func (g *GraphStore) RemoveEdge(sourceNode, targetNode types.NodeID) error
- func (g *GraphStore) RemoveVertex(nodeID types.NodeID) error
- func (g *GraphStore) Subscribe(ctx context.Context, fn storage.PeerSubscribeFunc) (context.CancelFunc, error)
- func (g *GraphStore) UpdateEdge(sourceNode, targetNode types.NodeID, edge graph.Edge[types.NodeID]) error
- func (g *GraphStore) Vertex(nodeID types.NodeID) (node types.MeshNode, props graph.VertexProperties, err error)
- func (g *GraphStore) VertexCount() (int, error)
- type MeshStateStore
- type NetworkingStore
- func (nw *NetworkingStore) DeleteNetworkACL(ctx context.Context, name string) error
- func (nw *NetworkingStore) DeleteRoute(ctx context.Context, name string) error
- func (nw *NetworkingStore) GetNetworkACL(ctx context.Context, name string) (types.NetworkACL, error)
- func (nw *NetworkingStore) GetRoute(ctx context.Context, name string) (types.Route, error)
- func (nw *NetworkingStore) GetRoutesByCIDR(ctx context.Context, cidr netip.Prefix) (types.Routes, error)
- func (nw *NetworkingStore) GetRoutesByNode(ctx context.Context, nodeID types.NodeID) (types.Routes, error)
- func (nw *NetworkingStore) ListNetworkACLs(ctx context.Context) (types.NetworkACLs, error)
- func (nw *NetworkingStore) ListRoutes(ctx context.Context) (types.Routes, error)
- func (nw *NetworkingStore) PutNetworkACL(ctx context.Context, acl types.NetworkACL) error
- func (nw *NetworkingStore) PutRoute(ctx context.Context, route types.Route) error
- type PluginDataStore
- type PluginMeshStorage
- func (p *PluginMeshStorage) Close() error
- func (p *PluginMeshStorage) Delete(ctx context.Context, key []byte) error
- func (p *PluginMeshStorage) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (p *PluginMeshStorage) IterPrefix(ctx context.Context, prefix []byte, fn storage.PrefixIterator) error
- func (p *PluginMeshStorage) ListKeys(ctx context.Context, prefix []byte) ([][]byte, error)
- func (p *PluginMeshStorage) PutValue(ctx context.Context, key, value []byte, ttl time.Duration) error
- func (p *PluginMeshStorage) Subscribe(ctx context.Context, prefix []byte, fn storage.KVSubscribeFunc) (context.CancelFunc, error)
- type QueryClient
- type QueryServer
- type RBACStore
- func (r *RBACStore) DeleteGroup(ctx context.Context, name string) error
- func (r *RBACStore) DeleteRole(ctx context.Context, name string) error
- func (r *RBACStore) DeleteRoleBinding(ctx context.Context, name string) error
- func (r *RBACStore) GetEnabled(ctx context.Context) (bool, error)
- func (r *RBACStore) GetGroup(ctx context.Context, name string) (types.Group, error)
- func (r *RBACStore) GetRole(ctx context.Context, name string) (types.Role, error)
- func (r *RBACStore) GetRoleBinding(ctx context.Context, name string) (types.RoleBinding, error)
- func (r *RBACStore) ListGroups(ctx context.Context) ([]types.Group, error)
- func (r *RBACStore) ListNodeRoles(ctx context.Context, nodeID types.NodeID) (types.RolesList, error)
- func (r *RBACStore) ListRoleBindings(ctx context.Context) ([]types.RoleBinding, error)
- func (r *RBACStore) ListRoles(ctx context.Context) (types.RolesList, error)
- func (r *RBACStore) ListUserRoles(ctx context.Context, user types.NodeID) (types.RolesList, error)
- func (r *RBACStore) PutGroup(ctx context.Context, group types.Group) error
- func (r *RBACStore) PutRole(ctx context.Context, role types.Role) error
- func (r *RBACStore) PutRoleBinding(ctx context.Context, rolebinding types.RoleBinding) error
- func (r *RBACStore) SetEnabled(ctx context.Context, enabled bool) error
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.
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) AddVertex ¶ added in v0.12.0
func (g *GraphStore) AddVertex(nodeID types.NodeID, node types.MeshNode, props graph.VertexProperties) 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 (g *GraphStore) Subscribe(ctx context.Context, fn storage.PeerSubscribeFunc) (context.CancelFunc, error)
func (*GraphStore) UpdateEdge ¶ added in v0.12.0
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) GetRoutesByCIDR ¶ added in v0.12.0
func (*NetworkingStore) GetRoutesByNode ¶ added in v0.12.0
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 (*NetworkingStore) PutNetworkACL ¶ added in v0.12.0
func (nw *NetworkingStore) PutNetworkACL(ctx context.Context, acl types.NetworkACL) 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) IterPrefix ¶ added in v0.12.0
func (p *PluginMeshStorage) IterPrefix(ctx context.Context, prefix []byte, fn storage.PrefixIterator) error
func (*PluginMeshStorage) Subscribe ¶ added in v0.12.0
func (p *PluginMeshStorage) Subscribe(ctx context.Context, prefix []byte, fn storage.KVSubscribeFunc) (context.CancelFunc, error)
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.