slack

package
v0.0.0-...-7dcfc68 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_API = "https://slack.com/api/rtm.start"
View Source
const WS_ORIGIN = "https://api.slack.com/"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

type BaseEvent struct {
	Id      uint64 `json:"id"`
	Type    string `json:"type"`
	Channel string `json:"channel"`
	Text    string `json:"text"`
}

func (BaseEvent) ConcreteEvent

func (event BaseEvent) ConcreteEvent() Event

func (BaseEvent) EventType

func (event BaseEvent) EventType() string

func (BaseEvent) SetNextId

func (event BaseEvent) SetNextId()

func (BaseEvent) String

func (event BaseEvent) String() string

type Event

type Event interface {
	String() string
	ConcreteEvent() Event
	SetNextId()

	EventType() string
}

type MessageEvent

type MessageEvent struct {
	*BaseEvent
}

type RtmStartApi

type RtmStartApi struct {
	Token string
}

func (*RtmStartApi) WssUrl

func (api *RtmStartApi) WssUrl() (url string, err error)

type Session

type Session struct {
	Token string
	Bot   *bot.SlackBot
	// contains filtered or unexported fields
}

func (*Session) Close

func (session *Session) Close() error

func (*Session) Receive

func (session *Session) Receive() (Event, error)

func (*Session) Send

func (session *Session) Send(event Event) error

func (*Session) Start

func (session *Session) Start() error

Jump to

Keyboard shortcuts

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