topics

package
v1.0.6-1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasTopic

func HasTopic(projectUUID string, name string, store stores.Store) bool

HasTopic returns true if project & topic combination exist

func RemoveTopic

func RemoveTopic(projectUUID string, name string, store stores.Store) error

RemoveTopic removes an existing topic

Types

type PaginatedTopics

type PaginatedTopics struct {
	Topics        []Topic `json:"topics"`
	NextPageToken string  `json:"nextPageToken"`
	TotalSize     int32   `json:"totalSize"`
}

PaginatedTopics holds information about a topics' page and how to access the next page

func Find

func Find(projectUUID, userUUID, name, pageToken string, pageSize int32, 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"`
}

Topic struct to hold information for a given topic

func CreateTopic

func CreateTopic(projectUUID string, name string, schemaUUID string, store stores.Store) (Topic, error)

CreateTopic creates a new topic

func New

func New(projectUUID string, projectName string, name string) Topic

New creates a new topic based on name

func (*Topic) ExportJSON

func (tp *Topic) ExportJSON() (string, error)

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(projectUUID string, name string, store stores.Store) (TopicMetrics, error)

Find 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

Jump to

Keyboard shortcuts

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