This commit is contained in:
Wei Tang 2018-06-02 06:23:06 +08:00
commit fc7f6de7c5
5 changed files with 11 additions and 9 deletions

View file

@ -1 +1 @@
1.8.10 1.8.11

View file

@ -271,7 +271,7 @@ func (b *bridge) SleepBlocks(call otto.FunctionCall) (response otto.Value) {
} }
type jsonrpcCall struct { type jsonrpcCall struct {
Id int64 ID int64
Method string Method string
Params []interface{} Params []interface{}
} }
@ -304,7 +304,7 @@ func (b *bridge) Send(call otto.FunctionCall) (response otto.Value) {
resps, _ := call.Otto.Object("new Array()") resps, _ := call.Otto.Object("new Array()")
for _, req := range reqs { for _, req := range reqs {
resp, _ := call.Otto.Object(`({"jsonrpc":"2.0"})`) resp, _ := call.Otto.Object(`({"jsonrpc":"2.0"})`)
resp.Set("id", req.Id) resp.Set("id", req.ID)
var result json.RawMessage var result json.RawMessage
err = b.client.Call(&result, req.Method, req.Params...) err = b.client.Call(&result, req.Method, req.Params...)
switch err := err.(type) { switch err := err.(type) {

View file

@ -73,6 +73,8 @@ type Console struct {
printer io.Writer // Output writer to serialize any display strings to printer io.Writer // Output writer to serialize any display strings to
} }
// New initializes a JavaScript interpreted runtime environment and sets defaults
// with the config struct.
func New(config Config) (*Console, error) { func New(config Config) (*Console, error) {
// Handle unset config values gracefully // Handle unset config values gracefully
if config.Prompter == nil { if config.Prompter == nil {

View file

@ -362,7 +362,7 @@ type nodeInfo struct {
// authMsg is the authentication infos needed to login to a monitoring server. // authMsg is the authentication infos needed to login to a monitoring server.
type authMsg struct { type authMsg struct {
Id string `json:"id"` ID string `json:"id"`
Info nodeInfo `json:"info"` Info nodeInfo `json:"info"`
Secret string `json:"secret"` Secret string `json:"secret"`
} }
@ -381,7 +381,7 @@ func (s *Service) login(conn *websocket.Conn) error {
protocol = fmt.Sprintf("les/%d", les.ClientProtocolVersions[0]) protocol = fmt.Sprintf("les/%d", les.ClientProtocolVersions[0])
} }
auth := &authMsg{ auth := &authMsg{
Id: s.node, ID: s.node,
Info: nodeInfo{ Info: nodeInfo{
Name: s.node, Name: s.node,
Node: infos.Name, Node: infos.Name,

View file

@ -23,8 +23,8 @@ import (
const ( const (
VersionMajor = 1 // Major version component of the current release VersionMajor = 1 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release VersionMinor = 8 // Minor version component of the current release
VersionPatch = 10 // Patch version component of the current release VersionPatch = 11 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string VersionMeta = "unstable" // Version metadata to append to the version string
) )
// Version holds the textual version string. // Version holds the textual version string.