Skip to content

Commit

Permalink
version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gentee committed Aug 16, 2020
1 parent 1dfe38a commit 796126b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 16 deletions.
65 changes: 50 additions & 15 deletions assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion const.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main

const (
// Version of the application
Version = "0.1.0+1 (alpha)"
Version = "0.2.0+1 (beta)"
// DefPort is the default web-server port
DefPort = 3234
// DefTheme is the default web-server theme
Expand Down
10 changes: 10 additions & 0 deletions script/embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package script
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -76,6 +77,7 @@ var (
{Prototype: `SetVar(str,int)`, Object: SetVarInt},
{Prototype: `GetVar(str) str`, Object: GetVar},
{Prototype: `GetVarBool(str) bool`, Object: GetVarBool},
{Prototype: `GetVarInt(str) int`, Object: GetVarInt},
// For gentee
{Prototype: `YamlToMap(str) map`, Object: YamlToMap},
}
Expand Down Expand Up @@ -188,6 +190,14 @@ func GetVarBool(name string) (ret int64, err error) {
return
}

func GetVarInt(name string) (ret int64, err error) {
var tmp string
if tmp, err = GetVar(name); err == nil {
ret, _ = strconv.ParseInt(tmp, 10, 64)
}
return
}

func Init(pars ...interface{}) {
dataScript.Mutex.Lock()
defer dataScript.Mutex.Unlock()
Expand Down

0 comments on commit 796126b

Please sign in to comment.