hearkat

package module
v0.0.0-...-cbab12b Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: GPL-2.0 Imports: 9 Imported by: 6

README

hearkat-go

A go client for hearkat

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMessage

type AuthMessage struct {
	WebsocketMessage
	UserToken   string `json:"usertoken"`
	AccessToken string `json:"accesstoken"`
}

type Chat

type Chat struct {
	Sender  string `json:"sender"`
	Message string `json:"message"`
}

type ConsumeMessage

type ConsumeMessage struct {
	WebsocketMessage
	Channel *string `json:"channel,omitempty"`
}

type Event

type Event struct {
	Key  string            `json:"key"`
	Args map[string]string `json:"args"`
}

type Hearkat

type Hearkat interface {
	Push(channel string, message *Message) error
	Pull(channel string) ([]*MessageContainer, error)
	PullAll() ([]*MessageContainer, error)
	Stream(channel string) (*Stream, error)
	StreamAll() (*Stream, error)
}

func NewClient

func NewClient(userToken string, accessToken string) Hearkat

type Job

type Job struct {
	Title    string            `json:"title"`
	Company  string            `json:"company"`
	Location string            `json:"location"`
	Type     string            `json:"type"`
	Desc     string            `json:"description"`
	Link     string            `json:"link"`
	Misc     map[string]string `json:"misc"`
}

type Message

type Message struct {
	Notification *Notification `json:"notification,omitempty"`
	News         *News         `json:"news,omitempty"`
	Chat         *Chat         `json:"chat,omitempty"`
	Job          *Job          `json:"job,omitempty"`
	ShopItem     *ShopItem     `json:"shopItem,omitempty"`
	Event        *Event        `json:"event,omitempty"`
	Metadata     *Metadata     `json:"metadata,omitempty"`
	Tags         *Tags         `json:"tags,omitempty"`
}

func (*Message) Reader

func (message *Message) Reader() io.Reader

type MessageContainer

type MessageContainer struct {
	Channel string  `json:"channel"`
	Sender  string  `json:"sender"`
	Message Message `json:"message"`
}

type Metadata

type Metadata map[string]interface{}

type News

type News struct {
	Title   string `json:"title"`
	Summary string `json:"summary"`
	Link    string `json:"link"`
}

type Notification

type Notification struct {
	Title   string  `json:"title"`
	Message string  `json:"message"`
	Link    *string `json:"link,omitempty"`
	Image   *string `json:"image,omitempty"`
}

type ShopItem

type ShopItem struct {
	Title    string  `json:"title"`
	Price    float64 `json:"price"`
	Link     string  `json:"link"`
	Image    *string `json:"image,omitempty"`
	Merchant *string `json:"merchant,omitempty"`
}

type Stream

type Stream struct {
	Messages chan *MessageContainer
	Errors   chan error
	// contains filtered or unexported fields
}

func (*Stream) Close

func (stream *Stream) Close() error

type Tags

type Tags []string

type WebsocketMessage

type WebsocketMessage struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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