pubsub

package
v0.0.0-...-b496231 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFile

func FindFile() ([]byte, string)

Types

type Credential

type Credential struct {
	Type                        string `json:"type"`
	Project_id                  string `json:"project_id"`
	Private_key_id              string `json:"private_key_id"`
	Private_key                 string `json:"private_key"`
	Client_email                string `json:"client_email"`
	Client_id                   string `json:"client_id"`
	Auth_uri                    string `json:"auth_uri"`
	Token_uri                   string `json:"token_uri"`
	Auth_provider_x509_cert_url string `json:"auth_provider_x509_cert_url"`
	Client_x509_cert_url        string `json:"client_x509_cert_url"`
}

type G

type G struct {
	sync.Mutex
	CredentialFile string
	Credential     Credential
	// contains filtered or unexported fields
}

func NewG

func NewG() *G

func (*G) CreateSub

func (g *G) CreateSub(subName string, topic *pubsub.Topic) (*pubsub.Subscription, error)

func (*G) CreateTopic

func (g *G) CreateTopic(topicName string) (*pubsub.Topic, error)

func (*G) Publish

func (g *G) Publish(w io.Writer, topicID, msg string) (string, error)

func (*G) PullMsgs

func (g *G) PullMsgs(w io.Writer, subID string) ([]byte, error)

Jump to

Keyboard shortcuts

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