googlecloudrun

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudRunAPIUrlOnly

type CloudRunAPIUrlOnly struct {
	Status struct {
		URL string `json:"url"`
	} `json:"status"`
}

type GoogleCloudRun

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

GoogleCloudRun provides google cloud pubsub but specifically tailored to Google Cloud Run, in that is works over http and push and not a long running process

func NewGoogleCloudRun

func NewGoogleCloudRun(projectID string) (*GoogleCloudRun, error)

NewGoogleCloudRun creates a new GoogleCloudRun instace for a project

func (*GoogleCloudRun) Publish

func (g *GoogleCloudRun) Publish(ctx context.Context, topic string, m *ps.Msg) error

Publish implements Publish

func (*GoogleCloudRun) RegisterHandler

func (g *GoogleCloudRun) RegisterHandler(m *http.ServeMux)

func (*GoogleCloudRun) Shutdown

func (g *GoogleCloudRun) Shutdown()

Shutdown shuts down all subscribers gracefully

func (*GoogleCloudRun) Subscribe

func (g *GoogleCloudRun) Subscribe(opts ps.HandlerOptions, h ps.MsgHandler)

Subscribe implements Subscribe

type PushRequest

type PushRequest struct {
	Message struct {
		Attributes  map[string]string `json:"attributes"`
		Data        []byte            `json:"data"`
		ID          string            `json:"message_id"`
		PublishTime time.Time         `json:"publish_time"`
	} `json:"message"`
	Subscription string `json:"subscription"`
}

Jump to

Keyboard shortcuts

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