Update README.md
This commit is contained in:
parent
81389df948
commit
c5a9af19b1
1 changed files with 3 additions and 2 deletions
|
@ -36,12 +36,13 @@ Go 1.18+ required
|
||||||
```
|
```
|
||||||
|
|
||||||
Handler must have exact two arguments (context and input of any json serializable type) and exact two return values (output of any json serializable type and error)
|
Handler must have exact two arguments (context and input of any json serializable type) and exact two return values (output of any json serializable type and error)
|
||||||
3. Wrap handler with `rpc.Wrap` method and register it in server:
|
|
||||||
|
4. Wrap handler with `rpc.H` method and register it in server:
|
||||||
```go
|
```go
|
||||||
s.Register("multiply", rpc.H(Multiply))
|
s.Register("multiply", rpc.H(Multiply))
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Run RPC server:
|
5. Run RPC server:
|
||||||
```go
|
```go
|
||||||
s.Run(ctx)
|
s.Run(ctx)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue