examples

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batcher_step_example added in v1.2.0

func Batcher_step_example()

func JobGrouper added in v1.2.0

func JobGrouper(s, i interface{}, idx int) (interface{}, error)

JobGrouper groups jobs

func JobMapper added in v1.2.0

func JobMapper(in interface{}) (interface{}, error)

JobMapper transforms a input into a pubsub validation job

func Mapper_step_example

func Mapper_step_example()

Mapper_step_example exhibits the operation of a recently instantiated SubscriberPipeline with an additional mapper step attached, which modifies the data that goes through the pipeline.

The pipeline outputs the contents of a channel, which is channeling *Pubsub.Message messages, in this case. The message then goes through a Mapper step, which is suported by the package, but provided by the client.

A Mapper is particularly useful for consuming the raw *Pubsub.Message contents and transforming them into a more practical custom type (such as myCustomType).

func Publisher_pipeline_example added in v1.1.1

func Publisher_pipeline_example()

Publisher_pipeline_example shows the operation of a recently instantiated Generics compatible PubsubClient publisher. It accepts any message schema, requiring only that it's type implements ToByteser interface. The message schema, along with a wrapped Pubsub Topic (created with a NewTopicWrapper), must be passed to the PubsubClient builder (MustNewPubSubClient).

func Raw_pipeline_example

func Raw_pipeline_example()

Raw_pipeline_example shows the raw operation of a recently instantiated SubscriberPipeline with no additional steps attached.

The SubscriberPipeline builder (MustNewSubscriberPipeline) requires a Pubsub Subscriber (or something that equally implements it's Receive functionality). The pipeline then outputs the contents of a channel, which in it's turn, channels *Pubsub.Message messages in this case.

Types

type MessageSchema added in v1.1.1

type MessageSchema struct {
	Attr string
}

MessageSchema represents the message schema that will be published.

func (MessageSchema) ToBytes added in v1.1.1

func (ms MessageSchema) ToBytes() ([]byte, error)

ToBytes marshals itself using it's instance data.

type PubsubMessage added in v1.2.0

type PubsubMessage struct {
	Msg *pubsub.Message
}

PubsubMessage encapsulates pubsub messages

type ValidationData added in v1.2.0

type ValidationData struct {
	Data1 string `json:"data_1"`
	Data2 string `json:"data_2"`
}

type ValidationJob added in v1.2.0

type ValidationJob struct {
	Attribute1 string

	Data1 string
	Data2 string
}

ValidationJob represents a domain ValidationMessage at Pubsub.

func NewPubsubValidationJob added in v1.2.0

func NewPubsubValidationJob(pm PubsubMessage) (ValidationJob, error)

NewPubsubValidationJob creates a new ValidationJob instance.

type ValidationJobGroups added in v1.2.0

type ValidationJobGroups map[string]ValidationJobList

ValidationJobGroups groups validation jobs by a key

type ValidationJobList added in v1.2.0

type ValidationJobList []ValidationJob

ValidationJobList is a list of validation jobs

Jump to

Keyboard shortcuts

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