gows

package
v0.0.0-...-ab261b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2013 License: LGPL-3.0, LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

main.go : GOWS main program Copyright (C) 2013 Shaun Savage <savages@savages.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

gows.go : GOWS library entry main program Copyright (C) 2013 Shaun Savage <savages@savages.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

main.go : GOWS main program Copyright (C) 2013 Shaun Savage <savages@savages.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var Modules = make(map[string]*Module)

Functions

func Broadcast

func Broadcast(conn *Connection, dat map[string]interface{})

func ConvNullInt

func ConvNullInt(val sql.NullInt64) int64

func ConvNullStr

func ConvNullStr(val sql.NullString) string

func DeReflect

func DeReflect(unk interface{})

func GetDB

func GetDB() *sqlx.DB

func HHandle

func HHandle(dir string, hndlr func(http.ResponseWriter, *http.Request))

func Init

func Init() *sqlx.DB

func MsgNew

func MsgNew(cmd map[string]interface{}) map[string]interface{}

func Regfunc

func Regfunc(nam string, cmd Command)

func Run

func Run(flag *string, errhndlr http.Handler)

func Setup

func Setup(dir string, hndlr func(http.ResponseWriter, *http.Request))

func WHandle

func WHandle(dir string, hndlr websocket.Handler)

Types

type BaseReq

type BaseReq struct {
	// contains filtered or unexported fields
}

type BaseRet

type BaseRet struct {
	BaseReq
	// contains filtered or unexported fields
}

type Cmdfunc

type Cmdfunc struct {
	// contains filtered or unexported fields
}

type Cmditem

type Cmditem struct {
	// contains filtered or unexported fields
}

type Cmdstruct

type Cmdstruct struct {
	// contains filtered or unexported fields
}

type Command

type Command func(conn *Connection, jin map[string]interface{}) map[string]interface{}

type Connection

type Connection struct {
	// The websocket connection.
	Ws *websocket.Conn

	// Buffered channel of outbound messages.
	Send chan map[string]interface{}

	Msg map[string]interface{}
	// contains filtered or unexported fields
}

func (*Connection) Reply

func (c *Connection) Reply(dat map[string]interface{})

func (*Connection) Run

func (h *Connection) Run()

func (*Connection) SendMsg

func (c *Connection) SendMsg(msg map[string]interface{})

type Module

type Module struct {
	Name  string
	Procs map[string]Command
	Data  interface{}
}

func (Module) Add

func (m Module) Add(mod *Module)

func (Module) List

func (m Module) List()
func ddmods() {
	modules["stroke"] = &stroke.Module
	modules["book"] = &book.Module
	modules["edit"] = &edit.Module

	stroke.Module.Add(&stroke.Module)
	book.Module.Add(&book.Module)
	edit.Module.Add(&edit.Module)
}

func Del

type T

type T struct {
	Msg   string
	Count int
}

Directories

Path Synopsis
auth.go : GOWS authencation program Copyright (C) 2013 Shaun Savage <savages@savages.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
auth.go : GOWS authencation program Copyright (C) 2013 Shaun Savage <savages@savages.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
conf.go : GOWS configuration Copyright (C) 2013 Shaun Savage <savages@savages.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
conf.go : GOWS configuration Copyright (C) 2013 Shaun Savage <savages@savages.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL