domain

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	C = newStore()
)

Functions

func CreateChannel

func CreateChannel(name, description string)

func ListChannels

func ListChannels() map[string]*Stream

func SendMessage

func SendMessage(channel, message string) error

func Setup

func Setup()

TODO: streams per user

Types

type Message

type Message struct {
	Id       string
	Text     string
	Created  int64 `json:",string"`
	Stream   string
	Metadata *Metadata
}

func ListMessages

func ListMessages(channel string, limit int64) []*Message

type Metadata

type Metadata struct {
	Created     int64
	Title       string
	Description string
	Type        string
	Image       string
	Url         string
	Site        string
}

type Store

type Store struct {
	Created int64
	Updates chan *Message

	Streams *lru.Cache
	// contains filtered or unexported fields
}

func (*Store) CreateStream

func (c *Store) CreateStream(name, description string)

func (*Store) ListStreams

func (c *Store) ListStreams() map[string]*Stream

func (*Store) Metadata

func (c *Store) Metadata(t *Message)

func (*Store) Retrieve

func (c *Store) Retrieve(message string, streem string, direction, last, limit int64) []*Message

func (*Store) Run

func (c *Store) Run()

func (*Store) Save

func (c *Store) Save(message *Message)

type Stream

type Stream struct {
	Id          string
	Description string
	Messages    []*Message
	Updated     int64
}

Jump to

Keyboard shortcuts

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