From 43e3a8a3970165e6669bdab3b08ba6b271beb66c Mon Sep 17 00:00:00 2001 From: Kirillkriv Date: Tue, 6 Oct 2026 13:40:54 +0300 Subject: [PATCH] chore: moved packages to v1 --- README.md | 14 +++++++++++++- gomax.go | 1 - {context => v1/context}/context.go | 2 +- {context => v1/context}/options.go | 0 {core => v1/core}/dispatcher.go | 6 +++--- {core => v1/core}/errors.go | 0 {core => v1/core}/handler.go | 2 +- {core => v1/core}/pollers.go | 0 {core => v1/core}/router.go | 2 +- {errors => v1/errors}/errors.go | 0 {filters => v1/filters}/filters.go | 4 ++-- v1/gomax.go | 1 + {middleware => v1/middleware}/middleware.go | 6 +++--- {state => v1/state}/memory/memory.go | 2 +- {state => v1/state}/state.go | 0 15 files changed, 26 insertions(+), 14 deletions(-) delete mode 100644 gomax.go rename {context => v1/context}/context.go (97%) rename {context => v1/context}/options.go (100%) rename {core => v1/core}/dispatcher.go (96%) rename {core => v1/core}/errors.go (100%) rename {core => v1/core}/handler.go (81%) rename {core => v1/core}/pollers.go (100%) rename {core => v1/core}/router.go (96%) rename {errors => v1/errors}/errors.go (100%) rename {filters => v1/filters}/filters.go (96%) create mode 100644 v1/gomax.go rename {middleware => v1/middleware}/middleware.go (90%) rename {state => v1/state}/memory/memory.go (98%) rename {state => v1/state}/state.go (100%) diff --git a/README.md b/README.md index 713f284..bbc2620 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -**gomax** is a framework for MAX BotAPI, originating from [github.com/abelith/etu-bot/pkg/maxlib](https://github.com/abelith/etu-bot/tree/main/pkg/maxlib) \ No newline at end of file +**gomax** is a framework for [MAX BotAPI](https://dev.max.ru/docs-api), originating from [github.com/abelith/etu-bot/pkg/maxlib](https://github.com/abelith/etu-bot/tree/main/pkg/maxlib) + +The project is inspired by [aiogram](https://aiogram.dev) + +The project is in active development, so things may change quickly + +# Table of Contents +- [General](#general) +- [Future plans](#future-plans) + +# General + +# Future plans \ No newline at end of file diff --git a/gomax.go b/gomax.go deleted file mode 100644 index 67fd8f7..0000000 --- a/gomax.go +++ /dev/null @@ -1 +0,0 @@ -package gomax diff --git a/context/context.go b/v1/context/context.go similarity index 97% rename from context/context.go rename to v1/context/context.go index fe99ac8..52a1595 100644 --- a/context/context.go +++ b/v1/context/context.go @@ -2,7 +2,7 @@ package context import ( "context" - "github.com/abelith/gomax/state" + "github.com/abelith/gomax/v1/state" maxbot "github.com/max-messenger/max-bot-api-client-go/v2" "github.com/max-messenger/max-bot-api-client-go/v2/model" "time" diff --git a/context/options.go b/v1/context/options.go similarity index 100% rename from context/options.go rename to v1/context/options.go diff --git a/core/dispatcher.go b/v1/core/dispatcher.go similarity index 96% rename from core/dispatcher.go rename to v1/core/dispatcher.go index 756a7cf..970a993 100644 --- a/core/dispatcher.go +++ b/v1/core/dispatcher.go @@ -3,9 +3,9 @@ package core import ( "context" "errors" - mcontext "github.com/abelith/gomax/context" - "github.com/abelith/gomax/state" - "github.com/abelith/gomax/state/memory" + mcontext "github.com/abelith/gomax/v1/context" + "github.com/abelith/gomax/v1/state" + "github.com/abelith/gomax/v1/state/memory" maxbot "github.com/max-messenger/max-bot-api-client-go/v2" "github.com/max-messenger/max-bot-api-client-go/v2/model" "github.com/rs/zerolog/log" diff --git a/core/errors.go b/v1/core/errors.go similarity index 100% rename from core/errors.go rename to v1/core/errors.go diff --git a/core/handler.go b/v1/core/handler.go similarity index 81% rename from core/handler.go rename to v1/core/handler.go index 5e7ce3a..5c82ff5 100644 --- a/core/handler.go +++ b/v1/core/handler.go @@ -1,6 +1,6 @@ package core -import mcontext "github.com/abelith/gomax/context" +import mcontext "github.com/abelith/gomax/v1/context" type HandlerFunc func(c *mcontext.Context) error diff --git a/core/pollers.go b/v1/core/pollers.go similarity index 100% rename from core/pollers.go rename to v1/core/pollers.go diff --git a/core/router.go b/v1/core/router.go similarity index 96% rename from core/router.go rename to v1/core/router.go index 4c3147a..e4571ad 100644 --- a/core/router.go +++ b/v1/core/router.go @@ -2,7 +2,7 @@ package core import ( "errors" - mcontext "github.com/abelith/gomax/context" + mcontext "github.com/abelith/gomax/v1/context" ) type Middleware func(next HandlerFunc) HandlerFunc diff --git a/errors/errors.go b/v1/errors/errors.go similarity index 100% rename from errors/errors.go rename to v1/errors/errors.go diff --git a/filters/filters.go b/v1/filters/filters.go similarity index 96% rename from filters/filters.go rename to v1/filters/filters.go index ee7af05..138b15c 100644 --- a/filters/filters.go +++ b/v1/filters/filters.go @@ -1,8 +1,8 @@ package filters import ( - mcontext "github.com/abelith/gomax/context" - "github.com/abelith/gomax/state" + mcontext "github.com/abelith/gomax/v1/context" + "github.com/abelith/gomax/v1/state" "github.com/max-messenger/max-bot-api-client-go/v2/model" "regexp" "strings" diff --git a/v1/gomax.go b/v1/gomax.go new file mode 100644 index 0000000..b7b1f99 --- /dev/null +++ b/v1/gomax.go @@ -0,0 +1 @@ +package v1 diff --git a/middleware/middleware.go b/v1/middleware/middleware.go similarity index 90% rename from middleware/middleware.go rename to v1/middleware/middleware.go index 27eff3e..213d15c 100644 --- a/middleware/middleware.go +++ b/v1/middleware/middleware.go @@ -2,9 +2,9 @@ package middleware import ( "errors" - mcontext "github.com/abelith/gomax/context" - "github.com/abelith/gomax/core" - merrors "github.com/abelith/gomax/errors" + mcontext "github.com/abelith/gomax/v1/context" + "github.com/abelith/gomax/v1/core" + merrors "github.com/abelith/gomax/v1/errors" "github.com/rs/zerolog/log" ) diff --git a/state/memory/memory.go b/v1/state/memory/memory.go similarity index 98% rename from state/memory/memory.go rename to v1/state/memory/memory.go index caeccf6..c891c00 100644 --- a/state/memory/memory.go +++ b/v1/state/memory/memory.go @@ -2,7 +2,7 @@ package memory import ( "context" - "github.com/abelith/gomax/state" + "github.com/abelith/gomax/v1/state" "sync" "time" ) diff --git a/state/state.go b/v1/state/state.go similarity index 100% rename from state/state.go rename to v1/state/state.go