pkg

package
v0.0.0-...-74dbd4c Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubscribePubsubAndPull

func SubscribePubsubAndPull(ctx context.Context, wg *sync.WaitGroup, job Job) chan *pubsub.Message

func SyncEvents

func SyncEvents(ctx context.Context, config Config)

func WaitAndBQSync

func WaitAndBQSync(ctx context.Context, wg *sync.WaitGroup, job Job, eventChannel chan *pubsub.Message)

func WaitAndGoogleStorageSync

func WaitAndGoogleStorageSync(ctx context.Context, wg *sync.WaitGroup, job Job, eventChannel chan *pubsub.Message, loadToBigQuery bool)

Types

type BigQueryField

type BigQueryField struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Mode string `json:"mode"`
}

type BigqueryConfig

type BigqueryConfig struct {
	ProjectId string `json:"projectId"`
	Dataset   string `json:"dataset"`
}

type Config

type Config struct {
	Jobs []Job `json:"jobs"`
}

type Destination

type Destination struct {
	Type                 string              `json:"type"`
	BatchSize            int                 `json:"batchSize"`
	TimestampColumnName  string              `json:"timestampColumnName"`
	TimestampFormat      string              `json:"timestampFormat"`
	TimePartitioningType string              `json:"timePartitioningType"`
	Expiration           string              `json:"expiration"`
	ClusterBy            []string            `json:"clusterBy"`
	BigqueryConfig       BigqueryConfig      `json:"bigqueryConfig"`
	GoogleStorageConfig  GoogleStorageConfig `json:"googleStorageConfig"`
}

type Event

type Event map[string]interface{}

func (Event) Save

func (data Event) Save() (map[string]bigquery.Value, string, error)

type Filter

type Filter struct {
	Type   string          `json:"type"`
	Name   string          `json:"name"`
	Action string          `json:"action"`
	Target Target          `json:"target,omitempty"`
	Schema []BigQueryField `json:"schema,omitempty"`
}

type GoogleStorageConfig

type GoogleStorageConfig struct {
	ProjectId  string `json:"projectId"`
	Bucket     string `json:"bucket"`
	BlobPrefix string `json:"blobPrefix"`
}

type Job

type Job struct {
	Name        string      `json:"name"`
	Suspend     bool        `json:"suspend"`
	Source      Source      `json:"source"`
	Filters     []Filter    `json:"filters"`
	Destination Destination `json:"destination,omitempty"`
}

type PubsubConfig

type PubsubConfig struct {
	ProjectId              string `json:"projectId"`
	SubscriptionId         string `json:"subscriptionId"`
	MaxOutstandingMessages int    `json:"maxOutstandingMessages"`
	AttributeKeyName       string `json:"attributeKeyName"`
}

type Source

type Source struct {
	Type         string       `json:"type"`
	PubsubConfig PubsubConfig `json:"pubsubConfig"`
}

type Target

type Target struct {
	Table string `json:"table"`
}

Jump to

Keyboard shortcuts

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