mock

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Close          = "Close"
	ReadOnly       = "ReadOnly"
	AllowedTopics  = "AllowedTopics"
	ListTopics     = "ListTopics"
	CreateTopic    = "CreateTopic"
	RetrieveTopic  = "RetrieveTopic"
	UpdateTopic    = "UpdateTopic"
	DeleteTopic    = "DeleteTopic"
	ListTopicNames = "ListTopicNames"
	TopicExists    = "TopicExists"
	TopicName      = "TopicName"
)

Constants are used to reference store methods in mock code

Variables

This section is empty.

Functions

func UnmarshalTopicList added in v0.5.1

func UnmarshalTopicList(data []byte, jsonpb *protojson.UnmarshalOptions) (topics []*api.Topic, err error)

Types

type Store

type Store struct {
	OnClose          func() error
	OnReadOnly       func() bool
	OnAllowedTopics  func(ulid.ULID) ([]ulid.ULID, error)
	OnListTopics     func(ulid.ULID) iterator.TopicIterator
	OnCreateTopic    func(*api.Topic) error
	OnRetrieveTopic  func(topicID ulid.ULID) (*api.Topic, error)
	OnUpdateTopic    func(*api.Topic) error
	OnDeleteTopic    func(topicID ulid.ULID) error
	OnListTopicNames func(ulid.ULID) iterator.TopicNamesIterator
	OnTopicExists    func(*api.TopicName) (*api.TopicExistsInfo, error)
	OnTopicName      func(ulid.ULID) (string, error)
	// contains filtered or unexported fields
}

Implements both a store.EventStore and a store.MetaStore for testing purposes.

func Open

func Open(conf config.StorageConfig) (*Store, error)

func (*Store) AllowedTopics added in v0.5.1

func (s *Store) AllowedTopics(projectID ulid.ULID) ([]ulid.ULID, error)

func (*Store) Calls

func (s *Store) Calls(call string) int

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateTopic

func (s *Store) CreateTopic(topic *api.Topic) error

func (*Store) DeleteTopic

func (s *Store) DeleteTopic(topicID ulid.ULID) error

func (*Store) ListTopicNames added in v0.5.1

func (s *Store) ListTopicNames(projectID ulid.ULID) iterator.TopicNamesIterator

func (*Store) ListTopics

func (s *Store) ListTopics(projectID ulid.ULID) iterator.TopicIterator

func (*Store) ReadOnly

func (s *Store) ReadOnly() bool

func (*Store) Reset

func (s *Store) Reset()

func (*Store) RetrieveTopic

func (s *Store) RetrieveTopic(topicID ulid.ULID) (*api.Topic, error)

func (*Store) TopicExists added in v0.5.1

func (s *Store) TopicExists(in *api.TopicName) (*api.TopicExistsInfo, error)

func (*Store) TopicName added in v0.7.0

func (s *Store) TopicName(topicID ulid.ULID) (string, error)

func (*Store) UpdateTopic

func (s *Store) UpdateTopic(topic *api.Topic) error

func (*Store) UseError

func (s *Store) UseError(call string, err error) error

func (*Store) UseFixture

func (s *Store) UseFixture(call, path string) (err error)

type TopicIterator

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

func NewErrorIterator

func NewErrorIterator(err error) *TopicIterator

func NewTopicIterator

func NewTopicIterator(topics []*api.Topic) *TopicIterator

func (*TopicIterator) Error

func (t *TopicIterator) Error() error

func (*TopicIterator) Key added in v0.5.1

func (t *TopicIterator) Key() []byte

func (*TopicIterator) Next

func (t *TopicIterator) Next() bool

func (*TopicIterator) NextPage

func (t *TopicIterator) NextPage(in *api.PageInfo) (out *api.TopicsPage, err error)

func (*TopicIterator) Prev

func (t *TopicIterator) Prev() bool

func (*TopicIterator) Release

func (t *TopicIterator) Release()

func (*TopicIterator) Topic

func (t *TopicIterator) Topic() (*api.Topic, error)

Jump to

Keyboard shortcuts

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