heya

package
v0.0.0-...-8fcfbba Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Defines package responsible for performing the actual sending and receiving of messages to URLs.

Index

Constants

View Source
const (
	StateNew        = 0
	StateUnassigned = 1
	StateAssigned   = 2

	HeyaScheme  = "heya"
	DefaultPort = heya_client.DefaultPort
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(config *config.Config, d *db.Database, processOnce bool, processor MessageProcessor, assignmentChangeReporter func(ids.ID, string, bool) error) (*Manager, error)

func (*Manager) CreateTransport

func (m *Manager) CreateTransport(authToken, host string, port int) error

func (*Manager) Ping

func (m *Manager) Ping(_ context.Context, host string, port int) error

func (*Manager) ReportGroup

func (m *Manager) ReportGroup(id ids.ID) error

func (*Manager) Send

func (m *Manager) Send(from, to string, body []byte) error

func (*Manager) SetIOSPushTokens

func (m *Manager) SetIOSPushTokens(tokens []string) error

func (*Manager) Shutdown

func (m *Manager) Shutdown() error

func (*Manager) Start

func (m *Manager) Start() error

func (*Manager) URLsForGroup

func (m *Manager) URLsForGroup(id ids.ID) ([]string, error)

func (*Manager) Updates

func (m *Manager) Updates() chan interface{}

func (*Manager) WaitForPending

func (m *Manager) WaitForPending()

type MessageImpl

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

func (*MessageImpl) Body

func (m *MessageImpl) Body() []byte

func (*MessageImpl) From

func (m *MessageImpl) From() string

type MessageProcessor

type MessageProcessor func([]*MessageImpl) error

type ParsedURL

type ParsedURL struct {
	Host        string
	Port        int
	PublicBytes [32]byte
	SendToken   [32]byte
}

func ParseURL

func ParseURL(u string) (*ParsedURL, error)

func (*ParsedURL) URL

func (pu *ParsedURL) URL() string

type StateUpdate

type StateUpdate struct {
	Host  string
	Port  int
	State string
}

Jump to

Keyboard shortcuts

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