Coder Social home page Coder Social logo

brlala / sdk-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serverlessworkflow/sdk-go

0.0 0.0 0.0 287 KB

Go SDK for Serverless Workflow

Home Page: http://serverlessworkflow.io

License: Apache License 2.0

Shell 0.39% Go 99.31% Makefile 0.30%

sdk-go's Introduction

Go SDK for Serverless Workflow

Here you will find all the specification types defined by our Json Schemas, in Go.

Current status of features implemented in the SDK is listed in the table below:

Feature Status
Parse workflow JSON and YAML definitions โœ”๏ธ
Programmatically build workflow definitions ๐Ÿšซ
Validate workflow definitions (Schema) โœ”๏ธ
Validate workflow definitions (Integrity) โœ”๏ธ
Generate workflow diagram (SVG) ๐Ÿšซ

Status

Latest Releases Conformance to spec version
v1.0.0 v0.5
v2.0.1 v0.6
v2.1.x v0.7

How to use

Run the following command in the root of your Go's project:

$ go get github.com/serverlessworkflow/sdk-go/v2

Your go.mod file should be updated to add a dependency from the Serverless Workflow specification.

To use the generated types, import the package in your go file like this:

import "github.com/serverlessworkflow/sdk-go/v2/model"

Then just reference the package in your Go file like myfunction := model.Function{}.

Parsing Serverless Workflow files

Serverless Workflow Specification supports YAML and JSON files for Workflow definitions. To transform such files into a Go data structure, use:

package sw

import (
    "github.com/serverlessworkflow/sdk-go/v2/model"
    "github.com/serverlessworkflow/sdk-go/v2/parser"
)

func ParseWorkflow(filePath string) (*model.Workflow, error) {
    workflow, err := parser.FromFile(filePath)
    if err != nil {
        return nil, err
    } 
    return workflow, nil
} 

The Workflow structure then can be used in your application.

Slack Channel

Join us at CNCF Slack, channel #serverless-workflow-sdk and say hello ๐Ÿ™‹.

sdk-go's People

Contributors

ricardozanini avatar lsytj0413 avatar spolti avatar brlala avatar mattgarmon avatar tsurdilo avatar vicngu avatar andresmijares avatar arcolife avatar calvinmclean avatar davidesalerno avatar someshkoli avatar soniasingla avatar globalflea avatar iwita avatar mend-bolt-for-github[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.