stream

package
v0.0.0-...-a17a3e0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2017 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StreamBucket = store.Bucket("streams")
)

Buckets. Note that each River in RiverBucket is a bucket.

Functions

func CheckExists

func CheckExists(id string) func(*bolt.Tx) error

CheckExists returns a function which returns nil if the Stream with the given ID exists.

func CheckNotExist

func CheckNotExist(id string) func(*bolt.Tx) error

CheckNotExist returns a function which returns nil if the Stream with the given ID does not exist.

func Delete

func Delete(id string) func(*bolt.Tx) error

Delete deletes the stream with the given ID.

func Get

func Get(s *Stream, id string) func(*bolt.Tx) error

Get returns a function which loads the stream for the given ID, or returns any error.

func GetAll

func GetAll(
	user string,
	filters ...users.Filter,
) func(*bolt.Tx) ([]*Stream, error)

GetAll returns a function which unmarshals all streams for which the user has ownership. If Filters are passed, only streams for which filter.Member(stream) == true will be returned.

func IsExists

func IsExists(err error) bool

func IsMissing

func IsMissing(err error) bool

func IsUnauthorized

func IsUnauthorized(err error) bool

func Upsert

func Upsert(s *Stream) func(*bolt.Tx) error

Upsert returns a function which inserts or updates the given Stream, or returns any error.

Types

type Connected

type Connected ConnectionNotif

Connected is a notification Resourcer that can inform a user someone has joined the Stream.

func (Connected) Resource

func (Connected) Resource() store.Resource

Resource implements Resourcer.Resource on Connected.

type ConnectionNotif

type ConnectionNotif struct {
	UserID   string `json:"userID"`
	StreamID string `json:"streamID"`
}

ConnectionNotif is a base for stream Resourcers to create notifs. Implement store.Resourcer as a method on an alias of ConnectionNotif.

type Deleted

type Deleted string

Deleted is a notification Resourcer that notifies the user a resource has been deleted.

func (Deleted) Resource

func (Deleted) Resource() store.Resource

Resource implements Resourcer.Resource on Deleted.

type Disconnected

type Disconnected ConnectionNotif

Disconnected is a notification Resourcer that can inform a user someone has left the Stream.

func (Disconnected) Resource

func (Disconnected) Resource() store.Resource

Resource implements Resourcer.Resource on Disconnected.

type Message

type Message struct {
	Kind    int    `json:"kind"`
	Content string `json:"content"`
}

type Removed

type Removed string

Removed is a notification Resourcer that can inform a user they have been removed from the Stream without informing them of any other information about the Stream.

func (Removed) Resource

func (Removed) Resource() store.Resource

Resource implements Resourcer.Resource on Removed.

type Stream

type Stream struct {
	users.Group

	ID   string `json:"id"`
	Name string `json:"name"`
}

Stream represents user access to an underlying Router, Coupler, etc.

func (*Stream) Connected

func (s *Stream) Connected(user string) store.Resourcer

Connected is a method on Stream which returns a Resourcer for the connection notif.

func (*Stream) Disconnected

func (s *Stream) Disconnected(user string) store.Resourcer

Disconnected is a method on Stream which returns a Resourcer for the disconnection notif.

func (Stream) Resource

func (Stream) Resource() store.Resource

Resource implements store.Resourcer on Stream.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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