campfire

package
v0.0.0-...-4ab9184 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2012 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(account, token string) *Client

func (*Client) Get

func (self *Client) Get(path string) (*http.Response, error)

func (*Client) Post

func (self *Client) Post(path string, body string) (*http.Response, error)

func (*Client) Room

func (self *Client) Room(id int) *Room

func (*Client) Stream

func (self *Client) Stream(roomId int, channel chan *Message)

type Message

type Message struct {
	Id     int `json:"id"`
	RoomId int `json:"room_id"`
	UserId int `json:"user_id"`

	Type      string `json:"type"`
	CreatedAt string `json:"created_at"`
	Body      string `json:"body"`
}

type MessageWrapper

type MessageWrapper struct {
	Message *Message `json:"message"`
}

type Room

type Room struct {
	Client *Client

	Id    int     `json:"id"`
	Name  string  `json:"name"`
	Users []*User `json:"users"`
}

func (*Room) Join

func (self *Room) Join() error

func (*Room) Say

func (self *Room) Say(message string)

func (*Room) Show

func (self *Room) Show() (*Room, error)

func (*Room) Stream

func (self *Room) Stream(channel chan *Message)

type Stream

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

func NewStream

func NewStream(token string, room *Room) *Stream

func (*Stream) Connect

func (self *Stream) Connect() (*http.Response, error)

func (*Stream) Read

func (self *Stream) Read(resp *http.Response)

func (*Stream) SetChannel

func (self *Stream) SetChannel(channel chan *Message)

type User

type User struct {
	Id   int
	Name string
}

Jump to

Keyboard shortcuts

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