migrations

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: AGPL-3.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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, config *Config) ([]byte, error)

MigrateToLatest migrates the given flow definition to the latest version

func MigrateToVersion

func MigrateToVersion(data []byte, to *semver.Version, config *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]interface{}

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]interface{}

Flow holds a flow definition

func Migrate13_1

func Migrate13_1(f Flow) (Flow, error)

Migrate13_1 adds UUID to send_msg templating

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 MigrationFunc

type MigrationFunc func(Flow) (Flow, error)

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

type Node

type Node map[string]interface{}

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]interface{}

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