This commit is contained in:
hoteas 2018-04-08 16:02:13 +00:00
parent 36dec599a2
commit 546058513f
4 changed files with 187 additions and 78 deletions

View File

@ -5,10 +5,10 @@
</component>
<component name="ChangeListManager">
<list default="true" readonly="true" id="03ed5703-81a1-441b-849c-c426276586b7" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/cache_redis.go" afterPath="$PROJECT_DIR$/cache/cache_redis.go" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/example/config/config.json" afterPath="$PROJECT_DIR$/example/config/config.json" />
<change beforePath="$PROJECT_DIR$/example/main.go" afterPath="$PROJECT_DIR$/example/main.go" />
<change beforePath="$PROJECT_DIR$/type.go" afterPath="$PROJECT_DIR$/type.go" />
<change beforePath="$PROJECT_DIR$/example/tpt/index.html" afterPath="$PROJECT_DIR$/example/tpt/index.html" />
</list>
<ignored path=".idea/dataSources.local.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -29,15 +29,25 @@
<file leaf-file-name="main.go" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="49" column="17" lean-forward="true" selection-start-line="49" selection-start-column="17" selection-end-line="49" selection-end-column="17" />
<state relative-caret-position="256">
<caret line="82" column="31" lean-forward="true" selection-start-line="82" selection-start-column="31" selection-end-line="82" selection-end-column="31" />
<folding>
<element signature="e#14#167#0" expanded="true" />
<element signature="e#14#177#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="index.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/tpt/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="0" lean-forward="false" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="type.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/type.go">
<provider selected="true" editor-type-id="text-editor">
@ -51,7 +61,7 @@
<file leaf-file-name="cache_redis.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cache/cache_redis.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<state relative-caret-position="1575">
<caret line="110" column="50" lean-forward="false" selection-start-line="110" selection-start-column="50" selection-end-line="110" selection-end-column="50" />
<folding>
<element signature="e#15#106#0" expanded="true" />
@ -63,8 +73,8 @@
<file leaf-file-name="strings.go" pinned="false" current-in-tab="false">
<entry file="file://D:/app/go/src/strings/strings.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="203">
<caret line="92" column="15" lean-forward="true" selection-start-line="92" selection-start-column="15" selection-end-line="92" selection-end-column="15" />
<state relative-caret-position="1335">
<caret line="92" column="15" lean-forward="false" selection-start-line="92" selection-start-column="15" selection-end-line="92" selection-end-column="15" />
<folding />
</state>
</provider>
@ -73,7 +83,7 @@
<file leaf-file-name="objtoobj.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/objtoobj.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="158">
<state relative-caret-position="2985">
<caret line="204" column="5" lean-forward="false" selection-start-line="204" selection-start-column="5" selection-end-line="204" selection-end-column="5" />
<folding />
</state>
@ -84,7 +94,7 @@
<entry file="file://$PROJECT_DIR$/cache_memory.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="915">
<caret line="64" column="23" lean-forward="true" selection-start-line="64" selection-start-column="23" selection-end-line="64" selection-end-column="23" />
<caret line="64" column="0" lean-forward="false" selection-start-line="64" selection-start-column="0" selection-end-line="64" selection-end-column="0" />
<folding />
</state>
</provider>
@ -93,8 +103,8 @@
<file leaf-file-name="config.json" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/config/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="26" lean-forward="true" selection-start-line="15" selection-start-column="26" selection-end-line="15" selection-end-column="26" />
<state relative-caret-position="210">
<caret line="14" column="17" lean-forward="false" selection-start-line="14" selection-start-column="17" selection-end-line="14" selection-end-column="17" />
<folding />
</state>
</provider>
@ -103,8 +113,8 @@
<file leaf-file-name="cache_db.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cache_db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-795">
<caret line="10" column="10" lean-forward="true" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
<state relative-caret-position="105">
<caret line="10" column="10" lean-forward="false" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
<folding />
</state>
</provider>
@ -113,18 +123,8 @@
<file leaf-file-name="db.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="615">
<caret line="331" column="27" lean-forward="true" selection-start-line="331" selection-start-column="27" selection-end-line="331" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="context_base.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/context_base.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="16" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
<state relative-caret-position="4860">
<caret line="331" column="27" lean-forward="false" selection-start-line="331" selection-start-column="27" selection-end-line="331" selection-end-column="27" />
<folding />
</state>
</provider>
@ -187,7 +187,6 @@
<option value="$PROJECT_DIR$/cache_groupcache.go" />
<option value="$PROJECT_DIR$/application.go" />
<option value="$PROJECT_DIR$/session.go" />
<option value="$PROJECT_DIR$/example/tpt/index.html" />
<option value="$PROJECT_DIR$/map.go" />
<option value="$PROJECT_DIR$/const.go" />
<option value="$PROJECT_DIR$/func.go" />
@ -195,8 +194,9 @@
<option value="$PROJECT_DIR$/cache_memory.go" />
<option value="$PROJECT_DIR$/cache_redis.go" />
<option value="$PROJECT_DIR$/type.go" />
<option value="$PROJECT_DIR$/example/config/config.json" />
<option value="$PROJECT_DIR$/cache/cache_redis.go" />
<option value="$PROJECT_DIR$/example/config/config.json" />
<option value="$PROJECT_DIR$/example/tpt/index.html" />
<option value="$PROJECT_DIR$/example/main.go" />
</list>
</option>
@ -232,8 +232,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<expand>
@ -257,11 +255,19 @@
<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>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="AndroidView" />
<pane id="Scratches" />
<pane id="PackagesPane" />
</panes>
</component>
@ -467,6 +473,7 @@
<workItem from="1522778115746" duration="44000" />
<workItem from="1522778659126" duration="455000" />
<workItem from="1522779789231" duration="6991000" />
<workItem from="1523202491878" duration="835000" />
</task>
<task id="LOCAL-00001">
<created>1500458878821</created>
@ -668,7 +675,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="100670000" />
<option name="totallyTimeSpent" value="101505000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -689,18 +696,18 @@
<window_info id="Capture Analysis" 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="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" 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="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32911393" sideWeight="0.5" order="2" 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="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" 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="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.37341422" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" 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="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24972437" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" 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="Favorites" 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="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3997923" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" 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="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Debug Logs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@ -733,12 +740,96 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#14#177#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/type.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="4" lean-forward="false" selection-start-line="11" selection-start-column="4" selection-end-line="11" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache/cache_redis.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1575">
<caret line="110" column="50" lean-forward="false" selection-start-line="110" selection-start-column="50" selection-end-line="110" selection-end-column="50" />
<folding>
<element signature="e#15#106#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://D:/app/go/src/strings/strings.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1335">
<caret line="92" column="15" lean-forward="true" selection-start-line="92" selection-start-column="15" selection-end-line="92" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/objtoobj.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2985">
<caret line="204" column="5" lean-forward="false" selection-start-line="204" selection-start-column="5" selection-end-line="204" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache_memory.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="915">
<caret line="64" column="0" lean-forward="true" selection-start-line="64" selection-start-column="0" selection-end-line="64" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/config/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="26" lean-forward="true" selection-start-line="15" selection-start-column="26" selection-end-line="15" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache_db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="10" column="10" lean-forward="true" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4860">
<caret line="331" column="27" lean-forward="true" selection-start-line="331" selection-start-column="27" selection-end-line="331" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/context_base.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="16" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="18" column="29" lean-forward="false" selection-start-line="18" selection-start-column="29" selection-end-line="18" selection-end-column="29" />
<folding>
<element signature="e#14#167#0" expanded="true" />
<element signature="e#14#177#0" expanded="true" />
</folding>
</state>
</provider>
@ -756,7 +847,7 @@
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#14#167#0" expanded="true" />
<element signature="e#14#177#0" expanded="true" />
</folding>
</state>
</provider>
@ -769,18 +860,11 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache_redis.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<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$/cache_redis.go" />
<entry file="file://$PROJECT_DIR$/context_base.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="16" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
<caret line="13" column="16" lean-forward="false" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
<folding />
</state>
</provider>
@ -788,14 +872,14 @@
<entry file="file://$PROJECT_DIR$/cache_memory.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="915">
<caret line="64" column="23" lean-forward="true" selection-start-line="64" selection-start-column="23" selection-end-line="64" selection-end-column="23" />
<caret line="64" column="0" lean-forward="false" selection-start-line="64" selection-start-column="0" selection-end-line="64" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/objtoobj.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="158">
<state relative-caret-position="2985">
<caret line="204" column="5" lean-forward="false" selection-start-line="204" selection-start-column="5" selection-end-line="204" selection-end-column="5" />
<folding />
</state>
@ -803,8 +887,8 @@
</entry>
<entry file="file://D:/app/go/src/strings/strings.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="203">
<caret line="92" column="15" lean-forward="true" selection-start-line="92" selection-start-column="15" selection-end-line="92" selection-end-column="15" />
<state relative-caret-position="1335">
<caret line="92" column="15" lean-forward="false" selection-start-line="92" selection-start-column="15" selection-end-line="92" selection-end-column="15" />
<folding />
</state>
</provider>
@ -819,7 +903,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/cache/cache_redis.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<state relative-caret-position="1575">
<caret line="110" column="50" lean-forward="false" selection-start-line="110" selection-start-column="50" selection-end-line="110" selection-end-column="50" />
<folding>
<element signature="e#15#106#0" expanded="true" />
@ -827,36 +911,44 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/config/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="26" lean-forward="true" selection-start-line="15" selection-start-column="26" selection-end-line="15" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cache_db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-795">
<caret line="10" column="10" lean-forward="true" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
<state relative-caret-position="105">
<caret line="10" column="10" lean-forward="false" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="615">
<caret line="331" column="27" lean-forward="true" selection-start-line="331" selection-start-column="27" selection-end-line="331" selection-end-column="27" />
<state relative-caret-position="4860">
<caret line="331" column="27" lean-forward="false" selection-start-line="331" selection-start-column="27" selection-end-line="331" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/config/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" column="17" lean-forward="false" selection-start-line="14" selection-start-column="17" selection-end-line="14" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/tpt/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="0" lean-forward="false" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="49" column="17" lean-forward="true" selection-start-line="49" selection-start-column="17" selection-end-line="49" selection-end-column="17" />
<state relative-caret-position="256">
<caret line="82" column="31" lean-forward="true" selection-start-line="82" selection-start-column="31" selection-end-line="82" selection-end-column="31" />
<folding>
<element signature="e#14#167#0" expanded="true" />
<element signature="e#14#177#0" expanded="true" />
</folding>
</state>
</provider>

View File

@ -12,7 +12,7 @@
],
"error": {},
"logLevel": 0,
"port": "80",
"port": "8080",
"redisHost": "192.168.6.254:6379",
"redisPort": "6379",
"redisPwd": "9rusdfjk482fjdfo2e023",

View File

@ -5,8 +5,9 @@ import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"go.hoteas.com/hotime"
"go.hoteas.com/hotime/cache"
//"go.hoteas.com/hotime/cache"
"golang.org/x/net/websocket"
"time"
)
func main() {
@ -32,14 +33,8 @@ func main() {
appIns.SetConfig("example/config/config.json")
ca:=hotime.CacheIns(&cache.CacheRedis{Host:appIns.Config.GetString("redisHost"),Pwd:appIns.Config.GetString("redisPwd"),Time:appIns.Config.GetCeilInt64("cacheLongTime")})
//ca:=hotime.CacheIns(&cache.CacheRedis{Host:appIns.Config.GetString("redisHost"),Pwd:appIns.Config.GetString("redisPwd"),Time:appIns.Config.GetCeilInt64("cacheLongTime")})
ca.Cache("x",hotime.Map{"1":"2132"})
fmt.Println(ca.Cache("x").ToMap())
fmt.Println(ca.Cache("x",nil).Data)
fmt.Println(ca.Cache("x",nil).Data)
fmt.Println(ca.Cache("x").Data)
fmt.Println(ca.Cache("x").Data)
appIns.SetConnectDB(func(err ...*hotime.Error) *sql.DB {
query := appIns.Config.GetString("dbUser") + ":" + appIns.Config.GetString("dbPwd") +
"@tcp(" + appIns.Config.GetString("dbHost") + ":" + appIns.Config.GetString("dbPort") + ")/" + appIns.Config.GetString("dbName") + "?charset=utf8"
@ -81,7 +76,11 @@ func main() {
for true {
msg := make([]byte, 5120)
n, err := ws.Read(msg)
go func() {
time.Sleep(time.Second*5)
ws.Write([]byte("dsadasdasgregergrerge"))
}()
if err != nil {
return
}

View File

@ -1,10 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<meta charset="UTF-8"/>
<title>Sample of websocket with golang</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function() {
var ws = new WebSocket("ws://localhost:8080/app/index/websocket");
ws.onmessage = function(e) {
$('<li>').text(e.data).appendTo($ul);
};
var $ul = $('#msg-list');
$('#sendBtn').click(function(){
var data = $('#name').val();
ws.send(data);
});
});
</script>
</head>
<body>
<input id="name" type="text"/>
<input type="button" id="sendBtn" value="send"/>
<ul id="msg-list"></ul>
</body>
</html>