router

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB_BATCH_FETCH_SIZE        int
	MAX_PROCESS_WORKER         int
	MAX_BATCH_PAYLOAD_SIZE     int
	BATCH_JOB_PROCESS_TIMEOUT  time.Duration
	JOB_RESPONSE_BATCH_TIMEOUT time.Duration
)

Functions

func BackendConfigSubscriber added in v1.1.0

func BackendConfigSubscriber()

func UpdateRouterConfig added in v1.1.0

func UpdateRouterConfig(connection backendconfig.ConnectionDetailT)

Types

type DBHandleI added in v1.1.0

type DBHandleI interface {
	Connect(string) bool
	InsertPayloadInTransaction([]json.RawMessage) error
}

type DestinationRouterT added in v1.1.0

type DestinationRouterT struct {
	DBHandle   DBHandleI   `json:"DBHandle"`
	RestHandle RestHandleI `json:"RestHandle"`
	Enabled    bool        `json:"Enabled"`
}

type HandleT

type HandleT struct {
	JobsDB                  *jobsdb.HandleT
	ConfigDB                *backendconfig.HandleT
	JobProcessRequestQ      chan *JobProcessRequestT
	JobProcessBatchRequestQ chan *JobProcessRequestT
	JobProcessResponseQ     chan *JobProcessResponseT
	// contains filtered or unexported fields
}

func (*HandleT) CreateNewJobWithFailedEvents added in v1.1.0

func (router *HandleT) CreateNewJobWithFailedEvents(events []interface{}, destinationID int)

func (*HandleT) JobsRequestWorker added in v1.1.0

func (router *HandleT) JobsRequestWorker()

func (*HandleT) JobsResponseWorker added in v1.1.0

func (router *HandleT) JobsResponseWorker()

func (*HandleT) ProcessBatchRouterJobs added in v1.1.0

func (router *HandleT) ProcessBatchRouterJobs()

func (*HandleT) ProcessRouterJobs added in v1.1.0

func (router *HandleT) ProcessRouterJobs(index int)

func (*HandleT) Setup

func (router *HandleT) Setup(jobsDB *jobsdb.HandleT, configDB *backendconfig.HandleT)

type JobProcessRequestT added in v1.1.0

type JobProcessRequestT struct {
	JobID         int64           `json:"JobID"`
	AttemptNum    int             `json:"AttemptNum"`
	DestinationID int             `json:"DestinationID"`
	EventPayload  json.RawMessage `json:"EventPayload"`
}

type JobProcessResponseT added in v1.1.0

type JobProcessResponseT struct {
	JobID         int64           `json:"JobID"`
	AttemptNum    int             `json:"AttemptNum"`
	State         string          `json:"State"`
	ErrorCode     string          `json:"ErrorCode"`
	ErrorResponse json.RawMessage `json:"ErrorResponse"`
}

type RestHandleI added in v1.1.0

type RestHandleI interface {
	Init(string) bool
	Send(json.RawMessage, map[string]interface{}) (int, string, []interface{})
}

Jump to

Keyboard shortcuts

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