shared

package
v0.4.36 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

This package is intended to be a centralized module for any shared utilities across activities for the datasync workflow

Index

Constants

View Source
const (
	// The benthos value for null
	NullString = "null"
)

Variables

This section is empty.

Functions

func BuildBenthosRedisTlsConfig

func BuildBenthosRedisTlsConfig(redisConfig *RedisConfig) *neosync_benthos.RedisTlsConfig

func GetConnectionById

func GetConnectionById(
	ctx context.Context,
	connclient mgmtv1alpha1connect.ConnectionServiceClient,
	connectionId string,
) (*mgmtv1alpha1.Connection, error)

func GetNeosyncHttpClient

func GetNeosyncHttpClient() *http.Client

Returns an instance of *http.Client that includes the Neosync API Token if one was found in the environment

func GetNeosyncUrl

func GetNeosyncUrl() string

Returns the neosync url found in the environment, otherwise defaults to localhost

func GetUniqueSchemasFromJob

func GetUniqueSchemasFromJob(job *mgmtv1alpha1.Job) []string

Parses the job and returns the unique set of schemas.

func GetUniqueSchemasFromMappings

func GetUniqueSchemasFromMappings(mappings []*mgmtv1alpha1.JobMapping) []string

Parses the job mappings and returns the unique set of schemas found

func GetUniqueTablesFromMappings

func GetUniqueTablesFromMappings(mappings []*mgmtv1alpha1.JobMapping) map[string]struct{}

Parses the job mappings and returns the unique set of tables.

func GetUniqueTablesMapFromJob

func GetUniqueTablesMapFromJob(job *mgmtv1alpha1.Job) map[string]struct{}

Parses the job and returns the unique set of tables.

func Ptr

func Ptr[T any](val T) *T

Generic util method that turns any value into its pointer

Types

type BenthosDsn

type BenthosDsn struct {
	EnvVarKey string
	// Neosync Connection Id
	ConnectionId string
}

Holds the environment variable name and the connection id that should replace it at runtime when the Sync activity is launched

type RedisConfig

type RedisConfig struct {
	Url    string
	Kind   string
	Master *string
	Tls    *RedisTlsConfig
}

func GetRedisConfig

func GetRedisConfig() *RedisConfig

type RedisTlsConfig

type RedisTlsConfig struct {
	Enabled               bool
	SkipCertVerify        bool
	EnableRenegotiation   bool
	RootCertAuthority     *string
	RootCertAuthorityFile *string
}

type WorkflowMetadata

type WorkflowMetadata struct {
	WorkflowId string
	RunId      string
}

General workflow metadata struct that is intended to be common across activities

Jump to

Keyboard shortcuts

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