-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackages.go
44 lines (42 loc) · 1.14 KB
/
packages.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
package src
import (
"github.com/embly/star/src/io"
"github.com/embly/star/src/io/ioutil"
"github.com/embly/star/src/net/http"
"github.com/embly/star/src/sync"
"github.com/embly/star/src/time"
"go.starlark.net/starlark"
)
var Packages = map[string]map[string]starlark.Value{
"io": map[string]starlark.Value{
"Reader": io.Reader,
"ReadCloser": io.ReadCloser,
},
"io/ioutil": map[string]starlark.Value{
"NopCloser": ioutil.NopCloser,
"ReadAll": ioutil.ReadAll,
},
"net/http": map[string]starlark.Value{
"Get": http.Get,
"Response": http.Response,
"ResponseWriter": http.ResponseWriter,
"Handler": http.Handler,
"ListenAndServe": http.ListenAndServe,
"HandleFunc": http.HandleFunc,
},
"sync": map[string]starlark.Value{
"WaitGroup": sync.WaitGroup,
},
"time": map[string]starlark.Value{
"Sleep": time.Sleep,
"Duration": time.Duration,
"Nanosecond": time.Nanosecond,
"Microsecond": time.Microsecond,
"Millisecond": time.Millisecond,
"Second": time.Second,
"Minute": time.Minute,
"Hour": time.Hour,
"Now": time.Now,
"Time": time.Time,
},
}