Documentation
¶
Index ¶
- type AmassRangerEntry
- type Asset
- type AssetData
- type AssetPipeline
- type Association
- type Backlog
- type Dispatcher
- type EmailMeta
- type Event
- type EventDataElement
- type Handler
- type PipelineQueue
- type Plugin
- type Registry
- type Scope
- type Session
- type SessionHTTPClients
- type SessionManager
- type SessionPipelines
- type SessionSemaphone
- type SessionStats
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmassRangerEntry ¶
type AssetPipeline ¶
type AssetPipeline struct {
Pipeline *pipeline.Pipeline
Queue *PipelineQueue
}
type Association ¶ added in v5.1.1
type Backlog ¶ added in v5.1.1
type Backlog interface {
Has(e *dbt.Entity) bool
Enqueue(e *dbt.Entity) error
EnqueueDone(e *dbt.Entity) error
// ClaimNext leases up to num entities of this asset type.
// Claimed items will not be returned again until Ack/Release or lease expiry.
ClaimNext(atype oam.AssetType, num int) ([]*dbt.Entity, error)
// Ack marks completion (done). Call on actual completion (e.g. pipeline finished).
Ack(e *dbt.Entity, enforceOwner bool) error
// Release returns a leased item back to queued (e.g. backpressure/admission failure).
Release(e *dbt.Entity, atype oam.AssetType, enforceOwner bool) error
Counts(atype oam.AssetType) (queued, leased, done int64, err error)
Delete(e *dbt.Entity) error
Close() error
// Optional knobs:
SetOwner(owner string)
SetLeaseTTL(ttl time.Duration)
}
Backlog is the durable, per-session work backlog with claim/lease semantics. Items are:
- Enqueued (queued)
- Claimed (leased/in-flight)
- Acked (done) or Released (returned to queued)
type Dispatcher ¶
type EventDataElement ¶
type EventDataElement struct {
Event *Event
Error error
Exit chan *EventDataElement
Ref any
}
func NewEventDataElement ¶
func NewEventDataElement(e *Event) *EventDataElement
func (*EventDataElement) Clone ¶
func (ede *EventDataElement) Clone() pipeline.Data
type PipelineQueue ¶
type PipelineQueue struct {
// contains filtered or unexported fields
}
func NewPipelineQueue ¶
func NewPipelineQueue() *PipelineQueue
func (*PipelineQueue) Append ¶ added in v5.1.1
func (pq *PipelineQueue) Append(data *EventDataElement) error
func (*PipelineQueue) Data ¶
func (pq *PipelineQueue) Data() pipeline.Data
Data implements the pipeline InputSource interface.
func (*PipelineQueue) Drain ¶ added in v5.1.1
func (pq *PipelineQueue) Drain()
func (*PipelineQueue) Error ¶
func (pq *PipelineQueue) Error() error
Error implements the pipeline InputSource interface.
func (*PipelineQueue) Len ¶ added in v5.1.1
func (pq *PipelineQueue) Len() int
type Scope ¶ added in v5.1.1
type Scope interface {
// Methods for modifying and querying the scope
Add(a oam.Asset) bool
IsAssetInScope(a oam.Asset, conf int) (oam.Asset, int)
AddBlacklist(name string)
IsBlacklisted(a oam.Asset) bool
// Methods that support detecting association
IsAssociated(req *Association) ([]*Association, error)
AssetsWithAssociation(asset *dbt.Entity) []*dbt.Entity
// Methods for adding and getting FQDNs
Domains() []string
FQDNs() []*oamdns.FQDN
AddDomain(d string) bool
// Methods for adding and getting IP addresses
Addresses() []string
AddAddress(addr string) bool
IPAddresses() []*oamnet.IPAddress
// Methods for adding and getting Netblocks
CIDRs() []string
AddCIDR(cidr string) bool
Netblocks() []*oamnet.Netblock
// Methods for adding and getting autonomous systems
ASNs() []int
AddASN(asn int) bool
AutonomousSystems() []*oamnet.AutonomousSystem
// Methods for adding and getting Organizations
AddOrgByName(o string) bool
Organizations() []*oamorg.Organization
// Methods for adding and getting Locations
Locations() []*oamcon.Location
AddLocation(loc *oamcon.Location) bool
}
type Session ¶
type Session interface {
ID() uuid.UUID
Ctx() context.Context
Log() *slog.Logger
PubSub() *pubsub.Logger
NetSem() SessionSemaphone
Config() *config.Config
Scope() Scope
StartTime() time.Time
DB() repository.Repository
Backlog() Backlog
Pipelines() SessionPipelines
Clients() *SessionHTTPClients
CIDRanger() cidranger.Ranger
TmpDir() string
Stats() *SessionStats
Done() bool
Kill()
}
type SessionHTTPClients ¶ added in v5.1.1
type SessionManager ¶
type SessionPipelines ¶ added in v5.1.1
type SessionPipelines map[oam.AssetType]*AssetPipeline
type SessionSemaphone ¶ added in v5.1.1
type SessionSemaphone interface {
Acquire()
Release()
}
type SessionStats ¶
Click to show internal directories.
Click to hide internal directories.