simulator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSpreader

func NewSpreader() *spreader

Types

type Channel

type Channel struct {
	Ch       chan *api.Message
	IsClosed bool
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel() *Channel

func (*Channel) Close

func (c *Channel) Close()

func (*Channel) IsClose

func (c *Channel) IsClose() bool

type Simulator

type Simulator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSimulator

func NewSimulator(strg storage.MessageStorage) (*Simulator, error)

func (*Simulator) Delete

func (s *Simulator) Delete(key *api.Key) error

func (*Simulator) DeleteAll

func (s *Simulator) DeleteAll(key *api.Key) error

func (*Simulator) Get

func (s *Simulator) Get(key *api.Key) (*api.Message, error)

func (*Simulator) GetAll

func (s *Simulator) GetAll(key *api.Key) ([]*api.Message, error)

func (*Simulator) Put

func (s *Simulator) Put(mes *api.Message) error

func (*Simulator) Watch

func (s *Simulator) Watch(key *api.Key, ch *Channel) error

Jump to

Keyboard shortcuts

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