chore: change code.alt-gnome to code.aides.space
This commit is contained in:
parent
121ff91e92
commit
e4f9743dea
26 changed files with 52 additions and 52 deletions
|
@ -10,7 +10,7 @@ linters-settings:
|
||||||
exclude-functions:
|
exclude-functions:
|
||||||
- github.com/go-chi/render.Render
|
- github.com/go-chi/render.Render
|
||||||
goimports:
|
goimports:
|
||||||
local-prefixes: "code.alt-gnome.ru/aides-infra/aides-repo-api"
|
local-prefixes: "code.aides.space/aides-infra/aides-repo-api"
|
||||||
gofmt:
|
gofmt:
|
||||||
simplify: true
|
simplify: true
|
||||||
gofumpt:
|
gofumpt:
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -22,13 +22,13 @@ swag:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build \
|
go build \
|
||||||
-ldflags="-X 'code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config.Version=$(APP_VERSION)'" \
|
-ldflags="-X 'code.aides.space/aides-infra/aides-repo-api/internal/config.Version=$(APP_VERSION)'" \
|
||||||
-o aides-repo-api \
|
-o aides-repo-api \
|
||||||
./cmd/aides-repo-api/main.go
|
./cmd/aides-repo-api/main.go
|
||||||
|
|
||||||
release:
|
release:
|
||||||
go build \
|
go build \
|
||||||
-ldflags="-s -w -X 'code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config.Version=$(APP_VERSION)'" \
|
-ldflags="-s -w -X 'code.aides.space/aides-infra/aides-repo-api/internal/config.Version=$(APP_VERSION)'" \
|
||||||
-o aides-repo-api \
|
-o aides-repo-api \
|
||||||
./cmd/aides-repo-api/main.go
|
./cmd/aides-repo-api/main.go
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Aides repo API
|
# Aides repo API
|
||||||
|
|
||||||
[![Go Report Card](https://goreportcard.com/badge/code.alt-gnome.ru/aides-infra/aides-repo-api)](https://goreportcard.com/report/code.alt-gnome.ru/aides-infra/aides-repo-api) ![Coverage](./coverage-badge.svg)
|
[![Go Report Card](https://goreportcard.com/badge/code.aides.space/aides-infra/aides-repo-api)](https://goreportcard.com/report/code.aides.space/aides-infra/aides-repo-api) ![Coverage](./coverage-badge.svg)
|
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/app"
|
"code.aides.space/aides-infra/aides-repo-api/internal/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
// _
|
// _
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module code.alt-gnome.ru/aides-infra/aides-repo-api
|
module code.aides.space/aides-infra/aides-repo-api
|
||||||
|
|
||||||
go 1.23.3
|
go 1.23.3
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,14 @@ import (
|
||||||
gormlogger "gorm.io/gorm/logger"
|
gormlogger "gorm.io/gorm/logger"
|
||||||
"moul.io/zapgorm2"
|
"moul.io/zapgorm2"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config"
|
"code.aides.space/aides-infra/aides-repo-api/internal/config"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
"code.aides.space/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/router"
|
"code.aides.space/aides-infra/aides-repo-api/internal/router"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/cronservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/cronservice"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/reposervice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/reposervice"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
type App struct {
|
type App struct {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package taskcontroller
|
package taskcontroller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskService interface {
|
type TaskService interface {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package taskcontroller_test
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskServiceMock struct {
|
type TaskServiceMock struct {
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/common/errors"
|
"code.aides.space/aides-infra/aides-repo-api/internal/common/errors"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateTaskDTO struct {
|
type CreateTaskDTO struct {
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
"code.aides.space/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
|
|
||||||
commonErrors "code.alt-gnome.ru/aides-infra/aides-repo-api/internal/common/errors"
|
commonErrors "code.aides.space/aides-infra/aides-repo-api/internal/common/errors"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskUploadResponse struct {
|
type TaskUploadResponse struct {
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
"code.aides.space/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUpload(t *testing.T) {
|
func TestUpload(t *testing.T) {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
|
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/common/errors"
|
"code.aides.space/aides-infra/aides-repo-api/internal/common/errors"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config"
|
"code.aides.space/aides-infra/aides-repo-api/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateAuthGuard(cfg *config.Config) func(next http.Handler) http.Handler {
|
func CreateAuthGuard(cfg *config.Config) func(next http.Handler) http.Handler {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package middlewares
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CustomResponseWriter wraps http.ResponseWriter to capture status code and response size
|
// CustomResponseWriter wraps http.ResponseWriter to capture status code and response size
|
||||||
|
|
|
@ -4,11 +4,11 @@ import (
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
httpSwagger "github.com/swaggo/http-swagger"
|
httpSwagger "github.com/swaggo/http-swagger"
|
||||||
|
|
||||||
docs "code.alt-gnome.ru/aides-infra/aides-repo-api/docs"
|
docs "code.aides.space/aides-infra/aides-repo-api/docs"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config"
|
"code.aides.space/aides-infra/aides-repo-api/internal/config"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
"code.aides.space/aides-infra/aides-repo-api/internal/controllers/taskcontroller"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/middlewares"
|
"code.aides.space/aides-infra/aides-repo-api/internal/middlewares"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Router struct {
|
type Router struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package cronservice
|
||||||
import (
|
import (
|
||||||
"github.com/go-co-op/gocron/v2"
|
"github.com/go-co-op/gocron/v2"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RepoService interface {
|
type RepoService interface {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config interface {
|
type Config interface {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createRepoDirs(repoDir, repoName, arch string) error {
|
func createRepoDirs(repoDir, repoName, arch string) error {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package taskservice
|
package taskservice
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Service) Create(repo string) (*models.Task, error) {
|
func (s *Service) Create(repo string) (*models.Task, error) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config interface {
|
type Config interface {
|
||||||
|
|
|
@ -13,8 +13,8 @@ import (
|
||||||
"github.com/cavaliergopher/rpm"
|
"github.com/cavaliergopher/rpm"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/logger"
|
"code.aides.space/aides-infra/aides-repo-api/internal/logger"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskUploadInput struct {
|
type TaskUploadInput struct {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package taskservice
|
package taskservice
|
||||||
|
|
||||||
import "code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
import "code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
|
|
||||||
type WrapperRpmVersion struct {
|
type WrapperRpmVersion struct {
|
||||||
file *models.RPMFile
|
file *models.RPMFile
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/reposervice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/reposervice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRepoService_ForceUpdate(t *testing.T) {
|
func TestRepoService_ForceUpdate(t *testing.T) {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTaskService_Create(t *testing.T) {
|
func TestTaskService_Create(t *testing.T) {
|
||||||
|
|
|
@ -13,8 +13,8 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/services/taskservice"
|
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func createMultipartFileHeader(filePath string) *multipart.FileHeader {
|
func createMultipartFileHeader(filePath string) *multipart.FileHeader {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"gorm.io/driver/sqlite"
|
"gorm.io/driver/sqlite"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config"
|
"code.aides.space/aides-infra/aides-repo-api/internal/config"
|
||||||
"code.alt-gnome.ru/aides-infra/aides-repo-api/internal/models"
|
"code.aides.space/aides-infra/aides-repo-api/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func prepareDb(t *testing.T) *gorm.DB {
|
func prepareDb(t *testing.T) *gorm.DB {
|
||||||
|
|
Loading…
Reference in a new issue