octopush/internal/cli/cli.go
kjuulh 46cc160764
Examples, rename and fixes
updated roadmap

updated roadmap

Add a basic readme (#15)

Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: kjuulh/kraken#15

fix readme

Add readme

with stuff

more roadmap items

update formatting

formatting 2

more setup

with semantic

with semantic 2

revert

add releaserc

with releaser

with kraken

Update roadmap

rename

rename

feature/move-command (#18)

Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #18

fix/require-two-pushes (#20)

Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #20
2022-09-21 22:52:24 +02:00

31 lines
745 B
Go

package cli
import (
"context"
"git.front.kjuulh.io/kjuulh/curre"
"git.front.kjuulh.io/kjuulh/octopush/internal/server"
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/signer"
"go.uber.org/zap"
)
func Start(ctx context.Context, logger *zap.Logger) (*serverdeps.ServerDeps, curre.CleanupFunc, error) {
deps := serverdeps.NewServerDeps(logger)
readyChan := make(chan curre.ComponentsAreReady, 1)
cleanupFunc, err := curre.NewManager().
Register(
server.NewStorageServer(logger.With(zap.Namespace("storage")), deps),
).
Register(
signer.NewOpenPGPApp(deps.GetOpenPGP()),
).
RunNonBlocking(ctx, readyChan)
<-readyChan
return deps, cleanupFunc, err
}