pubsubapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Live

type Live struct {
	// contains filtered or unexported fields
}

func NewLiveClient

func NewLiveClient(sdmProjectID string, gcpProjectID string, subscriptionID string) *Live

func (*Live) AckMessages

func (c *Live) AckMessages(ackIDs []string) error

func (*Live) MakeContext

func (c *Live) MakeContext() (context.Context, context.CancelFunc)

func (*Live) Pull

func (c *Live) Pull() ([]SdmEvent, error)

func (*Live) WithContext

func (c *Live) WithContext(ctx context.Context) PubSub

func (*Live) WithLogMessages

func (c *Live) WithLogMessages() *Live

func (*Live) WithMaxMessageAge

func (c *Live) WithMaxMessageAge(d time.Duration) *Live

func (*Live) WithServiceAccountCreds

func (c *Live) WithServiceAccountCreds(credsFile string) PubSub

func (*Live) WithTimeout

func (c *Live) WithTimeout(d time.Duration) PubSub

type PubSub

type PubSub interface {
	WithServiceAccountCreds(creds string) PubSub
	WithTimeout(d time.Duration) PubSub
	WithContext(ctx context.Context) PubSub
	Pull() ([]SdmEvent, error)
	AckMessages(ackIDs []string) error
}

type SdmEvent

type SdmEvent struct {
	AckID     string
	DeviceID  string
	Timestamp time.Time
	Traits    sdmapi.Traits
}

Jump to

Keyboard shortcuts

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