You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this commit, the way in which the local and remote keys are specified
is changed. Instead of passing them in as command line arguments to the
binary, they are instead passed in as parameters to the ConnectServer
function.
Copy file name to clipboardExpand all lines: cmd/wasm-client/config.go
-31Lines changed: 0 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -3,43 +3,12 @@
3
3
4
4
package main
5
5
6
-
import (
7
-
"errors"
8
-
"fmt"
9
-
)
10
-
11
6
typeconfigstruct {
12
7
DebugLevelstring`long:"debuglevel" description:"Logging level for all subsystems {trace, debug, info, warn, error, critical} -- You may also specify <subsystem>=<level>,<subsystem2>=<level>,... to set the log level for individual subsystems -- Use show to list available subsystems"`
13
8
NameSpacestring`long:"namespace" description:"The name of the JS namespace in which all the call back functions should be registered"`
14
9
15
-
LocalPrivatestring`long:"localprivate" description:"The static local private key to be used for creating the noise connection"`
16
-
RemotePublicstring`long:"remotepublic" description:"The static remote public key to be used for creating the noise connection"`
17
-
18
10
OnLocalPrivCreatestring`long:"onlocalprivcreate" description:"The name of the js callback function that should be called once the local private key has been generated. This function is expected to persist the key so that it can be provided via a command line flag on a future connection"`
19
11
OnRemoteKeyReceivestring`long:"onremotekeyreceive" description:"The name of the js callback function to be called once the client receives the remote static key. This function is expected to persist the key so that it can be provided via a command line flag on a future connection"`
20
12
21
13
OnAuthDatastring`long:"onauthdata" description:"The name of the js callback function to be called once the client receives auth data from the remote peer."`
22
14
}
23
-
24
-
func (c*config) validate() error {
25
-
ifc.NameSpace=="" {
26
-
returnfmt.Errorf("a non-empty namespace is required")
27
-
}
28
-
29
-
ifc.RemotePublic!=""&&c.LocalPrivate=="" {
30
-
returnerrors.New("cannot set remote pub key if local priv "+
31
-
"key is not also set")
32
-
}
33
-
34
-
ifc.LocalPrivate==""&&c.OnLocalPrivCreate=="" {
35
-
returnerrors.New("OnLocalPrivCreate must be defined if a "+
36
-
"local key is not provided")
37
-
}
38
-
39
-
ifc.RemotePublic==""&&c.OnRemoteKeyReceive=="" {
40
-
returnerrors.New("OnRemoteKeyReceive must be defined if a "+
0 commit comments