Documentation ¶
Overview ¶
Package rpcdb provides a meshdb that operates over RPC.
Package rpcdb provides a meshdb that operates over RPC.
Index ¶
- func Open(q Querier) storage.MeshDB
- func OpenKV(q Querier) storage.MeshStorage
- func OpenKVServer(s QueryServer) storage.MeshStorage
- func OpenServer(s QueryServer) storage.MeshDB
- 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 KVStorage
- func (p *KVStorage) Close() error
- func (p *KVStorage) Delete(ctx context.Context, key []byte) error
- func (p *KVStorage) GetValue(ctx context.Context, key []byte) ([]byte, error)
- func (p *KVStorage) IterPrefix(ctx context.Context, prefix []byte, fn storage.PrefixIterator) error
- func (p *KVStorage) ListKeys(ctx context.Context, prefix []byte) ([][]byte, error)
- func (p *KVStorage) PutValue(ctx context.Context, key, value []byte, ttl time.Duration) error
- func (p *KVStorage) Subscribe(ctx context.Context, prefix []byte, fn storage.KVSubscribeFunc) (context.CancelFunc, 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 Querier
- type QuerierFunc
- 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
- type RPCDataStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenKV ¶
func OpenKV(q Querier) storage.MeshStorage
OpenKV opens a new key-value store connection over a Querier interface.
func OpenKVServer ¶
func OpenKVServer(s QueryServer) storage.MeshStorage
OpenKVServer opens a new key-value store connection over a QueryServer interface.
func OpenServer ¶
func OpenServer(s QueryServer) storage.MeshDB
OpenServer opens a new mesh database over a QueryServer interface.
Types ¶
type GraphStore ¶
type GraphStore struct {
*RPCDataStore
}
GraphStore implements a mesh graph store over a plugin query stream.
func (*GraphStore) AddVertex ¶
func (g *GraphStore) AddVertex(nodeID types.NodeID, node types.MeshNode, props graph.VertexProperties) error
func (*GraphStore) ListVertices ¶
func (g *GraphStore) ListVertices() ([]types.NodeID, error)
func (*GraphStore) RemoveEdge ¶
func (g *GraphStore) RemoveEdge(sourceNode, targetNode types.NodeID) error
func (*GraphStore) RemoveVertex ¶
func (g *GraphStore) RemoveVertex(nodeID types.NodeID) error
func (*GraphStore) Subscribe ¶
func (g *GraphStore) Subscribe(ctx context.Context, fn storage.PeerSubscribeFunc) (context.CancelFunc, error)
func (*GraphStore) UpdateEdge ¶
func (*GraphStore) Vertex ¶
func (g *GraphStore) Vertex(nodeID types.NodeID) (node types.MeshNode, props graph.VertexProperties, err error)
func (*GraphStore) VertexCount ¶
func (g *GraphStore) VertexCount() (int, error)
type KVStorage ¶
type KVStorage struct {
Querier
}
KVStorage implements a mesh key-value store over a plugin query stream.
func (*KVStorage) IterPrefix ¶
type MeshStateStore ¶
type MeshStateStore struct {
*RPCDataStore
}
MeshStateStore implements a mesh state store over a plugin query stream.
func (*MeshStateStore) GetMeshState ¶
func (st *MeshStateStore) GetMeshState(ctx context.Context) (types.NetworkState, error)
func (*MeshStateStore) SetMeshState ¶
func (st *MeshStateStore) SetMeshState(ctx context.Context, state types.NetworkState) error
type NetworkingStore ¶
type NetworkingStore struct {
*RPCDataStore
}
NetworkingStore implements a mesh networking store over a plugin query stream.
func (*NetworkingStore) DeleteNetworkACL ¶
func (nw *NetworkingStore) DeleteNetworkACL(ctx context.Context, name string) error
func (*NetworkingStore) DeleteRoute ¶
func (nw *NetworkingStore) DeleteRoute(ctx context.Context, name string) error
func (*NetworkingStore) GetNetworkACL ¶
func (nw *NetworkingStore) GetNetworkACL(ctx context.Context, name string) (types.NetworkACL, error)
func (*NetworkingStore) GetRoutesByCIDR ¶
func (*NetworkingStore) GetRoutesByNode ¶
func (*NetworkingStore) ListNetworkACLs ¶
func (nw *NetworkingStore) ListNetworkACLs(ctx context.Context) (types.NetworkACLs, error)
func (*NetworkingStore) ListRoutes ¶
func (*NetworkingStore) PutNetworkACL ¶
func (nw *NetworkingStore) PutNetworkACL(ctx context.Context, acl types.NetworkACL) error
type Querier ¶
type Querier interface { // Query invokes the query RPC. Query(ctx context.Context, query *v1.QueryRequest) (*v1.QueryResponse, error) }
Querier is an interface for invoking the query RPC.
func QuerierFromServer ¶
func QuerierFromServer(s QueryServer) Querier
QuerierFromServer returns a Querier from a QueryServer.
type QuerierFunc ¶
type QuerierFunc func(ctx context.Context, query *v1.QueryRequest) (*v1.QueryResponse, error)
QuerierFunc is a function that implements the Querier interface.
func (QuerierFunc) Query ¶
func (f QuerierFunc) Query(ctx context.Context, query *v1.QueryRequest) (*v1.QueryResponse, error)
Query invokes the query RPC.
type QueryServer ¶
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 a generic streaming querier interface.
type RBACStore ¶
type RBACStore struct {
*RPCDataStore
}
RBACStore implements a mesh rbac store over a plugin query stream.
func (*RBACStore) DeleteGroup ¶
func (*RBACStore) DeleteRole ¶
func (*RBACStore) DeleteRoleBinding ¶
func (*RBACStore) GetRoleBinding ¶
func (*RBACStore) ListGroups ¶
func (*RBACStore) ListNodeRoles ¶
func (*RBACStore) ListRoleBindings ¶
func (*RBACStore) ListUserRoles ¶
func (*RBACStore) PutRoleBinding ¶
type RPCDataStore ¶
type RPCDataStore struct {
Querier
}
RPCDataStore is a MeshDataStore that operates over RPC.
func (*RPCDataStore) GraphStore ¶
func (pdb *RPCDataStore) GraphStore() storage.GraphStore
GraphStore returns the interface for managing network topology and data about peers.
func (*RPCDataStore) MeshState ¶
func (pdb *RPCDataStore) MeshState() storage.MeshState
MeshState returns the interface for querying mesh state.
func (*RPCDataStore) Networking ¶
func (pdb *RPCDataStore) Networking() storage.Networking
Networking returns the interface for managing networking in the mesh.
func (*RPCDataStore) RBAC ¶
func (pdb *RPCDataStore) RBAC() storage.RBAC
RBAC returns the interface for managing RBAC policies in the mesh.