Skip to content

Commit

Permalink
chore: make format swagger golines (#242)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 authored Sep 3, 2024
1 parent 54aa456 commit 013556a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 14 deletions.
3 changes: 2 additions & 1 deletion internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func Start(cfg *config.Config) error {

// Start API listener
if cfg.Tls.CertFilePath != "" && cfg.Tls.KeyFilePath != "" {
err := router.RunTLS(fmt.Sprintf("%s:%d", cfg.Api.ListenAddress, cfg.Api.ListenPort),
err := router.RunTLS(
fmt.Sprintf("%s:%d", cfg.Api.ListenAddress, cfg.Api.ListenPort),
cfg.Tls.CertFilePath,
cfg.Tls.KeyFilePath,
)
Expand Down
91 changes: 78 additions & 13 deletions internal/utxorpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,85 @@ func Start(cfg *config.Config) error {
mux.Handle(submitPath, submitHandler)
mux.Handle(syncPath, syncHandler)
mux.Handle(watchPath, watchHandler)
mux.Handle(grpchealth.NewHandler(grpchealth.NewStaticChecker(queryconnect.QueryServiceName), compress1KB))
mux.Handle(grpchealth.NewHandler(grpchealth.NewStaticChecker(submitconnect.SubmitServiceName), compress1KB))
mux.Handle(grpchealth.NewHandler(grpchealth.NewStaticChecker(syncconnect.SyncServiceName), compress1KB))
mux.Handle(grpchealth.NewHandler(grpchealth.NewStaticChecker(watchconnect.WatchServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1(grpcreflect.NewStaticReflector(queryconnect.QueryServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1(grpcreflect.NewStaticReflector(submitconnect.SubmitServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1(grpcreflect.NewStaticReflector(syncconnect.SyncServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1(grpcreflect.NewStaticReflector(watchconnect.WatchServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1Alpha(grpcreflect.NewStaticReflector(queryconnect.QueryServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1Alpha(grpcreflect.NewStaticReflector(submitconnect.SubmitServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1Alpha(grpcreflect.NewStaticReflector(syncconnect.SyncServiceName), compress1KB))
mux.Handle(grpcreflect.NewHandlerV1Alpha(grpcreflect.NewStaticReflector(watchconnect.WatchServiceName), compress1KB))
mux.Handle(
grpchealth.NewHandler(
grpchealth.NewStaticChecker(queryconnect.QueryServiceName),
compress1KB,
),
)
mux.Handle(
grpchealth.NewHandler(
grpchealth.NewStaticChecker(submitconnect.SubmitServiceName),
compress1KB,
),
)
mux.Handle(
grpchealth.NewHandler(
grpchealth.NewStaticChecker(syncconnect.SyncServiceName),
compress1KB,
),
)
mux.Handle(
grpchealth.NewHandler(
grpchealth.NewStaticChecker(watchconnect.WatchServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1(
grpcreflect.NewStaticReflector(queryconnect.QueryServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1(
grpcreflect.NewStaticReflector(submitconnect.SubmitServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1(
grpcreflect.NewStaticReflector(syncconnect.SyncServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1(
grpcreflect.NewStaticReflector(watchconnect.WatchServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1Alpha(
grpcreflect.NewStaticReflector(queryconnect.QueryServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1Alpha(
grpcreflect.NewStaticReflector(submitconnect.SubmitServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1Alpha(
grpcreflect.NewStaticReflector(syncconnect.SyncServiceName),
compress1KB,
),
)
mux.Handle(
grpcreflect.NewHandlerV1Alpha(
grpcreflect.NewStaticReflector(watchconnect.WatchServiceName),
compress1KB,
),
)
if cfg.Tls.CertFilePath != "" && cfg.Tls.KeyFilePath != "" {
err := http.ListenAndServeTLS(fmt.Sprintf("%s:%d", cfg.Utxorpc.ListenAddress, cfg.Utxorpc.ListenPort),
err := http.ListenAndServeTLS(
fmt.Sprintf(
"%s:%d",
cfg.Utxorpc.ListenAddress,
cfg.Utxorpc.ListenPort,
),
cfg.Tls.CertFilePath,
cfg.Tls.KeyFilePath,
nil,
Expand Down

0 comments on commit 013556a

Please sign in to comment.