From 1fa9b6bc449f2c0d0b603120dc757fd8e2b57967 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 21 Feb 2018 22:43:35 +0000 Subject: [PATCH 1/6] boom boom --- main.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 349689b..63d5838 100644 --- a/main.go +++ b/main.go @@ -58,20 +58,23 @@ func home(w http.ResponseWriter, r *http.Request) { homeTemplate.Execute(w, "ws://"+r.Host+"/echo") } func balance(w http.ResponseWriter, r *http.Request) { + var sendmessage string = "test message" c, err := upgrader.Upgrade(w, r, nil) if err != nil { - log.Print("upgrade:", err) + log.Print("balance upgrade:", err) return } defer c.Close() for { mt, message, err := c.ReadMessage() - if err != nil { - log.Println("read:", err) - break - } - log.Printf("recv: %s", message) - err = c.WriteMessage(mt, message) + if err != nil { + log.Println("read:", err) + break + } + log.Debug(message) + + + err = c.WriteMessage(mt, []byte(sendmessage)) if err != nil { log.Println("write:", err) break @@ -101,7 +104,7 @@ func updateData() { pushBalance(i,balance) } } - time.Sleep(300 * time.Millisecond) + time.Sleep(1000 * time.Millisecond) } } @@ -114,7 +117,7 @@ func main() { flag.Parse() - go updateData() + //go updateData() http.HandleFunc("/echo", echo) http.HandleFunc("/", home) From 02d3ff3b5c8005c39a1ccadf3773a9e1925d83ca Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 22 Feb 2018 22:35:59 +0000 Subject: [PATCH 2/6] lets go --- balance/balance.go | 21 +++++++++++++++++++++ main.go | 43 ++++++++++++++++--------------------------- 2 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 balance/balance.go diff --git a/balance/balance.go b/balance/balance.go new file mode 100644 index 0000000..bf9ad16 --- /dev/null +++ b/balance/balance.go @@ -0,0 +1,21 @@ +package balance + +import ( + "math/rand" + "strconv" + + log "github.com/sirupsen/logrus" +) + +//PushBalance sends it back to the client +func PushBalance(userid int, balance int) { + log.Debug("Pushing " + strconv.Itoa(balance) + " to " + strconv.Itoa(userid)) +} + +//GetBalance just returns a random number for now +func GetBalance(userid int) int { + var balance int + balance = rand.Intn(100) + log.Debug("Balance for " + strconv.Itoa(userid) + " = " + strconv.Itoa(balance)) + return balance +} diff --git a/main.go b/main.go index 63d5838..1f5e9fc 100644 --- a/main.go +++ b/main.go @@ -4,15 +4,14 @@ import ( "flag" "fmt" "html/template" - "math/rand" "net/http" "os" - "strconv" "time" "github.com/gorilla/websocket" "github.com/sgoodliff/hello" + "github.com/sgoodliff/improved-giggle/balance" log "github.com/sirupsen/logrus" ) @@ -53,12 +52,8 @@ func echo(w http.ResponseWriter, r *http.Request) { } } } - -func home(w http.ResponseWriter, r *http.Request) { - homeTemplate.Execute(w, "ws://"+r.Host+"/echo") -} -func balance(w http.ResponseWriter, r *http.Request) { - var sendmessage string = "test message" +func balanceHandler(w http.ResponseWriter, r *http.Request) { + var sendmessage = "test message" c, err := upgrader.Upgrade(w, r, nil) if err != nil { log.Print("balance upgrade:", err) @@ -67,12 +62,11 @@ func balance(w http.ResponseWriter, r *http.Request) { defer c.Close() for { mt, message, err := c.ReadMessage() - if err != nil { - log.Println("read:", err) - break - } + if err != nil { + log.Println("read:", err) + break + } log.Debug(message) - err = c.WriteMessage(mt, []byte(sendmessage)) if err != nil { @@ -81,27 +75,22 @@ func balance(w http.ResponseWriter, r *http.Request) { } } } -func pushBalance(userid int,balance int) { - log.Debug("Pushing " + strconv.Itoa(balance) + " to " + strconv.Itoa(userid) ) -} -func getBalance(userid int) int { - var balance int - balance = rand.Intn(100) - log.Debug("Balance for " + strconv.Itoa(userid) + " = " + strconv.Itoa(balance)) - return balance +func home(w http.ResponseWriter, r *http.Request) { + //homeTemplate.Execute(w, "ws://"+r.Host+"/echo") + homeTemplate.Execute(w, "ws://"+r.Host+"/balance") } func updateData() { balances := make(map[int]int) - var balance int + var mybalance int for { for i := 0; i < 100; i++ { - balance = getBalance(i) - if balance != balances[i] { + mybalance = balance.GetBalance(i) + if mybalance != balances[i] { log.Debug("Current balance has changed") - balances[i] = balance + balances[i] = mybalance // we need to push this to client - pushBalance(i,balance) + balance.PushBalance(i, mybalance) } } time.Sleep(1000 * time.Millisecond) @@ -121,7 +110,7 @@ func main() { http.HandleFunc("/echo", echo) http.HandleFunc("/", home) - http.HandleFunc("/balance", balance) + http.HandleFunc("/balance", balanceHandler) log.Fatal(http.ListenAndServe(*addr, nil)) } From 7f49df61e3070cfba847db72c474fa708f30291d Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 6 Mar 2018 21:12:43 +0000 Subject: [PATCH 3/6] new additions --- Gopkg.lock | 23 ++++++++- client.go | 138 +++++++++++++++++++++++++++++++++++++++++++++++++ html/home.html | 98 +++++++++++++++++++++++++++++++++++ hub.go | 53 +++++++++++++++++++ main.go | 19 +++++++ 5 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 client.go create mode 100644 html/home.html create mode 100644 hub.go diff --git a/Gopkg.lock b/Gopkg.lock index a667c76..ffb45ea 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -13,9 +13,30 @@ packages = ["."] revision = "8932dfe1d5c8eea12a90372a7fbd0ecf003afb71" +[[projects]] + name = "github.com/sirupsen/logrus" + packages = ["."] + revision = "d682213848ed68c0a260ca37d6dd5ace8423f5ba" + version = "v1.0.4" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + revision = "91a49db82a88618983a78a06c1cbd4e00ab749ab" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows" + ] + revision = "dd2ff4accc098aceecb86b36eaa7829b2a17b1c9" + [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "3e660fdcf9fd331fc96db063246816876280939c02d47ae51bf32d39f7280d4f" + inputs-digest = "70923857844a07f13b3c0bd9e900e7b85717299f6b9c6ff36e5b4af2aac02da2" solver-name = "gps-cdcl" solver-version = 1 diff --git a/client.go b/client.go new file mode 100644 index 0000000..8c95a43 --- /dev/null +++ b/client.go @@ -0,0 +1,138 @@ +// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "log" + "net/http" + "time" + + "github.com/gorilla/websocket" +) + +const ( + // Time allowed to write a message to the peer. + writeWait = 10 * time.Second + + // Time allowed to read the next pong message from the peer. + pongWait = 60 * time.Second + + // Send pings to peer with this period. Must be less than pongWait. + pingPeriod = (pongWait * 9) / 10 + + // Maximum message size allowed from peer. + maxMessageSize = 512 +) + +var ( + newline = []byte{'\n'} + space = []byte{' '} +) + +/* +var upgrader = websocket.Upgrader{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, +} +*/ +// Client is a middleman between the websocket connection and the hub. +type Client struct { + hub *Hub + + // The websocket connection. + conn *websocket.Conn + + // Buffered channel of outbound messages. + send chan []byte +} + +// readPump pumps messages from the websocket connection to the hub. +// +// The application runs readPump in a per-connection goroutine. The application +// ensures that there is at most one reader on a connection by executing all +// reads from this goroutine. +func (c *Client) readPump() { + defer func() { + c.hub.unregister <- c + c.conn.Close() + }() + c.conn.SetReadLimit(maxMessageSize) + c.conn.SetReadDeadline(time.Now().Add(pongWait)) + c.conn.SetPongHandler(func(string) error { c.conn.SetReadDeadline(time.Now().Add(pongWait)); return nil }) + for { + _, message, err := c.conn.ReadMessage() + if err != nil { + if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) { + log.Printf("error: %v", err) + } + break + } + message = bytes.TrimSpace(bytes.Replace(message, newline, space, -1)) + c.hub.broadcast <- message + } +} + +// writePump pumps messages from the hub to the websocket connection. +// +// A goroutine running writePump is started for each connection. The +// application ensures that there is at most one writer to a connection by +// executing all writes from this goroutine. +func (c *Client) writePump() { + ticker := time.NewTicker(pingPeriod) + defer func() { + ticker.Stop() + c.conn.Close() + }() + for { + select { + case message, ok := <-c.send: + c.conn.SetWriteDeadline(time.Now().Add(writeWait)) + if !ok { + // The hub closed the channel. + c.conn.WriteMessage(websocket.CloseMessage, []byte{}) + return + } + + w, err := c.conn.NextWriter(websocket.TextMessage) + if err != nil { + return + } + w.Write(message) + + // Add queued chat messages to the current websocket message. + n := len(c.send) + for i := 0; i < n; i++ { + w.Write(newline) + w.Write(<-c.send) + } + + if err := w.Close(); err != nil { + return + } + case <-ticker.C: + c.conn.SetWriteDeadline(time.Now().Add(writeWait)) + if err := c.conn.WriteMessage(websocket.PingMessage, nil); err != nil { + return + } + } + } +} + +// serveWs handles websocket requests from the peer. +func serveWs(hub *Hub, w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + log.Println(err) + return + } + client := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)} + client.hub.register <- client + + // Allow collection of memory referenced by the caller by doing all work in + // new goroutines. + go client.writePump() + go client.readPump() +} diff --git a/html/home.html b/html/home.html new file mode 100644 index 0000000..a39a0c2 --- /dev/null +++ b/html/home.html @@ -0,0 +1,98 @@ + + + +Chat Example + + + + +
+
+ + +
+ + diff --git a/hub.go b/hub.go new file mode 100644 index 0000000..7f07ea0 --- /dev/null +++ b/hub.go @@ -0,0 +1,53 @@ +// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// hub maintains the set of active clients and broadcasts messages to the +// clients. +type Hub struct { + // Registered clients. + clients map[*Client]bool + + // Inbound messages from the clients. + broadcast chan []byte + + // Register requests from the clients. + register chan *Client + + // Unregister requests from clients. + unregister chan *Client +} + +func newHub() *Hub { + return &Hub{ + broadcast: make(chan []byte), + register: make(chan *Client), + unregister: make(chan *Client), + clients: make(map[*Client]bool), + } +} + +func (h *Hub) run() { + for { + select { + case client := <-h.register: + h.clients[client] = true + case client := <-h.unregister: + if _, ok := h.clients[client]; ok { + delete(h.clients, client) + close(client.send) + } + case message := <-h.broadcast: + for client := range h.clients { + select { + case client.send <- message: + default: + close(client.send) + delete(h.clients, client) + } + } + } + } +} diff --git a/main.go b/main.go index 1f5e9fc..1e5a8ec 100644 --- a/main.go +++ b/main.go @@ -79,6 +79,18 @@ func home(w http.ResponseWriter, r *http.Request) { //homeTemplate.Execute(w, "ws://"+r.Host+"/echo") homeTemplate.Execute(w, "ws://"+r.Host+"/balance") } +func hubHomeHandler(w http.ResponseWriter, r *http.Request) { + log.Println(r.URL) + if r.URL.Path != "/hubhome" { + http.Error(w, "Not found", http.StatusNotFound) + return + } + if r.Method != "GET" { + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + return + } + http.ServeFile(w, r, "html/home.html") +} func updateData() { balances := make(map[int]int) @@ -107,10 +119,17 @@ func main() { flag.Parse() //go updateData() + hub := newHub() + go hub.run() http.HandleFunc("/echo", echo) http.HandleFunc("/", home) http.HandleFunc("/balance", balanceHandler) + http.HandleFunc("/hubhome", hubHomeHandler) + //http.HandleFunc("/hub", hubHandler) + http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { + serveWs(hub, w, r) + }) log.Fatal(http.ListenAndServe(*addr, nil)) } From f9d19e2f7b82ddd7f2640ec0b597cec1209e292d Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 11 Oct 2018 22:18:17 +0100 Subject: [PATCH 4/6] see if i can remember where i'd got to --- .gitignore | 1 + client.go | 7 +- html/My Infrequent Thoughts.html | 235 +++++++++++++++++++ html/My Infrequent Thoughts_files/logo.png | Bin 0 -> 9836 bytes html/My Infrequent Thoughts_files/main.css | 5 + html/My Infrequent Thoughts_files/main.js | 1 + html/My Infrequent Thoughts_files/sidebar.js | 1 + hub.go | 3 +- main.go | 172 +++----------- 9 files changed, 273 insertions(+), 152 deletions(-) create mode 100644 html/My Infrequent Thoughts.html create mode 100644 html/My Infrequent Thoughts_files/logo.png create mode 100644 html/My Infrequent Thoughts_files/main.css create mode 100644 html/My Infrequent Thoughts_files/main.js create mode 100644 html/My Infrequent Thoughts_files/sidebar.js diff --git a/.gitignore b/.gitignore index 18d19d0..c615fa0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor improved-giggle +/old diff --git a/client.go b/client.go index 8c95a43..3993617 100644 --- a/client.go +++ b/client.go @@ -27,16 +27,11 @@ const ( maxMessageSize = 512 ) +/* var ( newline = []byte{'\n'} space = []byte{' '} ) - -/* -var upgrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024, -} */ // Client is a middleman between the websocket connection and the hub. type Client struct { diff --git a/html/My Infrequent Thoughts.html b/html/My Infrequent Thoughts.html new file mode 100644 index 0000000..83551f0 --- /dev/null +++ b/html/My Infrequent Thoughts.html @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + My Infrequent Thoughts + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ + +
+
+
+

Recent Posts

+
+ +
    + +
  • +
    + + Posted on + + + +
    +
    +

    + Movinghouse +

    +
    +
  • + + +
  • +
    + + Posted on + + + +
    +
    +

    + GCP Exam +

    +
    +
  • + + +
+
+
+
+ + + +
+
+ + + + + + + \ No newline at end of file diff --git a/html/My Infrequent Thoughts_files/logo.png b/html/My Infrequent Thoughts_files/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7d21219a7f137bcb7e96ace03bbaea95b25febfd GIT binary patch literal 9836 zcmaKSc{r3``1g5c%-Cs}M2KpbQDP#y81+SyJt4cYBztz*9x2+WW{@?LN<|`TlWkD> zj)WHbHfo||nMhHL_woJx-oM`Kdat?WnmK3A+|PY~&VA0g&;7ZtSX-Kk3hfXA0EkkK z{&O4v6!H}X1hB}*&*+bTkPqx>Gt+;-`o@di_>hM52!&6=bx%rYvCx1A_ z!kGUPieG3yVR?CT5diXl@{iGp=%LwB|4#3ScujV!;dPQn&M7aU3{9zv+T~J2_KrvJ z=3^1^+lW-M`55Yu(X;zIM4B#bGF(oQ3{WWWJ!15XzrtdNqRoZsq!w!uM!CZ1g4N8X zP1LNtva&uzZTZgghBFVu)Kb@G&dBvmyx4O116{3oY5aRre`0x~eYx@*pwU17R$)+! z#iNYf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?csoMpV+qhl?*u(tbD zPn=p$!`~ppjG09uh*2^wJg`&JR%HF9At#@M{{BS@Plu&N(|5eI7U>CLfRCNfFG}TZ zR!NCu{)t)1hBqN53nwCs*R8kxL@q#|=Hd_&m0o$Mu#zZZ7NP&t*oMSWX`cyK@~HaR zEwyWL)HAeId6pSMNlS<$=Jtj5m{q!CoApoTwDb#=sznF2)R$EDd@Psv-}<8n%z7O5 z#{1DMPA|@qOa~x#*m&T-k|?)XqH;OU$!2XSeR}?ldbH=Kg_4spC)dvW>SlkT{8e$)YUWq literal 0 HcmV?d00001 diff --git a/html/My Infrequent Thoughts_files/main.css b/html/My Infrequent Thoughts_files/main.css new file mode 100644 index 0000000..431697f --- /dev/null +++ b/html/My Infrequent Thoughts_files/main.css @@ -0,0 +1,5 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none} +/*! + * Theme Name: Minimo + * Author: Munif Tanjim + */body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1em;line-height:1.5;color:#37474f;word-wrap:break-word}@media screen and (min-width:480px){body{font-size:1.125em}}.title,h1,h2,h3,h4,h5,h6{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-weight:700;line-height:1.2;color:#263238;margin:0 0 .625em}.comment-content h2,.comment-content h3,.comment-content h4,.comment-content h5,.comment-content h6,.entry-content h2,.entry-content h3,.entry-content h4,.entry-content h5,.entry-content h6{margin-top:1.5em}.comment-content h2:first-child,.comment-content h3:first-child,.comment-content h4:first-child,.comment-content h5:first-child,.comment-content h6:first-child,.entry-content h2:first-child,.entry-content h3:first-child,.entry-content h4:first-child,.entry-content h5:first-child,.entry-content h6:first-child{margin-top:0}.site-title,h1{font-size:2em}h2{font-size:1.75em}h3{font-size:1.5em}h4{font-size:1.375em}h5{font-size:1.25em}h6{font-size:1.125em}p{margin:0 0 1.5em}blockquote,cite,dfn,em,i{font-style:italic}blockquote{font-size:1.125em;padding-left:1em;border-left:.2em solid #bdbdbd}address,blockquote{margin:0 0 1.5em}code,kbd,pre,samp,var{font-family:Menlo,Consolas,Monaco,Ubuntu Mono,Liberation Mono,Lucida Console,monospace;background:#eee;color:#212121;border:1px solid #dcdcdc;border-radius:.25em;padding:.1em .25em}pre{overflow:auto;word-wrap:normal;text-align:initial;margin-bottom:1.5em;padding:.75em 1em}pre code,pre kbd,pre samp,pre var{background:none;color:inherit;border:0;padding:0}code,kbd,samp,var{font-size:.9375em}.highlight pre{border:0;margin:0}.comment-content .highlight,.entry-content .highlight{margin-bottom:1.5em}abbr,acronym{border-bottom:1px dotted #212121;cursor:help}ins,mark{background:#212121;text-decoration:none}big{font-size:125%}.desc{font-style:italic}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}blockquote,q{quotes:"" ""}blockquote:after,blockquote:before,q:after,q:before{content:""}blockquote :last-child,q :last-child{margin-bottom:0}hr{border:0;height:1px;margin:2em 0;background-color:#bdbdbd}img{max-width:100%;height:auto}figure{margin:1em 0}a{color:#212121;text-decoration:none;transition:color .1s ease-in-out}a:focus{outline-color:#ffcd00;outline-color:var(--color-accent)}a:active,a:hover{outline:0}a:active,a:focus,a:hover{color:#37474f}a.button{display:inline-block}ol,ul{padding:0;margin:0 0 1.5em 2em}ul{list-style:disc}ol{list-style:decimal}li>ol,li>ul{padding-left:1.5em;margin-bottom:0;margin-left:.5em}dt{font-weight:700}dd{margin:0 1.5em 1.5em}table,td,th{border:1px solid #bdbdbd}table{width:100%;margin:0 0 1.5em;table-layout:fixed;border-collapse:separate;border-spacing:0;border-width:1px 0 0 1px}caption,td,th{font-weight:400;text-align:left}th{font-weight:700}td,th{border-width:0 1px 1px 0}td,th{padding:.375em}.button,button,input[type=button],input[type=reset],input[type=submit]{width:auto;padding:.5em .75em;border:1px solid #bdbdbd;border-radius:.2em;background:#fff;color:#37474f;font-size:1em;font-weight:700;line-height:1.15;text-align:center;letter-spacing:1px;white-space:nowrap;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;transition:.1s ease-in-out}.button:focus,button:focus,input[type=button]:focus,input[type=reset]:focus,input[type=submit]:focus{outline-color:#ffcd00;outline-color:var(--color-accent)}.button:active,.button:hover,button:active,button:hover,input[type=button]:active,input[type=button]:hover,input[type=reset]:active,input[type=reset]:hover,input[type=submit]:active,input[type=submit]:hover{outline:0}.button:active,.button:focus,.button:hover,button:active,button:focus,button:hover,input[type=button]:active,input[type=button]:focus,input[type=button]:hover,input[type=reset]:active,input[type=reset]:focus,input[type=reset]:hover,input[type=submit]:active,input[type=submit]:focus,input[type=submit]:hover{background:#37474f;color:#fff}input,select,textarea{width:100%;padding:.625em .875em;border:1px solid #bdbdbd;border-radius:.2em;color:#37474f;transition:.1s ease-in-out}input:focus,select:focus,textarea:focus{border-color:#ffcd00;outline-color:transparent}label{font-weight:700;letter-spacing:1px}.menu ul{list-style:none;margin:0}.menu li{text-transform:uppercase}.menu li.current>a{font-weight:700;pointer-events:none}.main-menu>div{display:flex;align-items:center}.main-menu li{display:inline-block;margin-right:.625em}.main-menu li:last-child{margin-right:0}.sidebar-menu .item{display:flex;flex-flow:row wrap;justify-content:flex-end}.sidebar-menu .has-current>a{font-style:italic}.sidebar-menu .sub-menu{display:none;padding-left:0;flex:100%;flex-shrink:0}.sidebar-menu .sub-menu .item:not(.has-children){padding-right:1.2em}.sub-menu-toggler{border:0;padding:0;margin-left:.2em;font-weight:400;width:1em}.sub-menu-toggler:active,.sub-menu-toggler:focus,.sub-menu-toggler:hover{background:none}.sub-menu-toggler>.sign{position:relative;top:-2px}.sub-menu-toggler>.sign:after{content:"+"}.toggled>.sub-menu{display:block}.toggled>.sub-menu-toggler>.sign:after{content:"\2013"}.menu a,.sidebar-toggler span,.sub-menu-toggler,.widget-social_menu a{color:#455a64}.menu a:focus,.menu a:hover,.sidebar-toggler span:focus,.sidebar-toggler span:hover,.sub-menu-toggler:focus,.sub-menu-toggler:hover,.widget-social_menu a:focus,.widget-social_menu a:hover{color:#263238}.entry-nav .sep-before:nth-child(2):before{width:2em;margin:1em 0}.entry-nav div a{display:block;font-style:italic}.entry-nav div span{display:block;font-style:normal;font-size:.875em}.page-links{margin-top:2em}.page-link{display:inline-block;padding:.25em .625em}.page-link:first-child{padding-left:0}.page-link:last-child{padding-right:0}.page-link.current{font-weight:700}.page-link.dots{padding:0}.site{overflow-x:hidden}.main{width:100%;padding-top:2em;transition:margin-left .2s}.sidebar.toggled~.main{margin-left:300px}@media screen and (min-width:920px){.main{width:auto}.has-sidebar .main{float:left;margin-left:300px;padding-left:2em}}.container{width:100%;max-width:740px;padding:0 20px;margin:0 auto}.has-sidebar .container{margin-left:0}.sep-after:after,.sep-before:before{content:"";display:block;width:4em;margin-top:2.5em;margin-bottom:2.5em;border-bottom:.125em solid #bdbdbd}.sidebar{visibility:hidden;float:left;left:-300px;position:absolute;width:300px;max-width:100%;min-height:100%;padding:2em 0;margin-right:-100%;outline:0;z-index:99999;transition:left .2s;text-align:right;background:#fff}.sidebar.toggled{visibility:visible;left:0}.sidebar .sep-after:after{margin-left:auto}@media screen and (min-width:920px){.sidebar{visibility:visible;left:0}}.sidebar-toggler{background:none;border:0}.sidebar-toggler .icon{font-size:1.25em}.sidebar-toggler:active,.sidebar-toggler:focus,.sidebar-toggler:hover{background:none}.main .sidebar-toggler{padding:0;position:absolute;right:20px}.main .sidebar-toggler .close{display:none}.main-menu .sidebar-toggler{position:static;margin-right:.75em}.sidebar .sidebar-toggler{position:absolute;top:.5em;left:.5em;z-index:2027}.sidebar .sidebar-toggler .open{display:none}@media screen and (min-width:920px){.sidebar-toggler{display:none}}.sidebar-overlay{display:none}.sidebar.toggled .sidebar-overlay{display:block}.sidebar.toggled .sidebar-overlay:after{content:"";display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:-2027;background:#fff;opacity:.75}@media screen and (min-width:920px){.sidebar.toggled .sidebar-overlay{display:none}}.header .sep-after:after{border-bottom-color:#ffcd00;border-bottom-color:var(--color-accent)}.has-cover .header .sep-after:after,.site-header{display:none}.error404 .site-header,.home .site-header{display:flex}.header-info{margin-top:1.5em}.header-info .title{margin-bottom:0}.header-info .desc{margin:.5em 0 0}.header-info .taxonomy-name{font-size:.875em;margin-right:.25em;font-style:italic}.entry-meta{margin-top:.75em}.entry-meta span{font-size:.9375em;margin-right:.75em;font-style:italic}.entry-meta .icon{margin-right:.25em}.entry-cover figure{margin-top:2em;margin-bottom:2.5em}.entry-cover img{display:block}.entry-cover figcaption{text-align:center;margin:.25em auto 0;padding:0}.entry-cover figcaption span{font-size:.875em}.cover-wide{padding:0;max-width:1080px}.cover-full{padding:0;max-width:100%}.cover-full img{width:100%}details,summary{display:block}summary{cursor:pointer}.no-details details:not([open])>:not(summary){display:none}.no-details details>summary:before{content:"\25BC";display:inline-block;margin-right:.25em;transition:.1s;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.no-details details[open]>summary:before{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.entry-toc{margin-bottom:2.5em}.entry-toc ul{list-style:none;margin:0}.comment-content>:last-child,.comment-content>:last-child>:last-child,.entry-content>:last-child,.entry-content>:last-child>:last-child{margin-bottom:0}.comment-content a,.entry-content a{border-bottom:.125em dashed #bdbdbd}.comment-content a:focus,.comment-content a:hover,.entry-content a:focus,.entry-content a:hover{border-bottom-color:#ffcd00;border-bottom-color:var(--color-accent)}.comment-content a.footnote-return,.entry-content a.footnote-return{border-bottom:none}.entry-footer .container>div{margin-top:.5em}.entry-footer .container>div:first-child{margin-top:2.5em}.entry-footer .taxonomy-icon{margin-right:.375em}.comments ol{list-style:none;margin:0}.comments-title{font-size:1.25em;margin-bottom:1.5em}.comment{position:relative;margin:1em 0}.comment-header{min-height:3em}.comment .avatar{float:left;height:3em;width:3em;border-radius:.25em;margin-right:.75em}.comment-meta{font-size:.875em}.comment .fn{display:inline-block;margin-top:.1em}.comment .reply{position:absolute;right:0;margin-top:-2em}.comment .reply,.comment .reply a{display:inline-block}.comment-content{margin-top:.75em;border-radius:.25em;border:1px solid #bdbdbd;padding:1em;padding-bottom:2em}.comment-respond{margin:1.5em 0}.comment-reply-title small{display:inline-block;font-size:.5em;margin-left:1em}.comment-form label{display:inline-block;margin-bottom:.25em}.comment-form>div{margin-top:1em}.comment-submission-feedback{display:none;position:relative;border-radius:.25em;border:1px solid #bdbdbd;padding:1.5em;margin-bottom:1.5em}.comment-submission-feedback a{position:absolute;top:1.5em;right:1.5em;font-size:.875em}.comment-submission-feedback:target{display:block}.list{margin:0 auto;list-style:none}.entry+.list-container{margin-top:2.5em}.list .item{display:flex;width:100%;margin-top:1em}.list .item:first-of-type{margin-top:0}.list .item .meta{flex:0 0 6em}.list .item .meta span{font-size:.875em}.list .item-header{flex:1}.list .item-title{font-size:1em;font-weight:400;margin-bottom:0;line-height:inherit}.list .item .icon{margin-right:.25em}.taxonomy-cloud{display:flex;flex-wrap:wrap;align-items:center}.taxonomy-cloud li{max-width:100%;padding:0 1.5em .5em 0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.footer .sep-before:before{border-bottom-color:#ffcd00;border-bottom-color:var(--color-accent)}.footer a{font-style:italic}.footer .container>div,.footer .container>section{width:100%;margin-top:1em}.footer .container>div:first-child,.footer .container>section:first-child{margin-top:0}.footer .container>div:last-child,.footer .container>section:last-child{margin-bottom:2em}.error404 .gopher{margin:0}.error404 .gopher img{width:17.5em}.error404 .gopher a{display:block;border:0}.error404 .gopher figcaption{margin-top:1em}.error404 .gopher .title{margin-bottom:0}.home-widgets .sep-before:before{display:none}.entry+.home-widgets .sep-before:before{display:block}.icon{display:inline-block;stroke:currentColor;fill:none;position:relative;top:2px}.icon,img.emoji{height:1em;width:1em}img.emoji{margin:0 .05em 0 .1em;vertical-align:-.1em}.layout-archive .list .item{padding-left:1em}.layout-archive .list .item .meta{flex:0 0 3.5em}.archive-group.sep-after:last-child:after{display:none}.widget-title{margin-bottom:1em}.widget.sep-after:after{margin-top:1.5em;margin-bottom:1.5em}.widget.sep-after:last-of-type:after{display:none}.sidebar .widget-title{margin-bottom:.5em;font-size:1.25em}.sidebar .widget .container{padding:0}.widget-about .logo{max-width:5em}.widget-about .logo a{display:block;line-height:0}.sidebar .widget-about .logo{margin-left:auto}.widget-about .site-title{margin-bottom:0;font-size:1.75em}.sidebar .widget-about.sep-after:after{border-bottom-color:#ffcd00;border-bottom-color:var(--color-accent)}.sidebar .widget-recent_posts .meta{display:none}.sidebar .widget-recent_posts .item{margin-top:0}.widget-social_menu ul{list-style:none;padding:0;margin:0}.widget-social_menu li{display:inline-block;margin-right:.625em}.widget-social_menu li:last-child{margin-right:0}.widget-social_menu li a{font-size:1.125em}.sidebar .widget-social_menu li{margin-right:0;margin-left:.625em}.sidebar .widget-taxonomy_cloud .taxonomy-cloud{justify-content:flex-end;font-size:.875em}.sidebar .widget-taxonomy_cloud li{padding:0 0 .4em .8em}.comment .says,.screen-reader-text{position:absolute;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;width:1px;margin:-1px;padding:0;border:0;overflow:hidden;word-wrap:normal!important}.comment .says:focus,.screen-reader-text:focus{display:block;left:.5em;top:.5em;clip:auto;-webkit-clip-path:none;clip-path:none;height:auto;width:auto;padding:1em;border-radius:.25em;font-size:.875em;font-weight:700;line-height:normal;text-decoration:none;background:#212121;color:#fafafa;z-index:100000}.align-center{text-align:center}.align-center>blockquote{display:inline-block}.align-center>ol,.align-center>ul{display:inline-block;text-align:initial}.align-center li{word-wrap:normal}.convo ol{display:table;list-style:none;margin:0}.convo li{display:table-row}.convo li>div{display:table-cell;padding-bottom:1.5em}.convo .person{font-size:.9em;font-style:italic;text-align:right}.convo .sep{padding-left:.75em;padding-right:.5em}.text-shortcode *{color:inherit;font-size:1em} diff --git a/html/My Infrequent Thoughts_files/main.js b/html/My Infrequent Thoughts_files/main.js new file mode 100644 index 0000000..9136269 --- /dev/null +++ b/html/My Infrequent Thoughts_files/main.js @@ -0,0 +1 @@ +!function(e){function t(t){for(var n,r,u=t[0],i=t[1],c=0,l=[];cb?p>w?y?(y=!1,h=A>0?A:0,n.setAttribute("style","top: "+h+"px;")):!g&&p+b>v+A&&v0?A:0,n.setAttribute("style","top: "+h+"px;")):!y&&p - - - - - - - -
-

Click "Open" to create a connection to the server, -"Send" to send a message to the server and "Close" to close the connection. -You can change the message and send multiple times. -

-

- - -

- -

-
-
-
- - -`)) From 02048f95a042ffb5fd89d4e57719ff6a76c9e2ec Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 11 Oct 2018 22:21:42 +0100 Subject: [PATCH 5/6] tidy up warnings --- client.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 3993617..ad88df8 100644 --- a/client.go +++ b/client.go @@ -1,7 +1,3 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - package main import ( @@ -33,7 +29,8 @@ var ( space = []byte{' '} ) */ -// Client is a middleman between the websocket connection and the hub. + +//Client is a middleman between the websocket connection and the hub. type Client struct { hub *Hub From fe4388176aa5252bb3b89e60178da012dbec8e33 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 17 Oct 2018 21:42:00 +0100 Subject: [PATCH 6/6] moved balace handler to balance.go --- balance/balance.go | 14 ++++++++++++++ main.go | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/balance/balance.go b/balance/balance.go index bf9ad16..c6041b8 100644 --- a/balance/balance.go +++ b/balance/balance.go @@ -2,11 +2,25 @@ package balance import ( "math/rand" + "net/http" "strconv" log "github.com/sirupsen/logrus" ) +func balanceHomeHandler(w http.ResponseWriter, r *http.Request) { + log.Println(r.URL) + if r.URL.Path != "/home" { + http.Error(w, "Not found", http.StatusNotFound) + return + } + if r.Method != "GET" { + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + return + } + http.ServeFile(w, r, "html/home.html") +} + //PushBalance sends it back to the client func PushBalance(userid int, balance int) { log.Debug("Pushing " + strconv.Itoa(balance) + " to " + strconv.Itoa(userid)) diff --git a/main.go b/main.go index a940143..0ce5d48 100644 --- a/main.go +++ b/main.go @@ -33,19 +33,6 @@ var ( upgrader = websocket.Upgrader{} // use default options ) -func balanceHomeHandler(w http.ResponseWriter, r *http.Request) { - log.Println(r.URL) - if r.URL.Path != "/home" { - http.Error(w, "Not found", http.StatusNotFound) - return - } - if r.Method != "GET" { - http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) - return - } - http.ServeFile(w, r, "html/home.html") -} - func balanceHandler(w http.ResponseWriter, r *http.Request) { b := []byte("Hello, goodbye, etc!") c, err := upgrader.Upgrade(w, r, nil)