gcppubsub

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedEvent = errors.New("malformed event")
)

Functions

func NewInventoryEventBuilder

func NewInventoryEventBuilder() entities.EventBuilder

Types

type Config

type Config struct {
	ProjectID          string `json:"projectId"`
	TopicName          string `json:"topicName"`
	SubscriptionID     string `json:"subscriptionId"`
	AckDeadlineSeconds int    `json:"ackDeadlineSeconds,omitempty"`
}

func (*Config) Validate

func (c *Config) Validate() error

type ConsumerOptions

type ConsumerOptions struct {
	Ctx context.Context
	Log *logrus.Logger
}

type GCPConsumer

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

func New

func New(options *ConsumerOptions, cfg config.GenericConfig, pipeline pipeline.IPipelineGroup, eventBuilder entities.EventBuilder) (*GCPConsumer, error)

func (*GCPConsumer) Close

func (g *GCPConsumer) Close() error

type InventoryEvent

type InventoryEvent struct {
	Asset           InventoryEventAsset  `json:"asset"`
	PriorAsset      InventoryEventAsset  `json:"priorAsset"`
	PriorAssetState string               `json:"priorAssetState"`
	Window          InventoryEventWindow `json:"window"`
	Deleted         bool                 `json:"deleted"`
}

type InventoryEventAsset

type InventoryEventAsset struct {
	Ancestors  []string               `json:"ancestors"`
	AssetType  string                 `json:"assetType"`
	Name       string                 `json:"name"`
	Resource   map[string]interface{} `json:"resource"`
	UpdateTime string                 `json:"updateTime"`
}

type InventoryEventBuilder

type InventoryEventBuilder struct{}

func (*InventoryEventBuilder) GetPipelineEvent

func (b *InventoryEventBuilder) GetPipelineEvent(_ context.Context, data []byte) (entities.PipelineEvent, error)

type InventoryEventWindow

type InventoryEventWindow struct {
	StartTime string `json:"startTime"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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