interfaces

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptinInterface

type CaptinInterface interface {
	Execute(ctx context.Context, e IncomingEventInterface) (bool, []ErrorInterface)
	IsRunning() bool
}

CaptinInterface - Captin Interface

type ConfigMapperInterface

type ConfigMapperInterface interface {
	ConfigsForKey(eventKey string) []ConfigurationInterface
}

ConfigMapperInterface - Interface for config mapper

type ConfigurationInterface

type ConfigurationInterface interface {
	GetByEnv(key string) (string, string)
	GetThrottleValue() time.Duration
	GetDelayValue() time.Duration
	GetTimeValueMillis(timeValue string) time.Duration
	GetActions() []string
	GetConfigID() string
	GetCallbackURL() string
	GetValidate() string
	GetSource() string
	GetThrottle() string
	GetDelay() string
	GetThrottleTrailingDisabled() bool
	GetKeepThrottledPayloads() bool
	GetKeepThrottledDocuments() bool
	GetIncludeDocument() bool
	GetName() string
	GetAllowLoopback() bool
	GetSender() string
	GetDocumentStore() string
	GetRetryBackoff() []string
	GetIncludeDocumentAttrs() []string
	GetExcludeDocumentAttrs() []string
	GetIncludePayloadAttrs() []string
	GetExcludePayloadAttrs() []string
	GetExtras() map[string]string
}

type DestinationInterface

type DestinationInterface interface {
	GetConfig() ConfigurationInterface
	GetCallbackURL() string
	GetSqsSenderConfig(key string) string
	GetDocumentStore() string
}

type DispatchDelayerInterface

type DispatchDelayerInterface interface {
	Execute(ctx context.Context, e IncomingEventInterface, d DestinationInterface, exec func())
}

DispatchDelayerInterface - class for deciding how event message is delayed

type DocumentStoreInterface

type DocumentStoreInterface interface {
	// GetDocument - Get value from store, return the document map
	GetDocument(ctx context.Context, e IncomingEventInterface) map[string]interface{}
}

StoreInterface - Store for throttle events

type ErrorHandlerInterface

type ErrorHandlerInterface interface {
	Exec(ctx context.Context, e ErrorInterface)
}

type ErrorInterface

type ErrorInterface interface {
	Error() string
}

type EventSenderInterface

type EventSenderInterface interface {
	SendEvent(ctx context.Context, e IncomingEventInterface, d DestinationInterface) error
}

EventSenderInterface - Event Sender Interface

type IncomingEventInterface

type IncomingEventInterface interface {
	GetTraceInfo() map[string]interface{}
	GetControl() map[string]interface{}
	GetOutstandingDelaySeconds() time.Duration
	IsValid() bool
}

type IncomingHandler

type IncomingHandler interface {
	SetConfigMapper(configMapper *ConfigMapperInterface)
	Setup(c CaptinInterface)
}

IncomingHandler - Interface for creating handler to trigger captin execute

type StoreInterface

type StoreInterface interface {
	// Get - Get value from store, return with remaining time
	Get(ctx context.Context, key string) (payload string, exists bool, ttl time.Duration, err error)

	// Set - Set value into store with ttl
	Set(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)

	// Update - Update value for key
	Update(ctx context.Context, key string, value string) (bool, error)

	// Remove - Remove value for key
	Remove(ctx context.Context, key string) (bool, error)

	DataKey(ctx context.Context, e IncomingEventInterface, dest DestinationInterface, prefix string, suffix string) string

	Enqueue(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)

	GetQueue(ctx context.Context, key string) (values []string, exists bool, ttl time.Duration, err error)
}

StoreInterface - Store for throttle events

type ThrottleInterface

type ThrottleInterface interface {
	// CanTrigger - Check if can trigger
	CanTrigger(ctx context.Context, id string, period time.Duration) (canTrigger bool, ttl time.Duration, err error)
}

ThrottleInterface - interface for a throttle object Throttle event flow: Mutex Lock: 1 Payload Store: p p p p (Expired * 2) Events: x x x x - Throttle: t t2

Jump to

Keyboard shortcuts

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