initial commit lets start
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package facades
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"plcopenxmlbuilder/builders"
|
||||
"schema"
|
||||
)
|
||||
|
||||
type GenerateType int
|
||||
|
||||
const (
|
||||
PLC GenerateType = iota
|
||||
Application
|
||||
Files
|
||||
)
|
||||
|
||||
type Builder interface {
|
||||
Marshal(s *schema.Project) ([]byte, error)
|
||||
}
|
||||
|
||||
func NewBuilder(platform string, generateType GenerateType) (Builder, error) {
|
||||
var builder Builder
|
||||
|
||||
switch platform {
|
||||
case "twincat3":
|
||||
builder = builders.NewTwincat3Builder()
|
||||
default:
|
||||
return nil, fmt.Errorf("no builder for %s found", platform)
|
||||
}
|
||||
|
||||
return builder, nil
|
||||
}
|
||||
Reference in New Issue
Block a user