runtime

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(wfConf *WorkflowConfig, connMap *sync.Map) ([]serverless.GetFlowFunc, []serverless.GetSinkFunc)

Build the workflow by config (.yaml). It will create one stream for each flows/sinks.

func DispatcherWithFunc

func DispatcherWithFunc(flows []serverless.GetFlowFunc, reader io.Reader) rx.RxStream

DispatcherWithFunc dispatches the input stream to downstreams.

func GetSinks

func GetSinks(wfConf *WorkflowConfig, connMap *sync.Map) []serverless.GetSinkFunc

GetSinks get sinks from workflow config and connMap

func NewServerHandler

func NewServerHandler(conf *WorkflowConfig, meshConfURL string) quic.ServerHandler

NewServerHandler inits a new ServerHandler

Types

type App

type App struct {
	Name string `yaml:"name"`
}

App represents a YoMo Application.

type Runtime

type Runtime interface {
	// Serve a YoMo server.
	Serve(endpoint string) error
}

Runtime represents the YoMo runtime.

func NewRuntime

func NewRuntime(conf *WorkflowConfig, meshConfURL string) Runtime

NewRuntime inits a new YoMo runtime.

type ServerConn

type ServerConn struct {
	Session quic.Session
	// contains filtered or unexported fields
}

ServerConn represents the YoMo Server connection.

func NewServerConn

func NewServerConn(sess quic.Session, st quic.Stream, conf *WorkflowConfig) *ServerConn

NewServerConn inits a new YoMo Server connection.

func (*ServerConn) Beat

func (c *ServerConn) Beat()

Beat sends the heartbeat to clients in every 200ms.

func (*ServerConn) Close

func (c *ServerConn) Close() error

Close the QUIC connection.

func (*ServerConn) SendSinkFlowSignal

func (c *ServerConn) SendSinkFlowSignal() error

SendSinkFlowSignal sends the signal Flow/Sink to client.

type Workflow

type Workflow struct {
	Flows []App `yaml:"flows"`
	Sinks []App `yaml:"sinks"`
}

Workflow represents a YoMo Workflow.

type WorkflowConfig

type WorkflowConfig struct {
	Name     string `yaml:"name"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Workflow `yaml:",inline"`
}

Workflow represents a YoMo Workflow config.

func Load

func Load(path string) (*WorkflowConfig, error)

Load the WorkflowConfig by path.

func ParseConfig

func ParseConfig(config string) (*WorkflowConfig, error)

Jump to

Keyboard shortcuts

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