Documentation ¶
Index ¶
- Constants
- func EventListFixture(path string) (_ []*api.EventWrapper, err error)
- func GroupListFixture(path string) (_ []*api.ConsumerGroup, err error)
- func TopicInfoListFixture(path string) (_ map[string]*api.TopicInfo, err error)
- func TopicListFixture(path string) (_ []*api.Topic, err error)
- func TopicNamesListFixture(path string) (_ []*api.TopicName, err error)
- func UnmarshalEventList(data []byte) (events []*api.EventWrapper, err error)
- func UnmarshalGroupList(data []byte) (groups []*api.ConsumerGroup, err error)
- func UnmarshalTopicInfoList(data []byte) (infos map[string]*api.TopicInfo, err error)
- func UnmarshalTopicList(data []byte) (topics []*api.Topic, err error)
- func UnmarshalTopicNamesList(data []byte) (names []*api.TopicName, err error)
- type EventIterator
- type IndashIterator
- type MockIterator
- func (i *MockIterator) Error() error
- func (i *MockIterator) Key() []byte
- func (i *MockIterator) Next() bool
- func (i *MockIterator) Object() (interface{}, error)
- func (i *MockIterator) Page(in *api.PageInfo) (out []interface{}, token string, err error)
- func (i *MockIterator) Prev() bool
- func (i *MockIterator) Release()
- func (i *MockIterator) Value() []byte
- type Store
- func (s *Store) AllowedTopics(projectID ulid.ULID) ([]ulid.ULID, error)
- func (s *Store) Calls(call string) int
- func (s *Store) ClearIndash(topicID ulid.ULID) error
- func (s *Store) Close() error
- func (s *Store) CreateTopic(topic *api.Topic) error
- func (s *Store) DeleteTopic(topicID ulid.ULID) error
- func (s *Store) Destroy(topicID ulid.ULID) error
- func (s *Store) Indash(topicID ulid.ULID, hash []byte, eventID rlid.RLID) error
- func (s *Store) Insert(in *api.EventWrapper) error
- func (s *Store) List(topicID ulid.ULID) iterator.EventIterator
- func (s *Store) ListAllTopics() iterator.TopicIterator
- func (s *Store) ListTopicNames(projectID ulid.ULID) iterator.TopicNamesIterator
- func (s *Store) ListTopics(projectID ulid.ULID) iterator.TopicIterator
- func (s *Store) LoadIndash(topicID ulid.ULID) iterator.IndashIterator
- func (s *Store) LookupTopicID(name string, projectID ulid.ULID) (topicID ulid.ULID, err error)
- func (s *Store) ReadOnly() bool
- func (s *Store) Reset()
- func (s *Store) Retrieve(topicID ulid.ULID, eventID rlid.RLID) (*api.EventWrapper, error)
- func (s *Store) RetrieveTopic(topicID ulid.ULID) (*api.Topic, error)
- func (s *Store) TopicExists(in *api.TopicName) (*api.TopicExistsInfo, error)
- func (s *Store) TopicInfo(topicID ulid.ULID) (*api.TopicInfo, error)
- func (s *Store) TopicName(topicID ulid.ULID) (string, error)
- func (s *Store) Unhash(topicID ulid.ULID, hash []byte) (*api.EventWrapper, error)
- func (s *Store) UpdateTopic(topic *api.Topic) error
- func (s *Store) UpdateTopicInfo(info *api.TopicInfo) error
- func (s *Store) UseError(call string, err error) error
- func (s *Store) UseFixture(call, path string) (err error)
- type TopicIterator
- type TopicNamesIterator
Constants ¶
View Source
const ( Close = "Close" ReadOnly = "ReadOnly" Insert = "Insert" List = "List" Retrieve = "Retrieve" Destroy = "Destroy" Indash = "Indash" Unhash = "Unhash" LoadIndash = "LoadIndash" ClearIndash = "ClearIndash" AllowedTopics = "AllowedTopics" ListTopics = "ListTopics" CreateTopic = "CreateTopic" RetrieveTopic = "RetrieveTopic" UpdateTopic = "UpdateTopic" DeleteTopic = "DeleteTopic" ListTopicNames = "ListTopicNames" TopicExists = "TopicExists" TopicName = "TopicName" LookupTopicID = "LookupTopicID" ListAllTopics = "ListAllTopics" TopicInfo = "TopicInfo" UpdateTopicInfo = "UpdateTopicInfo" )
Constants are used to reference store methods in mock code
Variables ¶
This section is empty.
Functions ¶
func EventListFixture ¶ added in v0.9.0
func EventListFixture(path string) (_ []*api.EventWrapper, err error)
func GroupListFixture ¶ added in v0.9.0
func GroupListFixture(path string) (_ []*api.ConsumerGroup, err error)
func TopicInfoListFixture ¶ added in v0.9.0
func TopicListFixture ¶ added in v0.9.0
func TopicNamesListFixture ¶ added in v0.9.0
func UnmarshalEventList ¶ added in v0.9.0
func UnmarshalEventList(data []byte) (events []*api.EventWrapper, err error)
func UnmarshalGroupList ¶ added in v0.9.0
func UnmarshalGroupList(data []byte) (groups []*api.ConsumerGroup, err error)
func UnmarshalTopicInfoList ¶ added in v0.9.0
func UnmarshalTopicList ¶ added in v0.5.1
Types ¶
type EventIterator ¶ added in v0.9.0
type EventIterator struct {
MockIterator
}
func NewEventErrorIterator ¶ added in v0.9.0
func NewEventErrorIterator(err error) *EventIterator
func NewEventIterator ¶ added in v0.9.0
func NewEventIterator(events []*api.EventWrapper) *EventIterator
func (*EventIterator) Event ¶ added in v0.9.0
func (t *EventIterator) Event() (*api.EventWrapper, error)
type IndashIterator ¶ added in v0.11.0
type IndashIterator struct {
MockIterator
}
func NewIndashErrorIterator ¶ added in v0.11.0
func NewIndashErrorIterator(err error) *IndashIterator
func NewIndashIterator ¶ added in v0.11.0
func NewIndashIterator(hashes [][]byte) *IndashIterator
func (*IndashIterator) Hash ¶ added in v0.11.0
func (t *IndashIterator) Hash() ([]byte, error)
type MockIterator ¶ added in v0.9.0
type MockIterator struct {
// contains filtered or unexported fields
}
func (*MockIterator) Error ¶ added in v0.9.0
func (i *MockIterator) Error() error
func (*MockIterator) Key ¶ added in v0.9.0
func (i *MockIterator) Key() []byte
func (*MockIterator) Next ¶ added in v0.9.0
func (i *MockIterator) Next() bool
func (*MockIterator) Object ¶ added in v0.9.0
func (i *MockIterator) Object() (interface{}, error)
func (*MockIterator) Page ¶ added in v0.9.0
func (i *MockIterator) Page(in *api.PageInfo) (out []interface{}, token string, err error)
func (*MockIterator) Prev ¶ added in v0.9.0
func (i *MockIterator) Prev() bool
func (*MockIterator) Release ¶ added in v0.9.0
func (i *MockIterator) Release()
func (*MockIterator) Value ¶ added in v0.9.0
func (i *MockIterator) Value() []byte
type Store ¶
type Store struct { sync.RWMutex OnClose func() error OnReadOnly func() bool OnAllowedTopics func(ulid.ULID) ([]ulid.ULID, error) OnInsert func(*api.EventWrapper) error OnList func(ulid.ULID) iterator.EventIterator OnRetrieve func(ulid.ULID, rlid.RLID) (*api.EventWrapper, error) OnDestroy func(ulid.ULID) error OnIndash func(ulid.ULID, []byte, rlid.RLID) error OnUnhash func(ulid.ULID, []byte) (*api.EventWrapper, error) OnLoadIndash func(ulid.ULID) iterator.IndashIterator OnClearIndash func(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) OnLookupTopicID func(string, ulid.ULID) (ulid.ULID, error) OnListAllTopics func() iterator.TopicIterator OnTopicInfo func(ulid.ULID) (*api.TopicInfo, error) OnUpdateTopicInfo func(*api.TopicInfo) error // contains filtered or unexported fields }
Implements both a store.EventStore and a store.MetaStore for testing purposes.
func (*Store) AllowedTopics ¶ added in v0.5.1
func (*Store) ClearIndash ¶ added in v0.12.0
func (*Store) DeleteTopic ¶
func (*Store) List ¶ added in v0.9.0
func (s *Store) List(topicID ulid.ULID) iterator.EventIterator
func (*Store) ListAllTopics ¶ added in v0.9.0
func (s *Store) ListAllTopics() iterator.TopicIterator
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) LoadIndash ¶ added in v0.11.0
func (s *Store) LoadIndash(topicID ulid.ULID) iterator.IndashIterator
func (*Store) LookupTopicID ¶ added in v0.9.0
func (*Store) TopicExists ¶ added in v0.5.1
func (*Store) Unhash ¶ added in v0.12.0
func (s *Store) Unhash(topicID ulid.ULID, hash []byte) (*api.EventWrapper, error)
func (*Store) UpdateTopicInfo ¶ added in v0.9.0
func (*Store) UseFixture ¶
type TopicIterator ¶
type TopicIterator struct {
MockIterator
}
func NewTopicErrorIterator ¶ added in v0.9.0
func NewTopicErrorIterator(err error) *TopicIterator
func NewTopicIterator ¶
func NewTopicIterator(topics []*api.Topic) *TopicIterator
func (*TopicIterator) NextPage ¶
func (t *TopicIterator) NextPage(in *api.PageInfo) (out *api.TopicsPage, err error)
type TopicNamesIterator ¶ added in v0.9.0
type TopicNamesIterator struct {
MockIterator
}
func NewTopicNamesErrorIterator ¶ added in v0.9.0
func NewTopicNamesErrorIterator(err error) *TopicNamesIterator
func NewTopicNamesIterator ¶ added in v0.9.0
func NewTopicNamesIterator(names []*api.TopicName) *TopicNamesIterator
func (*TopicNamesIterator) NextPage ¶ added in v0.9.0
func (t *TopicNamesIterator) NextPage(in *api.PageInfo) (out *api.TopicNamesPage, err error)
Click to show internal directories.
Click to hide internal directories.