mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-22 21:49:07 -06:00
add remaining services
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
|
||||
"github.com/owncloud/ocis/accounts/pkg/flagset"
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/version"
|
||||
@@ -127,13 +129,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new accounts.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.Accounts.Context = sctx // propagate the context down to the go-micro services.
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Accounts,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ import (
|
||||
"github.com/owncloud/ocis/glauth/pkg/config"
|
||||
"github.com/owncloud/ocis/glauth/pkg/flagset"
|
||||
"github.com/owncloud/ocis/glauth/pkg/version"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-glauth command.
|
||||
@@ -115,13 +117,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new glauth.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.GLAuth.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.GLAuth,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ import (
|
||||
"github.com/owncloud/ocis/idp/pkg/config"
|
||||
"github.com/owncloud/ocis/idp/pkg/flagset"
|
||||
"github.com/owncloud/ocis/idp/pkg/version"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-idp command.
|
||||
@@ -116,13 +118,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new idp.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.IDP.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.IDP,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,18 @@ import (
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
accounts "github.com/owncloud/ocis/accounts/pkg/command"
|
||||
glauth "github.com/owncloud/ocis/glauth/pkg/command"
|
||||
idp "github.com/owncloud/ocis/idp/pkg/command"
|
||||
ocs "github.com/owncloud/ocis/ocs/pkg/command"
|
||||
onlyoffice "github.com/owncloud/ocis/onlyoffice/pkg/command"
|
||||
proxy "github.com/owncloud/ocis/proxy/pkg/command"
|
||||
settings "github.com/owncloud/ocis/settings/pkg/command"
|
||||
storage "github.com/owncloud/ocis/storage/pkg/command"
|
||||
store "github.com/owncloud/ocis/store/pkg/command"
|
||||
thumbnails "github.com/owncloud/ocis/thumbnails/pkg/command"
|
||||
web "github.com/owncloud/ocis/web/pkg/command"
|
||||
webdav "github.com/owncloud/ocis/webdav/pkg/command"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/runtime/config"
|
||||
@@ -92,8 +102,28 @@ func NewService(options ...Option) (*Service, error) {
|
||||
cfg: opts.Config,
|
||||
}
|
||||
|
||||
s.ServicesRegistry["onlyoffice"] = onlyoffice.NewSutureService
|
||||
s.ServicesRegistry["settings"] = settings.NewSutureService
|
||||
s.ServicesRegistry["storage-metadata"] = storage.NewStorageMetadata
|
||||
s.ServicesRegistry["accounts"] = accounts.NewSutureService
|
||||
s.ServicesRegistry["glauth"] = glauth.NewSutureService
|
||||
s.ServicesRegistry["idp"] = idp.NewSutureService
|
||||
s.ServicesRegistry["ocs"] = ocs.NewSutureService
|
||||
s.ServicesRegistry["onlyoffice"] = onlyoffice.NewSutureService
|
||||
s.ServicesRegistry["proxy"] = proxy.NewSutureService
|
||||
s.ServicesRegistry["store"] = store.NewSutureService
|
||||
s.ServicesRegistry["thumbnails"] = thumbnails.NewSutureService
|
||||
s.ServicesRegistry["web"] = web.NewSutureService
|
||||
s.ServicesRegistry["webdav"] = webdav.NewSutureService
|
||||
s.ServicesRegistry["storage-frontend"] = storage.NewFrontend
|
||||
s.ServicesRegistry["storage-gateway"] = storage.NewGateway
|
||||
s.ServicesRegistry["storage-users"] = storage.NewUsersProviderService
|
||||
s.ServicesRegistry["storage-groupsprovider"] = storage.NewGroupsProvider
|
||||
s.ServicesRegistry["storage-authbasic"] = storage.NewAuthBasic
|
||||
s.ServicesRegistry["storage-authbearer"] = storage.NewAuthBearer
|
||||
s.ServicesRegistry["storage-home"] = storage.NewStorageHome
|
||||
s.ServicesRegistry["storage-users"] = storage.NewStorageUsers
|
||||
s.ServicesRegistry["storage-public-link"] = storage.NewStoragePublicLink
|
||||
s.ServicesRegistry["storage-sharing"] = storage.NewSharing
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/ocs/pkg/config"
|
||||
"github.com/owncloud/ocis/ocs/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-ocs command.
|
||||
@@ -113,13 +115,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new ocs.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.OCS.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.OCS,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
@@ -14,6 +12,7 @@ import (
|
||||
"github.com/owncloud/ocis/onlyoffice/pkg/flagset"
|
||||
"github.com/owncloud/ocis/onlyoffice/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-onlyoffice command.
|
||||
|
||||
@@ -6,11 +6,13 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||
"github.com/owncloud/ocis/proxy/pkg/flagset"
|
||||
"github.com/owncloud/ocis/proxy/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-proxy command.
|
||||
@@ -117,13 +119,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new proxy.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.Proxy.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Proxy,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/thejerf/suture"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -208,24 +210,13 @@ type AuthBasicSutureService struct {
|
||||
}
|
||||
|
||||
// NewAuthBasicSutureService creates a new store.AuthBasicSutureService
|
||||
func NewAuthBasic(ctx context.Context, o ...Option) AuthBasicSutureService {
|
||||
func NewAuthBasic(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.AuthBasic.Context = sctx
|
||||
return AuthBasicSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"path"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -188,24 +190,13 @@ type AuthBearerSutureService struct {
|
||||
}
|
||||
|
||||
// NewAuthBearerSutureService creates a new gateway.AuthBearerSutureService
|
||||
func NewAuthBearer(ctx context.Context, o ...Option) AuthBearerSutureService {
|
||||
func NewAuthBearer(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.AuthBearer.Context = sctx
|
||||
return AuthBearerSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -336,24 +338,13 @@ type FrontendSutureService struct {
|
||||
}
|
||||
|
||||
// NewFrontendSutureService creates a new frontend.FrontendSutureService
|
||||
func NewFrontend(ctx context.Context, o ...Option) FrontendSutureService {
|
||||
func NewFrontend(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.Frontend.Context = sctx
|
||||
return FrontendSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -265,24 +267,13 @@ type GatewaySutureService struct {
|
||||
}
|
||||
|
||||
// NewGatewaySutureService creates a new gateway.GatewaySutureService
|
||||
func NewGateway(ctx context.Context, o ...Option) GatewaySutureService {
|
||||
func NewGateway(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.Gateway.Context = sctx
|
||||
return GatewaySutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -222,24 +224,13 @@ type GroupsProvider struct {
|
||||
}
|
||||
|
||||
// NewGroupsProvider creates a new storage.GroupsProvider
|
||||
func NewGroupsProvider(ctx context.Context, o ...Option) GroupsProvider {
|
||||
func NewGroupsProvider(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.Groups.Context = sctx
|
||||
return GroupsProvider{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -211,24 +213,13 @@ type SharingSutureService struct {
|
||||
}
|
||||
|
||||
// NewSharingSutureService creates a new store.SharingSutureService
|
||||
func NewSharing(ctx context.Context, o ...Option) SharingSutureService {
|
||||
func NewSharing(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.Sharing.Context = sctx
|
||||
return SharingSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"path"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -207,24 +209,13 @@ type StorageHomeSutureService struct {
|
||||
}
|
||||
|
||||
// NewStorageHomeSutureService creates a new storage.StorageHomeSutureService
|
||||
func NewStorageHome(ctx context.Context, o ...Option) StorageHomeSutureService {
|
||||
func NewStorageHome(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.StorageHome.Context = sctx
|
||||
return StorageHomeSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ import (
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/owncloud/ocis/storage/pkg/service/external"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/oklog/run"
|
||||
@@ -228,23 +229,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new storagemetadata.SutureService
|
||||
func NewStorageMetadata(ctx context.Context, o ...Option) SutureService {
|
||||
func NewStorageMetadata(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Storage.Reva.StorageMetadata.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"path"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -185,24 +187,13 @@ type StoragePublicLinkSutureService struct {
|
||||
}
|
||||
|
||||
// NewStoragePublicLinkSutureService creates a new storage.StoragePublicLinkSutureService
|
||||
func NewStoragePublicLink(ctx context.Context, o ...Option) StoragePublicLinkSutureService {
|
||||
func NewStoragePublicLink(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.StoragePublicLink.Context = sctx
|
||||
return StoragePublicLinkSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"path"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -207,24 +209,13 @@ type StorageUsersSutureService struct {
|
||||
}
|
||||
|
||||
// NewStorageUsersSutureService creates a new storage.StorageUsersSutureService
|
||||
func NewStorageUsers(ctx context.Context, o ...Option) StorageUsersSutureService {
|
||||
func NewStorageUsers(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.StorageUsers.Context = sctx
|
||||
return StorageUsersSutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture"
|
||||
"github.com/cs3org/reva/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/micro/cli/v2"
|
||||
@@ -223,24 +225,13 @@ type UsersProviderService struct {
|
||||
}
|
||||
|
||||
// NewUsersProviderService creates a new storage.UsersProviderService
|
||||
func NewUsersProviderService(ctx context.Context, o ...Option) UsersProviderService {
|
||||
func NewUsersProviderService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg := config.New()
|
||||
|
||||
opts := newOptions(o...)
|
||||
|
||||
// merge config and options
|
||||
cfg.Context = sctx
|
||||
|
||||
cfg.Log.Level = opts.LogLevel
|
||||
cfg.Log.Pretty = opts.LogPretty
|
||||
cfg.Log.Color = opts.LogColor
|
||||
|
||||
cfg.Context = sctx
|
||||
cfg.Storage.Reva.Users.Context = sctx
|
||||
return UsersProviderService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Storage,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,8 @@ type Port struct {
|
||||
// Config can be used to configure the reva instance.
|
||||
// Services and Protocol will be ignored if this is used
|
||||
Config map[string]interface{}
|
||||
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
// Users defines the available users configuration.
|
||||
@@ -378,8 +380,6 @@ type Config struct {
|
||||
Reva Reva
|
||||
Tracing Tracing
|
||||
Asset Asset
|
||||
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
// New initializes a new configuration with or without defaults.
|
||||
|
||||
@@ -6,11 +6,13 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/store/pkg/config"
|
||||
"github.com/owncloud/ocis/store/pkg/flagset"
|
||||
"github.com/owncloud/ocis/store/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-store command.
|
||||
@@ -116,13 +118,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new store.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.Store.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Store,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/config"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-thumbnails command.
|
||||
@@ -113,13 +115,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new thumbnails.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.Thumbnails.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Thumbnails,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/web/pkg/config"
|
||||
"github.com/owncloud/ocis/web/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the web command.
|
||||
@@ -109,13 +111,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new web.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.Web.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.Web,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/webdav/pkg/config"
|
||||
"github.com/owncloud/ocis/webdav/pkg/version"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// Execute is the entry point for the ocis-webdav command.
|
||||
@@ -111,13 +113,13 @@ type SutureService struct {
|
||||
}
|
||||
|
||||
// NewSutureService creates a new webdav.SutureService
|
||||
func NewSutureService(ctx context.Context, cfg *config.Config) SutureService {
|
||||
func NewSutureService(ctx context.Context, cfg *ociscfg.Config) suture.Service {
|
||||
sctx, cancel := context.WithCancel(ctx)
|
||||
cfg.Context = sctx // propagate the context down to the go-micro services.
|
||||
cfg.WebDAV.Context = sctx
|
||||
return SutureService{
|
||||
ctx: sctx,
|
||||
cancel: cancel,
|
||||
cfg: cfg,
|
||||
cfg: cfg.WebDAV,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user