chitchat

package module
v0.0.0-...-84ab04b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2015 License: MIT Imports: 4 Imported by: 0

README

Chit Chat

A little Redis experiment in Go.

Basically publish text to a Redis topic, and the subscribers speak the phrase via the /usr/bin/say command.

For amusement create mutliple subscribers on multiple machines, with different voices.

Build

See build.sh

Usage

Publisher

The voice parameter is ignored for the publisher.

$ ./bin/chitchatpub --help
Usage of ./bin/chitchatpub:
-db=0: Redis database
-host="127.0.0.1": Redis host
-key="speech": Key to broadcast to
-port=6379: Redis port
-voice="": Voice to use for speech
Subscriber

The voice parameter is optional. If not supplied the say command will be executed without a voice specified so the system default will be used.

If a voice is specified it is assumed to exist on your system. Specifiying a voice that does not exist will result in silence when speaking a message.

$ ./bin/chitchatsub --help
Usage of ./bin/chitchatsub:
-db=0: Redis database
-host="127.0.0.1": Redis host
-key="speech": Key to broadcast to
-port=6379: Redis port
-voice="": Voice to use for speech
Examples

Subscribe to messages, using voice alex

$ ./bin/chitchatsub -v alex --host 192.168.x.y

Publish a message

$ ./bin/chitchatsub -v alex --host 192.168.x.y

Publish a message.

$ ./bin/chitchatpub --host 192.168.x.y This is the sound of noise

Listen to the voices, but take care when following their advice :)

License

The MIT License (MIT)

Copyright (c) 2015 Scott Barr

See LICENSE.md

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(config *RedisConfig) redis.Conn

Types

type Config

type Config struct {
	RedisConfig
	Voice string
}

func ParseConfig

func ParseConfig() *Config

Parse the config

type RedisConfig

type RedisConfig struct {
	Host string
	Port int
	DB   int
	Key  string
}

func (*RedisConfig) ConnString

func (config *RedisConfig) ConnString() string

Directories

Path Synopsis
cmd
chitchatpub
pub.go
pub.go
chitchatsub
sub.go
sub.go

Jump to

Keyboard shortcuts

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