migrations

package
v0.200.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{}

Functions

func Clone added in v0.63.0

func Clone(data []byte, depMapping map[uuids.UUID]uuids.UUID) ([]byte, error)

Clone clones the given flow definition by replacing all UUIDs using the provided mapping and generating new random UUIDs if they aren't in the mapping

func MigrateToLatest

func MigrateToLatest(data []byte, cfg *Config) ([]byte, error)

MigrateToLatest migrates the given flow definition to the latest version

func MigrateToVersion

func MigrateToVersion(data []byte, to *semver.Version, cfg *Config) ([]byte, error)

MigrateToVersion migrates the given flow definition to the given version

func Registered

func Registered() map[*semver.Version]MigrationFunc

Registered gets all registered migrations

Types

type Action

type Action map[string]any

Action holds an action definition

func (Action) Type

func (a Action) Type() string

Type returns the type of this action

type Config

type Config struct {
	BaseMediaURL string
}

Config configures how flow migrations are handled

type Flow

type Flow map[string]any

Flow holds a flow definition

func Migrate13_1

func Migrate13_1(f Flow, cfg *Config) (Flow, error)

Migrate13_1 adds a `uuid` property to templating objects in [action:send_msg] actions.

@version 13_1 "13.1"

func Migrate13_2 added in v0.179.0

func Migrate13_2(f Flow, cfg *Config) (Flow, error)

Migrate13_2 replaces `base` as a flow language with `und` which indicates text with undetermined language in the ISO-639-3 standard.

@version 13_2 "13.2"

func (Flow) Localization added in v0.179.0

func (f Flow) Localization() Localization

Localization returns the localization of this flow

func (Flow) Nodes

func (f Flow) Nodes() []Node

Nodes returns the nodes in this flow

type Header13

type Header13 struct {
	UUID        assets.FlowUUID `json:"uuid" validate:"required,uuid4"`
	Name        string          `json:"name"`
	SpecVersion *semver.Version `json:"spec_version" validate:"required"`
}

Header13 is the set of fields common to all 13+ flow spec versions

type Localization added in v0.179.0

type Localization map[string]any

type MigrationFunc

type MigrationFunc func(Flow, *Config) (Flow, error)

MigrationFunc is a function that can migrate a flow definition from one version to another

type Node

type Node map[string]any

Node holds a node definition

func (Node) Actions

func (n Node) Actions() []Action

Actions returns the actions on this node

func (Node) Router

func (n Node) Router() Router

Router returns the router on this node

type Router

type Router map[string]any

Router holds a router definition

func (Router) Type

func (r Router) Type() string

Type returns the type of this router

Jump to

Keyboard shortcuts

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