mock

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Close         = "Close"
	ReadOnly      = "ReadOnly"
	ListTopics    = "ListTopics"
	CreateTopic   = "CreateTopic"
	RetrieveTopic = "RetrieveTopic"
	UpdateTopic   = "UpdateTopic"
	DeleteTopic   = "DeleteTopic"
)

Constants are used to reference store methods in mock code

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	OnClose         func() error
	OnReadOnly      func() bool
	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
	// 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) 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) 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) 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) 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