File: go1_21_net_rpc.go

package info (click to toggle)
golang-github-traefik-yaegi 0.16.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 24,608 kB
  • sloc: sh: 457; makefile: 39
file content (94 lines) | stat: -rw-r--r-- 3,430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Code generated by 'yaegi extract net/rpc'. DO NOT EDIT.

//go:build go1.21 && !go1.22
// +build go1.21,!go1.22

package stdlib

import (
	"go/constant"
	"go/token"
	"net/rpc"
	"reflect"
)

func init() {
	Symbols["net/rpc/rpc"] = map[string]reflect.Value{
		// function, constant and variable definitions
		"Accept":             reflect.ValueOf(rpc.Accept),
		"DefaultDebugPath":   reflect.ValueOf(constant.MakeFromLiteral("\"/debug/rpc\"", token.STRING, 0)),
		"DefaultRPCPath":     reflect.ValueOf(constant.MakeFromLiteral("\"/_goRPC_\"", token.STRING, 0)),
		"DefaultServer":      reflect.ValueOf(&rpc.DefaultServer).Elem(),
		"Dial":               reflect.ValueOf(rpc.Dial),
		"DialHTTP":           reflect.ValueOf(rpc.DialHTTP),
		"DialHTTPPath":       reflect.ValueOf(rpc.DialHTTPPath),
		"ErrShutdown":        reflect.ValueOf(&rpc.ErrShutdown).Elem(),
		"HandleHTTP":         reflect.ValueOf(rpc.HandleHTTP),
		"NewClient":          reflect.ValueOf(rpc.NewClient),
		"NewClientWithCodec": reflect.ValueOf(rpc.NewClientWithCodec),
		"NewServer":          reflect.ValueOf(rpc.NewServer),
		"Register":           reflect.ValueOf(rpc.Register),
		"RegisterName":       reflect.ValueOf(rpc.RegisterName),
		"ServeCodec":         reflect.ValueOf(rpc.ServeCodec),
		"ServeConn":          reflect.ValueOf(rpc.ServeConn),
		"ServeRequest":       reflect.ValueOf(rpc.ServeRequest),

		// type definitions
		"Call":        reflect.ValueOf((*rpc.Call)(nil)),
		"Client":      reflect.ValueOf((*rpc.Client)(nil)),
		"ClientCodec": reflect.ValueOf((*rpc.ClientCodec)(nil)),
		"Request":     reflect.ValueOf((*rpc.Request)(nil)),
		"Response":    reflect.ValueOf((*rpc.Response)(nil)),
		"Server":      reflect.ValueOf((*rpc.Server)(nil)),
		"ServerCodec": reflect.ValueOf((*rpc.ServerCodec)(nil)),
		"ServerError": reflect.ValueOf((*rpc.ServerError)(nil)),

		// interface wrapper definitions
		"_ClientCodec": reflect.ValueOf((*_net_rpc_ClientCodec)(nil)),
		"_ServerCodec": reflect.ValueOf((*_net_rpc_ServerCodec)(nil)),
	}
}

// _net_rpc_ClientCodec is an interface wrapper for ClientCodec type
type _net_rpc_ClientCodec struct {
	IValue              interface{}
	WClose              func() error
	WReadResponseBody   func(a0 any) error
	WReadResponseHeader func(a0 *rpc.Response) error
	WWriteRequest       func(a0 *rpc.Request, a1 any) error
}

func (W _net_rpc_ClientCodec) Close() error {
	return W.WClose()
}
func (W _net_rpc_ClientCodec) ReadResponseBody(a0 any) error {
	return W.WReadResponseBody(a0)
}
func (W _net_rpc_ClientCodec) ReadResponseHeader(a0 *rpc.Response) error {
	return W.WReadResponseHeader(a0)
}
func (W _net_rpc_ClientCodec) WriteRequest(a0 *rpc.Request, a1 any) error {
	return W.WWriteRequest(a0, a1)
}

// _net_rpc_ServerCodec is an interface wrapper for ServerCodec type
type _net_rpc_ServerCodec struct {
	IValue             interface{}
	WClose             func() error
	WReadRequestBody   func(a0 any) error
	WReadRequestHeader func(a0 *rpc.Request) error
	WWriteResponse     func(a0 *rpc.Response, a1 any) error
}

func (W _net_rpc_ServerCodec) Close() error {
	return W.WClose()
}
func (W _net_rpc_ServerCodec) ReadRequestBody(a0 any) error {
	return W.WReadRequestBody(a0)
}
func (W _net_rpc_ServerCodec) ReadRequestHeader(a0 *rpc.Request) error {
	return W.WReadRequestHeader(a0)
}
func (W _net_rpc_ServerCodec) WriteResponse(a0 *rpc.Response, a1 any) error {
	return W.WWriteResponse(a0, a1)
}