util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigFloatToInt64 added in v0.2.0

func BigFloatToInt64(input *big.Float) int64

func CalculateHash

func CalculateHash(s, salt string) (string, error)

func CalculateHashFromGlobalSalt added in v0.4.0

func CalculateHashFromGlobalSalt(s string) (string, error)

func CreateFlowpipeSalt added in v0.3.0

func CreateFlowpipeSalt(filename string, length int) (string, error)

Assumes that the dir exists

The function creates the salt if it does not exist, or it returns the existing salt if it's already there

func EnsureDir added in v0.3.0

func EnsureDir(dir string) error

func ExtendInputs added in v0.4.3

func ExtendInputs(executionId, pipelineExecutionId, stepExecutionId, stepName string, input modconfig.Input) modconfig.Input

TODO: refactor/tidy extendInputs is only relevant for the "input step". This is the best location we can find right now.

We have tried to encapsulate this in the: 1) Step Definition's getInput() in pipe-fittings, but it needs the salt and we believe that it's not appropriate to use the salt in pipe-fittings. 2) In the primitive itself, but it's too late. We need this information in the Event for the remote CLI use case.

func GetBaseUrl added in v0.3.0

func GetBaseUrl() string

func GetGlobalSalt added in v0.3.0

func GetGlobalSalt() (string, error)

func GetHost

func GetHost() string

func GetHttpFormUrl added in v0.3.0

func GetHttpFormUrl(executionId string, pipelineExecutionId string, stepExecutionId string) (string, error)

func GetModSaltOrDefault added in v0.3.0

func GetModSaltOrDefault() (string, error)

Global vs Mod salt behaviour:

- We should only create the salt *automatically* in the "global" location: `~/.flowpipe/internal/salt ` - A user may create a "mod salt" file in the mod manually (`./.flowpipe/internal/salt`)

- If there is a mod salt, it is used for triggers, otherwise use the global salt. *Integrations* always use the global salt - this implies that:

  • any new installs will only have global salt (unless a user manually creates one)
  • existing installs work and continue to use the same salt as they currently do (unless the user manually deletes the salt)
  • the user may decide to use their own custom per-mod salt, but this is an advanced operation

func NewExecutionID

func NewExecutionID() string

func NewPipelineExecutionID

func NewPipelineExecutionID() string

func NewProcessID

func NewProcessID() string

func NewSessionID

func NewSessionID() string

func NewStepExecutionID

func NewStepExecutionID() string

func NewUniqueID

func NewUniqueID() string

func SafeDeref added in v0.3.0

func SafeDeref[T any](ptr *T) T

func ValidateEmailInput

func ValidateEmailInput(ctx context.Context, i modconfig.Input) error

Types

type CommandBusMock added in v0.2.0

type CommandBusMock struct {
	SendFunc         func(ctx context.Context, command interface{}) error
	SendWithLockFunc func(ctx context.Context, command interface{}, lock *sync.Mutex) error
}

func (*CommandBusMock) Send added in v0.2.0

func (c *CommandBusMock) Send(ctx context.Context, command interface{}) error

func (*CommandBusMock) SendWithLock added in v0.2.0

func (c *CommandBusMock) SendWithLock(ctx context.Context, command interface{}, lock *sync.Mutex) error

type HclExpressionMock added in v0.2.0

type HclExpressionMock struct {
	ValueFunc func(evalCtx *hcl.EvalContext) (cty.Value, hcl.Diagnostics)
}

func (*HclExpressionMock) Range added in v0.2.0

func (*HclExpressionMock) Range() hcl.Range

func (*HclExpressionMock) StartRange added in v0.2.0

func (*HclExpressionMock) StartRange() hcl.Range

func (*HclExpressionMock) Value added in v0.2.0

func (h *HclExpressionMock) Value(evalCtx *hcl.EvalContext) (cty.Value, hcl.Diagnostics)

func (*HclExpressionMock) Variables added in v0.2.0

func (*HclExpressionMock) Variables() []hcl.Traversal

Jump to

Keyboard shortcuts

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