metaevents

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const ChildStreamCreatedId = "ChildStreamCreated"
View Source
const CreatedId = "Created"
View Source
const RotatedId = "Rotated"
View Source
const SubscribedId = "Subscribed"
View Source
const SubscriptionActivityId = "SubscriptionActivity"
View Source
const UnsubscribedId = "Unsubscribed"

Variables

This section is empty.

Functions

func EncodeRegularLine

func EncodeRegularLine(input string) string

encodes a regular line for storing in Event Horizon. caller's responsibility is to check that input does not contain \n

func Parse

func Parse(line string) (metaType string, lineContent string, metaEvent interface{})

parses both regular and meta event lines

Types

type ChildStreamCreated

type ChildStreamCreated struct {
	ChildStream string `json:"child_stream"`
	Timestamp   string `json:"ts"`
}

/ChildStreamCreated {"child_stream": "/tenants/foo:0:0", "ts":"2017-02-27T17:12:31.446Z"}

func NewChildStreamCreated

func NewChildStreamCreated(childStream string) *ChildStreamCreated

func (*ChildStreamCreated) Serialize

func (c *ChildStreamCreated) Serialize() string

type Created

type Created struct {
	SubscriptionIds []string `json:"subscription_ids"`
	Timestamp       string   `json:"ts"`
}

/Created {"subscription_ids": "89a3c083-6396", "ts":"2017-02-27T17:12:31.446Z"}

func NewCreated

func NewCreated(subscriptionIds []string) *Created

func (*Created) Serialize

func (c *Created) Serialize() string

type Rotated

type Rotated struct {
	Next      string `json:"next"`
	Timestamp string `json:"ts"`
}

/Rotated {"next":"/tenants/foo:1:0:127.0.0.1","ts":"2017-03-03T19:33:49.709Z"}

func NewRotated

func NewRotated(next string) *Rotated

func (*Rotated) Serialize

func (r *Rotated) Serialize() string

type Subscribed

type Subscribed struct {
	SubscriptionId string `json:"subscription_id"`
	Timestamp      string `json:"ts"`
}

/Subscribed {"subscription_id":"6894605c-2a8e","ts":"2017-02-27T17:12:31.446Z"}

func NewSubscribed

func NewSubscribed(subscriptionId string) *Subscribed

func (*Subscribed) Serialize

func (s *Subscribed) Serialize() string

type SubscriptionActivity

type SubscriptionActivity struct {
	Activity  []string `json:"activity"` // each unique stream is mentioned only once
	Timestamp string   `json:"ts"`
}

/SubscriptionActivity {"activity": ["/tenants/foo:0:700", "/tenants/bar:245:14"], "ts":"2017-02-27T17:12:31.446Z"}

func NewSubscriptionActivity

func NewSubscriptionActivity() *SubscriptionActivity

func (*SubscriptionActivity) Serialize

func (c *SubscriptionActivity) Serialize() string

type Unsubscribed

type Unsubscribed struct {
	SubscriptionId string `json:"subscription_id"`
	Timestamp      string `json:"ts"`
}

/Unsubscribed {"subscription_id":"6894605c-2a8e","ts":"2017-02-27T17:12:31.446Z"}

func NewUnsubscribed

func NewUnsubscribed(subscriptionId string) *Unsubscribed

func (*Unsubscribed) Serialize

func (u *Unsubscribed) Serialize() string

Jump to

Keyboard shortcuts

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