channels

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

This package contains the code implementing the queries, mutations and subscriptions defined in logger.graphql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMessage

func AddMessage(ctx context.Context, channelName string, message string) (bool, error)

Add a message to the given channel.

func HandleAddMessage

func HandleAddMessage(ctx echo.Context) error

func MessageAdded

func MessageAdded(ctx context.Context, channelName string) (<-chan *types.Message, error)

Subscription handler for added messages.

Types

type Channel

type Channel struct {
	*sync.Mutex
	Name      string
	LastUsed  time.Time
	Listeners map[string]*Listener
}

Defines a channel which a client can push data to.

type Listener

type Listener struct {
	Id      string
	Channel chan *types.Message
}

Defines a listener within a channel.

Jump to

Keyboard shortcuts

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