pubsubop

package module
v0.0.0-...-4b3a689 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 6 Imported by: 0

README

Overview

pubsubop is client of interaction with Cloud PubSub.

The manager enable to keep the context such as project, topic, and subscription. Therefore the other modules don't need be aware of those detail after the initialization.

How to use

Follow public GCP document of Cloud Pus/Sub

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	ProjectID string
	SubName   string
	TopicName string
	// contains filtered or unexported fields
}

func (*Manager) CreateSub

func (mgr *Manager) CreateSub() error

CreateSub creates subscription

func (*Manager) InitClient

func (mgr *Manager) InitClient()

func (*Manager) Publish

func (mgr *Manager) Publish(msg []byte) error

Publish sends data given as array of byte to pubsub server

func (*Manager) PublishStr

func (mgr *Manager) PublishStr(msg string) error

PublishStr sends data given as string to pubsub server

func (*Manager) PullMessages

func (mgr *Manager) PullMessages() ([]string, error)

Jump to

Keyboard shortcuts

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