This commit is contained in:
hoteas 2018-04-03 19:16:11 +00:00
parent 910424f80c
commit c3d0b64d72
3 changed files with 25 additions and 38 deletions

View File

@ -5,6 +5,7 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" readonly="true" id="03ed5703-81a1-441b-849c-c426276586b7" name="Default" comment="工具"> <list default="true" readonly="true" id="03ed5703-81a1-441b-849c-c426276586b7" name="Default" comment="工具">
<change beforePath="" afterPath="$PROJECT_DIR$/cache" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/cache_memory.go" afterPath="$PROJECT_DIR$/cache_memory.go" /> <change beforePath="$PROJECT_DIR$/cache_memory.go" afterPath="$PROJECT_DIR$/cache_memory.go" />
<change beforePath="$PROJECT_DIR$/cache_redis.go" afterPath="$PROJECT_DIR$/cache_redis.go" /> <change beforePath="$PROJECT_DIR$/cache_redis.go" afterPath="$PROJECT_DIR$/cache_redis.go" />
@ -27,11 +28,11 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="main.go" pinned="false" current-in-tab="false"> <file leaf-file-name="main.go" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/main.go"> <entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390"> <state relative-caret-position="375">
<caret line="32" column="6" lean-forward="true" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" /> <caret line="32" column="17" lean-forward="true" selection-start-line="32" selection-start-column="17" selection-end-line="32" selection-end-column="17" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -57,11 +58,11 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="cache_redis.go" pinned="false" current-in-tab="true"> <file leaf-file-name="cache_redis.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cache_redis.go"> <entry file="file://$PROJECT_DIR$/cache_redis.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90"> <state relative-caret-position="90">
<caret line="9" column="4" lean-forward="false" selection-start-line="9" selection-start-column="4" selection-end-line="9" selection-end-column="7" /> <caret line="10" column="14" lean-forward="true" selection-start-line="10" selection-start-column="14" selection-end-line="10" selection-end-column="14" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -132,8 +133,8 @@
<option value="$PROJECT_DIR$/error.go" /> <option value="$PROJECT_DIR$/error.go" />
<option value="$PROJECT_DIR$/cache_memory.go" /> <option value="$PROJECT_DIR$/cache_memory.go" />
<option value="$PROJECT_DIR$/example/config/config.json" /> <option value="$PROJECT_DIR$/example/config/config.json" />
<option value="$PROJECT_DIR$/example/main.go" />
<option value="$PROJECT_DIR$/cache_redis.go" /> <option value="$PROJECT_DIR$/cache_redis.go" />
<option value="$PROJECT_DIR$/example/main.go" />
</list> </list>
</option> </option>
</component> </component>
@ -177,23 +178,6 @@
<item name="hotime" type="b2602c69:ProjectViewProjectNode" /> <item name="hotime" type="b2602c69:ProjectViewProjectNode" />
<item name="hotime" type="462c0819:PsiDirectoryNode" /> <item name="hotime" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="hotime" type="b2602c69:ProjectViewProjectNode" />
<item name="hotime" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="hotime" type="b2602c69:ProjectViewProjectNode" />
<item name="hotime" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="config" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="hotime" type="b2602c69:ProjectViewProjectNode" />
<item name="hotime" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="tpt" type="462c0819:PsiDirectoryNode" />
</path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
@ -402,7 +386,7 @@
<workItem from="1522771122447" duration="2480000" /> <workItem from="1522771122447" duration="2480000" />
<workItem from="1522778115746" duration="44000" /> <workItem from="1522778115746" duration="44000" />
<workItem from="1522778659126" duration="455000" /> <workItem from="1522778659126" duration="455000" />
<workItem from="1522779789231" duration="1365000" /> <workItem from="1522779789231" duration="1641000" />
</task> </task>
<task id="LOCAL-00001"> <task id="LOCAL-00001">
<created>1500458878821</created> <created>1500458878821</created>
@ -597,7 +581,7 @@
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="95044000" /> <option name="totallyTimeSpent" value="95320000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -610,6 +594,7 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="55" y="-8" width="1873" height="1084" extended-state="0" /> <frame x="55" y="-8" width="1873" height="1084" extended-state="0" />
<editor active="true" />
<layout> <layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32846716" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32846716" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@ -619,7 +604,7 @@
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.6329114" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.6329114" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32911393" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32911393" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32805908" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32805908" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.36900166" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.36900166" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
@ -701,14 +686,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390">
<caret line="32" column="6" lean-forward="true" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache_memory.go"> <entry file="file://$PROJECT_DIR$/cache_memory.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="133"> <state relative-caret-position="133">
@ -720,7 +697,15 @@
<entry file="file://$PROJECT_DIR$/cache_redis.go"> <entry file="file://$PROJECT_DIR$/cache_redis.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90"> <state relative-caret-position="90">
<caret line="9" column="4" lean-forward="false" selection-start-line="9" selection-start-column="4" selection-end-line="9" selection-end-column="7" /> <caret line="10" column="14" lean-forward="true" selection-start-line="10" selection-start-column="14" selection-end-line="10" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="32" column="17" lean-forward="true" selection-start-line="32" selection-start-column="17" selection-end-line="32" selection-end-column="17" />
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@ -3,17 +3,18 @@ package hotime
import ( import (
"time" "time"
"sync" "sync"
"github.com/garyburd/redigo/redis"
) )
type CacheRedis struct { type CacheRedis struct {
Time int64 Time int64
Map redis.Conn
contextBase contextBase
} }
func (this *CacheRedis) Cache(key string, data ...interface{}) *Obj { func (this *CacheRedis) Cache(key string, data ...interface{}) *Obj {
redis.Dial()
reData:= &Obj{} reData:= &Obj{}

View File

@ -6,10 +6,11 @@ import (
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"go.hoteas.com/hotime" "go.hoteas.com/hotime"
"golang.org/x/net/websocket" "golang.org/x/net/websocket"
"github.com/garyburd/redigo/redis"
) )
func main() { func main() {
hotime.CacheRedis{nil,redis.Dial()}
appIns := hotime.Application{} appIns := hotime.Application{}
i := 0 i := 0