Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .bingo/go-xgettext.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.23.4

require github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a // go-xgettext

require github.com/jessevdk/go-flags v1.6.1 // indirect
3 changes: 2 additions & 1 deletion opencloud/pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ func New(cfg *config.Config) Runtime {

// Start rpc runtime
func (r *Runtime) Start(ctx context.Context) error {
return service.Start(ctx, service.WithConfig(r.c))
return service.StartV2(ctx, service.WithConfig(r.c))
//return service.Start(ctx, service.WithConfig(r.c))
}
34 changes: 34 additions & 0 deletions opencloud/pkg/runtime/service/ocservice/ocservice.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package ocservice

import (
"context"

occfg "github.com/opencloud-eu/opencloud/pkg/config"
)

type OCService struct {
exec func(ctx context.Context) error
name string
}

// NewSutureServiceBuilder creates a new suture service
func NewOCServiceBuilder(name string, f func(context.Context, *occfg.Config) error) func(*occfg.Config) OCService {
return func(cfg *occfg.Config) OCService {
return OCService{
exec: func(ctx context.Context) error {
return f(ctx, cfg)
},
name: name,
}
}
}

// Serve to fullfil Server interface
func (s OCService) Serve(ctx context.Context) error {
return s.exec(ctx)
}

// String to fullfil fmt.Stringer interface, used to log the service name
func (s OCService) String() string {
return s.name
}
Loading