mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
two level routing (based on how network switches work) (#241)
This commit is contained in:
@@ -11,6 +11,12 @@ import (
|
||||
"github.com/wavetermdev/thenextwave/pkg/waveobj"
|
||||
)
|
||||
|
||||
// command "announce", wshserver.AnnounceCommand
|
||||
func AnnounceCommand(w *wshutil.WshRpc, data string, opts *wshrpc.RpcOpts) error {
|
||||
_, err := sendRpcRequestCallHelper[any](w, "announce", data, opts)
|
||||
return err
|
||||
}
|
||||
|
||||
// command "authenticate", wshserver.AuthenticateCommand
|
||||
func AuthenticateCommand(w *wshutil.WshRpc, data string, opts *wshrpc.RpcOpts) error {
|
||||
_, err := sendRpcRequestCallHelper[any](w, "authenticate", data, opts)
|
||||
|
||||
@@ -25,6 +25,7 @@ const (
|
||||
|
||||
const (
|
||||
Command_Authenticate = "authenticate"
|
||||
Command_Announce = "announce" // special (for routing)
|
||||
Command_Message = "message"
|
||||
Command_GetMeta = "getmeta"
|
||||
Command_SetMeta = "setmeta"
|
||||
@@ -60,6 +61,7 @@ type RespOrErrorUnion[T any] struct {
|
||||
|
||||
type WshRpcInterface interface {
|
||||
AuthenticateCommand(ctx context.Context, data string) error
|
||||
AnnounceCommand(ctx context.Context, data string) error // (special) announces a new route to the main router
|
||||
|
||||
MessageCommand(ctx context.Context, data CommandMessageData) error
|
||||
GetMetaCommand(ctx context.Context, data CommandGetMetaData) (wstore.MetaMapType, error)
|
||||
|
||||
Reference in New Issue
Block a user