io

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadCloser = star.Interface{
	Name: "io.ReadCloser",
	Methods: map[string]star.Method{
		"Read": star.Method{
			Args:    []starlark.Value{star.ByteArray{}},
			Returns: []starlark.Value{starlark.Int{}, star.Error{}},
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				resp = make([]interface{}, 2)
				resp[0], resp[1] = recv.(io.ReadCloser).Read(args[0].([]byte))
				return
			},
		},
		"Close": star.Method{
			Returns: []starlark.Value{star.Error{}},
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				resp = make([]interface{}, 1)
				resp[0] = recv.(io.ReadCloser).Close()
				return
			},
		},
	},
}
View Source
var Reader = star.Interface{
	Name: "io.Reader",
	Methods: map[string]star.Method{
		"Read": star.Method{
			Args:    []starlark.Value{star.ByteArray{}},
			Returns: []starlark.Value{starlark.Int{}, star.Error{}},
			Call: func(recv interface{}, args []interface{}) (resp []interface{}) {
				resp = make([]interface{}, 2)
				resp[0], resp[1] = recv.(io.Reader).Read(args[0].([]byte))
				return
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL