-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dec83fc
commit 01bb7a3
Showing
24 changed files
with
325 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,9 +50,6 @@ make build | |
out: | ||
- name: router | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: router | ||
name: router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,6 @@ | |
error: | ||
- name: catch | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: router | ||
name: router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,6 @@ | |
out: | ||
- name: proxy | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: proxy | ||
name: proxy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,6 @@ | |
out: | ||
- name: router | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: router | ||
name: router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ | |
error: | ||
- name: catch | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: router | ||
name: router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,6 @@ | |
out: | ||
- name: router | ||
port: in | ||
env: | ||
PORT: | ||
data: '{{ .PORT }}' | ||
|
||
- kind: router | ||
name: router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
package io | ||
|
||
import "github.com/siyul-park/uniflow/pkg/scheme" | ||
import ( | ||
"github.com/siyul-park/uniflow/pkg/scheme" | ||
"github.com/siyul-park/uniflow/pkg/spec" | ||
) | ||
|
||
// AddToScheme returns a function that adds node types and codecs to the provided spec. | ||
func AddToScheme(fs FileSystem) scheme.Register { | ||
return scheme.RegisterFunc(func(s *scheme.Scheme) error { | ||
s.AddKnownType(KindSQL, &SQLNodeSpec{}) | ||
s.AddCodec(KindSQL, NewSQLNodeCodec()) | ||
definitions := []struct { | ||
kind string | ||
codec scheme.Codec | ||
spec spec.Spec | ||
}{ | ||
{KindSQL, NewSQLNodeCodec(), &SQLNodeSpec{}}, | ||
{KindPrint, NewPrintNodeCodec(fs), &PrintNodeSpec{}}, | ||
{KindScan, NewScanNodeCodec(fs), &ScanNodeSpec{}}, | ||
} | ||
|
||
s.AddKnownType(KindPrint, &PrintNodeSpec{}) | ||
s.AddCodec(KindPrint, NewPrintNodeCodec(fs)) | ||
|
||
s.AddKnownType(KindScan, &ScanNodeSpec{}) | ||
s.AddCodec(KindScan, NewScanNodeCodec(fs)) | ||
for _, def := range definitions { | ||
s.AddKnownType(def.kind, def.spec) | ||
s.AddCodec(def.kind, def.codec) | ||
} | ||
|
||
return nil | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.