Skip to content

Commit

Permalink
Merge pull request #30 from webability-go/late-night
Browse files Browse the repository at this point in the history
patch v2022.06.09
  • Loading branch information
metalwolf authored Jun 9, 2022
2 parents c68b43e + 5240989 commit 97a6b06
Show file tree
Hide file tree
Showing 18 changed files with 763 additions and 72 deletions.
9 changes: 5 additions & 4 deletions client/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package client
import (
"golang.org/x/text/language"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
"github.com/webability-go/xamboo/cms/context"

"github.com/webability-go/xmodules/base"
)
Expand All @@ -30,7 +31,7 @@ func init() {

// InitModule is called during the init phase to link the module with the system
// adds tables and caches to sitecontext::database
func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
func Setup(ds applications.Datasource, prefix string) ([]string, error) {

dts := ds.(*base.Datasource)
buildTables(dts)
Expand All @@ -42,7 +43,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
return []string{}, nil
}

func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
func Synchronize(ds applications.Datasource, prefix string) ([]string, error) {

messages := []string{}

Expand Down Expand Up @@ -71,6 +72,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
return messages, nil
}

func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error {
func StartContext(ds applications.Datasource, ctx *context.Context) error {
return nil
}
9 changes: 5 additions & 4 deletions clientlink/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package clientlink
import (
"golang.org/x/text/language"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
"github.com/webability-go/xamboo/cms/context"

"github.com/webability-go/xmodules/base"
)
Expand All @@ -30,7 +31,7 @@ func init() {

// InitModule is called during the init phase to link the module with the system
// adds tables and caches to sitecontext::database
func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
func Setup(ds applications.Datasource, prefix string) ([]string, error) {

ctx := ds.(*base.Datasource)
buildTables(ctx)
Expand All @@ -42,7 +43,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
return []string{}, nil
}

func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
func Synchronize(ds applications.Datasource, prefix string) ([]string, error) {

messages := []string{}

Expand Down Expand Up @@ -71,6 +72,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
return messages, nil
}

func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error {
func StartContext(ds applications.Datasource, ctx *context.Context) error {
return nil
}
9 changes: 5 additions & 4 deletions clientp18n/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package clientp18n
import (
"golang.org/x/text/language"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
"github.com/webability-go/xamboo/cms/context"

"github.com/webability-go/xmodules/base"
)
Expand All @@ -30,7 +31,7 @@ func init() {

// InitModule is called during the init phase to link the module with the system
// adds tables and caches to sitecontext::database
func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
func Setup(ds applications.Datasource, prefix string) ([]string, error) {

ctx := ds.(*base.Datasource)
buildTables(ctx)
Expand All @@ -42,7 +43,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
return []string{}, nil
}

func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
func Synchronize(ds applications.Datasource, prefix string) ([]string, error) {

messages := []string{}

Expand Down Expand Up @@ -71,6 +72,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
return messages, nil
}

func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error {
func StartContext(ds applications.Datasource, ctx *context.Context) error {
return nil
}
9 changes: 5 additions & 4 deletions clientsecurity/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package clientsecurity
import (
"golang.org/x/text/language"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
"github.com/webability-go/xamboo/cms/context"

"github.com/webability-go/xmodules/base"
)
Expand All @@ -30,7 +31,7 @@ func init() {

// InitModule is called during the init phase to link the module with the system
// adds tables and caches to sitecontext::database
func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
func Setup(ds applications.Datasource, prefix string) ([]string, error) {

ctx := ds.(*base.Datasource)
buildTables(ctx)
Expand All @@ -42,7 +43,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
return []string{}, nil
}

func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
func Synchronize(ds applications.Datasource, prefix string) ([]string, error) {

messages := []string{}

Expand Down Expand Up @@ -71,6 +72,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
return messages, nil
}

func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error {
func StartContext(ds applications.Datasource, ctx *context.Context) error {
return nil
}
9 changes: 5 additions & 4 deletions country/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package country
import (
"golang.org/x/text/language"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
"github.com/webability-go/xamboo/cms/context"

"github.com/webability-go/xmodules/base"
"github.com/webability-go/xmodules/country/assets"
Expand Down Expand Up @@ -35,7 +36,7 @@ func init() {

// InitModule is called during the init phase to link the module with the system
// adds tables and caches to ctx::database
func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
func Setup(ds applications.Datasource, prefix string) ([]string, error) {

ctx := ds.(*base.Datasource)
buildTables(ctx)
Expand All @@ -47,7 +48,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) {
return []string{}, nil
}

func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
func Synchronize(ds applications.Datasource, prefix string) ([]string, error) {

messages := []string{}

Expand Down Expand Up @@ -84,6 +85,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) {
return messages, nil
}

func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error {
func StartContext(ds applications.Datasource, ctx *context.Context) error {
return nil
}
10 changes: 5 additions & 5 deletions country/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/webability-go/xmodules/base"
"github.com/webability-go/xmodules/translation"

serverassets "github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/applications"
)

type StructureCountry struct {
Expand All @@ -17,15 +17,15 @@ type StructureCountry struct {
Data *xdominion.XRecord
}

func CreateStructureCountryByKey(sitecontext serverassets.Datasource, key string, lang language.Tag) base.Structure {
func CreateStructureCountryByKey(sitecontext applications.Datasource, key string, lang language.Tag) base.Structure {
data, _ := sitecontext.GetTable("country_country").SelectOne(key)
if data == nil {
return nil
}
return CreateStructureCountryByData(sitecontext, data, lang)
}

func CreateStructureCountryByData(sitecontext serverassets.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure {
func CreateStructureCountryByData(sitecontext applications.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure {

key, _ := data.GetString("key")

Expand All @@ -39,12 +39,12 @@ func CreateStructureCountryByData(sitecontext serverassets.Datasource, data xdom
}

// ComplementData adds all the needed data from other objects /duplicable in the thread since the object will be destroyed at the end
func (sc *StructureCountry) ComplementData(sitecontext serverassets.Datasource) {
func (sc *StructureCountry) ComplementData(sitecontext applications.Datasource) {

}

// IsAuthorized returns true if the structure can be used on this site/language/device
func (sc *StructureCountry) IsAuthorized(sitecontext serverassets.Datasource, site string, language string, device string) bool {
func (sc *StructureCountry) IsAuthorized(sitecontext applications.Datasource, site string, language string, device string) bool {
return true
}

Expand Down
30 changes: 30 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
module github.com/webability-go/xmodules

go 1.17

require (
cloud.google.com/go/translate v1.2.0
github.com/webability-go/xamboo v1.6.6
github.com/webability-go/xconfig v0.4.3
github.com/webability-go/xcore/v2 v2.1.2
github.com/webability-go/xdominion v0.4.0
github.com/webability-go/xdommask v0.0.7
golang.org/x/text v0.3.7
)

require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.3.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/lib/pq v1.10.3 // indirect
github.com/webability-go/wajaf v0.1.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
google.golang.org/api v0.70.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading

0 comments on commit 97a6b06

Please sign in to comment.