mirror of
https://github.com/harness/drone.git
synced 2025-05-09 15:50:29 +08:00

This Commit adds: - stream package (provides different implementation of stream producers and consumers) + Redis -> will be used for any non-local deployments + InMemory -> a VERY BASIC implementation that is used for local execution - events package + GenericReporter -> responsible for reporting events, can be used to send any type of event and payload + GenericReader -> responsible for reading events from a stream, can be used to register handlers for any type of event and payload + ReaderFactory -> responsible for launching readers for any type of consumer group&name. - webhook package + The wire frame of the webhook package. - gitrpc/events package + defines event Reader/Reporter for events of category git
64 lines
1.8 KiB
Go
64 lines
1.8 KiB
Go
// Copyright 2021 Harness Inc. All rights reserved.
|
|
// Use of this source code is governed by the Polyform Free Trial License
|
|
// that can be found in the LICENSE.md file for this repository.
|
|
|
|
//go:build wireinject && !harness
|
|
// +build wireinject,!harness
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/harness/gitness/events"
|
|
"github.com/harness/gitness/gitrpc"
|
|
gitrpcevents "github.com/harness/gitness/gitrpc/events"
|
|
gitrpcserver "github.com/harness/gitness/gitrpc/server"
|
|
"github.com/harness/gitness/internal/api/controller/pullreq"
|
|
"github.com/harness/gitness/internal/api/controller/repo"
|
|
"github.com/harness/gitness/internal/api/controller/serviceaccount"
|
|
"github.com/harness/gitness/internal/api/controller/space"
|
|
"github.com/harness/gitness/internal/api/controller/user"
|
|
"github.com/harness/gitness/internal/auth/authn"
|
|
"github.com/harness/gitness/internal/auth/authz"
|
|
"github.com/harness/gitness/internal/bootstrap"
|
|
"github.com/harness/gitness/internal/cron"
|
|
"github.com/harness/gitness/internal/router"
|
|
"github.com/harness/gitness/internal/server"
|
|
"github.com/harness/gitness/internal/store"
|
|
"github.com/harness/gitness/internal/store/database"
|
|
"github.com/harness/gitness/internal/webhook"
|
|
"github.com/harness/gitness/types"
|
|
"github.com/harness/gitness/types/check"
|
|
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
func initSystem(ctx context.Context, config *types.Config) (*system, error) {
|
|
wire.Build(
|
|
newSystem,
|
|
PackageConfigsWireSet,
|
|
ProvideRedis,
|
|
bootstrap.WireSet,
|
|
database.WireSet,
|
|
router.WireSet,
|
|
server.WireSet,
|
|
cron.WireSet,
|
|
space.WireSet,
|
|
repo.WireSet,
|
|
pullreq.WireSet,
|
|
serviceaccount.WireSet,
|
|
user.WireSet,
|
|
authn.WireSet,
|
|
authz.WireSet,
|
|
gitrpcevents.WireSet,
|
|
gitrpcserver.WireSet,
|
|
gitrpc.WireSet,
|
|
store.WireSet,
|
|
check.WireSet,
|
|
events.WireSet,
|
|
webhook.WireSet,
|
|
)
|
|
return &system{}, nil
|
|
}
|