Init(manifest, typechecker), now typechecker is optional (not nil, optional) + rename package 'gfw' into 'aicra'
This commit is contained in:
parent
ee72e2d285
commit
5fa8db0b7c
10
server.go
10
server.go
|
@ -1,4 +1,4 @@
|
||||||
package gfw
|
package aicra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -15,7 +15,7 @@ import (
|
||||||
// - path is the configuration path
|
// - path is the configuration path
|
||||||
// - if typeChecker is nil, defaults will be used (all *.so files
|
// - if typeChecker is nil, defaults will be used (all *.so files
|
||||||
// inside ./.build/types local directory)
|
// inside ./.build/types local directory)
|
||||||
func Init(path string, typeChecker *checker.TypeRegistry) (*Server, error) {
|
func Init(path string, typeChecker ...*checker.TypeRegistry) (*Server, error) {
|
||||||
|
|
||||||
/* (1) Init instance */
|
/* (1) Init instance */
|
||||||
inst := &Server{
|
inst := &Server{
|
||||||
|
@ -30,9 +30,9 @@ func Init(path string, typeChecker *checker.TypeRegistry) (*Server, error) {
|
||||||
}
|
}
|
||||||
inst.config = config
|
inst.config = config
|
||||||
|
|
||||||
/* (3) Store registry if not nil */
|
/* (3) Store registry if given */
|
||||||
if typeChecker != nil {
|
if len(typeChecker) > 0 && typeChecker[0] != nil {
|
||||||
inst.Checker = typeChecker
|
inst.Checker = typeChecker[0]
|
||||||
return inst, nil
|
return inst, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
types.go
2
types.go
|
@ -1,4 +1,4 @@
|
||||||
package gfw
|
package aicra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.xdrm.io/go/aicra/checker"
|
"git.xdrm.io/go/aicra/checker"
|
||||||
|
|
Loading…
Reference in New Issue