common

package
v1.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AsyncDestinations = []string{"MARKETO_BULK_UPLOAD", "BING_ADS"}

Functions

func GenerateArrayOfStrings

func GenerateArrayOfStrings(value string) []string

Generates array of strings for comma separated string Also removes "" elements from the array of strings if any.

func GetBatchRouterConfigInt64

func GetBatchRouterConfigInt64(key, destType string, defaultValue int64) int64

func GetTransformedData

func GetTransformedData(payload stdjson.RawMessage) string

Types

type AsyncDestinationManager

type AsyncDestinationManager interface {
	Upload(asyncDestStruct *AsyncDestinationStruct) AsyncUploadOutput
	Poll(pollInput AsyncPoll) PollStatusResponse
	GetUploadStats(UploadStatsInput GetUploadStatsInput) GetUploadStatsResponse
}

type AsyncDestinationStruct

type AsyncDestinationStruct struct {
	ImportingJobIDs       []int64
	FailedJobIDs          []int64
	Exists                bool
	Size                  int
	CreatedAt             time.Time
	FileName              string
	Count                 int
	CanUpload             bool
	UploadInProgress      bool
	UploadMutex           sync.RWMutex
	DestinationUploadURL  string
	Destination           *backendconfig.DestinationT
	Manager               AsyncDestinationManager
	AttemptNums           map[int64]int
	FirstAttemptedAts     map[int64]time.Time
	OriginalJobParameters map[int64]stdjson.RawMessage
}

type AsyncFailedPayload

type AsyncFailedPayload struct {
	Config   map[string]interface{}   `json:"config"`
	Input    []map[string]interface{} `json:"input"`
	DestType string                   `json:"destType"`
	ImportId string                   `json:"importId"`
	MetaData MetaDataT                `json:"metadata"`
}

type AsyncJob

type AsyncJob struct {
	Message  map[string]interface{} `json:"message"`
	Metadata map[string]interface{} `json:"metadata"`
}

type AsyncPoll

type AsyncPoll struct {
	ImportId string `json:"importId"`
}

type AsyncUploadOutput

type AsyncUploadOutput struct {
	ImportingJobIDs     []int64
	ImportingParameters stdjson.RawMessage
	FailedJobIDs        []int64
	SucceededJobIDs     []int64
	SuccessResponse     string
	FailedReason        string
	AbortJobIDs         []int64
	AbortReason         string
	ImportingCount      int
	FailedCount         int
	AbortCount          int
	DestinationID       string
}

type AsyncUploadT

type AsyncUploadT struct {
	Config   map[string]interface{} `json:"config"`
	Input    []AsyncJob             `json:"input"`
	DestType string                 `json:"destType"`
}

type BatchedJobs

type BatchedJobs struct {
	Jobs       []*jobsdb.JobT
	Connection *Connection
	TimeWindow time.Time
}

type Connection

type Connection struct {
	Source      backendconfig.SourceT
	Destination backendconfig.DestinationT
}

type ErrorResponse

type ErrorResponse struct {
	Error string
}

type EventStatMeta

type EventStatMeta struct {
	FailedKeys    []int64
	WarningKeys   []int64
	SucceededKeys []int64
	FailedReasons map[int64]string
}

type GetUploadStatsInput

type GetUploadStatsInput struct {
	FailedJobURLs      string
	Parameters         stdjson.RawMessage
	ImportingList      []*jobsdb.JobT
	PollResultFileURLs string
}

type GetUploadStatsResponse

type GetUploadStatsResponse struct {
	StatusCode int           `json:"statusCode"`
	Metadata   EventStatMeta `json:"metadata"`
}

type ImportParameters

type ImportParameters struct {
	ImportId string    `json:"importId"`
	MetaData MetaDataT `json:"metadata"`
}

type InvalidManager

type InvalidManager struct{}

func (*InvalidManager) GetUploadStats

func (*InvalidManager) Poll

func (*InvalidManager) Upload

func (f *InvalidManager) Upload(asyncDestStruct *AsyncDestinationStruct) AsyncUploadOutput

type MetaDataT

type MetaDataT struct {
	CSVHeaders string `json:"csvHeader"`
}

type PollStatusResponse

type PollStatusResponse struct {
	Complete       bool
	InProgress     bool
	StatusCode     int
	HasFailed      bool
	HasWarning     bool
	FailedJobURLs  string
	WarningJobsURL string
}

type UploadStruct

type UploadStruct struct {
	ImportId string                 `json:"importId"`
	Metadata map[string]interface{} `json:"metadata"`
}

Jump to

Keyboard shortcuts

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