retained

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package retained is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IterateFn

type IterateFn func(message *gmqtt.Message) bool

IterateFn is the callback function used by iterate() Return false means to stop the iteration.

type MockStore added in v0.2.0

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

MockStore is a mock of Store interface

func NewMockStore added in v0.2.0

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance

func (*MockStore) AddOrReplace added in v0.2.0

func (m *MockStore) AddOrReplace(message *gmqtt.Message)

AddOrReplace mocks base method

func (*MockStore) ClearAll added in v0.2.0

func (m *MockStore) ClearAll()

ClearAll mocks base method

func (*MockStore) EXPECT added in v0.2.0

func (m *MockStore) EXPECT() *MockStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStore) GetMatchedMessages added in v0.2.0

func (m *MockStore) GetMatchedMessages(topicFilter string) []*gmqtt.Message

GetMatchedMessages mocks base method

func (*MockStore) GetRetainedMessage added in v0.2.0

func (m *MockStore) GetRetainedMessage(topicName string) *gmqtt.Message

GetRetainedMessage mocks base method

func (*MockStore) Iterate added in v0.2.0

func (m *MockStore) Iterate(fn IterateFn)

Iterate mocks base method

func (*MockStore) Remove added in v0.2.0

func (m *MockStore) Remove(topicName string)

Remove mocks base method

type MockStoreMockRecorder added in v0.2.0

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

MockStoreMockRecorder is the mock recorder for MockStore

func (*MockStoreMockRecorder) AddOrReplace added in v0.2.0

func (mr *MockStoreMockRecorder) AddOrReplace(message interface{}) *gomock.Call

AddOrReplace indicates an expected call of AddOrReplace

func (*MockStoreMockRecorder) ClearAll added in v0.2.0

func (mr *MockStoreMockRecorder) ClearAll() *gomock.Call

ClearAll indicates an expected call of ClearAll

func (*MockStoreMockRecorder) GetMatchedMessages added in v0.2.0

func (mr *MockStoreMockRecorder) GetMatchedMessages(topicFilter interface{}) *gomock.Call

GetMatchedMessages indicates an expected call of GetMatchedMessages

func (*MockStoreMockRecorder) GetRetainedMessage added in v0.2.0

func (mr *MockStoreMockRecorder) GetRetainedMessage(topicName interface{}) *gomock.Call

GetRetainedMessage indicates an expected call of GetRetainedMessage

func (*MockStoreMockRecorder) Iterate added in v0.2.0

func (mr *MockStoreMockRecorder) Iterate(fn interface{}) *gomock.Call

Iterate indicates an expected call of Iterate

func (*MockStoreMockRecorder) Remove added in v0.2.0

func (mr *MockStoreMockRecorder) Remove(topicName interface{}) *gomock.Call

Remove indicates an expected call of Remove

type Store

type Store interface {
	// GetRetainedMessage returns the message that equals the passed topic.
	GetRetainedMessage(topicName string) *gmqtt.Message
	// ClearAll clears all retained messages.
	ClearAll()
	// AddOrReplace adds or replaces a retained message.
	AddOrReplace(message *gmqtt.Message)
	// remove removes a retained message.
	Remove(topicName string)
	// GetMatchedMessages returns the retained messages that match the passed topic filter.
	GetMatchedMessages(topicFilter string) []*gmqtt.Message
	// Iterate iterate all retained messages. The callback is called once for each message.
	// If callback return false, the iteration will be stopped.
	// Notice:
	// The results are not sorted in any way, no ordering of any kind is guaranteed.
	// This method will walk through all retained messages,
	// so this will be a expensive operation if there are a large number of retained messages.
	Iterate(fn IterateFn)
}

Store is the interface used by gmqtt.server and external logic to handler the operations of retained messages. User can get the implementation from gmqtt.Server interface. This interface provides the ability for extensions to interact with the retained message store. Notice: This methods will not trigger any gmqtt hooks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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