hart

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PushHandler

func PushHandler(ctx context.Context, r *http.Request)

PushHandler handles the pubsub push responses

Decodes the response sent by PubSub and updates datastore. It doesn't return anything as required by https://cloud.google.com/pubsub/docs/push, this is because by default the return is 200 OK for http POST requests. It does not return any 4xx codes on error because it could lead to a loop where PubSub tries to push same message again which is rejected.

func SyncAssetInfoFromHaRT

func SyncAssetInfoFromHaRT(ctx context.Context, proj, topic string, ids []string)

SyncAssetInfoFromHaRT publishes the request for the ids to be synced.

Types

type PSRequest

type PSRequest struct {
	Msg struct {
		Data      string `json:"data"`
		MessageID string `json:"messageId"`
	} `json:"message"`
	Sub string `json:"subscription"`
}

PSRequest helps to unmarshall json data sent from pubsub

The format of the data sent by PubSub is described in https://cloud.google.com/pubsub/docs/push?hl=en#receiving_push_messages

Jump to

Keyboard shortcuts

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