engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressingMap

type AddressingMap interface {
	GetSUUIDsByPair(address common.Address, pUUID core.PUUID) ([]core.SUUID, error)
	Insert(addr common.Address, pUUID core.PUUID, sUUID core.SUUID) error
}

AddressingMap ... Interface for mapping addresses to session UUIDs

func NewAddressingMap

func NewAddressingMap() AddressingMap

NewAddressingMap ... Initializer

type Manager

type Manager interface {
	GetInputType(invType core.InvariantType) (core.RegisterType, error)
	Transit() chan core.InvariantInput

	DeleteInvariantSession(core.SUUID) (core.SUUID, error)
	DeployInvariantSession(cfg *invariant.DeployConfig) (core.SUUID, error)

	core.Subsystem
}

Manager ... Engine manager interface

func NewManager

func NewManager(ctx context.Context, engine RiskEngine, addr AddressingMap,
	store SessionStore, it registry.InvariantTable, alertOutgress chan core.Alert) Manager

NewManager ... Initializer

type RiskEngine

type RiskEngine interface {
	Type() Type
	Execute(context.Context, core.TransitData,
		invariant.Invariant) (*core.Invalidation, bool)
}

RiskEngine ... Execution engine interface

func NewHardCodedEngine

func NewHardCodedEngine() RiskEngine

NewHardCodedEngine ... Initializer

type SessionStore

type SessionStore interface {
	AddInvSession(sUUID core.SUUID, pID core.PUUID, inv invariant.Invariant) error
	GetInstanceByUUID(sUUID core.SUUID) (invariant.Invariant, error)
	GetInstancesByUUIDs(sUUIDs []core.SUUID) ([]invariant.Invariant, error)
	GetSUUIDsByPUUID(pUUID core.PUUID) ([]core.SUUID, error)
}

SessionStore ...

func NewSessionStore

func NewSessionStore() SessionStore

NewSessionStore ... Initializer

type Type

type Type int

Type ... Risk engine execution type

const (
	HardCoded Type = iota + 1
	// NOTE: Dynamic invariant support is not implemented
	Dynamic
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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