c572fcfe04
Rename the Go module path from code.gitea.io/gitea to git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire codebase. Scope: - go.mod module declaration - 2,235 Go source files (import paths) - Dockerfile WORKDIR and COPY paths - Swagger API templates - golangci.yml linter config External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea, gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are separate upstream modules. Closes #132 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
927 B
Go
37 lines
927 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package ping
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/log"
|
|
|
|
pingv1 "code.gitea.io/actions-proto-go/ping/v1"
|
|
"code.gitea.io/actions-proto-go/ping/v1/pingv1connect"
|
|
"connectrpc.com/connect"
|
|
)
|
|
|
|
func NewPingServiceHandler() (string, http.Handler) {
|
|
return pingv1connect.NewPingServiceHandler(&Service{})
|
|
}
|
|
|
|
var _ pingv1connect.PingServiceHandler = (*Service)(nil)
|
|
|
|
type Service struct{}
|
|
|
|
func (s *Service) Ping(
|
|
ctx context.Context,
|
|
req *connect.Request[pingv1.PingRequest],
|
|
) (*connect.Response[pingv1.PingResponse], error) {
|
|
log.Trace("Content-Type: %s", req.Header().Get("Content-Type"))
|
|
log.Trace("User-Agent: %s", req.Header().Get("User-Agent"))
|
|
res := connect.NewResponse(&pingv1.PingResponse{
|
|
Data: fmt.Sprintf("Hello, %s!", req.Msg.Data),
|
|
})
|
|
return res, nil
|
|
}
|