Skip to content

Commit 4dd3140

Browse files
committed
Refurbish Controller-Logic-Model into Controller-Model by making models have logic, in order to reduce many but thin modules, and rename packages from plural to singular to define uncountable noun package correctly.
1 parent 524e269 commit 4dd3140

73 files changed

Lines changed: 1650 additions & 1804 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildtime/build_information.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package buildtime
22

3-
import "github.com/qb0C80aE/clay/extensions"
3+
import "github.com/qb0C80aE/clay/extension"
44

55
func init() {
66
var programInformation = &clayProgramInformation{
@@ -12,5 +12,5 @@ func init() {
1212
},
1313
},
1414
}
15-
extensions.RegisterProgramInformation(programInformation)
15+
extension.RegisterProgramInformation(programInformation)
1616
}

buildtime/revisions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package buildtime
22

3-
import "github.com/qb0C80aE/clay/extensions"
3+
import "github.com/qb0C80aE/clay/extension"
44

55
type clayProgramInformation struct {
66
buildTime string
@@ -16,8 +16,8 @@ func (clayProgramInformation *clayProgramInformation) BuildTime() string {
1616
return clayProgramInformation.buildTime
1717
}
1818

19-
func (clayProgramInformation *clayProgramInformation) SubModuleInformationList() []extensions.SubModuleInformation {
20-
result := make([]extensions.SubModuleInformation, len(clayProgramInformation.claySubModuleInformationList))
19+
func (clayProgramInformation *clayProgramInformation) SubModuleInformationList() []extension.SubModuleInformation {
20+
result := make([]extension.SubModuleInformation, len(clayProgramInformation.claySubModuleInformationList))
2121
for i, subModuleInformation := range clayProgramInformation.claySubModuleInformationList {
2222
result[i] = subModuleInformation
2323
}
File renamed without changes.

cmd/client.go renamed to client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package client
22

33
import (
44
"bytes"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
5-
"github.com/qb0C80aE/clay/extensions"
5+
"github.com/qb0C80aE/clay/extension"
66
"github.com/spf13/cobra"
77
"net/url"
88
)
@@ -22,7 +22,7 @@ var clientDeleteCmd = &cobra.Command{
2222
},
2323
RunE: func(cmd *cobra.Command, args []string) error {
2424
urlArg := args[0]
25-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodDelete), urlArg, "", nil)
25+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodDelete), urlArg, "", nil)
2626
if err != nil {
2727
return err
2828
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
5-
"github.com/qb0C80aE/clay/extensions"
5+
"github.com/qb0C80aE/clay/extension"
66
"github.com/spf13/cobra"
77
"net/url"
88
)
@@ -22,7 +22,7 @@ var clientGetCmd = &cobra.Command{
2222
},
2323
RunE: func(cmd *cobra.Command, args []string) error {
2424
urlArg := args[0]
25-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodGet), urlArg, "", nil)
25+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodGet), urlArg, "", nil)
2626
if err != nil {
2727
return err
2828
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
55

6-
"github.com/qb0C80aE/clay/extensions"
6+
"github.com/qb0C80aE/clay/extension"
77
"github.com/spf13/cobra"
88
"net/url"
99
)
@@ -53,7 +53,7 @@ var clientPostCmd = &cobra.Command{
5353
return err
5454
}
5555

56-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodPost),
56+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodPost),
5757
urlArg,
5858
"application/json",
5959
content)
@@ -71,7 +71,7 @@ var clientPostCmd = &cobra.Command{
7171
return err
7272
}
7373

74-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodPost),
74+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodPost),
7575
urlArg,
7676
contentType,
7777
content)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
55

6-
"github.com/qb0C80aE/clay/extensions"
6+
"github.com/qb0C80aE/clay/extension"
77
"github.com/spf13/cobra"
88
"net/url"
99
)
@@ -53,7 +53,7 @@ var clientPutCmd = &cobra.Command{
5353
return err
5454
}
5555

56-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodPut),
56+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodPut),
5757
urlArg,
5858
"application/json",
5959
content)
@@ -71,7 +71,7 @@ var clientPutCmd = &cobra.Command{
7171
return err
7272
}
7373

74-
response, err := sendRequest(extensions.LookUpMethodName(extensions.MethodPut),
74+
response, err := sendRequest(extension.LookUpMethodName(extension.MethodPut),
7575
urlArg,
7676
contentType,
7777
content)

cmd/root.go renamed to client/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
55
"os"
66

77
_ "github.com/qb0C80aE/clay/runtime" // Import runtime package to register Clay runtime
88

9-
"github.com/qb0C80aE/clay/extensions"
9+
"github.com/qb0C80aE/clay/extension"
1010
"github.com/spf13/cobra"
1111
)
1212

@@ -18,7 +18,7 @@ var RootCmd = &cobra.Command{
1818
By default, clay boots the system model store server.
1919
If you want to know what API endpoints clay has, send a GET request to the path '/' of the clay server.`,
2020
Run: func(cmd *cobra.Command, args []string) {
21-
extensions.RegisteredRuntime().Run()
21+
extension.GetRegisteredRuntime().Run()
2222
},
2323
}
2424

cmd/version.go renamed to client/version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package cmd
1+
package client
22

33
import (
44
"fmt"
5-
"github.com/qb0C80aE/clay/extensions"
5+
"github.com/qb0C80aE/clay/extension"
66
"github.com/spf13/cobra"
77
)
88

@@ -11,7 +11,7 @@ var versionCmd = &cobra.Command{
1111
Short: "Shows version",
1212
Long: `Shows clay and all submodule versions.`,
1313
Run: func(cmd *cobra.Command, args []string) {
14-
programInformation := extensions.RegisteredProgramInformation()
14+
programInformation := extension.GetRegisteredProgramInformation()
1515
fmt.Printf("Clay build-%s\n", programInformation.BuildTime())
1616
subModuleInformationList := programInformation.SubModuleInformationList()
1717
for _, subModuleInformation := range subModuleInformationList {

0 commit comments

Comments
 (0)