client

package module
v0.0.0-...-2a171a0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2014 License: MIT Imports: 9 Imported by: 4

README

Yo'ed HTTP interface

The Yo'ed HTTP interface. All the Yo'ed handlers should use the Client to communicate with the Yo'ed server over HTTP (only protocol supported now).

#Configuration

Add a config.json file in the same folder than the program.

##listen (string)

The ip:port to listen to

##serverUrl (string)

The main server URL to connect to

##handles ([]string)

The Yo handles to monitor

#Interface

All the Yo'ed handlers must comply to the following Go interface:

type Handler interface {
	Handle(username string)
}

The Handle method is the action to execute when a Yo is received.

#Protocol

The communication protocol with the Yo'ed server is described here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configPath string, v interface{}) error

Types

type Client

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

func New

func New(handler Handler, config *Config) *Client

func (*Client) Run

func (c *Client) Run()

type Config

type Config struct {
	Listen    string   `json:"listen"`
	ServerUrl string   `json:"server_url"`
	Handles   []string `json:"handles"`
}

type Handler

type Handler interface {
	Handle(username, handle string)
}

Jump to

Keyboard shortcuts

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