messagelog

package
v0.0.0-...-9ecb242 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrInvalidMessage

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

func (*ErrInvalidMessage) Error

func (err *ErrInvalidMessage) Error() string

type ErrTopicNotFound

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

func (*ErrTopicNotFound) Error

func (err *ErrTopicNotFound) Error() string

type Log

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

func New

func New() *Log

func (*Log) AddTopic

func (ml *Log) AddTopic(topic string, capacity int)

func (*Log) List

func (ml *Log) List(topic string, offset int) ([]Message, error)

func (*Log) Push

func (ml *Log) Push(topic string, message Message) error

type Message

type Message struct {
	Index       int         `json:"index"`
	Sender      string      `json:"sender" validate:"min=1"`
	ContentType string      `json:"content_type" validate:"min=1"`
	Content     interface{} `json:"content" validate:"nonnil"`
}

Jump to

Keyboard shortcuts

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