types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Session uuid.UUID `json:"sessionToken,omitempty"`
	Name    string    `json:"assetName,omitempty"`
	Data    AssetData `json:"data,omitempty"`
}

type AssetData

type AssetData struct {
	OAMAsset oam.Asset     `json:"asset"`
	OAMType  oam.AssetType `json:"type"`
}

type AssetPipeline

type AssetPipeline struct {
	Pipeline *pipeline.Pipeline
	Queue    *PipelineQueue
}

type Dispatcher

type Dispatcher interface {
	DispatchEvent(e *Event) error
	Shutdown()
}

type EmailMeta

type EmailMeta struct {
	VerifyAttempted bool
	Verified        bool
}

type Event

type Event struct {
	Name       string
	Asset      *dbt.Asset
	Meta       interface{}
	Dispatcher Dispatcher
	Session    Session
}

type EventDataElement

type EventDataElement struct {
	Event *Event
	Error error
	Queue queue.Queue
}

func NewEventDataElement

func NewEventDataElement(e *Event) *EventDataElement

func (*EventDataElement) Clone

func (ede *EventDataElement) Clone() pipeline.Data

type Handler

type Handler struct {
	Plugin       Plugin
	Name         string
	Priority     int
	MaxInstances int
	EventType    oam.AssetType
	Transforms   []string
	Callback     func(*Event) error
}

type PipelineQueue

type PipelineQueue struct {
	queue.Queue
}

func NewPipelineQueue

func NewPipelineQueue() *PipelineQueue

func (*PipelineQueue) Data

func (pq *PipelineQueue) Data() pipeline.Data

Data implements the pipeline InputSource interface.

func (*PipelineQueue) Error

func (pq *PipelineQueue) Error() error

Error implements the pipeline InputSource interface.

func (*PipelineQueue) Next

func (pq *PipelineQueue) Next(ctx context.Context) bool

Next implements the pipeline InputSource interface.

type Plugin

type Plugin interface {
	Name() string
	Start(r Registry) error
	Stop()
}

type Registry

type Registry interface {
	Log() *slog.Logger
	RegisterHandler(h *Handler) error
	BuildPipelines() error
	GetPipeline(eventType oam.AssetType) (*AssetPipeline, error)
}

type Session

type Session interface {
	ID() uuid.UUID
	Log() *slog.Logger
	PubSub() *pubsub.Logger
	Config() *config.Config
	DB() *assetdb.AssetDB
	Cache() cache.Cache
	Stats() *SessionStats
	Done() bool
	Kill()
}

type SessionManager

type SessionManager interface {
	NewSession(cfg *config.Config) (Session, error)
	AddSession(s Session) (uuid.UUID, error)
	CancelSession(id uuid.UUID)
	GetSession(id uuid.UUID) Session
	Shutdown()
}

type SessionStats

type SessionStats struct {
	sync.Mutex
	WorkItemsCompleted int `json:"workItemsCompleted"`
	WorkItemsTotal     int `json:"workItemsTotal"`
}

Jump to

Keyboard shortcuts

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