Documentation
¶
Index ¶
- func AttachSchemaToTopic(ctx context.Context, projectUUID, name, schemaUUID string, store stores.Store) error
- func DetachSchemaFromTopic(ctx context.Context, projectUUID, name string, store stores.Store) error
- func HasTopic(ctx context.Context, projectUUID string, name string, store stores.Store) bool
- func RemoveTopic(ctx context.Context, projectUUID string, name string, store stores.Store) error
- type PaginatedTopics
- type Topic
- type TopicMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachSchemaToTopic ¶
func AttachSchemaToTopic(ctx context.Context, projectUUID, name, schemaUUID string, store stores.Store) error
AttachSchemaToTopic links the provided schema with the given topic
func DetachSchemaFromTopic ¶
DetachSchemaFromTopic removes the link between the provided schema and the given topic
Types ¶
type PaginatedTopics ¶
type PaginatedTopics struct {
Topics []Topic `json:"topics"`
NextPageToken string `json:"nextPageToken"`
TotalSize int64 `json:"totalSize"`
}
PaginatedTopics holds information about a topics' page and how to access the next page
func Find ¶
func Find(ctx context.Context, projectUUID, userUUID, name, pageToken string, pageSize int64, store stores.Store) (PaginatedTopics, error)
Find searches and returns a specific topic or all topics of a given project
func (*PaginatedTopics) Empty ¶
func (tl *PaginatedTopics) Empty() bool
Empty returns true if Topics has no items
func (*PaginatedTopics) ExportJSON ¶
func (tl *PaginatedTopics) ExportJSON() (string, error)
ExportJSON exports whole Topics List Structure as a json string
type Topic ¶
type Topic struct {
ProjectUUID string `json:"-"`
Name string `json:"-"`
FullName string `json:"name"`
LatestPublish time.Time `json:"-"`
PublishRate float64 `json:"-"`
Schema string `json:"schema,omitempty"`
CreatedOn string `json:"created_on"`
}
Topic struct to hold information for a given topic
func CreateTopic ¶
func CreateTopic(ctx context.Context, projectUUID string, name string, schemaUUID string, createdOn time.Time, store stores.Store) (Topic, error)
CreateTopic creates a new topic
func (*Topic) ExportJSON ¶
ExportJSON exports whole Topic Structure as a json string
type TopicMetrics ¶
type TopicMetrics struct {
MsgNum int64 `json:"number_of_messages"`
TotalBytes int64 `json:"total_bytes"`
LatestPublish time.Time `json:"-"`
PublishRate float64 `json:"-"`
}
func FindMetric ¶
func FindMetric(ctx context.Context, projectUUID string, name string, store stores.Store) (TopicMetrics, error)
FindMetric searches and returns a specific topic or all topics of a given project
func (*TopicMetrics) ExportJSON ¶
func (tp *TopicMetrics) ExportJSON() (string, error)
ExportJSON exports whole TopicMetrics Structure as a json string