This commit is contained in:
Adam Majer 2024-07-16 22:05:44 +02:00
parent f260ee678e
commit eac00b184e
3 changed files with 21 additions and 5 deletions

View File

@ -26,6 +26,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect

View File

@ -48,6 +48,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

View File

@ -1,7 +1,10 @@
package main
import (
"time"
"src.opensuse.org/autogits/common"
"github.com/rabbitmq/amqp091-go"
)
const (
@ -10,19 +13,29 @@ const (
)
var GiteaToken string
var runId uint
func allocateRequestHandler() *common.RequestHandler {
runId++
return &common.RequestHandler {
Logger: &common.StdoutLogging{
Id: runId,
Date: time.Now(),
},
}
}
func main() {
var defs common.ListenDefinitions
defs.Url = ObsBuildBot
defs.GitAuthor = GitAuthor
defs.Handlers = make(map[string]common.RequestProcessor)
defs.Handlers[common.RequestType_PR] = processPullRequest
defs.Handlers[common.RequestType_PR_sync] = processPullRequest
common.RequireGiteaSecretToken()
common.RequireObsSecretToken()
common.StartServerWithAddress(defs, ListenAddr)
}