node

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtractBody      = "body"
	ExtractXPathXML  = "xpath_xml"
	ExtractXPathHTML = "xpath_html"
	ExtractXPathJSON = "xpath_json"
	ExtractRegexBody = "regex_body"
	ExtractHeader    = "header"
	ExtractStatus    = "status"
	ExtractSession   = "session"
)
View Source
const (
	IfEqual          = "equal"
	IfNotEqual       = "equal_not"
	IfGreater        = "greater"
	IfGreaterOrEqual = "greater_or_equal"
	IfLess           = "less"
	IfLessOrEqual    = "less_or_equal"
	IfContains       = "contains"
	IfNotContains    = "contains_not"
	IfRegexMatch     = "regex_match"
	IfRegexNotMatch  = "regex_match_not"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel string
const (
	ChannelStdout   Channel = "stdout"
	ChannelStderr   Channel = "stderr"
	ChannelActivity Channel = "activity"
)

type Connector

type Connector struct {
	Name        string                  `json:"name"`
	Type        transmission.ParentType `json:"type"`
	Linkable    bool                    `json:"linkable"`
	Description string                  `json:"description"`
}

func NewConnector

func NewConnector(name string, t transmission.ParentType, linkable bool, description ...string) Connector

type Connectors

type Connectors []Connector

func (Connectors) FindByName

func (c Connectors) FindByName(name string) (Connector, bool)

type DelayNode

type DelayNode struct {
	// contains filtered or unexported fields
}

func NewDelay

func NewDelay() *DelayNode

func (DelayNode) Busy

func (b DelayNode) Busy() bool

func (DelayNode) GetInjections

func (n DelayNode) GetInjections() map[string]transmission.Transmission

func (DelayNode) GetVars

func (b DelayNode) GetVars() *VarStorage

func (DelayNode) ID

func (b DelayNode) ID() uuid.UUID

func (DelayNode) IsReadOnly

func (b DelayNode) IsReadOnly() bool

func (DelayNode) LastInput

func (b DelayNode) LastInput() time.Time

func (DelayNode) MergeVars

func (b DelayNode) MergeVars(vars *VarStorage)

func (DelayNode) Name

func (b DelayNode) Name() string

func (DelayNode) SetID

func (b DelayNode) SetID(id uuid.UUID)

func (DelayNode) SetName

func (b DelayNode) SetName(name string)

func (DelayNode) SetVars

func (b DelayNode) SetVars(vars *VarStorage)

func (*DelayNode) Start

func (n *DelayNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (DelayNode) Type

func (b DelayNode) Type() Type

type ExtractorNode added in v0.0.2

type ExtractorNode struct {
	// contains filtered or unexported fields
}

func NewExtractor added in v0.0.2

func NewExtractor() *ExtractorNode

func (ExtractorNode) Busy added in v0.0.2

func (b ExtractorNode) Busy() bool

func (ExtractorNode) GetInjections added in v0.0.2

func (n ExtractorNode) GetInjections() map[string]transmission.Transmission

func (ExtractorNode) GetVars added in v0.0.2

func (b ExtractorNode) GetVars() *VarStorage

func (ExtractorNode) ID added in v0.0.2

func (b ExtractorNode) ID() uuid.UUID

func (ExtractorNode) IsReadOnly added in v0.0.2

func (b ExtractorNode) IsReadOnly() bool

func (ExtractorNode) LastInput added in v0.0.2

func (b ExtractorNode) LastInput() time.Time

func (ExtractorNode) MergeVars added in v0.0.2

func (b ExtractorNode) MergeVars(vars *VarStorage)

func (ExtractorNode) Name added in v0.0.2

func (b ExtractorNode) Name() string

func (ExtractorNode) SetID added in v0.0.2

func (b ExtractorNode) SetID(id uuid.UUID)

func (ExtractorNode) SetName added in v0.0.2

func (b ExtractorNode) SetName(name string)

func (ExtractorNode) SetVars added in v0.0.2

func (b ExtractorNode) SetVars(vars *VarStorage)

func (*ExtractorNode) Start added in v0.0.2

func (n *ExtractorNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (ExtractorNode) Type added in v0.0.2

func (b ExtractorNode) Type() Type

type FuzzerNode

type FuzzerNode struct {
	// contains filtered or unexported fields
}

func NewFuzzer

func NewFuzzer() *FuzzerNode

func (FuzzerNode) Busy

func (b FuzzerNode) Busy() bool

func (FuzzerNode) GetInjections

func (n FuzzerNode) GetInjections() map[string]transmission.Transmission

func (FuzzerNode) GetVars

func (b FuzzerNode) GetVars() *VarStorage

func (FuzzerNode) ID

func (b FuzzerNode) ID() uuid.UUID

func (FuzzerNode) IsReadOnly

func (b FuzzerNode) IsReadOnly() bool

func (FuzzerNode) LastInput

func (b FuzzerNode) LastInput() time.Time

func (FuzzerNode) MergeVars

func (b FuzzerNode) MergeVars(vars *VarStorage)

func (FuzzerNode) Name

func (b FuzzerNode) Name() string

func (FuzzerNode) SetID

func (b FuzzerNode) SetID(id uuid.UUID)

func (FuzzerNode) SetName

func (b FuzzerNode) SetName(name string)

func (FuzzerNode) SetVars

func (b FuzzerNode) SetVars(vars *VarStorage)

func (*FuzzerNode) Start

func (n *FuzzerNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (FuzzerNode) Type

func (b FuzzerNode) Type() Type

type IfNode added in v0.0.2

type IfNode struct {
	// contains filtered or unexported fields
}

func NewIf added in v0.0.2

func NewIf() *IfNode

func (IfNode) Busy added in v0.0.2

func (b IfNode) Busy() bool

func (IfNode) GetInjections added in v0.0.2

func (n IfNode) GetInjections() map[string]transmission.Transmission

func (IfNode) GetVars added in v0.0.2

func (b IfNode) GetVars() *VarStorage

func (IfNode) ID added in v0.0.2

func (b IfNode) ID() uuid.UUID

func (IfNode) IsReadOnly added in v0.0.2

func (b IfNode) IsReadOnly() bool

func (IfNode) LastInput added in v0.0.2

func (b IfNode) LastInput() time.Time

func (IfNode) MergeVars added in v0.0.2

func (b IfNode) MergeVars(vars *VarStorage)

func (IfNode) Name added in v0.0.2

func (b IfNode) Name() string

func (IfNode) SetID added in v0.0.2

func (b IfNode) SetID(id uuid.UUID)

func (IfNode) SetName added in v0.0.2

func (b IfNode) SetName(name string)

func (IfNode) SetVars added in v0.0.2

func (b IfNode) SetVars(vars *VarStorage)

func (*IfNode) Start added in v0.0.2

func (n *IfNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (IfNode) Type added in v0.0.2

func (b IfNode) Type() Type

type Input

type Input struct {
	Last bool
	Data map[string]transmission.Transmission
}
type Link struct {
	From       LinkDirection
	To         LinkDirection
	Annotation string
}

type LinkDirection

type LinkDirection struct {
	Node      uuid.UUID
	Connector string
}

type MergerNode added in v0.0.4

type MergerNode struct {
	// contains filtered or unexported fields
}

func NewMerger added in v0.0.4

func NewMerger() *MergerNode

func (MergerNode) Busy added in v0.0.4

func (b MergerNode) Busy() bool

func (MergerNode) GetInjections added in v0.0.4

func (n MergerNode) GetInjections() map[string]transmission.Transmission

func (MergerNode) GetVars added in v0.0.4

func (b MergerNode) GetVars() *VarStorage

func (MergerNode) ID added in v0.0.4

func (b MergerNode) ID() uuid.UUID

func (MergerNode) IsReadOnly added in v0.0.4

func (b MergerNode) IsReadOnly() bool

func (MergerNode) LastInput added in v0.0.4

func (b MergerNode) LastInput() time.Time

func (MergerNode) MergeVars added in v0.0.4

func (b MergerNode) MergeVars(vars *VarStorage)

func (MergerNode) Name added in v0.0.4

func (b MergerNode) Name() string

func (MergerNode) SetID added in v0.0.4

func (b MergerNode) SetID(id uuid.UUID)

func (MergerNode) SetName added in v0.0.4

func (b MergerNode) SetName(name string)

func (MergerNode) SetVars added in v0.0.4

func (b MergerNode) SetVars(vars *VarStorage)

func (*MergerNode) Start added in v0.0.4

func (n *MergerNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (MergerNode) Type added in v0.0.4

func (b MergerNode) Type() Type

type Node

type Node interface {
	IsReadOnly() bool
	ID() uuid.UUID
	SetID(uuid.UUID)
	SetName(string)
	Type() Type
	Name() string
	GetInputs() Connectors
	SetStaticInputValues(map[string]transmission.Transmission) error
	AddStaticInputValue(string, transmission.Transmission) error
	GetOutputs() Connectors
	GetVars() *VarStorage
	SetVars(*VarStorage)
	MergeVars(*VarStorage)
	Validate(params map[string]transmission.Transmission) error
	LastInput() time.Time
	Busy() bool

	GetInjections() map[string]transmission.Transmission
	Start(context.Context, <-chan Input, chan<- OutputInstance, chan<- Output) error
}

func FromType

func FromType(t Type) (Node, error)

type Output

type Output struct {
	Node    uuid.UUID
	Channel Channel
	Message string
}

func (Output) Pack

func (o Output) Pack() OutputM

type OutputInstance

type OutputInstance struct {
	OutputName string
	Current    int
	Total      int
	Complete   bool
	Data       transmission.Transmission
}

type OutputM

type OutputM struct {
	Node    string `json:"node"`
	Channel string `json:"channel"`
	Message string `json:"message"`
}

type OutputNode

type OutputNode struct {
	// contains filtered or unexported fields
}

func NewOutput

func NewOutput() *OutputNode

func (OutputNode) Busy

func (b OutputNode) Busy() bool

func (OutputNode) GetInjections

func (n OutputNode) GetInjections() map[string]transmission.Transmission

func (OutputNode) GetVars

func (b OutputNode) GetVars() *VarStorage

func (OutputNode) ID

func (b OutputNode) ID() uuid.UUID

func (OutputNode) IsReadOnly

func (b OutputNode) IsReadOnly() bool

func (OutputNode) LastInput

func (b OutputNode) LastInput() time.Time

func (OutputNode) MergeVars

func (b OutputNode) MergeVars(vars *VarStorage)

func (OutputNode) Name

func (b OutputNode) Name() string

func (OutputNode) SetID

func (b OutputNode) SetID(id uuid.UUID)

func (OutputNode) SetName

func (b OutputNode) SetName(name string)

func (OutputNode) SetVars

func (b OutputNode) SetVars(vars *VarStorage)

func (*OutputNode) Start

func (n *OutputNode) Start(ctx context.Context, in <-chan Input, _ chan<- OutputInstance, output chan<- Output) error

func (OutputNode) Type

func (b OutputNode) Type() Type

type RequestNode

type RequestNode struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest() *RequestNode

func (RequestNode) Busy

func (b RequestNode) Busy() bool

func (*RequestNode) GetInjections

func (n *RequestNode) GetInjections() map[string]transmission.Transmission

func (RequestNode) GetVars

func (b RequestNode) GetVars() *VarStorage

func (RequestNode) ID

func (b RequestNode) ID() uuid.UUID

func (RequestNode) IsReadOnly

func (b RequestNode) IsReadOnly() bool

func (RequestNode) LastInput

func (b RequestNode) LastInput() time.Time

func (RequestNode) MergeVars

func (b RequestNode) MergeVars(vars *VarStorage)

func (RequestNode) Name

func (b RequestNode) Name() string

func (RequestNode) SetID

func (b RequestNode) SetID(id uuid.UUID)

func (RequestNode) SetName

func (b RequestNode) SetName(name string)

func (RequestNode) SetVars

func (b RequestNode) SetVars(vars *VarStorage)

func (*RequestNode) Start

func (n *RequestNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (RequestNode) Type

func (b RequestNode) Type() Type

type SenderNode

type SenderNode struct {
	// contains filtered or unexported fields
}

func NewSender

func NewSender() *SenderNode

func (SenderNode) Busy

func (b SenderNode) Busy() bool

func (SenderNode) GetInjections

func (n SenderNode) GetInjections() map[string]transmission.Transmission

func (SenderNode) GetVars

func (b SenderNode) GetVars() *VarStorage

func (SenderNode) ID

func (b SenderNode) ID() uuid.UUID

func (SenderNode) IsReadOnly

func (b SenderNode) IsReadOnly() bool

func (SenderNode) LastInput

func (b SenderNode) LastInput() time.Time

func (SenderNode) MergeVars

func (b SenderNode) MergeVars(vars *VarStorage)

func (SenderNode) Name

func (b SenderNode) Name() string

func (SenderNode) SetID

func (b SenderNode) SetID(id uuid.UUID)

func (SenderNode) SetName

func (b SenderNode) SetName(name string)

func (SenderNode) SetVars

func (b SenderNode) SetVars(vars *VarStorage)

func (*SenderNode) Start

func (n *SenderNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (SenderNode) Type

func (b SenderNode) Type() Type

type StartNode

type StartNode struct {
	// contains filtered or unexported fields
}

func NewStart

func NewStart() *StartNode

func (StartNode) Busy

func (b StartNode) Busy() bool

func (StartNode) GetInjections

func (n StartNode) GetInjections() map[string]transmission.Transmission

func (StartNode) GetVars

func (b StartNode) GetVars() *VarStorage

func (StartNode) ID

func (b StartNode) ID() uuid.UUID

func (StartNode) IsReadOnly

func (b StartNode) IsReadOnly() bool

func (StartNode) LastInput

func (b StartNode) LastInput() time.Time

func (StartNode) MergeVars

func (b StartNode) MergeVars(vars *VarStorage)

func (StartNode) Name

func (b StartNode) Name() string

func (StartNode) SetID

func (b StartNode) SetID(id uuid.UUID)

func (StartNode) SetName

func (b StartNode) SetName(name string)

func (StartNode) SetVars

func (b StartNode) SetVars(vars *VarStorage)

func (*StartNode) Start

func (n *StartNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (StartNode) Type

func (b StartNode) Type() Type

type StatusFilterNode

type StatusFilterNode struct {
	// contains filtered or unexported fields
}

func NewStatusFilter

func NewStatusFilter() *StatusFilterNode

func (StatusFilterNode) Busy

func (b StatusFilterNode) Busy() bool

func (StatusFilterNode) GetInjections

func (n StatusFilterNode) GetInjections() map[string]transmission.Transmission

func (StatusFilterNode) GetVars

func (b StatusFilterNode) GetVars() *VarStorage

func (StatusFilterNode) ID

func (b StatusFilterNode) ID() uuid.UUID

func (StatusFilterNode) IsReadOnly

func (b StatusFilterNode) IsReadOnly() bool

func (StatusFilterNode) LastInput

func (b StatusFilterNode) LastInput() time.Time

func (StatusFilterNode) MergeVars

func (b StatusFilterNode) MergeVars(vars *VarStorage)

func (StatusFilterNode) Name

func (b StatusFilterNode) Name() string

func (StatusFilterNode) SetID

func (b StatusFilterNode) SetID(id uuid.UUID)

func (StatusFilterNode) SetName

func (b StatusFilterNode) SetName(name string)

func (StatusFilterNode) SetVars

func (b StatusFilterNode) SetVars(vars *VarStorage)

func (*StatusFilterNode) Start

func (n *StatusFilterNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (StatusFilterNode) Type

func (b StatusFilterNode) Type() Type

type TransmissionM

type TransmissionM struct {
	ParentType uint32      `json:"type"`
	ChildType  uint32      `json:"internal"`
	Data       interface{} `json:"data"`
}

func (*TransmissionM) Unpack

type Type

type Type int
const (
	TypeUnknown Type = iota
	TypeFuzzer
	TypeOutput
	TypeStatusFilter
	TypeRequest
	TypeStart
	TypeSender
	TypeVariables
	TypeDelay
	TypeExtractor
	TypeIf
	TypeMerger
)

type VarStorage

type VarStorage struct {
	// contains filtered or unexported fields
}

func NewVarStorage

func NewVarStorage(inputs, outputs Connectors, defaults map[string]transmission.Transmission) *VarStorage

func (*VarStorage) AddStaticInputValue

func (s *VarStorage) AddStaticInputValue(key string, value transmission.Transmission) error

func (*VarStorage) FindInput

func (s *VarStorage) FindInput(name string) (Connector, bool)

func (*VarStorage) FindOutput

func (s *VarStorage) FindOutput(name string) (Connector, bool)

func (*VarStorage) GetInputs

func (s *VarStorage) GetInputs() Connectors

func (*VarStorage) GetOutputs

func (s *VarStorage) GetOutputs() Connectors

func (*VarStorage) MarshalJSON

func (s *VarStorage) MarshalJSON() ([]byte, error)

func (*VarStorage) Merge

func (s *VarStorage) Merge(other *VarStorage)

func (*VarStorage) Pack

func (s *VarStorage) Pack() (*VarStorageM, error)

func (*VarStorage) ReadInputBool

func (s *VarStorage) ReadInputBool(name string, dynamicInputs map[string]transmission.Transmission) (bool, error)

func (*VarStorage) ReadInputChoice added in v0.0.2

func (s *VarStorage) ReadInputChoice(name string, dynamicInputs map[string]transmission.Transmission) (string, error)

func (*VarStorage) ReadInputInt

func (s *VarStorage) ReadInputInt(name string, dynamicInputs map[string]transmission.Transmission) (int, error)

func (*VarStorage) ReadInputList

func (s *VarStorage) ReadInputList(name string, dynamicInputs map[string]transmission.Transmission) (transmission.Lister, error)

func (*VarStorage) ReadInputMap

func (s *VarStorage) ReadInputMap(name string, dynamicInputs map[string]transmission.Transmission) (map[string]string, error)

func (*VarStorage) ReadInputRequest

func (s *VarStorage) ReadInputRequest(name string, dynamicInputs map[string]transmission.Transmission) (*packaging.HttpRequest, error)

func (*VarStorage) ReadInputResponse

func (s *VarStorage) ReadInputResponse(name string, dynamicInputs map[string]transmission.Transmission) (*packaging.HttpResponse, error)

func (*VarStorage) ReadInputString

func (s *VarStorage) ReadInputString(name string, dynamicInputs map[string]transmission.Transmission) (string, error)

func (*VarStorage) ReadValue

func (s *VarStorage) ReadValue(name string, dynamicInputs map[string]transmission.Transmission) (transmission.Transmission, error)

func (*VarStorage) SetStaticInputValues

func (s *VarStorage) SetStaticInputValues(values map[string]transmission.Transmission) error

func (*VarStorage) UnmarshalJSON

func (s *VarStorage) UnmarshalJSON(data []byte) error

func (*VarStorage) Validate

func (s *VarStorage) Validate(params map[string]transmission.Transmission) error

type VarStorageM

type VarStorageM struct {
	Inputs  Connectors               `json:"inputs"`
	Outputs Connectors               `json:"outputs"`
	Static  map[string]TransmissionM `json:"static"`
}

func (*VarStorageM) Unpack

func (m *VarStorageM) Unpack() (*VarStorage, error)

type VarsNode

type VarsNode struct {
	// contains filtered or unexported fields
}

func NewVars

func NewVars() *VarsNode

func (VarsNode) Busy

func (b VarsNode) Busy() bool

func (*VarsNode) GetInjections

func (n *VarsNode) GetInjections() map[string]transmission.Transmission

func (VarsNode) GetVars

func (b VarsNode) GetVars() *VarStorage

func (VarsNode) ID

func (b VarsNode) ID() uuid.UUID

func (VarsNode) IsReadOnly

func (b VarsNode) IsReadOnly() bool

func (VarsNode) LastInput

func (b VarsNode) LastInput() time.Time

func (VarsNode) MergeVars

func (b VarsNode) MergeVars(vars *VarStorage)

func (VarsNode) Name

func (b VarsNode) Name() string

func (VarsNode) SetID

func (b VarsNode) SetID(id uuid.UUID)

func (VarsNode) SetName

func (b VarsNode) SetName(name string)

func (VarsNode) SetVars

func (b VarsNode) SetVars(vars *VarStorage)

func (*VarsNode) Start

func (n *VarsNode) Start(ctx context.Context, in <-chan Input, out chan<- OutputInstance, _ chan<- Output) error

func (VarsNode) Type

func (b VarsNode) Type() Type

Jump to

Keyboard shortcuts

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