This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Showing
12 changed files
with
71 additions
and
70 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package typiobj | ||
|
||
import ( | ||
"github.com/urfave/cli" | ||
"go.uber.org/dig" | ||
) | ||
|
||
// CliAction to return cli action | ||
func CliAction(p interface{}, fn interface{}) func(ctx *cli.Context) error { | ||
return func(ctx *cli.Context) (err error) { | ||
c := dig.New() | ||
defer func() { | ||
if destructor, ok := p.(Destructor); ok { | ||
destructor.Destruct(c) | ||
} | ||
}() | ||
if constructor, ok := p.(Constructor); ok { | ||
if err = constructor.Construct(c); err != nil { | ||
return | ||
} | ||
} | ||
return c.Invoke(fn) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
EXPERIMENTAL/typictx/configuration.go → EXPERIMENTAL/typiobj/configuration.go
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,4 +1,4 @@ | ||
package typictx | ||
package typiobj | ||
|
||
// Configuration represent the configuration | ||
type Configuration struct { | ||
|
2 changes: 1 addition & 1 deletion
2
EXPERIMENTAL/typictx/modules.go → EXPERIMENTAL/typiobj/modules.go
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,4 +1,4 @@ | ||
package typictx | ||
package typiobj | ||
|
||
import ( | ||
"github.com/typical-go/typical-rest-server/EXPERIMENTAL/slice" | ||
|
2 changes: 1 addition & 1 deletion
2
EXPERIMENTAL/typictx/object.go → EXPERIMENTAL/typiobj/object.go
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,4 +1,4 @@ | ||
package typictx | ||
package typiobj | ||
|
||
import ( | ||
"github.com/urfave/cli" | ||
|
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