messagelog

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package messagelog provides a storage for an ordered set of messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageLog

type MessageLog interface {
	Append(msg messages.Message)
	Stream(done <-chan struct{}) <-chan messages.Message
	Messages() []messages.Message
	Reset(msgs []messages.Message)
}

MessageLog represents the message storage. It allows to asynchronously append messages, as well as to obtain multiple independent asynchronous streams to receive new messages from. Each of the streams provides an ordered sequence of all messages as they appear in the log. All methods are safe to invoke concurrently.

Append appends a new message to the log. It will never be blocked by any of the message streams.

Stream returns an independent channel to receive all messages as they appear in the log. Closing the channel passed to this function indicates the returned channel should be closed. Nil channel may be passed if there's no need to close the returned channel.

Messages returns all messages currently in the log.

Reset replaces messages stored in the log with the supplied ones.

func New

func New() MessageLog

New creates a new instance of the message log.

Directories

Path Synopsis
Package mock_messagelog is a generated GoMock package.
Package mock_messagelog is a generated GoMock package.

Jump to

Keyboard shortcuts

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