topic

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Create messageType = "create"
	Update messageType = "update"
	Delete messageType = "delete"
)

Variables

This section is empty.

Functions

func NewTopicManager

func NewTopicManager(e *etcd.Etcd) *topicManager

func PushEvent

func PushEvent(ctx context.Context, e *etcd.Etcd, uid string, t messageType, model model) error

Types

type Message

type Message struct {
	// Type: optional create/delete/update
	Type     messageType `json:"type,omitempty"`
	Resource Resource    `json:"resource,omitempty"`
}

type Resource

type Resource struct {
	ResourceType string                 `json:"rtype,omitempty"`
	ResourceId   string                 `json:"rid,omitempty"`
	Values       map[string]interface{} `json:"values,omitempty"`
}

func NewResource

func NewResource(rtype, rid string) Resource

func (Resource) GetTopicResource

func (r Resource) GetTopicResource() Resource

func (Resource) WithValue added in v0.1.7

func (r Resource) WithValue(key string, value interface{}) Resource

Jump to

Keyboard shortcuts

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