-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
server.go
56 lines (44 loc) · 1.25 KB
/
server.go
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
package http_ns
import (
"github.com/inoxlang/inox/internal/core/symbolic"
"github.com/inoxlang/inox/internal/prettyprint"
pprint "github.com/inoxlang/inox/internal/prettyprint"
)
var (
HTTP_SERVER_PROPNAMES = []string{"wait_closed", "close"}
)
type HttpsServer struct {
symbolic.UnassignablePropsMixin
_ int
}
func (r *HttpsServer) Test(v symbolic.Value, state symbolic.RecTestCallState) bool {
state.StartCall()
defer state.FinishCall()
_, ok := v.(*HttpsServer)
return ok
}
func (serv *HttpsServer) GetGoMethod(name string) (*symbolic.GoFunction, bool) {
switch name {
case "wait_closed":
return symbolic.WrapGoMethod(serv.wait_closed), true
case "close":
return symbolic.WrapGoMethod(serv.close), true
}
return nil, false
}
func (s *HttpsServer) Prop(name string) symbolic.Value {
return symbolic.GetGoMethodOrPanic(name, s)
}
func (*HttpsServer) PropertyNames() []string {
return HTTP_SERVER_PROPNAMES
}
func (serv *HttpsServer) wait_closed(ctx *symbolic.Context) {
}
func (serv *HttpsServer) close(ctx *symbolic.Context) {
}
func (r *HttpsServer) PrettyPrint(w prettyprint.PrettyPrintWriter, config *pprint.PrettyPrintConfig) {
w.WriteName("http-server")
}
func (r *HttpsServer) WidestOfType() symbolic.Value {
return &HttpsServer{}
}