From fbdeca454e1bc33e65bf9c613f9d4d29edd0df2e Mon Sep 17 00:00:00 2001 From: d34dscene Date: Wed, 18 Jun 2025 01:18:59 +0200 Subject: [PATCH] almost --- go.mod | 2 + go.sum | 4 + internal/api/handler/profiles.go | 143 -- internal/api/handler/traefik.go | 146 +- internal/api/middlewares/auth.go | 128 +- internal/api/middlewares/cors.go | 27 + internal/api/server/routes.go | 135 -- internal/api/server/server.go | 131 +- internal/api/service/agent.go | 138 +- internal/api/service/agentManagement.go | 214 +++ internal/api/service/backup.go | 161 ++ internal/api/service/entrypoint.go | 2 +- internal/api/service/middleware.go | 311 ++++ internal/api/service/profile.go | 2 +- internal/api/service/router.go | 27 +- internal/api/service/service.go | 357 +++++ internal/api/service/setting.go | 2 +- internal/api/service/user.go | 13 +- internal/app/config.go | 66 - internal/backup/backup.go | 13 +- internal/config/setup.go | 184 +-- internal/config/tasks.go | 14 +- internal/dns/client.go | 4 +- internal/settings/settings.go | 7 +- internal/settings/validate.go | 2 +- internal/storage/local.go | 4 +- internal/store/00000_base.sql | 32 +- internal/store/connection.go | 4 +- internal/store/db/agents.sql.go | 98 +- internal/store/db/db.go | 162 +- internal/store/db/dns_providers.sql.go | 2 +- internal/store/db/entry_points.sql.go | 2 +- internal/store/db/errors.sql.go | 2 +- internal/store/db/http_middlewares.sql.go | 75 +- .../store/db/http_router_dns_provider.sql.go | 2 +- internal/store/db/http_routers.sql.go | 81 +- internal/store/db/http_services.sql.go | 79 +- internal/store/db/models.go | 24 +- internal/store/db/profiles.sql.go | 9 +- internal/store/db/querier.go | 25 +- internal/store/db/settings.sql.go | 2 +- internal/store/db/tcp_middlewares.sql.go | 75 +- .../store/db/tcp_router_dns_provider.sql.go | 2 +- internal/store/db/tcp_routers.sql.go | 81 +- internal/store/db/tcp_services.sql.go | 79 +- internal/store/db/traefik_instances.sql.go | 74 +- .../store/db/udp_router_dns_provider.sql.go | 2 +- internal/store/db/udp_routers.sql.go | 81 +- internal/store/db/udp_services.sql.go | 79 +- internal/store/db/users.sql.go | 62 +- internal/store/queries/agents.sql | 26 +- internal/store/queries/http_middlewares.sql | 5 +- internal/store/queries/http_routers.sql | 5 +- internal/store/queries/http_services.sql | 5 +- internal/store/queries/profiles.sql | 4 +- internal/store/queries/tcp_middlewares.sql | 5 +- internal/store/queries/tcp_routers.sql | 5 +- internal/store/queries/tcp_services.sql | 5 +- internal/store/queries/traefik_instances.sql | 12 +- internal/store/queries/udp_routers.sql | 5 +- internal/store/queries/udp_services.sql | 5 +- internal/store/queries/users.sql | 18 +- internal/store/schema/traefik.go | 55 +- internal/traefik/agent.go | 104 -- internal/traefik/client.go | 130 +- internal/traefik/convert.go | 195 --- internal/util/tools.go | 22 +- proto/gen/mantrae/v1/agent.pb.go | 115 +- proto/gen/mantrae/v1/agent_management.pb.go | 898 +++++++++++ proto/gen/mantrae/v1/backup.pb.go | 726 +++++++++ proto/gen/mantrae/v1/entry_point.pb.go | 174 ++- .../agent_management.connect.go | 259 ++++ .../v1/mantraev1connect/backup.connect.go | 256 ++++ .../v1/mantraev1connect/middleware.connect.go | 41 +- proto/gen/mantrae/v1/middleware.pb.go | 732 ++++++--- proto/gen/mantrae/v1/profile.pb.go | 157 +- proto/gen/mantrae/v1/router.pb.go | 253 ++-- proto/gen/mantrae/v1/service.pb.go | 246 +-- proto/gen/mantrae/v1/setting.pb.go | 97 +- proto/gen/mantrae/v1/user.pb.go | 265 ++-- proto/gen/openapi/openapi.yaml | 1340 +++++++++++++++-- proto/mantrae/v1/agent_management.proto | 76 + proto/mantrae/v1/backup.proto | 52 + proto/mantrae/v1/middleware.proto | 45 +- proto/mantrae/v1/router.proto | 17 +- proto/mantrae/v1/service.proto | 15 +- sqlc.yml | 2 +- .../lib/gen/mantrae/v1/agent_management_pb.ts | 355 +++++ web/src/lib/gen/mantrae/v1/agent_pb.ts | 6 +- web/src/lib/gen/mantrae/v1/backup_pb.ts | 278 ++++ web/src/lib/gen/mantrae/v1/entry_point_pb.ts | 6 +- web/src/lib/gen/mantrae/v1/middleware_pb.ts | 205 ++- web/src/lib/gen/mantrae/v1/profile_pb.ts | 6 +- web/src/lib/gen/mantrae/v1/router_pb.ts | 45 +- web/src/lib/gen/mantrae/v1/service_pb.ts | 43 +- web/src/lib/gen/mantrae/v1/setting_pb.ts | 6 +- web/src/lib/gen/mantrae/v1/user_pb.ts | 6 +- 97 files changed, 8131 insertions(+), 2568 deletions(-) delete mode 100644 internal/api/handler/profiles.go delete mode 100644 internal/api/server/routes.go create mode 100644 internal/api/service/agentManagement.go create mode 100644 internal/api/service/backup.go create mode 100644 internal/api/service/middleware.go create mode 100644 internal/api/service/service.go delete mode 100644 internal/app/config.go delete mode 100644 internal/traefik/agent.go delete mode 100644 internal/traefik/convert.go create mode 100644 proto/gen/mantrae/v1/agent_management.pb.go create mode 100644 proto/gen/mantrae/v1/backup.pb.go create mode 100644 proto/gen/mantrae/v1/mantraev1connect/agent_management.connect.go create mode 100644 proto/gen/mantrae/v1/mantraev1connect/backup.connect.go create mode 100644 proto/mantrae/v1/agent_management.proto create mode 100644 proto/mantrae/v1/backup.proto create mode 100644 web/src/lib/gen/mantrae/v1/agent_management_pb.ts create mode 100644 web/src/lib/gen/mantrae/v1/backup_pb.ts diff --git a/go.mod b/go.mod index c90001f..40f89eb 100644 --- a/go.mod +++ b/go.mod @@ -31,6 +31,7 @@ require ( ) require ( + connectrpc.com/cors v0.1.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.31 // indirect @@ -79,6 +80,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rs/cors v1.11.1 // indirect github.com/rs/zerolog v1.34.0 // indirect github.com/sethvargo/go-retry v0.3.0 // indirect github.com/unrolled/render v1.7.0 // indirect diff --git a/go.sum b/go.sum index 38708db..d92ef13 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ connectrpc.com/connect v1.18.1 h1:PAg7CjSAGvscaf6YZKUefjoih5Z/qYkyaTrBW8xvYPw= connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8= +connectrpc.com/cors v0.1.0 h1:f3gTXJyDZPrDIZCQ567jxfD9PAIpopHiRDnJRt3QuOQ= +connectrpc.com/cors v0.1.0/go.mod h1:v8SJZCPfHtGH1zsm+Ttajpozd4cYIUryl4dFB6QEpfg= connectrpc.com/grpchealth v1.4.0 h1:MJC96JLelARPgZTiRF9KRfY/2N9OcoQvF2EWX07v2IE= connectrpc.com/grpchealth v1.4.0/go.mod h1:WhW6m1EzTmq3Ky1FE8EfkIpSDc6TfUx2M2KqZO3ts/Q= connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc= @@ -172,6 +174,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= diff --git a/internal/api/handler/profiles.go b/internal/api/handler/profiles.go deleted file mode 100644 index 7975128..0000000 --- a/internal/api/handler/profiles.go +++ /dev/null @@ -1,143 +0,0 @@ -package handler - -import ( - "encoding/json" - "log/slog" - "net/http" - "strconv" - - "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" - "github.com/mizuchilabs/mantrae/internal/source" - "github.com/mizuchilabs/mantrae/internal/traefik" - "github.com/mizuchilabs/mantrae/internal/util" -) - -func ListProfiles(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - profiles, err := q.ListProfiles(r.Context()) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - if err := json.NewEncoder(w).Encode(profiles); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - } -} - -func GetProfile(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - profile_id, err := strconv.ParseInt(r.PathValue("id"), 10, 64) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - profile, err := q.GetProfile(r.Context(), profile_id) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - if err := json.NewEncoder(w).Encode(profile); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - } -} - -func CreateProfile(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - var params db.CreateProfileParams - if err := json.NewDecoder(r.Body).Decode(¶ms); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - profileID, err := q.CreateProfile(r.Context(), params) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Create default local config - if err = q.UpsertTraefikConfig(r.Context(), db.UpsertTraefikConfigParams{ - ProfileID: profileID, - Source: source.Local, - }); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - profile, err := q.GetProfile(r.Context(), profileID) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - go func() { - if err := traefik.UpdateTraefikAPI(a.Conn.Get(), profile); err != nil { - slog.Error("Failed to update api data", "error", err) - } - }() - util.Broadcast <- util.EventMessage{ - Type: util.EventTypeCreate, - Category: util.EventCategoryProfile, - } - w.WriteHeader(http.StatusNoContent) - } -} - -func UpdateProfile(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - var params db.UpdateProfileParams - if err := json.NewDecoder(r.Body).Decode(¶ms); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if err := q.UpdateProfile(r.Context(), params); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - profile, err := q.GetProfile(r.Context(), params.ID) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - go func() { - if err := traefik.UpdateTraefikAPI(a.Conn.Get(), profile); err != nil { - slog.Error("Failed to update api data", "error", err) - } - }() - util.Broadcast <- util.EventMessage{ - Type: util.EventTypeUpdate, - Category: util.EventCategoryProfile, - } - w.WriteHeader(http.StatusNoContent) - } -} - -func DeleteProfile(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - profile_id, err := strconv.ParseInt(r.PathValue("id"), 10, 64) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if err := q.DeleteProfile(r.Context(), profile_id); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - util.Broadcast <- util.EventMessage{ - Type: util.EventTypeDelete, - Category: util.EventCategoryProfile, - } - w.WriteHeader(http.StatusNoContent) - } -} diff --git a/internal/api/handler/traefik.go b/internal/api/handler/traefik.go index 9cc47d1..d7eb155 100644 --- a/internal/api/handler/traefik.go +++ b/internal/api/handler/traefik.go @@ -3,44 +3,11 @@ package handler import ( "encoding/json" "net/http" - "strconv" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" - "github.com/mizuchilabs/mantrae/internal/source" - "github.com/mizuchilabs/mantrae/internal/traefik" - "github.com/traefik/traefik/v3/pkg/config/runtime" + "github.com/traefik/traefik/v3/pkg/config/dynamic" ) -func GetTraefikConfig(a *config.App) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - q := a.Conn.GetQuery() - profile_id, err := strconv.ParseInt(r.PathValue("id"), 10, 64) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - src := source.Source(r.PathValue("source")) - if !src.Valid() { - http.Error(w, "invalid source", http.StatusBadRequest) - return - } - config, err := q.GetTraefikConfigBySource(r.Context(), db.GetTraefikConfigBySourceParams{ - ProfileID: profile_id, - Source: src, - }) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - if err := json.NewEncoder(w).Encode(config); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - } -} - func PublishTraefikConfig(a *config.App) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { q := a.Conn.GetQuery() @@ -49,47 +16,112 @@ func PublishTraefikConfig(a *config.App) http.HandlerFunc { http.Error(w, err.Error(), http.StatusInternalServerError) return } - // Initialize merged config - merged := &db.TraefikConfiguration{ - Routers: make(map[string]*runtime.RouterInfo), - Middlewares: make(map[string]*runtime.MiddlewareInfo), - Services: make(map[string]*db.ServiceInfo), - TCPRouters: make(map[string]*runtime.TCPRouterInfo), - TCPMiddlewares: make(map[string]*runtime.TCPMiddlewareInfo), - TCPServices: make(map[string]*runtime.TCPServiceInfo), - UDPRouters: make(map[string]*runtime.UDPRouterInfo), - UDPServices: make(map[string]*runtime.UDPServiceInfo), + + cfg := &dynamic.Configuration{ + HTTP: &dynamic.HTTPConfiguration{ + Routers: make(map[string]*dynamic.Router), + Middlewares: make(map[string]*dynamic.Middleware), + Services: make(map[string]*dynamic.Service), + }, + TCP: &dynamic.TCPConfiguration{ + Routers: make(map[string]*dynamic.TCPRouter), + Middlewares: make(map[string]*dynamic.TCPMiddleware), + Services: make(map[string]*dynamic.TCPService), + }, + UDP: &dynamic.UDPConfiguration{ + Routers: make(map[string]*dynamic.UDPRouter), + Services: make(map[string]*dynamic.UDPService), + }, } - // Get local config - local, err := q.GetLocalTraefikConfig(r.Context(), profile.ID) + // Routers + httpRouters, err := q.GetHttpRoutersByProfile(r.Context(), profile.ID) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } - agents, err := q.GetAgentTraefikConfigs(r.Context(), profile.ID) + tcpRouters, err := q.GetTcpRoutersByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + udpRouters, err := q.GetUdpRoutersByProfile(r.Context(), profile.ID) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } - // Merge agent configurations (agent config) - for _, agent := range agents { - merged = traefik.MergeConfigs(merged, agent.Config) + // Services + httpServices, err := q.GetHttpServicesByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return } - if local.Config == nil && merged == nil { - w.WriteHeader(http.StatusOK) + tcpServices, err := q.GetTcpServicesByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + udpServices, err := q.GetUdpServicesByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) return } - // Merge with local config - merged = traefik.MergeConfigs(merged, local.Config) + // Middlewares + httpMiddlewares, err := q.GetHttpMiddlewaresByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + tcpMiddlewares, err := q.GetTcpMiddlewaresByProfile(r.Context(), profile.ID) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } - // Convert to dynamic - dynamic := traefik.ConvertToDynamicConfig(merged) + for _, r := range httpRouters { + cfg.HTTP.Routers[r.Name] = r.Config + } + for _, r := range tcpRouters { + cfg.TCP.Routers[r.Name] = r.Config + } + for _, r := range udpRouters { + cfg.UDP.Routers[r.Name] = r.Config + } + + for _, s := range httpServices { + cfg.HTTP.Services[s.Name] = s.Config + } + for _, s := range tcpServices { + cfg.TCP.Services[s.Name] = s.Config + } + for _, s := range udpServices { + cfg.UDP.Services[s.Name] = s.Config + } + + for _, m := range httpMiddlewares { + cfg.HTTP.Middlewares[m.Name] = m.Config + } + for _, m := range tcpMiddlewares { + cfg.TCP.Middlewares[m.Name] = m.Config + } + + // Cleanup empty sections (to avoid Traefik {} block warnings) + if len(cfg.HTTP.Routers) == 0 && len(cfg.HTTP.Middlewares) == 0 && + len(cfg.HTTP.Services) == 0 { + cfg.HTTP = nil + } + if len(cfg.TCP.Routers) == 0 && len(cfg.TCP.Middlewares) == 0 && + len(cfg.TCP.Services) == 0 { + cfg.TCP = nil + } + if len(cfg.UDP.Routers) == 0 && len(cfg.UDP.Services) == 0 { + cfg.UDP = nil + } w.Header().Set("Content-Type", "application/json") - if err := json.NewEncoder(w).Encode(dynamic); err != nil { + if err := json.NewEncoder(w).Encode(cfg); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } diff --git a/internal/api/middlewares/auth.go b/internal/api/middlewares/auth.go index f9fb7fe..5685189 100644 --- a/internal/api/middlewares/auth.go +++ b/internal/api/middlewares/auth.go @@ -9,7 +9,6 @@ import ( "connectrpc.com/connect" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" "github.com/mizuchilabs/mantrae/internal/util" "github.com/mizuchilabs/mantrae/pkg/meta" "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1/mantraev1connect" @@ -19,9 +18,8 @@ import ( type ctxKey string const ( - AuthUserIDKey ctxKey = "user_id" - AuthUserKey ctxKey = "user" - AuthAgentKey ctxKey = "agent" + AuthUserIDKey ctxKey = "user_id" + AuthAgentIDKey ctxKey = "agent_id" ) // BasicAuth middleware for simple authentication @@ -48,47 +46,7 @@ func (h *MiddlewareHandler) BasicAuth(next http.Handler) http.Handler { return } - ctx := context.WithValue(r.Context(), AuthUserKey, user) - next.ServeHTTP(w, r.WithContext(ctx)) - }) -} - -// JWT authentication middleware -func (h *MiddlewareHandler) JWT(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - cookie, err := r.Cookie(util.CookieName) - if err != nil { - http.Error(w, "Unauthorized", http.StatusUnauthorized) - return - } - - token := cookie.Value - if token == "" { - http.Error(w, "Unauthorized", http.StatusUnauthorized) - return - } - - claims, err := util.DecodeUserJWT(token, h.app.Config.Secret) - if err != nil { - http.Error(w, "Invalid token", http.StatusUnauthorized) - return - } - - if claims.Username == "" { - http.Error(w, "Unauthorized", http.StatusUnauthorized) - return - } - - // Verify user exists in database - q := h.app.Conn.GetQuery() - user, err := q.GetUserByUsername(r.Context(), claims.Username) - if err != nil { - http.Error(w, "User not found", http.StatusUnauthorized) - return - } - - // Add user to context - ctx := context.WithValue(r.Context(), AuthUserKey, user) + ctx := context.WithValue(r.Context(), AuthUserIDKey, user.ID) next.ServeHTTP(w, r.WithContext(ctx)) }) } @@ -133,12 +91,12 @@ func Authentication(app *config.App) connect.UnaryInterceptorFunc { errors.New("token mismatch"), ) } - ctx = context.WithValue(ctx, AuthAgentKey, &agent) + ctx = context.WithValue(ctx, AuthAgentIDKey, agent.ID) return next(ctx, req) } // Parse and validate the token - claims, err := util.DecodeUserJWT(tokenString, app.Config.Secret) + claims, err := util.DecodeUserJWT(tokenString, app.Secret) if err != nil { return nil, connect.NewError( connect.CodeUnauthenticated, @@ -154,73 +112,6 @@ func Authentication(app *config.App) connect.UnaryInterceptorFunc { }) } -func (h *MiddlewareHandler) AdminOnly(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Get the username from the request context - user, ok := r.Context().Value(AuthUserKey).(db.GetUserByUsernameRow) - if !ok { - http.Error(w, "Unauthorized", http.StatusUnauthorized) - return - } - - if !user.IsAdmin { - http.Error(w, "Admin privileges required", http.StatusForbidden) - return - } - - next.ServeHTTP(w, r) - }) -} - -func GetAgentContext(ctx context.Context) *db.Agent { - agent, ok := ctx.Value(AuthAgentKey).(*db.Agent) - if !ok { - return nil - } - return agent -} - -func AgentAuth(app *config.App) connect.UnaryInterceptorFunc { - return func(next connect.UnaryFunc) connect.UnaryFunc { - return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { - auth := req.Header().Get("Authorization") - if auth == "" || !strings.HasPrefix(auth, "Bearer ") { - return nil, connect.NewError( - connect.CodeUnauthenticated, - errors.New("invalid or missing authorization header"), - ) - } - - agentID := req.Header().Get(meta.HeaderAgentID) - if agentID == "" { - return nil, connect.NewError( - connect.CodeUnauthenticated, - errors.New("missing mantrae-agent-id header"), - ) - } - - q := app.Conn.GetQuery() - dbAgent, err := q.GetAgent(ctx, agentID) - if err != nil { - return nil, connect.NewError(connect.CodeNotFound, errors.New("agent not found")) - } - - token := strings.TrimPrefix(auth, "Bearer ") - if dbAgent.Token != token { - return nil, connect.NewError( - connect.CodeUnauthenticated, - errors.New("token mismatch"), - ) - } - - // Store agent in context - ctx = context.WithValue(ctx, AuthAgentKey, &dbAgent) - - return next(ctx, req) - } - } -} - func isPublicEndpoint(procedure string) bool { publicEndpoints := map[string]bool{ mantraev1connect.UserServiceLoginUserProcedure: true, @@ -231,7 +122,12 @@ func isPublicEndpoint(procedure string) bool { } // Helper functions to get auth info from context -func GetUserIDFromContext(ctx context.Context) (int64, bool) { - id, ok := ctx.Value(AuthUserIDKey).(int64) +func GetUserIDFromContext(ctx context.Context) (string, bool) { + id, ok := ctx.Value(AuthUserIDKey).(string) return id, ok } + +func GetAgentIDFromContext(ctx context.Context) (string, bool) { + agent, ok := ctx.Value(AuthAgentIDKey).(string) + return agent, ok +} diff --git a/internal/api/middlewares/cors.go b/internal/api/middlewares/cors.go index 81f850a..a9600bc 100644 --- a/internal/api/middlewares/cors.go +++ b/internal/api/middlewares/cors.go @@ -1,8 +1,15 @@ package middlewares import ( + "context" + "log/slog" "net/http" "strings" + + connectcors "connectrpc.com/cors" + "github.com/mizuchilabs/mantrae/internal/config" + "github.com/mizuchilabs/mantrae/internal/settings" + "github.com/rs/cors" ) const ( @@ -45,3 +52,23 @@ func CORS(allowedOrigins ...string) func(http.Handler) http.Handler { }) } } + +// WithCORS adds CORS support to a Connect HTTP handler. +func WithCORS(h http.Handler, app *config.App) http.Handler { + serverURL, err := app.Conn.GetQuery().GetSetting(context.Background(), settings.KeyServerURL) + if err != nil { + slog.Error("Failed to get server URL", "error", err) + return h + } + if serverURL.Value == "" { + slog.Error("Server URL not set") + return h + } + middleware := cors.New(cors.Options{ + AllowedOrigins: []string{serverURL.Value}, + AllowedMethods: connectcors.AllowedMethods(), + AllowedHeaders: connectcors.AllowedHeaders(), + ExposedHeaders: connectcors.ExposedHeaders(), + }) + return middleware.Handler(h) +} diff --git a/internal/api/server/routes.go b/internal/api/server/routes.go deleted file mode 100644 index 3db4e34..0000000 --- a/internal/api/server/routes.go +++ /dev/null @@ -1,135 +0,0 @@ -package server - -import ( - "net/http" - - "github.com/mizuchilabs/mantrae/internal/api/handler" - "github.com/mizuchilabs/mantrae/internal/api/middlewares" -) - -func (s *Server) routes() { - // Create middleware handler with database access - mw := middlewares.NewMiddlewareHandler(s.app) - - // Middleware chains - logChain := middlewares.Chain( - mw.Logger, - ) - - jwtChain := middlewares.Chain( - mw.Logger, - mw.JWT, - ) - - basicChain := middlewares.Chain( - mw.Logger, - mw.BasicAuth, - ) - - adminChain := middlewares.Chain( - mw.Logger, - mw.JWT, - mw.AdminOnly, - ) - - // Helper for middleware registration - register := func(method, path string, chain middlewares.Middleware, handler http.HandlerFunc) { - s.mux.Handle(method+" /api"+path, chain(handler)) - } - - // Auth - register("POST", "/login", logChain, handler.Login(s.app)) - register("POST", "/logout", logChain, handler.Logout) - register("GET", "/verify", jwtChain, handler.Verify) - register("POST", "/verify/otp", logChain, handler.VerifyOTP(s.app)) - register("POST", "/reset/{name}", logChain, handler.SendResetEmail(s.app)) - register("GET", "/oidc/callback", logChain, handler.OIDCCallback(s.app)) - register("GET", "/oidc/login", logChain, handler.OIDCLogin(s.app)) - register("GET", "/oidc/status", logChain, handler.OIDCStatus(s.app)) - - // Events - register("GET", "/events", logChain, handler.GetEvents) - register("GET", "/version", logChain, handler.GetVersion) - - // Profiles - register("GET", "/profile", jwtChain, handler.ListProfiles(s.app)) - register("GET", "/profile/{id}", jwtChain, handler.GetProfile(s.app)) - register("POST", "/profile", jwtChain, handler.CreateProfile(s.app)) - register("PUT", "/profile", jwtChain, handler.UpdateProfile(s.app)) - register("DELETE", "/profile/{id}", jwtChain, handler.DeleteProfile(s.app)) - - // Routers/Services - register("POST", "/router/{id}", jwtChain, handler.UpsertRouter(s.app)) - register("DELETE", "/router", jwtChain, handler.DeleteRouter(s.app)) - register("DELETE", "/router/bulk", jwtChain, handler.BulkDeleteRouter(s.app)) - - // Middlewares - register("POST", "/middleware/{id}", jwtChain, handler.UpsertMiddleware(s.app)) - register("DELETE", "/middleware", jwtChain, handler.DeleteMiddleware(s.app)) - register("DELETE", "/middleware/bulk", jwtChain, handler.BulkDeleteMiddleware(s.app)) - register("GET", "/middleware/plugins", jwtChain, handler.GetMiddlewarePlugins) - - // Users - register("GET", "/user", jwtChain, handler.ListUsers(s.app)) - register("GET", "/user/{id}", jwtChain, handler.GetUser(s.app)) - register("POST", "/user", adminChain, handler.CreateUser(s.app)) - register("PUT", "/user", jwtChain, handler.UpdateUser(s.app)) - register("DELETE", "/user/{id}", adminChain, handler.DeleteUser(s.app)) - register("POST", "/user/password", adminChain, handler.UpdateUserPassword(s.app)) - - // DNS Provider - register("GET", "/dns", jwtChain, handler.ListDNSProviders(s.app)) - register("GET", "/dns/{id}", jwtChain, handler.GetDNSProvider(s.app)) - register("POST", "/dns", adminChain, handler.CreateDNSProvider(s.app)) - register("PUT", "/dns", adminChain, handler.UpdateDNSProvider(s.app)) - register("DELETE", "/dns/{id}", adminChain, handler.DeleteDNSProvider(s.app)) - - // DNS To Router - register("GET", "/dns/router", jwtChain, handler.GetRouterDNSProvider(s.app)) - register("GET", "/dns/router/{id}", jwtChain, handler.ListRouterDNSProviders(s.app)) - register("POST", "/dns/router", jwtChain, handler.SetRouterDNSProvider(s.app)) - register("DELETE", "/dns/router", jwtChain, handler.DeleteRouterDNSProvider(s.app)) - - // Settings (admin only) - register("GET", "/settings", adminChain, handler.ListSettings(s.app.SM)) - register("GET", "/settings/{key}", adminChain, handler.GetSetting(s.app.SM)) - register("POST", "/settings", adminChain, handler.UpsertSetting(s.app.SM)) - - // Agent - register("GET", "/agent", jwtChain, handler.ListAgents(s.app)) - register("GET", "/agent/list/{id}", jwtChain, handler.ListAgentsByProfile(s.app)) - register("GET", "/agent/{id}", jwtChain, handler.GetAgent(s.app)) - register("POST", "/agent/{id}", jwtChain, handler.CreateAgent(s.app)) - register("PUT", "/agent", jwtChain, handler.UpdateAgentIP(s.app)) - register("DELETE", "/agent/{id}", jwtChain, handler.DeleteAgent(s.app)) - register("POST", "/agent/token/{id}", jwtChain, handler.RotateAgentToken(s.app)) - - // Backup & Restore (admin only) - register("GET", "/backups", adminChain, handler.ListBackups(s.app.BM)) - register("GET", "/backups/download", adminChain, handler.DownloadBackup(s.app.BM)) - register("GET", "/backups/download/{name}", adminChain, handler.DownloadBackupByName(s.app.BM)) - register("POST", "/backups", adminChain, handler.CreateBackup(s.app.BM)) - register("POST", "/backups/restore", adminChain, handler.RestoreBackup(s.app.BM)) - register("POST", "/backups/restore/{name}", adminChain, handler.RestoreBackupByName(s.app.BM)) - register("DELETE", "/backups/{name}", adminChain, handler.DeleteBackup(s.app.BM)) - register("POST", "/dynamic/restore/{id}", adminChain, handler.RestoreDynamicConfig(s.app.BM)) - - // Errors - register("GET", "/errors", jwtChain, handler.ListErrors(s.app)) - register("GET", "/errors/{id}", jwtChain, handler.GetErrorsByProfile(s.app)) - register("DELETE", "/errors/{id}", jwtChain, handler.DeleteErrorByID(s.app)) - register("DELETE", "/errors/profile/{id}", jwtChain, handler.DeleteErrorsByProfile(s.app)) - - // Current IP - register("GET", "/ip", jwtChain, handler.GetPublicIP) - - // Traefik - register("GET", "/traefik/{id}/{source}", jwtChain, handler.GetTraefikConfig(s.app)) - - // Dynamic config - if s.app.Config.Server.BasicAuth { - register("GET", "/{name}", basicChain, handler.PublishTraefikConfig(s.app)) - } else { - register("GET", "/{name}", logChain, handler.PublishTraefikConfig(s.app)) - } -} diff --git a/internal/api/server/server.go b/internal/api/server/server.go index a8795e0..d349cfd 100644 --- a/internal/api/server/server.go +++ b/internal/api/server/server.go @@ -8,45 +8,68 @@ import ( "log/slog" "net/http" "runtime/debug" - "strings" "time" "connectrpc.com/connect" "connectrpc.com/grpchealth" "connectrpc.com/grpcreflect" + "github.com/caarlos0/env/v11" + "github.com/mizuchilabs/mantrae/internal/api/handler" "github.com/mizuchilabs/mantrae/internal/api/middlewares" "github.com/mizuchilabs/mantrae/internal/api/service" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/util" "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1/mantraev1connect" "github.com/mizuchilabs/mantrae/web" ) +const elementsHTML = ` + + + + API Documentation + + + + + + + + +` + type Server struct { - mux *http.ServeMux - app *config.App + Host string `env:"HOST" envDefault:"0.0.0.0"` + Port string `env:"PORT" envDefault:"3000"` + SecureTraefik bool `env:"SECURE_TRAEFIK" envDefault:"false"` + mux *http.ServeMux + app *config.App } func NewServer(app *config.App) *Server { + cfg, err := env.ParseAs[Server]() + if err != nil { + log.Fatal(err) + } + return &Server{ - mux: http.NewServeMux(), - app: app, + Host: cfg.Host, + Port: cfg.Port, + mux: http.NewServeMux(), + app: app, } } func (s *Server) Start(ctx context.Context) error { - // Start the event processor before registering services - util.StartEventProcessor(ctx) - s.registerServices() defer s.app.Conn.Close() - host := s.app.Config.Server.Host - port := s.app.Config.Server.Port - allowedOrigins := s.getAllowedOrigins(ctx) server := &http.Server{ - Addr: host + ":" + port, - Handler: middlewares.CORS(allowedOrigins...)(s.mux), + Addr: s.Host + ":" + s.Port, + Handler: middlewares.WithCORS(s.mux, s.app), ReadHeaderTimeout: 3 * time.Second, ReadTimeout: 5 * time.Minute, WriteTimeout: 5 * time.Minute, @@ -58,7 +81,7 @@ func (s *Server) Start(ctx context.Context) error { // Start server in a goroutine go func() { - slog.Info("Server starting", "host", host, "port", port) + slog.Info("Server starting", "host", s.Host, "port", s.Port) if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed { serverErr <- err } @@ -81,34 +104,6 @@ func (s *Server) Start(ctx context.Context) error { } } -func (s *Server) getAllowedOrigins(ctx context.Context) []string { - var origins []string - - // Always allow development frontend - devOrigin := "http://127.0.0.1:5173" - origins = append(origins, devOrigin) - - // Get server URL from settings for production - if serverURL, err := s.app.SM.Get(ctx, "server_url"); err == nil { - if url := serverURL.String(""); url != "" && url != devOrigin { - origins = append(origins, strings.TrimSuffix(url, "/")) - } - } - - // Remove duplicates - seen := make(map[string]bool) - var uniqueOrigins []string - for _, origin := range origins { - if !seen[origin] { - uniqueOrigins = append(uniqueOrigins, origin) - seen[origin] = true - } - } - - slog.Debug("CORS allowed origins", "origins", uniqueOrigins) - return uniqueOrigins -} - func (s *Server) registerServices() { // Common interceptors opts := []connect.HandlerOption{ @@ -138,15 +133,16 @@ func (s *Server) registerServices() { } s.mux.Handle("/", http.FileServer(http.FS(staticContent))) - // Routes - s.routes() - serviceNames := []string{ mantraev1connect.ProfileServiceName, mantraev1connect.UserServiceName, mantraev1connect.EntryPointServiceName, mantraev1connect.SettingServiceName, mantraev1connect.AgentServiceName, + mantraev1connect.AgentManagementServiceName, + mantraev1connect.RouterServiceName, + mantraev1connect.ServiceServiceName, + mantraev1connect.MiddlewareServiceName, } checker := grpchealth.NewStaticChecker(serviceNames...) @@ -156,6 +152,19 @@ func (s *Server) registerServices() { s.mux.Handle(grpcreflect.NewHandlerV1(reflector)) s.mux.Handle(grpcreflect.NewHandlerV1Alpha(reflector)) + // Serve OpenAPI specs file + s.mux.HandleFunc("/openapi.yaml", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "proto/gen/openapi/openapi.yaml") + }) + + // Serve Elements UI + s.mux.HandleFunc("/docs", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html") + if _, err := w.Write([]byte(elementsHTML)); err != nil { + slog.Error("failed to write elements HTML", "error", err) + } + }) + // Service implementations s.mux.Handle(mantraev1connect.NewProfileServiceHandler( service.NewProfileService(s.app), @@ -177,4 +186,34 @@ func (s *Server) registerServices() { service.NewAgentService(s.app), opts..., )) + s.mux.Handle(mantraev1connect.NewAgentManagementServiceHandler( + service.NewAgentManagementService(s.app), + opts..., + )) + s.mux.Handle(mantraev1connect.NewRouterServiceHandler( + service.NewRouterService(s.app), + opts..., + )) + s.mux.Handle(mantraev1connect.NewServiceServiceHandler( + service.NewServiceService(s.app), + opts..., + )) + s.mux.Handle(mantraev1connect.NewMiddlewareServiceHandler( + service.NewMiddlewareService(s.app), + opts..., + )) + + // Traefik endpoint (HTTP) ------------------------------------------------ + mw := middlewares.NewMiddlewareHandler(s.app) + logChain := middlewares.Chain(mw.Logger) + basicChain := middlewares.Chain(mw.Logger, mw.BasicAuth) + + if s.SecureTraefik { + s.mux.Handle("GET /{name}", basicChain(handler.PublishTraefikConfig(s.app))) + } else { + s.mux.Handle("GET /{name}", logChain(handler.PublishTraefikConfig(s.app))) + } + + // TODO: OIDC + // TODO: Public IP } diff --git a/internal/api/service/agent.go b/internal/api/service/agent.go index 375a7b0..35b84a2 100644 --- a/internal/api/service/agent.go +++ b/internal/api/service/agent.go @@ -11,12 +11,14 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/mizuchilabs/mantrae/internal/api/middlewares" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" "github.com/mizuchilabs/mantrae/internal/settings" - "github.com/mizuchilabs/mantrae/internal/traefik" + "github.com/mizuchilabs/mantrae/internal/store/db" + "github.com/mizuchilabs/mantrae/internal/store/schema" "github.com/mizuchilabs/mantrae/internal/util" "github.com/mizuchilabs/mantrae/pkg/meta" mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" + "github.com/traefik/paerser/parser" + "github.com/traefik/traefik/v3/pkg/config/dynamic" ) type AgentService struct { @@ -47,38 +49,38 @@ func (s *AgentService) GetContainer( ctx context.Context, req *connect.Request[mantraev1.GetContainerRequest], ) (*connect.Response[mantraev1.GetContainerResponse], error) { - agent := middlewares.GetAgentContext(ctx) - if agent == nil { - return nil, connect.NewError( - connect.CodeInternal, - errors.New("agent context missing"), - ) + agentID, ok := middlewares.GetAgentIDFromContext(ctx) + if !ok { + return nil, connect.NewError(connect.CodeInternal, errors.New("agent context missing")) } // Upsert agent params := db.UpdateAgentParams{ - ID: agent.ID, + ID: agentID, Hostname: &req.Msg.Hostname, PublicIp: &req.Msg.PublicIp, } - if agent.ActiveIp == nil { - params.ActiveIp = &req.Msg.PublicIp - } + // if agent.ActiveIp == nil { + // params.ActiveIp = &req.Msg.PublicIp + // } - privateIPs := db.AgentPrivateIPs{IPs: make([]string, len(req.Msg.PrivateIps))} + privateIPs := schema.AgentPrivateIPs{ + IPs: make([]string, len(req.Msg.PrivateIps)), + } privateIPs.IPs = req.Msg.PrivateIps params.PrivateIps = &privateIPs - var containers db.AgentContainers + var containers schema.AgentContainers for _, container := range req.Msg.Containers { - containers = append(containers, db.AgentContainer{ + created := container.Created.AsTime() + containers = append(containers, schema.AgentContainer{ ID: container.Id, Name: container.Name, Labels: container.Labels, Image: container.Image, Portmap: container.Portmap, Status: container.Status, - Created: container.Created.AsTime(), + Created: &created, }) } params.Containers = &containers @@ -89,8 +91,8 @@ func (s *AgentService) GetContainer( return nil, connect.NewError(connect.CodeInternal, err) } - // Update agent config - if err = traefik.DecodeAgentConfig(s.app.Conn.Get(), updatedAgent); err != nil { + // Update dynamic config + if err = s.DecodeAgentConfig(updatedAgent); err != nil { return nil, connect.NewError(connect.CodeInternal, err) } @@ -108,7 +110,7 @@ func (s *AgentService) updateToken(ctx context.Context, id string) (*string, err return nil, err } - claims, err := DecodeJWT(agent.Token, s.app.Config.Secret) + claims, err := DecodeJWT(agent.Token, s.app.Secret) if err != nil { return nil, err } @@ -125,7 +127,7 @@ func (s *AgentService) updateToken(ctx context.Context, id string) (*string, err return nil, err } - token, err := claims.EncodeJWT(s.app.Config.Secret, agentInterval.Duration(time.Hour*72)) + token, err := claims.EncodeJWT(s.app.Secret, agentInterval.Duration(time.Hour*72)) if err != nil { return nil, err } @@ -187,3 +189,99 @@ func DecodeJWT(tokenString, secret string) (*AgentClaims, error) { } return claims, nil } + +func (s *AgentService) DecodeAgentConfig(agent db.Agent) error { + ctx := context.Background() + + q := s.app.Conn.GetQuery() + for _, container := range *agent.Containers { + dynConfig := &dynamic.Configuration{ + HTTP: &dynamic.HTTPConfiguration{}, + TCP: &dynamic.TCPConfiguration{}, + UDP: &dynamic.UDPConfiguration{}, + TLS: &dynamic.TLSConfiguration{}, + } + + err := parser.Decode( + container.Labels, + dynConfig, + parser.DefaultRootName, + "traefik.http", + "traefik.tcp", + "traefik.udp", + "traefik.tls.stores.default", + ) + if err != nil { + return err + } + + for k, r := range dynConfig.HTTP.Routers { + q.CreateHttpRouter(ctx, db.CreateHttpRouterParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + for k, r := range dynConfig.TCP.Routers { + q.CreateTcpRouter(ctx, db.CreateTcpRouterParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + for k, r := range dynConfig.UDP.Routers { + q.CreateUdpRouter(ctx, db.CreateUdpRouterParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + + for k, r := range dynConfig.HTTP.Services { + q.CreateHttpService(ctx, db.CreateHttpServiceParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + for k, r := range dynConfig.TCP.Services { + q.CreateTcpService(ctx, db.CreateTcpServiceParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + for k, r := range dynConfig.UDP.Services { + q.CreateUdpService(ctx, db.CreateUdpServiceParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + + for k, r := range dynConfig.HTTP.Middlewares { + q.CreateHttpMiddleware(ctx, db.CreateHttpMiddlewareParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + for k, r := range dynConfig.TCP.Middlewares { + q.CreateTcpMiddleware(ctx, db.CreateTcpMiddlewareParams{ + ProfileID: agent.ProfileID, + AgentID: &agent.ID, + Name: k, + Config: r, + }) + } + } + + return nil +} diff --git a/internal/api/service/agentManagement.go b/internal/api/service/agentManagement.go new file mode 100644 index 0000000..51640b3 --- /dev/null +++ b/internal/api/service/agentManagement.go @@ -0,0 +1,214 @@ +package service + +import ( + "context" + "time" + + "connectrpc.com/connect" + + "github.com/google/uuid" + "github.com/mizuchilabs/mantrae/internal/config" + "github.com/mizuchilabs/mantrae/internal/settings" + "github.com/mizuchilabs/mantrae/internal/store/db" + mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" +) + +type AgentManagementService struct { + app *config.App +} + +func NewAgentManagementService(app *config.App) *AgentManagementService { + return &AgentManagementService{app: app} +} + +func (s *AgentManagementService) GetAgent( + ctx context.Context, + req *connect.Request[mantraev1.GetAgentRequest], +) (*connect.Response[mantraev1.GetAgentResponse], error) { + agent, err := s.app.Conn.GetQuery().GetAgent(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + // var containers []*mantraev1.Container + // err = json.Unmarshal(containers, &agent.Containers) + // if err != nil { + // return nil, connect.NewError(connect.CodeInternal, err) + // } + + return connect.NewResponse(&mantraev1.GetAgentResponse{ + Agent: &mantraev1.Agent{ + Id: agent.ID, + ProfileId: agent.ProfileID, + Hostname: SafeString(agent.Hostname), + PublicIp: SafeString(agent.PublicIp), + ActiveIp: SafeString(agent.ActiveIp), + Token: agent.Token, + PrivateIps: agent.PrivateIps.IPs, + // Containers: containers, + CreatedAt: SafeTimestamp(agent.CreatedAt), + UpdatedAt: SafeTimestamp(agent.UpdatedAt), + }, + }), nil +} + +func (s *AgentManagementService) CreateAgent( + ctx context.Context, + req *connect.Request[mantraev1.CreateAgentRequest], +) (*connect.Response[mantraev1.CreateAgentResponse], error) { + id, err := uuid.NewV7() + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + serverUrl, err := s.app.Conn.GetQuery().GetSetting(ctx, settings.KeyServerURL) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + claims := &AgentClaims{ + AgentID: id.String(), + ProfileID: req.Msg.ProfileId, + ServerURL: serverUrl.Value, + } + token, err := claims.EncodeJWT(s.app.Secret, time.Hour*72) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + agent, err := s.app.Conn.GetQuery().CreateAgent(ctx, db.CreateAgentParams{ + ID: claims.AgentID, + ProfileID: claims.ProfileID, + Token: token, + }) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.CreateAgentResponse{ + Agent: &mantraev1.Agent{ + Id: agent.ID, + ProfileId: agent.ProfileID, + Token: agent.Token, + }, + }), nil +} + +func (s *AgentManagementService) UpdateAgentIP( + ctx context.Context, + req *connect.Request[mantraev1.UpdateAgentIPRequest], +) (*connect.Response[mantraev1.UpdateAgentIPResponse], error) { + if err := s.app.Conn.GetQuery().UpdateAgentIP(ctx, db.UpdateAgentIPParams{ + ID: req.Msg.Id, + ActiveIp: &req.Msg.Ip, + }); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + agent, err := s.app.Conn.GetQuery().GetAgent(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.UpdateAgentIPResponse{ + Agent: &mantraev1.Agent{ + Id: agent.ID, + ProfileId: agent.ProfileID, + Hostname: SafeString(agent.Hostname), + PublicIp: SafeString(agent.PublicIp), + ActiveIp: SafeString(agent.ActiveIp), + Token: agent.Token, + PrivateIps: agent.PrivateIps.IPs, + CreatedAt: SafeTimestamp(agent.CreatedAt), + UpdatedAt: SafeTimestamp(agent.UpdatedAt), + }, + }), nil +} + +func (s *AgentManagementService) DeleteAgent( + ctx context.Context, + req *connect.Request[mantraev1.DeleteAgentRequest], +) (*connect.Response[mantraev1.DeleteAgentResponse], error) { + if err := s.app.Conn.GetQuery().DeleteAgent(ctx, req.Msg.Id); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + return connect.NewResponse(&mantraev1.DeleteAgentResponse{}), nil +} + +func (s *AgentManagementService) ListAgents( + ctx context.Context, + req *connect.Request[mantraev1.ListAgentsRequest], +) (*connect.Response[mantraev1.ListAgentsResponse], error) { + var params db.ListAgentsParams + if req.Msg.Limit == nil { + params.Limit = 100 + } else { + params.Limit = *req.Msg.Limit + } + if req.Msg.Offset == nil { + params.Offset = 0 + } else { + params.Offset = *req.Msg.Offset + } + + dbAgents, err := s.app.Conn.GetQuery().ListAgents(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err := s.app.Conn.GetQuery().CountAgents(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + var agents []*mantraev1.Agent + for _, agent := range dbAgents { + agents = append(agents, &mantraev1.Agent{ + Id: agent.ID, + ProfileId: agent.ProfileID, + Hostname: SafeString(agent.Hostname), + PublicIp: SafeString(agent.PublicIp), + ActiveIp: SafeString(agent.ActiveIp), + Token: agent.Token, + PrivateIps: agent.PrivateIps.IPs, + CreatedAt: SafeTimestamp(agent.CreatedAt), + UpdatedAt: SafeTimestamp(agent.UpdatedAt), + }) + } + return connect.NewResponse(&mantraev1.ListAgentsResponse{ + Agents: agents, + TotalCount: totalCount, + }), nil +} + +func (s *AgentManagementService) RotateAgentToken( + ctx context.Context, + req *connect.Request[mantraev1.RotateAgentTokenRequest], +) (*connect.Response[mantraev1.RotateAgentTokenResponse], error) { + agent, err := s.app.Conn.GetQuery().GetAgent(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + serverUrl, err := s.app.Conn.GetQuery().GetSetting(ctx, settings.KeyServerURL) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + claims := &AgentClaims{ + AgentID: agent.ID, + ProfileID: agent.ProfileID, + ServerURL: serverUrl.Value, + } + token, err := claims.EncodeJWT(s.app.Secret, time.Hour*72) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + if err := s.app.Conn.GetQuery().UpdateAgentToken(ctx, db.UpdateAgentTokenParams{ + ID: agent.ID, + Token: token, + }); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.RotateAgentTokenResponse{}), nil +} diff --git a/internal/api/service/backup.go b/internal/api/service/backup.go new file mode 100644 index 0000000..fc3c15a --- /dev/null +++ b/internal/api/service/backup.go @@ -0,0 +1,161 @@ +package service + +import ( + "context" + "errors" + "fmt" + "io" + "time" + + "connectrpc.com/connect" + "github.com/mizuchilabs/mantrae/internal/config" + mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" +) + +type BackupService struct { + app *config.App +} + +func NewBackupService(app *config.App) *BackupService { + return &BackupService{app: app} +} + +func (s *BackupService) CreateBackup( + ctx context.Context, + req *connect.Request[mantraev1.CreateBackupRequest], +) (*connect.Response[mantraev1.CreateBackupResponse], error) { + if err := s.app.BM.Create(ctx); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.CreateBackupResponse{}), nil +} + +func (s *BackupService) ListBackups( + ctx context.Context, + req *connect.Request[mantraev1.ListBackupsRequest], +) (*connect.Response[mantraev1.ListBackupsResponse], error) { + files, err := s.app.BM.List(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + var backups []*mantraev1.Backup + for _, file := range files { + backups = append(backups, &mantraev1.Backup{ + Name: file.Name, + Size: file.Size, + CreatedAt: SafeTimestamp(&file.Timestamp), + }) + } + return connect.NewResponse(&mantraev1.ListBackupsResponse{ + Backups: backups, + }), nil +} + +func (s *BackupService) DeleteBackup( + ctx context.Context, + req *connect.Request[mantraev1.DeleteBackupRequest], +) (*connect.Response[mantraev1.DeleteBackupResponse], error) { + if err := s.app.BM.Delete(ctx, req.Msg.Name); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + return connect.NewResponse(&mantraev1.DeleteBackupResponse{}), nil +} + +func (s *BackupService) RestoreBackup( + ctx context.Context, + req *connect.Request[mantraev1.RestoreBackupRequest], +) (*connect.Response[mantraev1.RestoreBackupResponse], error) { + if !s.app.BM.IsValidBackupFile(req.Msg.Name) { + return nil, connect.NewError( + connect.CodeInvalidArgument, + errors.New("invalid backup file name"), + ) + } + if err := s.app.BM.Restore(ctx, req.Msg.Name); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.RestoreBackupResponse{}), nil +} + +func (s *BackupService) DownloadBackup( + ctx context.Context, + req *connect.Request[mantraev1.DownloadBackupRequest], + stream *connect.ServerStream[mantraev1.DownloadBackupResponse], +) error { + filename := req.Msg.Name + if req.Msg.Name == "" { + files, err := s.app.BM.Storage.List(ctx) + if err != nil { + return connect.NewError(connect.CodeInternal, err) + } + filename = files[0].Name // Use latest backup + } + + reader, err := s.app.BM.Storage.Retrieve(ctx, filename) + if err != nil { + return connect.NewError(connect.CodeInternal, err) + } + defer reader.Close() + + buf := make([]byte, 32*1024) + for { + n, err := reader.Read(buf) + if err != nil { + if err == io.EOF { + break + } + return connect.NewError(connect.CodeInternal, err) + } + if err := stream.Send(&mantraev1.DownloadBackupResponse{ + Data: buf[:n], + }); err != nil { + return connect.NewError(connect.CodeInternal, err) + } + } + + return nil +} + +func (s *BackupService) UploadBackup( + ctx context.Context, + stream *connect.ClientStream[mantraev1.UploadBackupRequest], +) (*connect.Response[mantraev1.UploadBackupResponse], error) { + // Create a pipe to stream data from gRPC into storage + pr, pw := io.Pipe() + defer pr.Close() + + // Start storage write in background + filename := fmt.Sprintf("upload_%s.db", time.Now().UTC().Format("20060102_150405")) + storeErrChan := make(chan error, 1) + go func() { + defer pw.Close() + err := s.app.BM.Storage.Store(ctx, filename, pr) + storeErrChan <- err + }() + + for stream.Receive() { + chunk := stream.Msg() + if len(chunk.Data) == 0 { + continue + } + if _, err := pw.Write(chunk.Data); err != nil { + pw.CloseWithError(err) + return nil, connect.NewError(connect.CodeInternal, err) + } + } + + if err := stream.Err(); err != nil { + pw.CloseWithError(err) + return nil, connect.NewError(connect.CodeInternal, err) + } + + // Wait for store to finish + if err := <-storeErrChan; err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&mantraev1.UploadBackupResponse{}), nil +} diff --git a/internal/api/service/entrypoint.go b/internal/api/service/entrypoint.go index 776698f..e0e587a 100644 --- a/internal/api/service/entrypoint.go +++ b/internal/api/service/entrypoint.go @@ -6,7 +6,7 @@ import ( "connectrpc.com/connect" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store/db" mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" ) diff --git a/internal/api/service/middleware.go b/internal/api/service/middleware.go new file mode 100644 index 0000000..64ed1bb --- /dev/null +++ b/internal/api/service/middleware.go @@ -0,0 +1,311 @@ +package service + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net/http" + "slices" + + "connectrpc.com/connect" + + "github.com/mizuchilabs/mantrae/internal/config" + "github.com/mizuchilabs/mantrae/internal/store/db" + mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" +) + +type MiddlewareService struct { + app *config.App +} + +func NewMiddlewareService(app *config.App) *MiddlewareService { + return &MiddlewareService{app: app} +} + +func (s *MiddlewareService) GetMiddleware( + ctx context.Context, + req *connect.Request[mantraev1.GetMiddlewareRequest], +) (*connect.Response[mantraev1.GetMiddlewareResponse], error) { + var middleware *mantraev1.Middleware + + switch req.Msg.Type { + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP: + res, err := s.app.Conn.GetQuery().GetHttpMiddleware(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + middleware, err = buildProtoHttpMiddleware(res) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP: + res, err := s.app.Conn.GetQuery().GetTcpMiddleware(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + middleware, err = buildProtoTcpMiddleware(res) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError( + connect.CodeInvalidArgument, + errors.New("invalid middleware type"), + ) + } + + return connect.NewResponse(&mantraev1.GetMiddlewareResponse{Middleware: middleware}), nil +} + +func (s *MiddlewareService) CreateMiddleware( + ctx context.Context, + req *connect.Request[mantraev1.CreateMiddlewareRequest], +) (*connect.Response[mantraev1.CreateMiddlewareResponse], error) { + var middleware *mantraev1.Middleware + + switch req.Msg.Type { + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP: + var params db.CreateHttpMiddlewareParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ProfileID = req.Msg.ProfileId + params.Name = req.Msg.Name + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId + } + + dbMiddleware, err := s.app.Conn.GetQuery().CreateHttpMiddleware(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + middleware, err = buildProtoHttpMiddleware(dbMiddleware) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP: + var params db.CreateTcpMiddlewareParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ProfileID = req.Msg.ProfileId + params.Name = req.Msg.Name + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId + } + + dbMiddleware, err := s.app.Conn.GetQuery().CreateTcpMiddleware(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + middleware, err = buildProtoTcpMiddleware(dbMiddleware) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError( + connect.CodeInvalidArgument, + errors.New("invalid middleware type"), + ) + } + + return connect.NewResponse(&mantraev1.CreateMiddlewareResponse{Middleware: middleware}), nil +} + +func (s *MiddlewareService) UpdateMiddleware( + ctx context.Context, + req *connect.Request[mantraev1.UpdateMiddlewareRequest], +) (*connect.Response[mantraev1.UpdateMiddlewareResponse], error) { + var middleware *mantraev1.Middleware + + switch req.Msg.Type { + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP: + var params db.UpdateHttpMiddlewareParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ID = req.Msg.Id + params.Name = req.Msg.Name + + dbMiddleware, err := s.app.Conn.GetQuery().UpdateHttpMiddleware(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + middleware, err = buildProtoHttpMiddleware(dbMiddleware) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP: + var params db.UpdateTcpMiddlewareParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ID = req.Msg.Id + params.Name = req.Msg.Name + + dbMiddleware, err := s.app.Conn.GetQuery().UpdateTcpMiddleware(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + middleware, err = buildProtoTcpMiddleware(dbMiddleware) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError( + connect.CodeInvalidArgument, + errors.New("invalid middleware type"), + ) + } + + return connect.NewResponse(&mantraev1.UpdateMiddlewareResponse{Middleware: middleware}), nil +} + +func (s *MiddlewareService) DeleteMiddleware( + ctx context.Context, + req *connect.Request[mantraev1.DeleteMiddlewareRequest], +) (*connect.Response[mantraev1.DeleteMiddlewareResponse], error) { + err := s.app.Conn.GetQuery().DeleteHttpMiddleware(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + return connect.NewResponse(&mantraev1.DeleteMiddlewareResponse{}), nil +} + +func (s *MiddlewareService) ListMiddlewares( + ctx context.Context, + req *connect.Request[mantraev1.ListMiddlewaresRequest], +) (*connect.Response[mantraev1.ListMiddlewaresResponse], error) { + var limit int64 + var offset int64 + if req.Msg.Limit == nil { + limit = 100 + } else { + limit = *req.Msg.Limit + } + if req.Msg.Offset == nil { + offset = 0 + } else { + offset = *req.Msg.Offset + } + + var middlewares []*mantraev1.Middleware + var totalCount int64 + switch req.Msg.Type { + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP: + params := db.ListHttpMiddlewaresParams{Limit: limit, Offset: offset} + dbMiddlewares, err := s.app.Conn.GetQuery().ListHttpMiddlewares(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err = s.app.Conn.GetQuery().CountHttpMiddlewares(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + for _, dbMiddleware := range dbMiddlewares { + middleware, err := buildProtoHttpMiddleware(dbMiddleware) + if err != nil { + slog.Error("Failed to build proto middleware", "error", err) + continue + } + middlewares = append(middlewares, middleware) + } + + case mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP: + params := db.ListTcpMiddlewaresParams{Limit: limit, Offset: offset} + dbMiddlewares, err := s.app.Conn.GetQuery().ListTcpMiddlewares(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err = s.app.Conn.GetQuery().CountTcpMiddlewares(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + for _, dbMiddleware := range dbMiddlewares { + middleware, err := buildProtoTcpMiddleware(dbMiddleware) + if err != nil { + slog.Error("Failed to build proto middleware", "error", err) + continue + } + middlewares = append(middlewares, middleware) + } + + default: + return nil, connect.NewError( + connect.CodeInvalidArgument, + errors.New("invalid middleware type"), + ) + } + + return connect.NewResponse(&mantraev1.ListMiddlewaresResponse{ + Middlewares: middlewares, + TotalCount: totalCount, + }), nil +} + +func buildProtoHttpMiddleware(r db.HttpMiddleware) (*mantraev1.Middleware, error) { + configBytes, err := json.Marshal(r.Config) + if err != nil { + return nil, fmt.Errorf("failed to marshal HTTP config: %w", err) + } + return &mantraev1.Middleware{ + Id: r.ID, + ProfileId: r.ProfileID, + Name: r.Name, + Config: string(configBytes), + Type: mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP, + CreatedAt: SafeTimestamp(r.CreatedAt), + UpdatedAt: SafeTimestamp(r.UpdatedAt), + }, nil +} + +func buildProtoTcpMiddleware(r db.TcpMiddleware) (*mantraev1.Middleware, error) { + configBytes, err := json.Marshal(r.Config) + if err != nil { + return nil, fmt.Errorf("failed to marshal TCP config: %w", err) + } + return &mantraev1.Middleware{ + Id: r.ID, + ProfileId: r.ProfileID, + Name: r.Name, + Config: string(configBytes), + Type: mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP, + CreatedAt: SafeTimestamp(r.CreatedAt), + UpdatedAt: SafeTimestamp(r.UpdatedAt), + }, nil +} + +func (s *MiddlewareService) GetMiddlewarePlugins( + ctx context.Context, + req *connect.Request[mantraev1.GetMiddlewarePluginsRequest], +) (*connect.Response[mantraev1.GetMiddlewarePluginsResponse], error) { + resp, err := http.Get("https://plugins.traefik.io/api/services/plugins") + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + defer resp.Body.Close() + + var allPlugins []*mantraev1.Plugin + if err := json.NewDecoder(resp.Body).Decode(&allPlugins); err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + plugins := slices.DeleteFunc(allPlugins, func(p *mantraev1.Plugin) bool { + return p.Type != "middleware" + }) + + return connect.NewResponse(&mantraev1.GetMiddlewarePluginsResponse{Plugins: plugins}), nil +} diff --git a/internal/api/service/profile.go b/internal/api/service/profile.go index 9b95895..df1b9df 100644 --- a/internal/api/service/profile.go +++ b/internal/api/service/profile.go @@ -6,7 +6,7 @@ import ( "connectrpc.com/connect" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store/db" mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" ) diff --git a/internal/api/service/router.go b/internal/api/service/router.go index 1030212..cf2212d 100644 --- a/internal/api/service/router.go +++ b/internal/api/service/router.go @@ -81,8 +81,8 @@ func (s *RouterService) CreateRouter( } params.ProfileID = req.Msg.ProfileId params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId } dbRouter, err := s.app.Conn.GetQuery().CreateHttpRouter(ctx, params) @@ -102,8 +102,8 @@ func (s *RouterService) CreateRouter( } params.ProfileID = req.Msg.ProfileId params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId } dbRouter, err := s.app.Conn.GetQuery().CreateTcpRouter(ctx, params) @@ -123,8 +123,8 @@ func (s *RouterService) CreateRouter( } params.ProfileID = req.Msg.ProfileId params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId } dbRouter, err := s.app.Conn.GetQuery().CreateUdpRouter(ctx, params) @@ -158,9 +158,6 @@ func (s *RouterService) UpdateRouter( } params.ID = req.Msg.Id params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source - } dbRouter, err := s.app.Conn.GetQuery().UpdateHttpRouter(ctx, params) if err != nil { @@ -179,9 +176,6 @@ func (s *RouterService) UpdateRouter( } params.ID = req.Msg.Id params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source - } dbRouter, err := s.app.Conn.GetQuery().UpdateTcpRouter(ctx, params) if err != nil { @@ -200,9 +194,6 @@ func (s *RouterService) UpdateRouter( } params.ID = req.Msg.Id params.Name = req.Msg.Name - if req.Msg.Source != "" { - params.Source = &req.Msg.Source - } dbRouter, err := s.app.Conn.GetQuery().UpdateUdpRouter(ctx, params) if err != nil { @@ -338,9 +329,9 @@ func buildProtoHttpRouter(r db.HttpRouter) (*mantraev1.Router, error) { } return &mantraev1.Router{ Id: r.ID, + ProfileId: r.ProfileID, Name: r.Name, Config: string(configBytes), - Source: SafeString(r.Source), Enabled: r.Enabled, Type: mantraev1.RouterType_ROUTER_TYPE_HTTP, CreatedAt: SafeTimestamp(r.CreatedAt), @@ -355,9 +346,9 @@ func buildProtoTcpRouter(r db.TcpRouter) (*mantraev1.Router, error) { } return &mantraev1.Router{ Id: r.ID, + ProfileId: r.ProfileID, Name: r.Name, Config: string(configBytes), - Source: SafeString(r.Source), Enabled: r.Enabled, Type: mantraev1.RouterType_ROUTER_TYPE_TCP, CreatedAt: SafeTimestamp(r.CreatedAt), @@ -372,9 +363,9 @@ func buildProtoUdpRouter(r db.UdpRouter) (*mantraev1.Router, error) { } return &mantraev1.Router{ Id: r.ID, + ProfileId: r.ProfileID, Name: r.Name, Config: string(configBytes), - Source: SafeString(r.Source), Enabled: r.Enabled, Type: mantraev1.RouterType_ROUTER_TYPE_UDP, CreatedAt: SafeTimestamp(r.CreatedAt), diff --git a/internal/api/service/service.go b/internal/api/service/service.go new file mode 100644 index 0000000..60baae8 --- /dev/null +++ b/internal/api/service/service.go @@ -0,0 +1,357 @@ +package service + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + + "connectrpc.com/connect" + + "github.com/mizuchilabs/mantrae/internal/config" + "github.com/mizuchilabs/mantrae/internal/store/db" + mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" +) + +type Service struct { + app *config.App +} + +func NewServiceService(app *config.App) *Service { + return &Service{app: app} +} + +func (s *Service) GetService( + ctx context.Context, + req *connect.Request[mantraev1.GetServiceRequest], +) (*connect.Response[mantraev1.GetServiceResponse], error) { + var service *mantraev1.Service + + switch req.Msg.Type { + case mantraev1.ServiceType_SERVICE_TYPE_HTTP: + res, err := s.app.Conn.GetQuery().GetHttpService(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoHttpService(res) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_TCP: + res, err := s.app.Conn.GetQuery().GetTcpService(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + service, err = buildProtoTcpService(res) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_UDP: + res, err := s.app.Conn.GetQuery().GetUdpService(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + service, err = buildProtoUdpService(res) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError(connect.CodeInvalidArgument, nil) + } + + return connect.NewResponse(&mantraev1.GetServiceResponse{Service: service}), nil +} + +func (s *Service) CreateService( + ctx context.Context, + req *connect.Request[mantraev1.CreateServiceRequest], +) (*connect.Response[mantraev1.CreateServiceResponse], error) { + var service *mantraev1.Service + + switch req.Msg.Type { + case mantraev1.ServiceType_SERVICE_TYPE_HTTP: + var params db.CreateHttpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ProfileID = req.Msg.ProfileId + params.Name = req.Msg.Name + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId + } + + dbService, err := s.app.Conn.GetQuery().CreateHttpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoHttpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_TCP: + var params db.CreateTcpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ProfileID = req.Msg.ProfileId + params.Name = req.Msg.Name + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId + } + + dbService, err := s.app.Conn.GetQuery().CreateTcpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoTcpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_UDP: + var params db.CreateUdpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ProfileID = req.Msg.ProfileId + params.Name = req.Msg.Name + if req.Msg.AgentId != "" { + params.AgentID = &req.Msg.AgentId + } + + dbService, err := s.app.Conn.GetQuery().CreateUdpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoUdpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError(connect.CodeInvalidArgument, nil) + } + return connect.NewResponse(&mantraev1.CreateServiceResponse{Service: service}), nil +} + +func (s *Service) UpdateService( + ctx context.Context, + req *connect.Request[mantraev1.UpdateServiceRequest], +) (*connect.Response[mantraev1.UpdateServiceResponse], error) { + var service *mantraev1.Service + + switch req.Msg.Type { + case mantraev1.ServiceType_SERVICE_TYPE_HTTP: + var params db.UpdateHttpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ID = req.Msg.Id + params.Name = req.Msg.Name + + dbService, err := s.app.Conn.GetQuery().UpdateHttpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoHttpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_TCP: + var params db.UpdateTcpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ID = req.Msg.Id + params.Name = req.Msg.Name + + dbService, err := s.app.Conn.GetQuery().UpdateTcpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoTcpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + case mantraev1.ServiceType_SERVICE_TYPE_UDP: + var params db.UpdateUdpServiceParams + if err := json.Unmarshal([]byte(req.Msg.Config), ¶ms.Config); err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } + params.ID = req.Msg.Id + params.Name = req.Msg.Name + + dbService, err := s.app.Conn.GetQuery().UpdateUdpService(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + service, err = buildProtoUdpService(dbService) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + default: + return nil, connect.NewError(connect.CodeInvalidArgument, nil) + } + return connect.NewResponse(&mantraev1.UpdateServiceResponse{Service: service}), nil +} + +func (s *Service) DeleteService( + ctx context.Context, + req *connect.Request[mantraev1.DeleteServiceRequest], +) (*connect.Response[mantraev1.DeleteServiceResponse], error) { + err := s.app.Conn.GetQuery().DeleteHttpService(ctx, req.Msg.Id) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + return connect.NewResponse(&mantraev1.DeleteServiceResponse{}), nil +} + +func (s *Service) ListServices( + ctx context.Context, + req *connect.Request[mantraev1.ListServicesRequest], +) (*connect.Response[mantraev1.ListServicesResponse], error) { + var limit int64 + var offset int64 + if req.Msg.Limit == nil { + limit = 100 + } else { + limit = *req.Msg.Limit + } + if req.Msg.Offset == nil { + offset = 0 + } else { + offset = *req.Msg.Offset + } + + var services []*mantraev1.Service + var totalCount int64 + switch req.Msg.Type { + case mantraev1.ServiceType_SERVICE_TYPE_HTTP: + params := db.ListHttpServicesParams{Limit: limit, Offset: offset} + dbServices, err := s.app.Conn.GetQuery().ListHttpServices(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err = s.app.Conn.GetQuery().CountHttpServices(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + for _, dbService := range dbServices { + service, err := buildProtoHttpService(dbService) + if err != nil { + slog.Error("Failed to build proto service", "error", err) + continue + } + services = append(services, service) + } + + case mantraev1.ServiceType_SERVICE_TYPE_TCP: + params := db.ListTcpServicesParams{Limit: limit, Offset: offset} + dbServices, err := s.app.Conn.GetQuery().ListTcpServices(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err = s.app.Conn.GetQuery().CountTcpServices(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + for _, dbService := range dbServices { + service, err := buildProtoTcpService(dbService) + if err != nil { + slog.Error("Failed to build proto service", "error", err) + continue + } + services = append(services, service) + } + + case mantraev1.ServiceType_SERVICE_TYPE_UDP: + params := db.ListUdpServicesParams{Limit: limit, Offset: offset} + dbServices, err := s.app.Conn.GetQuery().ListUdpServices(ctx, params) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + totalCount, err = s.app.Conn.GetQuery().CountUdpServices(ctx) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + for _, dbService := range dbServices { + service, err := buildProtoUdpService(dbService) + if err != nil { + slog.Error("Failed to build proto service", "error", err) + continue + } + services = append(services, service) + } + + default: + return nil, connect.NewError(connect.CodeInvalidArgument, nil) + } + + return connect.NewResponse(&mantraev1.ListServicesResponse{ + Services: services, + TotalCount: totalCount, + }), nil +} + +func buildProtoHttpService(r db.HttpService) (*mantraev1.Service, error) { + configBytes, err := json.Marshal(r.Config) + if err != nil { + return nil, fmt.Errorf("failed to marshal HTTP config: %w", err) + } + return &mantraev1.Service{ + Id: r.ID, + ProfileId: r.ProfileID, + Name: r.Name, + Config: string(configBytes), + Type: mantraev1.ServiceType_SERVICE_TYPE_HTTP, + CreatedAt: SafeTimestamp(r.CreatedAt), + UpdatedAt: SafeTimestamp(r.UpdatedAt), + }, nil +} + +func buildProtoTcpService(r db.TcpService) (*mantraev1.Service, error) { + configBytes, err := json.Marshal(r.Config) + if err != nil { + return nil, fmt.Errorf("failed to marshal TCP config: %w", err) + } + return &mantraev1.Service{ + Id: r.ID, + ProfileId: r.ProfileID, + Name: r.Name, + Config: string(configBytes), + Type: mantraev1.ServiceType_SERVICE_TYPE_TCP, + CreatedAt: SafeTimestamp(r.CreatedAt), + UpdatedAt: SafeTimestamp(r.UpdatedAt), + }, nil +} + +func buildProtoUdpService(r db.UdpService) (*mantraev1.Service, error) { + configBytes, err := json.Marshal(r.Config) + if err != nil { + return nil, fmt.Errorf("failed to marshal UDP config: %w", err) + } + return &mantraev1.Service{ + Id: r.ID, + ProfileId: r.ProfileID, + Name: r.Name, + Config: string(configBytes), + Type: mantraev1.ServiceType_SERVICE_TYPE_UDP, + CreatedAt: SafeTimestamp(r.CreatedAt), + UpdatedAt: SafeTimestamp(r.UpdatedAt), + }, nil +} diff --git a/internal/api/service/setting.go b/internal/api/service/setting.go index 0c1f5e6..fe59380 100644 --- a/internal/api/service/setting.go +++ b/internal/api/service/setting.go @@ -6,7 +6,7 @@ import ( "connectrpc.com/connect" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store/db" mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" ) diff --git a/internal/api/service/user.go b/internal/api/service/user.go index c2fb45f..e7ed6c7 100644 --- a/internal/api/service/user.go +++ b/internal/api/service/user.go @@ -8,11 +8,12 @@ import ( "connectrpc.com/connect" "golang.org/x/crypto/bcrypt" + "github.com/google/uuid" "github.com/mizuchilabs/mantrae/internal/api/middlewares" "github.com/mizuchilabs/mantrae/internal/config" - "github.com/mizuchilabs/mantrae/internal/db" "github.com/mizuchilabs/mantrae/internal/mail" "github.com/mizuchilabs/mantrae/internal/settings" + "github.com/mizuchilabs/mantrae/internal/store/db" "github.com/mizuchilabs/mantrae/internal/util" mantraev1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" ) @@ -51,7 +52,7 @@ func (s *UserService) LoginUser( if req.Msg.Remember { expirationTime = time.Now().Add(30 * 24 * time.Hour) } - token, err := util.EncodeUserJWT(user.Username, s.app.Config.Secret, expirationTime) + token, err := util.EncodeUserJWT(user.Username, s.app.Secret, expirationTime) if err != nil { return nil, connect.NewError(connect.CodeInternal, err) } @@ -109,7 +110,7 @@ func (s *UserService) VerifyOTP( } expirationTime := time.Now().Add(1 * time.Hour) - token, err := util.EncodeUserJWT(user.Username, s.app.Config.Secret, expirationTime) + token, err := util.EncodeUserJWT(user.Username, s.app.Secret, expirationTime) if err != nil { return nil, connect.NewError(connect.CodeInternal, err) } @@ -223,7 +224,13 @@ func (s *UserService) CreateUser( ctx context.Context, req *connect.Request[mantraev1.CreateUserRequest], ) (*connect.Response[mantraev1.CreateUserResponse], error) { + id, err := uuid.NewV7() + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + params := db.CreateUserParams{ + ID: id.String(), Username: req.Msg.Username, Password: req.Msg.Password, IsAdmin: req.Msg.IsAdmin, diff --git a/internal/app/config.go b/internal/app/config.go deleted file mode 100644 index f07dbbd..0000000 --- a/internal/app/config.go +++ /dev/null @@ -1,66 +0,0 @@ -package app - -import ( - "fmt" - "log" - "os" - "path/filepath" - - "github.com/caarlos0/env/v11" -) - -// Config holds all application configuration -type Config struct { - Server ServerConfig - Traefik TraefikConfig - Secret string `env:"SECRET" envDefault:""` -} - -type ServerConfig struct { - Host string `env:"SERVER_HOST" envDefault:"0.0.0.0"` - Port string `env:"SERVER_PORT" envDefault:"3000"` - ServerURL string `env:"SERVER_URL" envDefault:"http://127.0.0.1"` - BasicAuth bool `env:"SERVER_BASIC_AUTH" envDefault:"false"` -} - -type TraefikConfig struct { - Profile string `env:"TRAEFIK_PROFILE" envDefault:"default"` - URL string `env:"TRAEFIK_URL" envDefault:""` - Username string `env:"TRAEFIK_USERNAME" envDefault:""` - Password string `env:"TRAEFIK_PASSWORD" envDefault:""` - TLS bool `env:"TRAEFIK_TLS" envDefault:""` -} - -func ReadConfig() (*Config, error) { - var config Config - if err := env.Parse(&config); err != nil { - return nil, err - } - - if config.Secret == "" { - return nil, fmt.Errorf("SECRET environment variable not set") - } - - return &config, nil -} - -func ResolvePath(path string) string { - var basePath string - if dbPath := os.Getenv("DB_PATH"); dbPath != "" { - basePath = dbPath - } else { - basePath = "data" - } - - // If the provided path is absolute, return it as-is - if filepath.IsAbs(path) { - return path - } - - // Create the base directory if it doesn't exist - if err := os.MkdirAll(basePath, 0755); err != nil { - log.Printf("Warning: failed to create base directory: %v", err) - } - - return filepath.Join(basePath, path) -} diff --git a/internal/backup/backup.go b/internal/backup/backup.go index ccd481f..e80cb58 100644 --- a/internal/backup/backup.go +++ b/internal/backup/backup.go @@ -11,14 +11,14 @@ import ( "sync" "time" - "github.com/mizuchilabs/mantrae/internal/app" - "github.com/mizuchilabs/mantrae/internal/db" "github.com/mizuchilabs/mantrae/internal/settings" "github.com/mizuchilabs/mantrae/internal/storage" + "github.com/mizuchilabs/mantrae/internal/store" + "github.com/mizuchilabs/mantrae/internal/util" ) type BackupManager struct { - Conn *db.Connection + Conn *store.Connection Settings *settings.SettingsManager Storage storage.Backend stopChan chan struct{} @@ -26,10 +26,7 @@ type BackupManager struct { mu sync.Mutex } -func NewManager( - conn *db.Connection, - settings *settings.SettingsManager, -) *BackupManager { +func NewManager(conn *store.Connection, settings *settings.SettingsManager) *BackupManager { return &BackupManager{ Conn: conn, Settings: settings, @@ -184,7 +181,7 @@ func (m *BackupManager) Restore(ctx context.Context, backupName string) error { return fmt.Errorf("invalid backup file name") } - dbPath := app.ResolvePath("mantrae.db") + dbPath := util.ResolvePath("mantrae.db") walPath := dbPath + "-wal" shmPath := dbPath + "-shm" diff --git a/internal/config/setup.go b/internal/config/setup.go index 4063052..01e1d08 100644 --- a/internal/config/setup.go +++ b/internal/config/setup.go @@ -5,21 +5,19 @@ import ( "fmt" "log/slog" "os" - "strings" - "github.com/mizuchilabs/mantrae/internal/app" + "github.com/caarlos0/env/v11" + "github.com/google/uuid" "github.com/mizuchilabs/mantrae/internal/backup" "github.com/mizuchilabs/mantrae/internal/settings" - "github.com/mizuchilabs/mantrae/internal/source" "github.com/mizuchilabs/mantrae/internal/store" "github.com/mizuchilabs/mantrae/internal/store/db" "github.com/mizuchilabs/mantrae/internal/util" "github.com/mizuchilabs/mantrae/pkg/logger" - "golang.org/x/crypto/bcrypt" ) type App struct { - Config *app.Config + Secret string `env:"SECRET"` Conn *store.Connection BM *backup.BackupManager SM *settings.SettingsManager @@ -33,33 +31,21 @@ func Setup(ctx context.Context) (*App, error) { ParseFlags() // Read environment variables - config, err := app.ReadConfig() + app, err := env.ParseAs[App]() if err != nil { return nil, err } - conn := store.NewConnection("") + app.Conn = store.NewConnection("") + app.BM = backup.NewManager(app.Conn, app.SM) + app.BM.Start(ctx) - // Setup settings manager - sm := settings.NewSettingsManager(conn) - if err := sm.Initialize(ctx); err != nil { + app.SM = settings.NewManager(app.Conn) + if err := app.SM.Initialize(ctx); err != nil { return nil, fmt.Errorf("failed to initialize settings: %w", err) } - bm := backup.NewManager(conn, sm) - bm.Start(ctx) - - app := App{ - Config: config, - Conn: conn, - BM: bm, - SM: sm, - } - - if err := app.setDefaultAdminUser(ctx); err != nil { - return nil, err - } - if err := app.setDefaultProfile(ctx); err != nil { + if err := app.setupDefaultData(ctx); err != nil { return nil, err } @@ -68,128 +54,64 @@ func Setup(ctx context.Context) (*App, error) { return &app, nil } -func (a *App) setDefaultAdminUser(ctx context.Context) error { - // Generate password if not provided - password := os.Getenv("ADMIN_PASSWORD") - if password == "" { - password = util.GenPassword(32) - slog.Info( - "Generated new admin password (Please use ADMIN_PASSWORD env var to set it)", - "password", - password, - ) - } - - hash, err := util.HashPassword(password) - if err != nil { - return fmt.Errorf("failed to hash password: %w", err) - } - - // Try to get existing admin user +func (a *App) setupDefaultData(ctx context.Context) error { q := a.Conn.GetQuery() - user, err := q.GetUser(ctx, 1) - // If admin doesn't exist, create new admin + + // Ensure at least one admin user exists + admins, err := q.ListAdminUsers(ctx, db.ListAdminUsersParams{Limit: 1, Offset: 0}) if err != nil { - adminMail := "admin@mantrae" + return fmt.Errorf("failed to list admin users: %w", err) + } + + if len(admins) == 0 { + // Generate password if not provided + password := os.Getenv("ADMIN_PASSWORD") + if password == "" { + password = util.GenPassword(32) + slog.Info("Generated new admin", "password", password) + } + + hash, err := util.HashPassword(password) + if err != nil { + return fmt.Errorf("failed to hash password: %w", err) + } + + email := os.Getenv("ADMIN_EMAIL") + if email == "" { + email = "admin@localhost" + } + + id, err := uuid.NewV7() + if err != nil { + return fmt.Errorf("failed to generate UUID: %w", err) + } + if _, err = q.CreateUser(ctx, db.CreateUserParams{ + ID: id.String(), Username: "admin", - Email: &adminMail, Password: hash, + Email: &email, IsAdmin: true, }); err != nil { - return fmt.Errorf("failed to create default admin user: %w", err) + return fmt.Errorf("failed to create admin user: %w", err) } - slog.Info("Generated default 'admin' user") - return nil } - userPassword, err := q.GetUserPassword(ctx, user.ID) + // Ensure default profile exists + profiles, err := q.ListProfiles(ctx, db.ListProfilesParams{Limit: 1, Offset: 0}) if err != nil { - return fmt.Errorf("failed to get user password: %w", err) + return fmt.Errorf("failed to list profiles: %w", err) } - // Skip if password is correct - passwordErr := bcrypt.CompareHashAndPassword([]byte(userPassword), []byte(password)) - if passwordErr == nil { - return nil - } else { - // Update password on change - if err = q.UpdateUserPassword(ctx, db.UpdateUserPasswordParams{ - ID: user.ID, - Password: hash, + + if len(profiles) == 0 { + description := "Default profile" + if _, err := q.CreateProfile(ctx, db.CreateProfileParams{ + Name: "default", + Description: &description, }); err != nil { - return fmt.Errorf("failed to update default admin user password: %w", err) + return fmt.Errorf("failed to create default profile: %w", err) } } return nil } - -func (a *App) setDefaultProfile(ctx context.Context) error { - if a.Config.Traefik.URL == "" { - return nil - } - - if !strings.HasPrefix(a.Config.Traefik.URL, "http://") && - !strings.HasPrefix(a.Config.Traefik.URL, "https://") { - a.Config.Traefik.URL = "http://" + a.Config.Traefik.URL - } - - q := a.Conn.GetQuery() - profile, err := q.GetProfileByName(ctx, a.Config.Traefik.Profile) - if err != nil { - profile, err := q.CreateProfile(ctx, db.CreateProfileParams{ - Name: a.Config.Traefik.Profile, - }) - if err != nil { - return fmt.Errorf("failed to create default profile: %w", err) - } - - // Create default local config - if err := q.UpsertTraefikConfig(ctx, db.UpsertTraefikConfigParams{ - ProfileID: profile.ID, - Source: source.Local, - }); err != nil { - return fmt.Errorf("failed to create default profile: %w", err) - } - - slog.Info( - "Created default profile", - "url", - a.Config.Traefik.URL, - "username", - a.Config.Traefik.Username, - "password", - a.Config.Traefik.Password, - ) - return nil - } - - // Skip if profile is correct - if profile.Url == a.Config.Traefik.URL && - util.SafeDeref(profile.Username) == a.Config.Traefik.Username && - util.SafeDeref(profile.Password) == a.Config.Traefik.Password && - profile.Tls == a.Config.Traefik.TLS { - return nil - } - - if err := q.UpdateProfile(ctx, db.UpdateProfileParams{ - ID: profile.ID, - Name: a.Config.Traefik.Profile, - Url: a.Config.Traefik.URL, - Username: &a.Config.Traefik.Username, - Password: &a.Config.Traefik.Password, - Tls: a.Config.Traefik.TLS, - }); err != nil { - return fmt.Errorf("failed to update default profile: %w", err) - } - slog.Info( - "Updated default profile", - "url", - a.Config.Traefik.URL, - "username", - a.Config.Traefik.Username, - "password", - a.Config.Traefik.Password, - ) - return nil -} diff --git a/internal/config/tasks.go b/internal/config/tasks.go index 6596ad3..ddcfc2f 100644 --- a/internal/config/tasks.go +++ b/internal/config/tasks.go @@ -29,13 +29,23 @@ func (a *App) syncTraefik(ctx context.Context) { ticker := time.NewTicker(duration.Duration(time.Hour)) defer ticker.Stop() - traefik.GetTraefikConfig(a.Conn.Get()) for { select { case <-ctx.Done(): return case <-ticker.C: - traefik.GetTraefikConfig(a.Conn.Get()) + instances, err := a.Conn.GetQuery().ListTraefikInstances(ctx) + if err != nil { + slog.Error("failed to list traefik instances", "error", err) + continue + } + + for _, instance := range instances { + if err := traefik.UpdateTraefikAPI(a.Conn.Get(), instance.ID); err != nil { + slog.Error("failed to update traefik api", "error", err) + continue + } + } } } } diff --git a/internal/dns/client.go b/internal/dns/client.go index e4a9cc0..a191277 100644 --- a/internal/dns/client.go +++ b/internal/dns/client.go @@ -6,7 +6,7 @@ import ( "fmt" "log/slog" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store/db" "github.com/mizuchilabs/mantrae/internal/util" ) @@ -34,7 +34,7 @@ func getProvider(id int64, q *db.Queries) (DNSProvider, error) { return nil, fmt.Errorf("invalid provider id") } - provider, err := q.GetDNSProvider(context.Background(), id) + provider, err := q.GetDnsProvider(context.Background(), id) if err != nil { return nil, err } diff --git a/internal/settings/settings.go b/internal/settings/settings.go index aab4c06..227cafb 100644 --- a/internal/settings/settings.go +++ b/internal/settings/settings.go @@ -8,7 +8,8 @@ import ( "strconv" "time" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store" + "github.com/mizuchilabs/mantrae/internal/store/db" ) type SettingWithDescription struct { @@ -51,11 +52,11 @@ type Settings struct { } type SettingsManager struct { - conn *db.Connection + conn *store.Connection defaults *Settings } -func NewSettingsManager(conn *db.Connection) *SettingsManager { +func NewManager(conn *store.Connection) *SettingsManager { return &SettingsManager{ conn: conn, defaults: getDefaults(), diff --git a/internal/settings/validate.go b/internal/settings/validate.go index c1abf32..c5ce327 100644 --- a/internal/settings/validate.go +++ b/internal/settings/validate.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/mizuchilabs/mantrae/internal/db" + "github.com/mizuchilabs/mantrae/internal/store/db" ) func (sm *SettingsManager) validateSetting( diff --git a/internal/storage/local.go b/internal/storage/local.go index 7efefad..518521f 100644 --- a/internal/storage/local.go +++ b/internal/storage/local.go @@ -8,7 +8,7 @@ import ( "path/filepath" "sort" - "github.com/mizuchilabs/mantrae/internal/app" + "github.com/mizuchilabs/mantrae/internal/util" ) // LocalStorage implements StorageBackend for local filesystem @@ -17,7 +17,7 @@ type LocalStorage struct { } func NewLocalStorage(path string) (*LocalStorage, error) { - resolvedPath := app.ResolvePath(path) + resolvedPath := util.ResolvePath(path) if err := os.MkdirAll(resolvedPath, 0755); err != nil { return nil, fmt.Errorf("failed to create storage directory: %w", err) } diff --git a/internal/store/00000_base.sql b/internal/store/00000_base.sql index 7c94d15..9c1243a 100644 --- a/internal/store/00000_base.sql +++ b/internal/store/00000_base.sql @@ -1,5 +1,5 @@ -- +goose Up -CREATE TABLE "profiles" ( +CREATE TABLE profiles ( id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE, description TEXT, @@ -7,7 +7,7 @@ CREATE TABLE "profiles" ( updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); -CREATE TABLE "entry_points" ( +CREATE TABLE entry_points ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, name TEXT NOT NULL, @@ -21,13 +21,14 @@ CREATE TABLE "entry_points" ( CREATE TABLE http_routers ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -36,13 +37,14 @@ CREATE INDEX idx_http_routers_profile_name ON http_routers (profile_id, name); CREATE TABLE tcp_routers ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -51,13 +53,14 @@ CREATE INDEX idx_tcp_middlewares_profile_name ON tcp_middlewares (profile_id, na CREATE TABLE udp_routers ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -66,12 +69,13 @@ CREATE INDEX idx_udp_routers_profile_name ON udp_routers (profile_id, name); CREATE TABLE http_services ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -80,12 +84,13 @@ CREATE INDEX idx_http_services_profile_name ON http_services (profile_id, name); CREATE TABLE tcp_services ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -94,12 +99,13 @@ CREATE INDEX idx_tcp_services_profile_name ON tcp_services (profile_id, name); CREATE TABLE udp_services ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -108,13 +114,14 @@ CREATE INDEX idx_udp_services_profile_name ON udp_services (profile_id, name); CREATE TABLE http_middlewares ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -123,13 +130,14 @@ CREATE INDEX idx_http_middlewares_profile_name ON http_middlewares (profile_id, CREATE TABLE tcp_middlewares ( id INTEGER PRIMARY KEY, profile_id INTEGER NOT NULL, + agent_id TEXT, name TEXT NOT NULL, config TEXT NOT NULL, - source TEXT DEFAULT 'user' CHECK (source IN ('user', 'agent')), enabled BOOLEAN NOT NULL DEFAULT TRUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE, + FOREIGN KEY (agent_id) REFERENCES agents (id) ON DELETE CASCADE, UNIQUE (profile_id, name) ); @@ -142,6 +150,10 @@ CREATE TABLE traefik_instances ( overview TEXT, config TEXT, version TEXT, + url TEXT NOT NULL, + username TEXT, + password TEXT, + tls BOOLEAN NOT NULL DEFAULT FALSE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE diff --git a/internal/store/connection.go b/internal/store/connection.go index abe99b7..61dd9ac 100644 --- a/internal/store/connection.go +++ b/internal/store/connection.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/mizuchilabs/mantrae/internal/app" "github.com/mizuchilabs/mantrae/internal/store/db" + "github.com/mizuchilabs/mantrae/internal/util" "github.com/pressly/goose/v3" _ "modernc.org/sqlite" ) @@ -30,7 +30,7 @@ type Connection struct { func NewConnection(path string) *Connection { var dataSource string if path == "" { - dataSource = fmt.Sprintf("file:%s", filepath.ToSlash(app.ResolvePath("mantrae.db"))) + dataSource = fmt.Sprintf("file:%s", filepath.ToSlash(util.ResolvePath("mantrae.db"))) } else { dataSource = path } diff --git a/internal/store/db/agents.sql.go b/internal/store/db/agents.sql.go index 7583645..6a2272c 100644 --- a/internal/store/db/agents.sql.go +++ b/internal/store/db/agents.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: agents.sql package db @@ -11,11 +11,25 @@ import ( "github.com/mizuchilabs/mantrae/internal/store/schema" ) -const createAgent = `-- name: CreateAgent :exec +const countAgents = `-- name: CountAgents :one +SELECT + COUNT(*) +FROM + agents +` + +func (q *Queries) CountAgents(ctx context.Context) (int64, error) { + row := q.queryRow(ctx, q.countAgentsStmt, countAgents) + var count int64 + err := row.Scan(&count) + return count, err +} + +const createAgent = `-- name: CreateAgent :one INSERT INTO agents (id, profile_id, token, created_at) VALUES - (?, ?, ?, CURRENT_TIMESTAMP) + (?, ?, ?, CURRENT_TIMESTAMP) RETURNING id, profile_id, hostname, public_ip, private_ips, containers, active_ip, token, created_at, updated_at ` type CreateAgentParams struct { @@ -24,9 +38,22 @@ type CreateAgentParams struct { Token string `json:"token"` } -func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) error { - _, err := q.exec(ctx, q.createAgentStmt, createAgent, arg.ID, arg.ProfileID, arg.Token) - return err +func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error) { + row := q.queryRow(ctx, q.createAgentStmt, createAgent, arg.ID, arg.ProfileID, arg.Token) + var i Agent + err := row.Scan( + &i.ID, + &i.ProfileID, + &i.Hostname, + &i.PublicIp, + &i.PrivateIps, + &i.Containers, + &i.ActiveIp, + &i.Token, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err } const deleteAgent = `-- name: DeleteAgent :exec @@ -68,59 +95,28 @@ func (q *Queries) GetAgent(ctx context.Context, id string) (Agent, error) { } const listAgents = `-- name: ListAgents :many -SELECT - id, profile_id, hostname, public_ip, private_ips, containers, active_ip, token, created_at, updated_at -FROM - agents -ORDER BY - hostname -` - -func (q *Queries) ListAgents(ctx context.Context) ([]Agent, error) { - rows, err := q.query(ctx, q.listAgentsStmt, listAgents) - if err != nil { - return nil, err - } - defer rows.Close() - var items []Agent - for rows.Next() { - var i Agent - if err := rows.Scan( - &i.ID, - &i.ProfileID, - &i.Hostname, - &i.PublicIp, - &i.PrivateIps, - &i.Containers, - &i.ActiveIp, - &i.Token, - &i.CreatedAt, - &i.UpdatedAt, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const listAgentsByProfile = `-- name: ListAgentsByProfile :many SELECT id, profile_id, hostname, public_ip, private_ips, containers, active_ip, token, created_at, updated_at FROM agents WHERE profile_id = ? +ORDER BY + created_at DESC +LIMIT + ? +OFFSET + ? ` -func (q *Queries) ListAgentsByProfile(ctx context.Context, profileID int64) ([]Agent, error) { - rows, err := q.query(ctx, q.listAgentsByProfileStmt, listAgentsByProfile, profileID) +type ListAgentsParams struct { + ProfileID int64 `json:"profileId"` + Limit int64 `json:"limit"` + Offset int64 `json:"offset"` +} + +func (q *Queries) ListAgents(ctx context.Context, arg ListAgentsParams) ([]Agent, error) { + rows, err := q.query(ctx, q.listAgentsStmt, listAgents, arg.ProfileID, arg.Limit, arg.Offset) if err != nil { return nil, err } diff --git a/internal/store/db/db.go b/internal/store/db/db.go index 1fff7ac..6d38520 100644 --- a/internal/store/db/db.go +++ b/internal/store/db/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 package db @@ -24,6 +24,9 @@ func New(db DBTX) *Queries { func Prepare(ctx context.Context, db DBTX) (*Queries, error) { q := Queries{db: db} var err error + if q.countAgentsStmt, err = db.PrepareContext(ctx, countAgents); err != nil { + return nil, fmt.Errorf("error preparing query CountAgents: %w", err) + } if q.countDnsProvidersStmt, err = db.PrepareContext(ctx, countDnsProviders); err != nil { return nil, fmt.Errorf("error preparing query CountDnsProviders: %w", err) } @@ -195,23 +198,23 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) { if q.getHttpMiddlewareStmt, err = db.PrepareContext(ctx, getHttpMiddleware); err != nil { return nil, fmt.Errorf("error preparing query GetHttpMiddleware: %w", err) } - if q.getHttpMiddlewareByProfileStmt, err = db.PrepareContext(ctx, getHttpMiddlewareByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetHttpMiddlewareByProfile: %w", err) + if q.getHttpMiddlewaresByProfileStmt, err = db.PrepareContext(ctx, getHttpMiddlewaresByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetHttpMiddlewaresByProfile: %w", err) } if q.getHttpRouterStmt, err = db.PrepareContext(ctx, getHttpRouter); err != nil { return nil, fmt.Errorf("error preparing query GetHttpRouter: %w", err) } - if q.getHttpRouterByProfileStmt, err = db.PrepareContext(ctx, getHttpRouterByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetHttpRouterByProfile: %w", err) - } if q.getHttpRouterDNSProviderStmt, err = db.PrepareContext(ctx, getHttpRouterDNSProvider); err != nil { return nil, fmt.Errorf("error preparing query GetHttpRouterDNSProvider: %w", err) } + if q.getHttpRoutersByProfileStmt, err = db.PrepareContext(ctx, getHttpRoutersByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetHttpRoutersByProfile: %w", err) + } if q.getHttpServiceStmt, err = db.PrepareContext(ctx, getHttpService); err != nil { return nil, fmt.Errorf("error preparing query GetHttpService: %w", err) } - if q.getHttpServiceByProfileStmt, err = db.PrepareContext(ctx, getHttpServiceByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetHttpServiceByProfile: %w", err) + if q.getHttpServicesByProfileStmt, err = db.PrepareContext(ctx, getHttpServicesByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetHttpServicesByProfile: %w", err) } if q.getProfileStmt, err = db.PrepareContext(ctx, getProfile); err != nil { return nil, fmt.Errorf("error preparing query GetProfile: %w", err) @@ -225,23 +228,23 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) { if q.getTcpMiddlewareStmt, err = db.PrepareContext(ctx, getTcpMiddleware); err != nil { return nil, fmt.Errorf("error preparing query GetTcpMiddleware: %w", err) } - if q.getTcpMiddlewareByProfileStmt, err = db.PrepareContext(ctx, getTcpMiddlewareByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetTcpMiddlewareByProfile: %w", err) + if q.getTcpMiddlewaresByProfileStmt, err = db.PrepareContext(ctx, getTcpMiddlewaresByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetTcpMiddlewaresByProfile: %w", err) } if q.getTcpRouterStmt, err = db.PrepareContext(ctx, getTcpRouter); err != nil { return nil, fmt.Errorf("error preparing query GetTcpRouter: %w", err) } - if q.getTcpRouterByProfileStmt, err = db.PrepareContext(ctx, getTcpRouterByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetTcpRouterByProfile: %w", err) - } if q.getTcpRouterDNSProviderStmt, err = db.PrepareContext(ctx, getTcpRouterDNSProvider); err != nil { return nil, fmt.Errorf("error preparing query GetTcpRouterDNSProvider: %w", err) } + if q.getTcpRoutersByProfileStmt, err = db.PrepareContext(ctx, getTcpRoutersByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetTcpRoutersByProfile: %w", err) + } if q.getTcpServiceStmt, err = db.PrepareContext(ctx, getTcpService); err != nil { return nil, fmt.Errorf("error preparing query GetTcpService: %w", err) } - if q.getTcpServiceByProfileStmt, err = db.PrepareContext(ctx, getTcpServiceByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetTcpServiceByProfile: %w", err) + if q.getTcpServicesByProfileStmt, err = db.PrepareContext(ctx, getTcpServicesByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetTcpServicesByProfile: %w", err) } if q.getTraefikInstanceStmt, err = db.PrepareContext(ctx, getTraefikInstance); err != nil { return nil, fmt.Errorf("error preparing query GetTraefikInstance: %w", err) @@ -252,17 +255,17 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) { if q.getUdpRouterStmt, err = db.PrepareContext(ctx, getUdpRouter); err != nil { return nil, fmt.Errorf("error preparing query GetUdpRouter: %w", err) } - if q.getUdpRouterByProfileStmt, err = db.PrepareContext(ctx, getUdpRouterByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetUdpRouterByProfile: %w", err) - } if q.getUdpRouterDNSProviderStmt, err = db.PrepareContext(ctx, getUdpRouterDNSProvider); err != nil { return nil, fmt.Errorf("error preparing query GetUdpRouterDNSProvider: %w", err) } + if q.getUdpRoutersByProfileStmt, err = db.PrepareContext(ctx, getUdpRoutersByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetUdpRoutersByProfile: %w", err) + } if q.getUdpServiceStmt, err = db.PrepareContext(ctx, getUdpService); err != nil { return nil, fmt.Errorf("error preparing query GetUdpService: %w", err) } - if q.getUdpServiceByProfileStmt, err = db.PrepareContext(ctx, getUdpServiceByProfile); err != nil { - return nil, fmt.Errorf("error preparing query GetUdpServiceByProfile: %w", err) + if q.getUdpServicesByProfileStmt, err = db.PrepareContext(ctx, getUdpServicesByProfile); err != nil { + return nil, fmt.Errorf("error preparing query GetUdpServicesByProfile: %w", err) } if q.getUserByEmailStmt, err = db.PrepareContext(ctx, getUserByEmail); err != nil { return nil, fmt.Errorf("error preparing query GetUserByEmail: %w", err) @@ -273,12 +276,12 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) { if q.getUserByUsernameStmt, err = db.PrepareContext(ctx, getUserByUsername); err != nil { return nil, fmt.Errorf("error preparing query GetUserByUsername: %w", err) } + if q.listAdminUsersStmt, err = db.PrepareContext(ctx, listAdminUsers); err != nil { + return nil, fmt.Errorf("error preparing query ListAdminUsers: %w", err) + } if q.listAgentsStmt, err = db.PrepareContext(ctx, listAgents); err != nil { return nil, fmt.Errorf("error preparing query ListAgents: %w", err) } - if q.listAgentsByProfileStmt, err = db.PrepareContext(ctx, listAgentsByProfile); err != nil { - return nil, fmt.Errorf("error preparing query ListAgentsByProfile: %w", err) - } if q.listDnsProvidersStmt, err = db.PrepareContext(ctx, listDnsProviders); err != nil { return nil, fmt.Errorf("error preparing query ListDnsProviders: %w", err) } @@ -404,6 +407,11 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) { func (q *Queries) Close() error { var err error + if q.countAgentsStmt != nil { + if cerr := q.countAgentsStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing countAgentsStmt: %w", cerr) + } + } if q.countDnsProvidersStmt != nil { if cerr := q.countDnsProvidersStmt.Close(); cerr != nil { err = fmt.Errorf("error closing countDnsProvidersStmt: %w", cerr) @@ -689,9 +697,9 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getHttpMiddlewareStmt: %w", cerr) } } - if q.getHttpMiddlewareByProfileStmt != nil { - if cerr := q.getHttpMiddlewareByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getHttpMiddlewareByProfileStmt: %w", cerr) + if q.getHttpMiddlewaresByProfileStmt != nil { + if cerr := q.getHttpMiddlewaresByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getHttpMiddlewaresByProfileStmt: %w", cerr) } } if q.getHttpRouterStmt != nil { @@ -699,24 +707,24 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getHttpRouterStmt: %w", cerr) } } - if q.getHttpRouterByProfileStmt != nil { - if cerr := q.getHttpRouterByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getHttpRouterByProfileStmt: %w", cerr) - } - } if q.getHttpRouterDNSProviderStmt != nil { if cerr := q.getHttpRouterDNSProviderStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getHttpRouterDNSProviderStmt: %w", cerr) } } + if q.getHttpRoutersByProfileStmt != nil { + if cerr := q.getHttpRoutersByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getHttpRoutersByProfileStmt: %w", cerr) + } + } if q.getHttpServiceStmt != nil { if cerr := q.getHttpServiceStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getHttpServiceStmt: %w", cerr) } } - if q.getHttpServiceByProfileStmt != nil { - if cerr := q.getHttpServiceByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getHttpServiceByProfileStmt: %w", cerr) + if q.getHttpServicesByProfileStmt != nil { + if cerr := q.getHttpServicesByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getHttpServicesByProfileStmt: %w", cerr) } } if q.getProfileStmt != nil { @@ -739,9 +747,9 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getTcpMiddlewareStmt: %w", cerr) } } - if q.getTcpMiddlewareByProfileStmt != nil { - if cerr := q.getTcpMiddlewareByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getTcpMiddlewareByProfileStmt: %w", cerr) + if q.getTcpMiddlewaresByProfileStmt != nil { + if cerr := q.getTcpMiddlewaresByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getTcpMiddlewaresByProfileStmt: %w", cerr) } } if q.getTcpRouterStmt != nil { @@ -749,24 +757,24 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getTcpRouterStmt: %w", cerr) } } - if q.getTcpRouterByProfileStmt != nil { - if cerr := q.getTcpRouterByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getTcpRouterByProfileStmt: %w", cerr) - } - } if q.getTcpRouterDNSProviderStmt != nil { if cerr := q.getTcpRouterDNSProviderStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getTcpRouterDNSProviderStmt: %w", cerr) } } + if q.getTcpRoutersByProfileStmt != nil { + if cerr := q.getTcpRoutersByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getTcpRoutersByProfileStmt: %w", cerr) + } + } if q.getTcpServiceStmt != nil { if cerr := q.getTcpServiceStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getTcpServiceStmt: %w", cerr) } } - if q.getTcpServiceByProfileStmt != nil { - if cerr := q.getTcpServiceByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getTcpServiceByProfileStmt: %w", cerr) + if q.getTcpServicesByProfileStmt != nil { + if cerr := q.getTcpServicesByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getTcpServicesByProfileStmt: %w", cerr) } } if q.getTraefikInstanceStmt != nil { @@ -784,24 +792,24 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getUdpRouterStmt: %w", cerr) } } - if q.getUdpRouterByProfileStmt != nil { - if cerr := q.getUdpRouterByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getUdpRouterByProfileStmt: %w", cerr) - } - } if q.getUdpRouterDNSProviderStmt != nil { if cerr := q.getUdpRouterDNSProviderStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getUdpRouterDNSProviderStmt: %w", cerr) } } + if q.getUdpRoutersByProfileStmt != nil { + if cerr := q.getUdpRoutersByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getUdpRoutersByProfileStmt: %w", cerr) + } + } if q.getUdpServiceStmt != nil { if cerr := q.getUdpServiceStmt.Close(); cerr != nil { err = fmt.Errorf("error closing getUdpServiceStmt: %w", cerr) } } - if q.getUdpServiceByProfileStmt != nil { - if cerr := q.getUdpServiceByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing getUdpServiceByProfileStmt: %w", cerr) + if q.getUdpServicesByProfileStmt != nil { + if cerr := q.getUdpServicesByProfileStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing getUdpServicesByProfileStmt: %w", cerr) } } if q.getUserByEmailStmt != nil { @@ -819,16 +827,16 @@ func (q *Queries) Close() error { err = fmt.Errorf("error closing getUserByUsernameStmt: %w", cerr) } } + if q.listAdminUsersStmt != nil { + if cerr := q.listAdminUsersStmt.Close(); cerr != nil { + err = fmt.Errorf("error closing listAdminUsersStmt: %w", cerr) + } + } if q.listAgentsStmt != nil { if cerr := q.listAgentsStmt.Close(); cerr != nil { err = fmt.Errorf("error closing listAgentsStmt: %w", cerr) } } - if q.listAgentsByProfileStmt != nil { - if cerr := q.listAgentsByProfileStmt.Close(); cerr != nil { - err = fmt.Errorf("error closing listAgentsByProfileStmt: %w", cerr) - } - } if q.listDnsProvidersStmt != nil { if cerr := q.listDnsProvidersStmt.Close(); cerr != nil { err = fmt.Errorf("error closing listDnsProvidersStmt: %w", cerr) @@ -1068,6 +1076,7 @@ func (q *Queries) queryRow(ctx context.Context, stmt *sql.Stmt, query string, ar type Queries struct { db DBTX tx *sql.Tx + countAgentsStmt *sql.Stmt countDnsProvidersStmt *sql.Stmt countEntryPointsStmt *sql.Stmt countHttpMiddlewaresStmt *sql.Stmt @@ -1125,34 +1134,34 @@ type Queries struct { getEntryPointStmt *sql.Stmt getErrorsByProfileStmt *sql.Stmt getHttpMiddlewareStmt *sql.Stmt - getHttpMiddlewareByProfileStmt *sql.Stmt + getHttpMiddlewaresByProfileStmt *sql.Stmt getHttpRouterStmt *sql.Stmt - getHttpRouterByProfileStmt *sql.Stmt getHttpRouterDNSProviderStmt *sql.Stmt + getHttpRoutersByProfileStmt *sql.Stmt getHttpServiceStmt *sql.Stmt - getHttpServiceByProfileStmt *sql.Stmt + getHttpServicesByProfileStmt *sql.Stmt getProfileStmt *sql.Stmt getProfileByNameStmt *sql.Stmt getSettingStmt *sql.Stmt getTcpMiddlewareStmt *sql.Stmt - getTcpMiddlewareByProfileStmt *sql.Stmt + getTcpMiddlewaresByProfileStmt *sql.Stmt getTcpRouterStmt *sql.Stmt - getTcpRouterByProfileStmt *sql.Stmt getTcpRouterDNSProviderStmt *sql.Stmt + getTcpRoutersByProfileStmt *sql.Stmt getTcpServiceStmt *sql.Stmt - getTcpServiceByProfileStmt *sql.Stmt + getTcpServicesByProfileStmt *sql.Stmt getTraefikInstanceStmt *sql.Stmt getTraefikInstanceByProfileStmt *sql.Stmt getUdpRouterStmt *sql.Stmt - getUdpRouterByProfileStmt *sql.Stmt getUdpRouterDNSProviderStmt *sql.Stmt + getUdpRoutersByProfileStmt *sql.Stmt getUdpServiceStmt *sql.Stmt - getUdpServiceByProfileStmt *sql.Stmt + getUdpServicesByProfileStmt *sql.Stmt getUserByEmailStmt *sql.Stmt getUserByIDStmt *sql.Stmt getUserByUsernameStmt *sql.Stmt + listAdminUsersStmt *sql.Stmt listAgentsStmt *sql.Stmt - listAgentsByProfileStmt *sql.Stmt listDnsProvidersStmt *sql.Stmt listEntryPointsStmt *sql.Stmt listErrorsStmt *sql.Stmt @@ -1199,6 +1208,7 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries { return &Queries{ db: tx, tx: tx, + countAgentsStmt: q.countAgentsStmt, countDnsProvidersStmt: q.countDnsProvidersStmt, countEntryPointsStmt: q.countEntryPointsStmt, countHttpMiddlewaresStmt: q.countHttpMiddlewaresStmt, @@ -1256,34 +1266,34 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries { getEntryPointStmt: q.getEntryPointStmt, getErrorsByProfileStmt: q.getErrorsByProfileStmt, getHttpMiddlewareStmt: q.getHttpMiddlewareStmt, - getHttpMiddlewareByProfileStmt: q.getHttpMiddlewareByProfileStmt, + getHttpMiddlewaresByProfileStmt: q.getHttpMiddlewaresByProfileStmt, getHttpRouterStmt: q.getHttpRouterStmt, - getHttpRouterByProfileStmt: q.getHttpRouterByProfileStmt, getHttpRouterDNSProviderStmt: q.getHttpRouterDNSProviderStmt, + getHttpRoutersByProfileStmt: q.getHttpRoutersByProfileStmt, getHttpServiceStmt: q.getHttpServiceStmt, - getHttpServiceByProfileStmt: q.getHttpServiceByProfileStmt, + getHttpServicesByProfileStmt: q.getHttpServicesByProfileStmt, getProfileStmt: q.getProfileStmt, getProfileByNameStmt: q.getProfileByNameStmt, getSettingStmt: q.getSettingStmt, getTcpMiddlewareStmt: q.getTcpMiddlewareStmt, - getTcpMiddlewareByProfileStmt: q.getTcpMiddlewareByProfileStmt, + getTcpMiddlewaresByProfileStmt: q.getTcpMiddlewaresByProfileStmt, getTcpRouterStmt: q.getTcpRouterStmt, - getTcpRouterByProfileStmt: q.getTcpRouterByProfileStmt, getTcpRouterDNSProviderStmt: q.getTcpRouterDNSProviderStmt, + getTcpRoutersByProfileStmt: q.getTcpRoutersByProfileStmt, getTcpServiceStmt: q.getTcpServiceStmt, - getTcpServiceByProfileStmt: q.getTcpServiceByProfileStmt, + getTcpServicesByProfileStmt: q.getTcpServicesByProfileStmt, getTraefikInstanceStmt: q.getTraefikInstanceStmt, getTraefikInstanceByProfileStmt: q.getTraefikInstanceByProfileStmt, getUdpRouterStmt: q.getUdpRouterStmt, - getUdpRouterByProfileStmt: q.getUdpRouterByProfileStmt, getUdpRouterDNSProviderStmt: q.getUdpRouterDNSProviderStmt, + getUdpRoutersByProfileStmt: q.getUdpRoutersByProfileStmt, getUdpServiceStmt: q.getUdpServiceStmt, - getUdpServiceByProfileStmt: q.getUdpServiceByProfileStmt, + getUdpServicesByProfileStmt: q.getUdpServicesByProfileStmt, getUserByEmailStmt: q.getUserByEmailStmt, getUserByIDStmt: q.getUserByIDStmt, getUserByUsernameStmt: q.getUserByUsernameStmt, + listAdminUsersStmt: q.listAdminUsersStmt, listAgentsStmt: q.listAgentsStmt, - listAgentsByProfileStmt: q.listAgentsByProfileStmt, listDnsProvidersStmt: q.listDnsProvidersStmt, listEntryPointsStmt: q.listEntryPointsStmt, listErrorsStmt: q.listErrorsStmt, diff --git a/internal/store/db/dns_providers.sql.go b/internal/store/db/dns_providers.sql.go index 639ceed..ea7dcf3 100644 --- a/internal/store/db/dns_providers.sql.go +++ b/internal/store/db/dns_providers.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: dns_providers.sql package db diff --git a/internal/store/db/entry_points.sql.go b/internal/store/db/entry_points.sql.go index a6f7ec9..10576bb 100644 --- a/internal/store/db/entry_points.sql.go +++ b/internal/store/db/entry_points.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: entry_points.sql package db diff --git a/internal/store/db/errors.sql.go b/internal/store/db/errors.sql.go index 3a37eaa..02758e3 100644 --- a/internal/store/db/errors.sql.go +++ b/internal/store/db/errors.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: errors.sql package db diff --git a/internal/store/db/http_middlewares.sql.go b/internal/store/db/http_middlewares.sql.go index 737f5dc..070e305 100644 --- a/internal/store/db/http_middlewares.sql.go +++ b/internal/store/db/http_middlewares.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: http_middlewares.sql package db @@ -29,9 +29,9 @@ const createHttpMiddleware = `-- name: CreateHttpMiddleware :one INSERT INTO http_middlewares ( profile_id, + agent_id, name, config, - source, enabled, created_at, updated_at @@ -45,32 +45,32 @@ VALUES ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - ) RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + ) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type CreateHttpMiddlewareParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Middleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` } func (q *Queries) CreateHttpMiddleware(ctx context.Context, arg CreateHttpMiddlewareParams) (HttpMiddleware, error) { row := q.queryRow(ctx, q.createHttpMiddlewareStmt, createHttpMiddleware, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, arg.Enabled, ) var i HttpMiddleware err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -91,7 +91,7 @@ func (q *Queries) DeleteHttpMiddleware(ctx context.Context, id int64) error { const getHttpMiddleware = `-- name: GetHttpMiddleware :one SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_middlewares WHERE @@ -104,9 +104,9 @@ func (q *Queries) GetHttpMiddleware(ctx context.Context, id int64) (HttpMiddlewa err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -114,34 +114,50 @@ func (q *Queries) GetHttpMiddleware(ctx context.Context, id int64) (HttpMiddlewa return i, err } -const getHttpMiddlewareByProfile = `-- name: GetHttpMiddlewareByProfile :one +const getHttpMiddlewaresByProfile = `-- name: GetHttpMiddlewaresByProfile :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_middlewares WHERE profile_id = ? ` -func (q *Queries) GetHttpMiddlewareByProfile(ctx context.Context, profileID int64) (HttpMiddleware, error) { - row := q.queryRow(ctx, q.getHttpMiddlewareByProfileStmt, getHttpMiddlewareByProfile, profileID) - var i HttpMiddleware - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.Enabled, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetHttpMiddlewaresByProfile(ctx context.Context, profileID int64) ([]HttpMiddleware, error) { + rows, err := q.query(ctx, q.getHttpMiddlewaresByProfileStmt, getHttpMiddlewaresByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []HttpMiddleware + for rows.Next() { + var i HttpMiddleware + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.Enabled, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listHttpMiddlewares = `-- name: ListHttpMiddlewares :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_middlewares ORDER BY @@ -169,9 +185,9 @@ func (q *Queries) ListHttpMiddlewares(ctx context.Context, arg ListHttpMiddlewar if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -194,17 +210,15 @@ UPDATE http_middlewares SET name = ?, config = ?, - source = ?, enabled = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type UpdateHttpMiddlewareParams struct { Name string `json:"name"` Config *dynamic.Middleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` ID int64 `json:"id"` } @@ -213,7 +227,6 @@ func (q *Queries) UpdateHttpMiddleware(ctx context.Context, arg UpdateHttpMiddle row := q.queryRow(ctx, q.updateHttpMiddlewareStmt, updateHttpMiddleware, arg.Name, arg.Config, - arg.Source, arg.Enabled, arg.ID, ) @@ -221,9 +234,9 @@ func (q *Queries) UpdateHttpMiddleware(ctx context.Context, arg UpdateHttpMiddle err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/store/db/http_router_dns_provider.sql.go b/internal/store/db/http_router_dns_provider.sql.go index 54876c6..a263a3b 100644 --- a/internal/store/db/http_router_dns_provider.sql.go +++ b/internal/store/db/http_router_dns_provider.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: http_router_dns_provider.sql package db diff --git a/internal/store/db/http_routers.sql.go b/internal/store/db/http_routers.sql.go index 2f45ebb..f0629a9 100644 --- a/internal/store/db/http_routers.sql.go +++ b/internal/store/db/http_routers.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: http_routers.sql package db @@ -29,37 +29,37 @@ const createHttpRouter = `-- name: CreateHttpRouter :one INSERT INTO http_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type CreateHttpRouterParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Router `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateHttpRouter(ctx context.Context, arg CreateHttpRouterParams) (HttpRouter, error) { row := q.queryRow(ctx, q.createHttpRouterStmt, createHttpRouter, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i HttpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -80,7 +80,7 @@ func (q *Queries) DeleteHttpRouter(ctx context.Context, id int64) error { const getHttpRouter = `-- name: GetHttpRouter :one SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_routers WHERE @@ -93,9 +93,9 @@ func (q *Queries) GetHttpRouter(ctx context.Context, id int64) (HttpRouter, erro err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -103,34 +103,50 @@ func (q *Queries) GetHttpRouter(ctx context.Context, id int64) (HttpRouter, erro return i, err } -const getHttpRouterByProfile = `-- name: GetHttpRouterByProfile :one +const getHttpRoutersByProfile = `-- name: GetHttpRoutersByProfile :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_routers WHERE profile_id = ? ` -func (q *Queries) GetHttpRouterByProfile(ctx context.Context, profileID int64) (HttpRouter, error) { - row := q.queryRow(ctx, q.getHttpRouterByProfileStmt, getHttpRouterByProfile, profileID) - var i HttpRouter - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.Enabled, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetHttpRoutersByProfile(ctx context.Context, profileID int64) ([]HttpRouter, error) { + rows, err := q.query(ctx, q.getHttpRoutersByProfileStmt, getHttpRoutersByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []HttpRouter + for rows.Next() { + var i HttpRouter + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.Enabled, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listHttpRouters = `-- name: ListHttpRouters :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM http_routers ORDER BY @@ -158,9 +174,9 @@ func (q *Queries) ListHttpRouters(ctx context.Context, arg ListHttpRoutersParams if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -183,33 +199,26 @@ UPDATE http_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type UpdateHttpRouterParams struct { Name string `json:"name"` Config *dynamic.Router `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateHttpRouter(ctx context.Context, arg UpdateHttpRouterParams) (HttpRouter, error) { - row := q.queryRow(ctx, q.updateHttpRouterStmt, updateHttpRouter, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateHttpRouterStmt, updateHttpRouter, arg.Name, arg.Config, arg.ID) var i HttpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/store/db/http_services.sql.go b/internal/store/db/http_services.sql.go index 2a9cbaf..f72643a 100644 --- a/internal/store/db/http_services.sql.go +++ b/internal/store/db/http_services.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: http_services.sql package db @@ -29,37 +29,37 @@ const createHttpService = `-- name: CreateHttpService :one INSERT INTO http_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type CreateHttpServiceParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Service `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateHttpService(ctx context.Context, arg CreateHttpServiceParams) (HttpService, error) { row := q.queryRow(ctx, q.createHttpServiceStmt, createHttpService, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i HttpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) @@ -79,7 +79,7 @@ func (q *Queries) DeleteHttpService(ctx context.Context, id int64) error { const getHttpService = `-- name: GetHttpService :one SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM http_services WHERE @@ -92,42 +92,58 @@ func (q *Queries) GetHttpService(ctx context.Context, id int64) (HttpService, er err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) return i, err } -const getHttpServiceByProfile = `-- name: GetHttpServiceByProfile :one +const getHttpServicesByProfile = `-- name: GetHttpServicesByProfile :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM http_services WHERE profile_id = ? ` -func (q *Queries) GetHttpServiceByProfile(ctx context.Context, profileID int64) (HttpService, error) { - row := q.queryRow(ctx, q.getHttpServiceByProfileStmt, getHttpServiceByProfile, profileID) - var i HttpService - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetHttpServicesByProfile(ctx context.Context, profileID int64) ([]HttpService, error) { + rows, err := q.query(ctx, q.getHttpServicesByProfileStmt, getHttpServicesByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []HttpService + for rows.Next() { + var i HttpService + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listHttpServices = `-- name: ListHttpServices :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM http_services ORDER BY @@ -155,9 +171,9 @@ func (q *Queries) ListHttpServices(ctx context.Context, arg ListHttpServicesPara if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -179,33 +195,26 @@ UPDATE http_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type UpdateHttpServiceParams struct { Name string `json:"name"` Config *dynamic.Service `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateHttpService(ctx context.Context, arg UpdateHttpServiceParams) (HttpService, error) { - row := q.queryRow(ctx, q.updateHttpServiceStmt, updateHttpService, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateHttpServiceStmt, updateHttpService, arg.Name, arg.Config, arg.ID) var i HttpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) diff --git a/internal/store/db/models.go b/internal/store/db/models.go index fb08dda..85f75e1 100644 --- a/internal/store/db/models.go +++ b/internal/store/db/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 package db @@ -56,9 +56,9 @@ type Error struct { type HttpMiddleware struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Middleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -67,9 +67,9 @@ type HttpMiddleware struct { type HttpRouter struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Router `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -83,9 +83,9 @@ type HttpRouterDnsProvider struct { type HttpService struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.Service `json:"config"` - Source *string `json:"source"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` } @@ -108,9 +108,9 @@ type Setting struct { type TcpMiddleware struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPMiddleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -119,9 +119,9 @@ type TcpMiddleware struct { type TcpRouter struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPRouter `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -135,9 +135,9 @@ type TcpRouterDnsProvider struct { type TcpService struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPService `json:"config"` - Source *string `json:"source"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` } @@ -145,10 +145,14 @@ type TcpService struct { type TraefikInstance struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` - Entrypoints *schema.EntryPoint `json:"entrypoints"` + Entrypoints *schema.EntryPoints `json:"entrypoints"` Overview *schema.Overview `json:"overview"` Config *schema.Configuration `json:"config"` Version *string `json:"version"` + Url string `json:"url"` + Username *string `json:"username"` + Password *string `json:"password"` + Tls bool `json:"tls"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` } @@ -156,9 +160,9 @@ type TraefikInstance struct { type UdpRouter struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.UDPRouter `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -172,9 +176,9 @@ type UdpRouterDnsProvider struct { type UdpService struct { ID int64 `json:"id"` ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.UDPService `json:"config"` - Source *string `json:"source"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` } diff --git a/internal/store/db/profiles.sql.go b/internal/store/db/profiles.sql.go index 14b8408..b090b87 100644 --- a/internal/store/db/profiles.sql.go +++ b/internal/store/db/profiles.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: profiles.sql package db @@ -25,19 +25,18 @@ func (q *Queries) CountProfiles(ctx context.Context) (int64, error) { const createProfile = `-- name: CreateProfile :one INSERT INTO - profiles (id, name, description, created_at, updated_at) + profiles (name, description, created_at, updated_at) VALUES - (?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, name, description, created_at, updated_at + (?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, name, description, created_at, updated_at ` type CreateProfileParams struct { - ID int64 `json:"id"` Name string `json:"name"` Description *string `json:"description"` } func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error) { - row := q.queryRow(ctx, q.createProfileStmt, createProfile, arg.ID, arg.Name, arg.Description) + row := q.queryRow(ctx, q.createProfileStmt, createProfile, arg.Name, arg.Description) var i Profile err := row.Scan( &i.ID, diff --git a/internal/store/db/querier.go b/internal/store/db/querier.go index 1e7e33b..31ca5f5 100644 --- a/internal/store/db/querier.go +++ b/internal/store/db/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 package db @@ -9,6 +9,7 @@ import ( ) type Querier interface { + CountAgents(ctx context.Context) (int64, error) CountDnsProviders(ctx context.Context) (int64, error) CountEntryPoints(ctx context.Context) (int64, error) CountHttpMiddlewares(ctx context.Context) (int64, error) @@ -22,7 +23,7 @@ type Querier interface { CountUdpRouters(ctx context.Context) (int64, error) CountUdpServices(ctx context.Context) (int64, error) CountUsers(ctx context.Context) (int64, error) - CreateAgent(ctx context.Context, arg CreateAgentParams) error + CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error) CreateDnsProvider(ctx context.Context, arg CreateDnsProviderParams) (DnsProvider, error) CreateEntryPoint(ctx context.Context, arg CreateEntryPointParams) (EntryPoint, error) CreateHttpMiddleware(ctx context.Context, arg CreateHttpMiddlewareParams) (HttpMiddleware, error) @@ -66,34 +67,34 @@ type Querier interface { GetEntryPoint(ctx context.Context, id int64) (EntryPoint, error) GetErrorsByProfile(ctx context.Context, profileID int64) ([]Error, error) GetHttpMiddleware(ctx context.Context, id int64) (HttpMiddleware, error) - GetHttpMiddlewareByProfile(ctx context.Context, profileID int64) (HttpMiddleware, error) + GetHttpMiddlewaresByProfile(ctx context.Context, profileID int64) ([]HttpMiddleware, error) GetHttpRouter(ctx context.Context, id int64) (HttpRouter, error) - GetHttpRouterByProfile(ctx context.Context, profileID int64) (HttpRouter, error) GetHttpRouterDNSProvider(ctx context.Context, arg GetHttpRouterDNSProviderParams) (HttpRouterDnsProvider, error) + GetHttpRoutersByProfile(ctx context.Context, profileID int64) ([]HttpRouter, error) GetHttpService(ctx context.Context, id int64) (HttpService, error) - GetHttpServiceByProfile(ctx context.Context, profileID int64) (HttpService, error) + GetHttpServicesByProfile(ctx context.Context, profileID int64) ([]HttpService, error) GetProfile(ctx context.Context, id int64) (Profile, error) GetProfileByName(ctx context.Context, name string) (Profile, error) GetSetting(ctx context.Context, key string) (Setting, error) GetTcpMiddleware(ctx context.Context, id int64) (TcpMiddleware, error) - GetTcpMiddlewareByProfile(ctx context.Context, profileID int64) (TcpMiddleware, error) + GetTcpMiddlewaresByProfile(ctx context.Context, profileID int64) ([]TcpMiddleware, error) GetTcpRouter(ctx context.Context, id int64) (TcpRouter, error) - GetTcpRouterByProfile(ctx context.Context, profileID int64) (TcpRouter, error) GetTcpRouterDNSProvider(ctx context.Context, arg GetTcpRouterDNSProviderParams) (TcpRouterDnsProvider, error) + GetTcpRoutersByProfile(ctx context.Context, profileID int64) ([]TcpRouter, error) GetTcpService(ctx context.Context, id int64) (TcpService, error) - GetTcpServiceByProfile(ctx context.Context, profileID int64) (TcpService, error) + GetTcpServicesByProfile(ctx context.Context, profileID int64) ([]TcpService, error) GetTraefikInstance(ctx context.Context, id int64) (TraefikInstance, error) GetTraefikInstanceByProfile(ctx context.Context, profileID int64) (TraefikInstance, error) GetUdpRouter(ctx context.Context, id int64) (UdpRouter, error) - GetUdpRouterByProfile(ctx context.Context, profileID int64) (UdpRouter, error) GetUdpRouterDNSProvider(ctx context.Context, arg GetUdpRouterDNSProviderParams) (UdpRouterDnsProvider, error) + GetUdpRoutersByProfile(ctx context.Context, profileID int64) ([]UdpRouter, error) GetUdpService(ctx context.Context, id int64) (UdpService, error) - GetUdpServiceByProfile(ctx context.Context, profileID int64) (UdpService, error) + GetUdpServicesByProfile(ctx context.Context, profileID int64) ([]UdpService, error) GetUserByEmail(ctx context.Context, email *string) (User, error) GetUserByID(ctx context.Context, id string) (User, error) GetUserByUsername(ctx context.Context, username string) (User, error) - ListAgents(ctx context.Context) ([]Agent, error) - ListAgentsByProfile(ctx context.Context, profileID int64) ([]Agent, error) + ListAdminUsers(ctx context.Context, arg ListAdminUsersParams) ([]User, error) + ListAgents(ctx context.Context, arg ListAgentsParams) ([]Agent, error) ListDnsProviders(ctx context.Context, arg ListDnsProvidersParams) ([]DnsProvider, error) ListEntryPoints(ctx context.Context, arg ListEntryPointsParams) ([]EntryPoint, error) ListErrors(ctx context.Context) ([]Error, error) diff --git a/internal/store/db/settings.sql.go b/internal/store/db/settings.sql.go index 58f699c..319396c 100644 --- a/internal/store/db/settings.sql.go +++ b/internal/store/db/settings.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: settings.sql package db diff --git a/internal/store/db/tcp_middlewares.sql.go b/internal/store/db/tcp_middlewares.sql.go index fc71e55..9165f00 100644 --- a/internal/store/db/tcp_middlewares.sql.go +++ b/internal/store/db/tcp_middlewares.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: tcp_middlewares.sql package db @@ -29,9 +29,9 @@ const createTcpMiddleware = `-- name: CreateTcpMiddleware :one INSERT INTO tcp_middlewares ( profile_id, + agent_id, name, config, - source, enabled, created_at, updated_at @@ -45,32 +45,32 @@ VALUES ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - ) RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + ) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type CreateTcpMiddlewareParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPMiddleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` } func (q *Queries) CreateTcpMiddleware(ctx context.Context, arg CreateTcpMiddlewareParams) (TcpMiddleware, error) { row := q.queryRow(ctx, q.createTcpMiddlewareStmt, createTcpMiddleware, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, arg.Enabled, ) var i TcpMiddleware err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -91,7 +91,7 @@ func (q *Queries) DeleteTcpMiddleware(ctx context.Context, id int64) error { const getTcpMiddleware = `-- name: GetTcpMiddleware :one SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_middlewares WHERE @@ -104,9 +104,9 @@ func (q *Queries) GetTcpMiddleware(ctx context.Context, id int64) (TcpMiddleware err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -114,34 +114,50 @@ func (q *Queries) GetTcpMiddleware(ctx context.Context, id int64) (TcpMiddleware return i, err } -const getTcpMiddlewareByProfile = `-- name: GetTcpMiddlewareByProfile :one +const getTcpMiddlewaresByProfile = `-- name: GetTcpMiddlewaresByProfile :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_middlewares WHERE profile_id = ? ` -func (q *Queries) GetTcpMiddlewareByProfile(ctx context.Context, profileID int64) (TcpMiddleware, error) { - row := q.queryRow(ctx, q.getTcpMiddlewareByProfileStmt, getTcpMiddlewareByProfile, profileID) - var i TcpMiddleware - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.Enabled, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetTcpMiddlewaresByProfile(ctx context.Context, profileID int64) ([]TcpMiddleware, error) { + rows, err := q.query(ctx, q.getTcpMiddlewaresByProfileStmt, getTcpMiddlewaresByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []TcpMiddleware + for rows.Next() { + var i TcpMiddleware + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.Enabled, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listTcpMiddlewares = `-- name: ListTcpMiddlewares :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_middlewares ORDER BY @@ -169,9 +185,9 @@ func (q *Queries) ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewares if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -194,17 +210,15 @@ UPDATE tcp_middlewares SET name = ?, config = ?, - source = ?, enabled = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type UpdateTcpMiddlewareParams struct { Name string `json:"name"` Config *dynamic.TCPMiddleware `json:"config"` - Source *string `json:"source"` Enabled bool `json:"enabled"` ID int64 `json:"id"` } @@ -213,7 +227,6 @@ func (q *Queries) UpdateTcpMiddleware(ctx context.Context, arg UpdateTcpMiddlewa row := q.queryRow(ctx, q.updateTcpMiddlewareStmt, updateTcpMiddleware, arg.Name, arg.Config, - arg.Source, arg.Enabled, arg.ID, ) @@ -221,9 +234,9 @@ func (q *Queries) UpdateTcpMiddleware(ctx context.Context, arg UpdateTcpMiddlewa err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/store/db/tcp_router_dns_provider.sql.go b/internal/store/db/tcp_router_dns_provider.sql.go index 777d146..926b97f 100644 --- a/internal/store/db/tcp_router_dns_provider.sql.go +++ b/internal/store/db/tcp_router_dns_provider.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: tcp_router_dns_provider.sql package db diff --git a/internal/store/db/tcp_routers.sql.go b/internal/store/db/tcp_routers.sql.go index 10a908b..ddf52ef 100644 --- a/internal/store/db/tcp_routers.sql.go +++ b/internal/store/db/tcp_routers.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: tcp_routers.sql package db @@ -29,37 +29,37 @@ const createTcpRouter = `-- name: CreateTcpRouter :one INSERT INTO tcp_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type CreateTcpRouterParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPRouter `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateTcpRouter(ctx context.Context, arg CreateTcpRouterParams) (TcpRouter, error) { row := q.queryRow(ctx, q.createTcpRouterStmt, createTcpRouter, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i TcpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -80,7 +80,7 @@ func (q *Queries) DeleteTcpRouter(ctx context.Context, id int64) error { const getTcpRouter = `-- name: GetTcpRouter :one SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_routers WHERE @@ -93,9 +93,9 @@ func (q *Queries) GetTcpRouter(ctx context.Context, id int64) (TcpRouter, error) err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -103,34 +103,50 @@ func (q *Queries) GetTcpRouter(ctx context.Context, id int64) (TcpRouter, error) return i, err } -const getTcpRouterByProfile = `-- name: GetTcpRouterByProfile :one +const getTcpRoutersByProfile = `-- name: GetTcpRoutersByProfile :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_routers WHERE profile_id = ? ` -func (q *Queries) GetTcpRouterByProfile(ctx context.Context, profileID int64) (TcpRouter, error) { - row := q.queryRow(ctx, q.getTcpRouterByProfileStmt, getTcpRouterByProfile, profileID) - var i TcpRouter - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.Enabled, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetTcpRoutersByProfile(ctx context.Context, profileID int64) ([]TcpRouter, error) { + rows, err := q.query(ctx, q.getTcpRoutersByProfileStmt, getTcpRoutersByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []TcpRouter + for rows.Next() { + var i TcpRouter + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.Enabled, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listTcpRouters = `-- name: ListTcpRouters :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM tcp_routers ORDER BY @@ -158,9 +174,9 @@ func (q *Queries) ListTcpRouters(ctx context.Context, arg ListTcpRoutersParams) if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -183,33 +199,26 @@ UPDATE tcp_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type UpdateTcpRouterParams struct { Name string `json:"name"` Config *dynamic.TCPRouter `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateTcpRouter(ctx context.Context, arg UpdateTcpRouterParams) (TcpRouter, error) { - row := q.queryRow(ctx, q.updateTcpRouterStmt, updateTcpRouter, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateTcpRouterStmt, updateTcpRouter, arg.Name, arg.Config, arg.ID) var i TcpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/store/db/tcp_services.sql.go b/internal/store/db/tcp_services.sql.go index 6f7028e..8099863 100644 --- a/internal/store/db/tcp_services.sql.go +++ b/internal/store/db/tcp_services.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: tcp_services.sql package db @@ -29,37 +29,37 @@ const createTcpService = `-- name: CreateTcpService :one INSERT INTO tcp_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type CreateTcpServiceParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.TCPService `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateTcpService(ctx context.Context, arg CreateTcpServiceParams) (TcpService, error) { row := q.queryRow(ctx, q.createTcpServiceStmt, createTcpService, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i TcpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) @@ -79,7 +79,7 @@ func (q *Queries) DeleteTcpService(ctx context.Context, id int64) error { const getTcpService = `-- name: GetTcpService :one SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM tcp_services WHERE @@ -92,42 +92,58 @@ func (q *Queries) GetTcpService(ctx context.Context, id int64) (TcpService, erro err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) return i, err } -const getTcpServiceByProfile = `-- name: GetTcpServiceByProfile :one +const getTcpServicesByProfile = `-- name: GetTcpServicesByProfile :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM tcp_services WHERE profile_id = ? ` -func (q *Queries) GetTcpServiceByProfile(ctx context.Context, profileID int64) (TcpService, error) { - row := q.queryRow(ctx, q.getTcpServiceByProfileStmt, getTcpServiceByProfile, profileID) - var i TcpService - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetTcpServicesByProfile(ctx context.Context, profileID int64) ([]TcpService, error) { + rows, err := q.query(ctx, q.getTcpServicesByProfileStmt, getTcpServicesByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []TcpService + for rows.Next() { + var i TcpService + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listTcpServices = `-- name: ListTcpServices :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM tcp_services ORDER BY @@ -155,9 +171,9 @@ func (q *Queries) ListTcpServices(ctx context.Context, arg ListTcpServicesParams if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -179,33 +195,26 @@ UPDATE tcp_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type UpdateTcpServiceParams struct { Name string `json:"name"` Config *dynamic.TCPService `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateTcpService(ctx context.Context, arg UpdateTcpServiceParams) (TcpService, error) { - row := q.queryRow(ctx, q.updateTcpServiceStmt, updateTcpService, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateTcpServiceStmt, updateTcpService, arg.Name, arg.Config, arg.ID) var i TcpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) diff --git a/internal/store/db/traefik_instances.sql.go b/internal/store/db/traefik_instances.sql.go index a0b5e9b..963da8b 100644 --- a/internal/store/db/traefik_instances.sql.go +++ b/internal/store/db/traefik_instances.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: traefik_instances.sql package db @@ -30,10 +30,10 @@ INSERT INTO traefik_instances ( id, profile_id, - entrypoints, - overview, - config, - version, + url, + username, + password, + tls, created_at, updated_at ) @@ -47,26 +47,26 @@ VALUES ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - ) RETURNING id, profile_id, entrypoints, overview, config, version, created_at, updated_at + ) RETURNING id, profile_id, entrypoints, overview, config, version, url, username, password, tls, created_at, updated_at ` type CreateTraefikInstanceParams struct { - ID int64 `json:"id"` - ProfileID int64 `json:"profileId"` - Entrypoints *schema.EntryPoint `json:"entrypoints"` - Overview *schema.Overview `json:"overview"` - Config *schema.Configuration `json:"config"` - Version *string `json:"version"` + ID int64 `json:"id"` + ProfileID int64 `json:"profileId"` + Url string `json:"url"` + Username *string `json:"username"` + Password *string `json:"password"` + Tls bool `json:"tls"` } func (q *Queries) CreateTraefikInstance(ctx context.Context, arg CreateTraefikInstanceParams) (TraefikInstance, error) { row := q.queryRow(ctx, q.createTraefikInstanceStmt, createTraefikInstance, arg.ID, arg.ProfileID, - arg.Entrypoints, - arg.Overview, - arg.Config, - arg.Version, + arg.Url, + arg.Username, + arg.Password, + arg.Tls, ) var i TraefikInstance err := row.Scan( @@ -76,6 +76,10 @@ func (q *Queries) CreateTraefikInstance(ctx context.Context, arg CreateTraefikIn &i.Overview, &i.Config, &i.Version, + &i.Url, + &i.Username, + &i.Password, + &i.Tls, &i.CreatedAt, &i.UpdatedAt, ) @@ -95,7 +99,7 @@ func (q *Queries) DeleteTraefikInstance(ctx context.Context, id int64) error { const getTraefikInstance = `-- name: GetTraefikInstance :one SELECT - id, profile_id, entrypoints, overview, config, version, created_at, updated_at + id, profile_id, entrypoints, overview, config, version, url, username, password, tls, created_at, updated_at FROM traefik_instances WHERE @@ -112,6 +116,10 @@ func (q *Queries) GetTraefikInstance(ctx context.Context, id int64) (TraefikInst &i.Overview, &i.Config, &i.Version, + &i.Url, + &i.Username, + &i.Password, + &i.Tls, &i.CreatedAt, &i.UpdatedAt, ) @@ -120,7 +128,7 @@ func (q *Queries) GetTraefikInstance(ctx context.Context, id int64) (TraefikInst const getTraefikInstanceByProfile = `-- name: GetTraefikInstanceByProfile :one SELECT - id, profile_id, entrypoints, overview, config, version, created_at, updated_at + id, profile_id, entrypoints, overview, config, version, url, username, password, tls, created_at, updated_at FROM traefik_instances WHERE @@ -137,6 +145,10 @@ func (q *Queries) GetTraefikInstanceByProfile(ctx context.Context, profileID int &i.Overview, &i.Config, &i.Version, + &i.Url, + &i.Username, + &i.Password, + &i.Tls, &i.CreatedAt, &i.UpdatedAt, ) @@ -145,7 +157,7 @@ func (q *Queries) GetTraefikInstanceByProfile(ctx context.Context, profileID int const listTraefikInstances = `-- name: ListTraefikInstances :many SELECT - id, profile_id, entrypoints, overview, config, version, created_at, updated_at + id, profile_id, entrypoints, overview, config, version, url, username, password, tls, created_at, updated_at FROM traefik_instances ORDER BY @@ -168,6 +180,10 @@ func (q *Queries) ListTraefikInstances(ctx context.Context) ([]TraefikInstance, &i.Overview, &i.Config, &i.Version, + &i.Url, + &i.Username, + &i.Password, + &i.Tls, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -187,17 +203,25 @@ func (q *Queries) ListTraefikInstances(ctx context.Context) ([]TraefikInstance, const updateTraefikInstance = `-- name: UpdateTraefikInstance :one UPDATE traefik_instances SET + url = ?, + username = ?, + password = ?, + tls = ?, entrypoints = ?, overview = ?, config = ?, version = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, entrypoints, overview, config, version, created_at, updated_at + id = ? RETURNING id, profile_id, entrypoints, overview, config, version, url, username, password, tls, created_at, updated_at ` type UpdateTraefikInstanceParams struct { - Entrypoints *schema.EntryPoint `json:"entrypoints"` + Url string `json:"url"` + Username *string `json:"username"` + Password *string `json:"password"` + Tls bool `json:"tls"` + Entrypoints *schema.EntryPoints `json:"entrypoints"` Overview *schema.Overview `json:"overview"` Config *schema.Configuration `json:"config"` Version *string `json:"version"` @@ -206,6 +230,10 @@ type UpdateTraefikInstanceParams struct { func (q *Queries) UpdateTraefikInstance(ctx context.Context, arg UpdateTraefikInstanceParams) (TraefikInstance, error) { row := q.queryRow(ctx, q.updateTraefikInstanceStmt, updateTraefikInstance, + arg.Url, + arg.Username, + arg.Password, + arg.Tls, arg.Entrypoints, arg.Overview, arg.Config, @@ -220,6 +248,10 @@ func (q *Queries) UpdateTraefikInstance(ctx context.Context, arg UpdateTraefikIn &i.Overview, &i.Config, &i.Version, + &i.Url, + &i.Username, + &i.Password, + &i.Tls, &i.CreatedAt, &i.UpdatedAt, ) diff --git a/internal/store/db/udp_router_dns_provider.sql.go b/internal/store/db/udp_router_dns_provider.sql.go index 8f4fed5..1230311 100644 --- a/internal/store/db/udp_router_dns_provider.sql.go +++ b/internal/store/db/udp_router_dns_provider.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: udp_router_dns_provider.sql package db diff --git a/internal/store/db/udp_routers.sql.go b/internal/store/db/udp_routers.sql.go index be60bcc..99d306f 100644 --- a/internal/store/db/udp_routers.sql.go +++ b/internal/store/db/udp_routers.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: udp_routers.sql package db @@ -29,37 +29,37 @@ const createUdpRouter = `-- name: CreateUdpRouter :one INSERT INTO udp_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type CreateUdpRouterParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.UDPRouter `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateUdpRouter(ctx context.Context, arg CreateUdpRouterParams) (UdpRouter, error) { row := q.queryRow(ctx, q.createUdpRouterStmt, createUdpRouter, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i UdpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -80,7 +80,7 @@ func (q *Queries) DeleteUdpRouter(ctx context.Context, id int64) error { const getUdpRouter = `-- name: GetUdpRouter :one SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM udp_routers WHERE @@ -93,9 +93,9 @@ func (q *Queries) GetUdpRouter(ctx context.Context, id int64) (UdpRouter, error) err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -103,34 +103,50 @@ func (q *Queries) GetUdpRouter(ctx context.Context, id int64) (UdpRouter, error) return i, err } -const getUdpRouterByProfile = `-- name: GetUdpRouterByProfile :one +const getUdpRoutersByProfile = `-- name: GetUdpRoutersByProfile :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM udp_routers WHERE profile_id = ? ` -func (q *Queries) GetUdpRouterByProfile(ctx context.Context, profileID int64) (UdpRouter, error) { - row := q.queryRow(ctx, q.getUdpRouterByProfileStmt, getUdpRouterByProfile, profileID) - var i UdpRouter - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.Enabled, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetUdpRoutersByProfile(ctx context.Context, profileID int64) ([]UdpRouter, error) { + rows, err := q.query(ctx, q.getUdpRoutersByProfileStmt, getUdpRoutersByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []UdpRouter + for rows.Next() { + var i UdpRouter + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.Enabled, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listUdpRouters = `-- name: ListUdpRouters :many SELECT - id, profile_id, name, config, source, enabled, created_at, updated_at + id, profile_id, agent_id, name, config, enabled, created_at, updated_at FROM udp_routers ORDER BY @@ -158,9 +174,9 @@ func (q *Queries) ListUdpRouters(ctx context.Context, arg ListUdpRoutersParams) if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, @@ -183,33 +199,26 @@ UPDATE udp_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, enabled, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at ` type UpdateUdpRouterParams struct { Name string `json:"name"` Config *dynamic.UDPRouter `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateUdpRouter(ctx context.Context, arg UpdateUdpRouterParams) (UdpRouter, error) { - row := q.queryRow(ctx, q.updateUdpRouterStmt, updateUdpRouter, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateUdpRouterStmt, updateUdpRouter, arg.Name, arg.Config, arg.ID) var i UdpRouter err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.Enabled, &i.CreatedAt, &i.UpdatedAt, diff --git a/internal/store/db/udp_services.sql.go b/internal/store/db/udp_services.sql.go index fbc95aa..cae7e4f 100644 --- a/internal/store/db/udp_services.sql.go +++ b/internal/store/db/udp_services.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: udp_services.sql package db @@ -29,37 +29,37 @@ const createUdpService = `-- name: CreateUdpService :one INSERT INTO udp_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) VALUES - (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, name, config, source, created_at, updated_at + (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type CreateUdpServiceParams struct { ProfileID int64 `json:"profileId"` + AgentID *string `json:"agentId"` Name string `json:"name"` Config *dynamic.UDPService `json:"config"` - Source *string `json:"source"` } func (q *Queries) CreateUdpService(ctx context.Context, arg CreateUdpServiceParams) (UdpService, error) { row := q.queryRow(ctx, q.createUdpServiceStmt, createUdpService, arg.ProfileID, + arg.AgentID, arg.Name, arg.Config, - arg.Source, ) var i UdpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) @@ -79,7 +79,7 @@ func (q *Queries) DeleteUdpService(ctx context.Context, id int64) error { const getUdpService = `-- name: GetUdpService :one SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM udp_services WHERE @@ -92,42 +92,58 @@ func (q *Queries) GetUdpService(ctx context.Context, id int64) (UdpService, erro err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) return i, err } -const getUdpServiceByProfile = `-- name: GetUdpServiceByProfile :one +const getUdpServicesByProfile = `-- name: GetUdpServicesByProfile :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM udp_services WHERE profile_id = ? ` -func (q *Queries) GetUdpServiceByProfile(ctx context.Context, profileID int64) (UdpService, error) { - row := q.queryRow(ctx, q.getUdpServiceByProfileStmt, getUdpServiceByProfile, profileID) - var i UdpService - err := row.Scan( - &i.ID, - &i.ProfileID, - &i.Name, - &i.Config, - &i.Source, - &i.CreatedAt, - &i.UpdatedAt, - ) - return i, err +func (q *Queries) GetUdpServicesByProfile(ctx context.Context, profileID int64) ([]UdpService, error) { + rows, err := q.query(ctx, q.getUdpServicesByProfileStmt, getUdpServicesByProfile, profileID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []UdpService + for rows.Next() { + var i UdpService + if err := rows.Scan( + &i.ID, + &i.ProfileID, + &i.AgentID, + &i.Name, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil } const listUdpServices = `-- name: ListUdpServices :many SELECT - id, profile_id, name, config, source, created_at, updated_at + id, profile_id, agent_id, name, config, created_at, updated_at FROM udp_services ORDER BY @@ -155,9 +171,9 @@ func (q *Queries) ListUdpServices(ctx context.Context, arg ListUdpServicesParams if err := rows.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -179,33 +195,26 @@ UPDATE udp_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE - id = ? RETURNING id, profile_id, name, config, source, created_at, updated_at + id = ? RETURNING id, profile_id, agent_id, name, config, created_at, updated_at ` type UpdateUdpServiceParams struct { Name string `json:"name"` Config *dynamic.UDPService `json:"config"` - Source *string `json:"source"` ID int64 `json:"id"` } func (q *Queries) UpdateUdpService(ctx context.Context, arg UpdateUdpServiceParams) (UdpService, error) { - row := q.queryRow(ctx, q.updateUdpServiceStmt, updateUdpService, - arg.Name, - arg.Config, - arg.Source, - arg.ID, - ) + row := q.queryRow(ctx, q.updateUdpServiceStmt, updateUdpService, arg.Name, arg.Config, arg.ID) var i UdpService err := row.Scan( &i.ID, &i.ProfileID, + &i.AgentID, &i.Name, &i.Config, - &i.Source, &i.CreatedAt, &i.UpdatedAt, ) diff --git a/internal/store/db/users.sql.go b/internal/store/db/users.sql.go index a485f87..7ebd7a8 100644 --- a/internal/store/db/users.sql.go +++ b/internal/store/db/users.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.29.0 +// sqlc v1.28.0 // source: users.sql package db @@ -26,12 +26,13 @@ func (q *Queries) CountUsers(ctx context.Context) (int64, error) { const createUser = `-- name: CreateUser :one INSERT INTO - users (username, password, email, is_admin) + users (id, username, password, email, is_admin) VALUES - (?, ?, ?, ?) RETURNING id, username, password, email, is_admin, otp, otp_expiry, last_login, created_at, updated_at + (?, ?, ?, ?, ?) RETURNING id, username, password, email, is_admin, otp, otp_expiry, last_login, created_at, updated_at ` type CreateUserParams struct { + ID string `json:"id"` Username string `json:"username"` Password string `json:"password"` Email *string `json:"email"` @@ -40,6 +41,7 @@ type CreateUserParams struct { func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { row := q.queryRow(ctx, q.createUserStmt, createUser, + arg.ID, arg.Username, arg.Password, arg.Email, @@ -153,6 +155,60 @@ func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, return i, err } +const listAdminUsers = `-- name: ListAdminUsers :many +SELECT + id, username, password, email, is_admin, otp, otp_expiry, last_login, created_at, updated_at +FROM + users +WHERE + is_admin = TRUE +ORDER BY + username +LIMIT + ? +OFFSET + ? +` + +type ListAdminUsersParams struct { + Limit int64 `json:"limit"` + Offset int64 `json:"offset"` +} + +func (q *Queries) ListAdminUsers(ctx context.Context, arg ListAdminUsersParams) ([]User, error) { + rows, err := q.query(ctx, q.listAdminUsersStmt, listAdminUsers, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + var items []User + for rows.Next() { + var i User + if err := rows.Scan( + &i.ID, + &i.Username, + &i.Password, + &i.Email, + &i.IsAdmin, + &i.Otp, + &i.OtpExpiry, + &i.LastLogin, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const listUsers = `-- name: ListUsers :many SELECT id, username, password, email, is_admin, otp, otp_expiry, last_login, created_at, updated_at diff --git a/internal/store/queries/agents.sql b/internal/store/queries/agents.sql index a7ee2b1..65e80db 100644 --- a/internal/store/queries/agents.sql +++ b/internal/store/queries/agents.sql @@ -1,8 +1,8 @@ --- name: CreateAgent :exec +-- name: CreateAgent :one INSERT INTO agents (id, profile_id, token, created_at) VALUES - (?, ?, ?, CURRENT_TIMESTAMP); + (?, ?, ?, CURRENT_TIMESTAMP) RETURNING *; -- name: GetAgent :one SELECT @@ -13,20 +13,24 @@ WHERE id = ?; -- name: ListAgents :many -SELECT - * -FROM - agents -ORDER BY - hostname; - --- name: ListAgentsByProfile :many SELECT * FROM agents WHERE - profile_id = ?; + profile_id = ? +ORDER BY + created_at DESC +LIMIT + ? +OFFSET + ?; + +-- name: CountAgents :one +SELECT + COUNT(*) +FROM + agents; -- name: UpdateAgent :one UPDATE agents diff --git a/internal/store/queries/http_middlewares.sql b/internal/store/queries/http_middlewares.sql index a47b213..ee6305d 100644 --- a/internal/store/queries/http_middlewares.sql +++ b/internal/store/queries/http_middlewares.sql @@ -2,9 +2,9 @@ INSERT INTO http_middlewares ( profile_id, + agent_id, name, config, - source, enabled, created_at, updated_at @@ -28,7 +28,7 @@ FROM WHERE id = ?; --- name: GetHttpMiddlewareByProfile :one +-- name: GetHttpMiddlewaresByProfile :many SELECT * FROM @@ -59,7 +59,6 @@ UPDATE http_middlewares SET name = ?, config = ?, - source = ?, enabled = ?, updated_at = CURRENT_TIMESTAMP WHERE diff --git a/internal/store/queries/http_routers.sql b/internal/store/queries/http_routers.sql index efe9fdf..e3fe1e4 100644 --- a/internal/store/queries/http_routers.sql +++ b/internal/store/queries/http_routers.sql @@ -2,9 +2,9 @@ INSERT INTO http_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetHttpRouterByProfile :one +-- name: GetHttpRoutersByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE http_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/http_services.sql b/internal/store/queries/http_services.sql index dcb6650..a269701 100644 --- a/internal/store/queries/http_services.sql +++ b/internal/store/queries/http_services.sql @@ -2,9 +2,9 @@ INSERT INTO http_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetHttpServiceByProfile :one +-- name: GetHttpServicesByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE http_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/profiles.sql b/internal/store/queries/profiles.sql index 1f006e5..d6d3d22 100644 --- a/internal/store/queries/profiles.sql +++ b/internal/store/queries/profiles.sql @@ -1,8 +1,8 @@ -- name: CreateProfile :one INSERT INTO - profiles (id, name, description, created_at, updated_at) + profiles (name, description, created_at, updated_at) VALUES - (?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *; + (?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *; -- name: GetProfile :one SELECT diff --git a/internal/store/queries/tcp_middlewares.sql b/internal/store/queries/tcp_middlewares.sql index 3a64c3e..d672750 100644 --- a/internal/store/queries/tcp_middlewares.sql +++ b/internal/store/queries/tcp_middlewares.sql @@ -2,9 +2,9 @@ INSERT INTO tcp_middlewares ( profile_id, + agent_id, name, config, - source, enabled, created_at, updated_at @@ -28,7 +28,7 @@ FROM WHERE id = ?; --- name: GetTcpMiddlewareByProfile :one +-- name: GetTcpMiddlewaresByProfile :many SELECT * FROM @@ -59,7 +59,6 @@ UPDATE tcp_middlewares SET name = ?, config = ?, - source = ?, enabled = ?, updated_at = CURRENT_TIMESTAMP WHERE diff --git a/internal/store/queries/tcp_routers.sql b/internal/store/queries/tcp_routers.sql index 7b06159..10d022d 100644 --- a/internal/store/queries/tcp_routers.sql +++ b/internal/store/queries/tcp_routers.sql @@ -2,9 +2,9 @@ INSERT INTO tcp_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetTcpRouterByProfile :one +-- name: GetTcpRoutersByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE tcp_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/tcp_services.sql b/internal/store/queries/tcp_services.sql index 54e5f43..a7756e5 100644 --- a/internal/store/queries/tcp_services.sql +++ b/internal/store/queries/tcp_services.sql @@ -2,9 +2,9 @@ INSERT INTO tcp_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetTcpServiceByProfile :one +-- name: GetTcpServicesByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE tcp_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/traefik_instances.sql b/internal/store/queries/traefik_instances.sql index 9b87564..cd5af78 100644 --- a/internal/store/queries/traefik_instances.sql +++ b/internal/store/queries/traefik_instances.sql @@ -3,10 +3,10 @@ INSERT INTO traefik_instances ( id, profile_id, - entrypoints, - overview, - config, - version, + url, + username, + password, + tls, created_at, updated_at ) @@ -55,6 +55,10 @@ FROM -- name: UpdateTraefikInstance :one UPDATE traefik_instances SET + url = ?, + username = ?, + password = ?, + tls = ?, entrypoints = ?, overview = ?, config = ?, diff --git a/internal/store/queries/udp_routers.sql b/internal/store/queries/udp_routers.sql index 3f3444f..4cf4e9a 100644 --- a/internal/store/queries/udp_routers.sql +++ b/internal/store/queries/udp_routers.sql @@ -2,9 +2,9 @@ INSERT INTO udp_routers ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetUdpRouterByProfile :one +-- name: GetUdpRoutersByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE udp_routers SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/udp_services.sql b/internal/store/queries/udp_services.sql index 353a527..3777dde 100644 --- a/internal/store/queries/udp_services.sql +++ b/internal/store/queries/udp_services.sql @@ -2,9 +2,9 @@ INSERT INTO udp_services ( profile_id, + agent_id, name, config, - source, created_at, updated_at ) @@ -19,7 +19,7 @@ FROM WHERE id = ?; --- name: GetUdpServiceByProfile :one +-- name: GetUdpServicesByProfile :many SELECT * FROM @@ -50,7 +50,6 @@ UPDATE udp_services SET name = ?, config = ?, - source = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING *; diff --git a/internal/store/queries/users.sql b/internal/store/queries/users.sql index 74c2b14..7f2cec6 100644 --- a/internal/store/queries/users.sql +++ b/internal/store/queries/users.sql @@ -1,8 +1,8 @@ -- name: CreateUser :one INSERT INTO - users (username, password, email, is_admin) + users (id, username, password, email, is_admin) VALUES - (?, ?, ?, ?) RETURNING *; + (?, ?, ?, ?, ?) RETURNING *; -- name: GetUserByID :one SELECT @@ -40,6 +40,20 @@ LIMIT OFFSET ?; +-- name: ListAdminUsers :many +SELECT + * +FROM + users +WHERE + is_admin = TRUE +ORDER BY + username +LIMIT + ? +OFFSET + ?; + -- name: CountUsers :one SELECT COUNT(*) diff --git a/internal/store/schema/traefik.go b/internal/store/schema/traefik.go index bc133ef..7d37bd4 100644 --- a/internal/store/schema/traefik.go +++ b/internal/store/schema/traefik.go @@ -1,25 +1,29 @@ package schema import ( + "time" + "github.com/traefik/traefik/v3/pkg/config/runtime" "github.com/traefik/traefik/v3/pkg/types" ) // EntryPoint ----------------------------------------------------------------- +type EntryPoints []EntryPoint + type EntryPoint struct { - Name string `json:"name,omitempty"` - Address string `json:"address,omitempty"` - AllowACMEByPass bool `json:"allow_acme_by_pass,omitempty"` - ReusePort bool `json:"reuse_port,omitempty"` - AsDefault bool `json:"as_default,omitempty"` - // Transport *EntryPointsTransport `json:"transport,omitempty"` - ProxyProtocol *ProxyProtocol `json:"proxy_protocol,omitempty"` - ForwardedHeaders *ForwardedHeaders `json:"forwarded_headers,omitempty"` - HTTP HTTPConfig `json:"http"` - HTTP2 *HTTP2Config `json:"http_2,omitempty"` - HTTP3 *HTTP3Config `json:"http_3,omitempty"` - // UDP *UDPConfig `json:"udp,omitempty"` - Observability *ObservabilityConfig `json:"observability,omitempty"` + Name string `json:"name,omitempty"` + Address string `json:"address,omitempty"` + AllowACMEByPass bool `json:"allow_acme_by_pass,omitempty"` + ReusePort bool `json:"reuse_port,omitempty"` + AsDefault bool `json:"as_default,omitempty"` + Transport *EntryPointsTransport `json:"transport,omitempty"` + ProxyProtocol *ProxyProtocol `json:"proxy_protocol,omitempty"` + ForwardedHeaders *ForwardedHeaders `json:"forwarded_headers,omitempty"` + HTTP HTTPConfig `json:"http"` + HTTP2 *HTTP2Config `json:"http_2,omitempty"` + HTTP3 *HTTP3Config `json:"http_3,omitempty"` + UDP *UDPConfig `json:"udp,omitempty"` + Observability *ObservabilityConfig `json:"observability,omitempty"` } type TLSConfig struct { @@ -51,9 +55,9 @@ type HTTP3Config struct { AdvertisedPort int `json:"advertised_port,omitempty"` } -// type UDPConfig struct { -// Timeout ptypes.Duration `json:"timeout,omitempty"` -// } +type UDPConfig struct { + Timeout time.Duration `json:"timeout,omitempty"` +} type ObservabilityConfig struct { AccessLogs *bool `json:"access_logs,omitempty"` @@ -77,12 +81,12 @@ type ProxyProtocol struct { TrustedIPs []string `json:"trusted_i_ps,omitempty"` } -// type EntryPointsTransport struct { -// // LifeCycle *LifeCycle -// // RespondingTimeouts *RespondingTimeouts -// KeepAliveMaxTime ptypes.Duration -// KeepAliveMaxRequests int -// } +type EntryPointsTransport struct { + // LifeCycle *LifeCycle + // RespondingTimeouts *RespondingTimeouts + KeepAliveMaxTime time.Duration + KeepAliveMaxRequests int +} // Overview ------------------------------------------------------------------- type Overview struct { @@ -123,3 +127,10 @@ type serviceInfoRepresentation struct { *runtime.ServiceInfo ServerStatus map[string]string `json:"serverStatus,omitempty"` } + +// Version ------------------------------------------------------------------- +type Version struct { + Version string `json:"version,omitempty"` + Codename string `json:"codename,omitempty"` + StartDate string `json:"startDate,omitempty"` +} diff --git a/internal/traefik/agent.go b/internal/traefik/agent.go deleted file mode 100644 index 11130f5..0000000 --- a/internal/traefik/agent.go +++ /dev/null @@ -1,104 +0,0 @@ -package traefik - -import ( - "context" - "database/sql" - "fmt" - - "github.com/mizuchilabs/mantrae/internal/db" - "github.com/traefik/paerser/parser" - "github.com/traefik/traefik/v3/pkg/config/dynamic" - "github.com/traefik/traefik/v3/pkg/config/runtime" - "golang.org/x/exp/maps" -) - -func DecodeAgentConfig(DB *sql.DB, agent db.Agent) error { - // Initialize merged configuration - params := db.UpsertTraefikAgentConfigParams{ - ProfileID: agent.ProfileID, - AgentID: &agent.ID, - Config: &db.TraefikConfiguration{ - Routers: make(map[string]*runtime.RouterInfo), - Middlewares: make(map[string]*runtime.MiddlewareInfo), - Services: make(map[string]*db.ServiceInfo), - TCPRouters: make(map[string]*runtime.TCPRouterInfo), - TCPMiddlewares: make(map[string]*runtime.TCPMiddlewareInfo), - TCPServices: make(map[string]*runtime.TCPServiceInfo), - UDPRouters: make(map[string]*runtime.UDPRouterInfo), - UDPServices: make(map[string]*runtime.UDPServiceInfo), - }, - } - - for _, container := range *agent.Containers { - dynConfig := &dynamic.Configuration{ - HTTP: &dynamic.HTTPConfiguration{}, - TCP: &dynamic.TCPConfiguration{}, - UDP: &dynamic.UDPConfiguration{}, - TLS: &dynamic.TLSConfiguration{}, - } - - err := parser.Decode( - container.Labels, - dynConfig, - parser.DefaultRootName, - "traefik.http", - "traefik.tcp", - "traefik.udp", - "traefik.tls.stores.default", - ) - if err != nil { - return err - } - - runtimeConfig := runtime.NewConfig(*dynConfig) - - // Merge routers - maps.Copy(params.Config.Routers, runtimeConfig.Routers) - maps.Copy(params.Config.TCPRouters, runtimeConfig.TCPRouters) - maps.Copy(params.Config.UDPRouters, runtimeConfig.UDPRouters) - - // Merge services - for k, v := range runtimeConfig.Services { - service := v.Service - for i, svc := range service.LoadBalancer.Servers { - if svc.Scheme == "" { - svc.Scheme = "http" - } - url := fmt.Sprintf("%s://%s:%s", svc.Scheme, *agent.ActiveIp, svc.Port) - service.LoadBalancer.Servers[i].URL = url - } - params.Config.Services[k] = &db.ServiceInfo{ - ServiceInfo: &runtime.ServiceInfo{Service: service}, - } - } - - for k, v := range runtimeConfig.TCPServices { - service := v.TCPService - for i, svc := range service.LoadBalancer.Servers { - address := fmt.Sprintf("%s:%s", *agent.ActiveIp, svc.Port) - service.LoadBalancer.Servers[i].Address = address - } - params.Config.TCPServices[k] = &runtime.TCPServiceInfo{TCPService: service} - } - - for k, v := range runtimeConfig.UDPServices { - service := v.UDPService - for i, svc := range service.LoadBalancer.Servers { - address := fmt.Sprintf("%s:%s", *agent.ActiveIp, svc.Port) - service.LoadBalancer.Servers[i].Address = address - } - params.Config.UDPServices[k] = &runtime.UDPServiceInfo{UDPService: service} - } - - // Merge middlewares - maps.Copy(params.Config.Middlewares, runtimeConfig.Middlewares) - maps.Copy(params.Config.TCPMiddlewares, runtimeConfig.TCPMiddlewares) - } - - q := db.New(DB) - if err := q.UpsertTraefikAgentConfig(context.Background(), params); err != nil { - return err - } - - return nil -} diff --git a/internal/traefik/client.go b/internal/traefik/client.go index 135d00b..9bdad49 100644 --- a/internal/traefik/client.go +++ b/internal/traefik/client.go @@ -7,13 +7,11 @@ import ( "encoding/json" "fmt" "io" - "log/slog" "net/http" "time" - "github.com/mizuchilabs/mantrae/internal/db" - "github.com/mizuchilabs/mantrae/internal/source" - "github.com/mizuchilabs/mantrae/internal/util" + "github.com/mizuchilabs/mantrae/internal/store/db" + "github.com/mizuchilabs/mantrae/internal/store/schema" ) const ( @@ -23,64 +21,67 @@ const ( VersionAPI = "/api/version" ) -func UpdateTraefikAPI(DB *sql.DB, profile db.Profile) error { - rawResponse, err := fetch(profile, RawAPI) +func UpdateTraefikAPI(DB *sql.DB, instanceID int64) error { + q := db.New(DB) + instance, err := q.GetTraefikInstance(context.Background(), instanceID) if err != nil { - slog.Error("Failed to fetch raw data", "error", err) - - // Clear api data - if err = ClearTraefikAPI(DB, profile.ID); err != nil { - slog.Error("Failed to clear API data", "error", err) - } - return err + return fmt.Errorf("failed to get traefik instance: %w", err) } - defer rawResponse.Close() - var config db.TraefikConfiguration - if err = json.NewDecoder(rawResponse).Decode(&config); err != nil { + rawResp, err := fetch(instance, RawAPI) + if err != nil { + return fmt.Errorf("failed to fetch %s: %w", instance.Url+RawAPI, err) + } + defer rawResp.Close() + + var config schema.Configuration + if err = json.NewDecoder(rawResp).Decode(&config); err != nil { return fmt.Errorf("failed to decode raw data: %w", err) } - epResponse, err := fetch(profile, EntrypointsAPI) + entrypointsResp, err := fetch(instance, EntrypointsAPI) if err != nil { - return fmt.Errorf("failed to fetch %s: %w", profile.Url+EntrypointsAPI, err) + return fmt.Errorf("failed to fetch %s: %w", instance.Url+EntrypointsAPI, err) } - defer epResponse.Close() + defer entrypointsResp.Close() - var entrypoints db.TraefikEntryPoints - if err = json.NewDecoder(epResponse).Decode(&entrypoints); err != nil { + var entrypoints schema.EntryPoints + if err = json.NewDecoder(entrypointsResp).Decode(&entrypoints); err != nil { return fmt.Errorf("failed to decode entrypoints: %w", err) } - oResponse, err := fetch(profile, OverviewAPI) - if err != nil { - return fmt.Errorf("failed to fetch %s: %w", profile.Url+OverviewAPI, err) - } - defer epResponse.Close() - var overview db.TraefikOverview - if err = json.NewDecoder(oResponse).Decode(&overview); err != nil { + overviewResp, err := fetch(instance, OverviewAPI) + if err != nil { + return fmt.Errorf("failed to fetch %s: %w", instance.Url+OverviewAPI, err) + } + defer overviewResp.Close() + + var overview schema.Overview + if err = json.NewDecoder(overviewResp).Decode(&overview); err != nil { return fmt.Errorf("failed to decode overview: %w", err) } - vResponse, err := fetch(profile, VersionAPI) + versionResp, err := fetch(instance, VersionAPI) if err != nil { - return fmt.Errorf("failed to fetch %s: %w", profile.Url+VersionAPI, err) + return fmt.Errorf("failed to fetch %s: %w", instance.Url+VersionAPI, err) } - defer vResponse.Close() + defer versionResp.Close() - var version db.TraefikVersion - if err := json.NewDecoder(vResponse).Decode(&version); err != nil { + var version schema.Version + if err := json.NewDecoder(versionResp).Decode(&version); err != nil { return fmt.Errorf("failed to decode version: %w", err) } - q := db.New(DB) - if err := q.UpsertTraefikConfig(context.Background(), db.UpsertTraefikConfigParams{ - ProfileID: profile.ID, + if _, err := q.UpdateTraefikInstance(context.Background(), db.UpdateTraefikInstanceParams{ + ID: instance.ID, + Url: instance.Url, + Username: instance.Username, + Password: instance.Password, + Tls: instance.Tls, Entrypoints: &entrypoints, Overview: &overview, Version: &version.Version, Config: &config, - Source: source.API, }); err != nil { return fmt.Errorf("failed to update api data: %w", err) } @@ -88,72 +89,31 @@ func UpdateTraefikAPI(DB *sql.DB, profile db.Profile) error { return nil } -func ClearTraefikAPI(DB *sql.DB, profileID int64) error { - q := db.New(DB) - if err := q.UpsertTraefikConfig(context.Background(), db.UpsertTraefikConfigParams{ - ProfileID: profileID, - Source: source.API, - Entrypoints: nil, - Overview: nil, - Version: nil, - Config: nil, - }); err != nil { - return fmt.Errorf("Failed to clear API data: %w", err) - } - return nil -} - -func GetTraefikConfig(DB *sql.DB) { - q := db.New(DB) - profiles, err := q.ListProfiles(context.Background()) - if err != nil { - slog.Error("Failed to get profiles", "error", err) - return - } - - for _, profile := range profiles { - if profile.Url == "" { - continue - } - - if err := UpdateTraefikAPI(DB, profile); err != nil { - slog.Error("Failed to update api data", "error", err) - continue - } - } - - // Broadcast the update to all clients - util.Broadcast <- util.EventMessage{ - Type: util.EventTypeUpdate, - Category: util.EventCategoryTraefik, - } -} - -func fetch(profile db.Profile, endpoint string) (io.ReadCloser, error) { - if profile.Url == "" { +func fetch(instance db.TraefikInstance, endpoint string) (io.ReadCloser, error) { + if instance.Url == "" { return nil, fmt.Errorf("invalid URL or endpoint") } client := http.Client{Timeout: time.Second * 10} - if !profile.Tls { + if !instance.Tls { client.Transport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } } - req, err := http.NewRequest("GET", profile.Url+endpoint, nil) + req, err := http.NewRequest("GET", instance.Url+endpoint, nil) if err != nil { return nil, fmt.Errorf("failed to create request: %w", err) } req.Header.Set("Content-Type", "application/json") - if profile.Username != nil && profile.Password != nil { - req.SetBasicAuth(*profile.Username, *profile.Password) + if instance.Username != nil && instance.Password != nil { + req.SetBasicAuth(*instance.Username, *instance.Password) } resp, err := client.Do(req) if err != nil { - return nil, fmt.Errorf("failed to fetch %s: %w", profile.Url+endpoint, err) + return nil, fmt.Errorf("failed to fetch %s: %w", instance.Url+endpoint, err) } if resp.StatusCode != http.StatusOK { diff --git a/internal/traefik/convert.go b/internal/traefik/convert.go deleted file mode 100644 index de05730..0000000 --- a/internal/traefik/convert.go +++ /dev/null @@ -1,195 +0,0 @@ -package traefik - -import ( - "encoding/json" - "fmt" - "io" - "mime/multipart" - - "github.com/mizuchilabs/mantrae/internal/db" - "github.com/traefik/traefik/v3/pkg/config/dynamic" - "github.com/traefik/traefik/v3/pkg/config/runtime" - "golang.org/x/exp/maps" - "sigs.k8s.io/yaml" -) - -func ConvertToDynamicConfig(rc *db.TraefikConfiguration) *dynamic.Configuration { - dc := &dynamic.Configuration{} - - // Only create HTTP config if there are HTTP components - if len(rc.Routers) > 0 || len(rc.Middlewares) > 0 || len(rc.Services) > 0 { - dc.HTTP = &dynamic.HTTPConfiguration{ - Routers: make(map[string]*dynamic.Router), - Middlewares: make(map[string]*dynamic.Middleware), - Services: make(map[string]*dynamic.Service), - } - - for name, router := range rc.Routers { - dc.HTTP.Routers[name] = router.Router - } - for name, service := range rc.Services { - dc.HTTP.Services[name] = service.Service - } - for name, middleware := range rc.Middlewares { - dc.HTTP.Middlewares[name] = middleware.Middleware - } - } - - // Only create TCP config if there are TCP components - if len(rc.TCPRouters) > 0 || len(rc.TCPMiddlewares) > 0 || len(rc.TCPServices) > 0 { - dc.TCP = &dynamic.TCPConfiguration{ - Routers: make(map[string]*dynamic.TCPRouter), - Middlewares: make(map[string]*dynamic.TCPMiddleware), - Services: make(map[string]*dynamic.TCPService), - } - - for name, router := range rc.TCPRouters { - dc.TCP.Routers[name] = router.TCPRouter - } - for name, service := range rc.TCPServices { - dc.TCP.Services[name] = service.TCPService - } - for name, middleware := range rc.TCPMiddlewares { - dc.TCP.Middlewares[name] = middleware.TCPMiddleware - } - } - - // Only create UDP config if there are UDP components - if len(rc.UDPRouters) > 0 || len(rc.UDPServices) > 0 { - dc.UDP = &dynamic.UDPConfiguration{ - Routers: make(map[string]*dynamic.UDPRouter), - Services: make(map[string]*dynamic.UDPService), - } - - for name, router := range rc.UDPRouters { - dc.UDP.Routers[name] = router.UDPRouter - } - for name, service := range rc.UDPServices { - dc.UDP.Services[name] = service.UDPService - } - } - - return dc -} - -func ConvertFileToDynamicConfig( - file multipart.File, - extension string, -) (*dynamic.Configuration, error) { - // Read the file content - content, err := io.ReadAll(file) - if err != nil { - return nil, fmt.Errorf("failed to read file: %w", err) - } - - // Create a new configuration - configuration := &dynamic.Configuration{ - HTTP: &dynamic.HTTPConfiguration{ - Routers: make(map[string]*dynamic.Router), - Middlewares: make(map[string]*dynamic.Middleware), - Services: make(map[string]*dynamic.Service), - ServersTransports: make(map[string]*dynamic.ServersTransport), - }, - TCP: &dynamic.TCPConfiguration{ - Routers: make(map[string]*dynamic.TCPRouter), - Services: make(map[string]*dynamic.TCPService), - Middlewares: make(map[string]*dynamic.TCPMiddleware), - ServersTransports: make(map[string]*dynamic.TCPServersTransport), - }, - UDP: &dynamic.UDPConfiguration{ - Routers: make(map[string]*dynamic.UDPRouter), - Services: make(map[string]*dynamic.UDPService), - }, - } - - // Unmarshal yaml or json - if extension == ".json" { - if err := json.Unmarshal(content, configuration); err != nil { - return nil, fmt.Errorf("failed to parse JSON: %w", err) - } - } - if extension == ".yaml" || extension == ".yml" { - if err := yaml.Unmarshal(content, configuration); err != nil { - return nil, fmt.Errorf("failed to parse YAML: %w", err) - } - } - return configuration, nil -} - -func ConvertDynamicToRuntime(dc *dynamic.Configuration) *db.TraefikConfiguration { - rc := runtime.NewConfig(*dc) - config := &db.TraefikConfiguration{ - Routers: rc.Routers, - Middlewares: rc.Middlewares, - TCPRouters: rc.TCPRouters, - TCPMiddlewares: rc.TCPMiddlewares, - TCPServices: rc.TCPServices, - UDPRouters: rc.UDPRouters, - UDPServices: rc.UDPServices, - } - config.Services = make(map[string]*db.ServiceInfo) - for k, v := range rc.Services { - config.Services[k] = db.FromRuntimeServiceInfo(v) - } - return config -} - -func MergeConfigs(base, overlay *db.TraefikConfiguration) *db.TraefikConfiguration { - if base == nil { - return overlay - } - if overlay == nil { - return base - } - - initializeMaps(base) - - // Merge components - mergeMaps(base.Routers, overlay.Routers) - mergeMaps(base.Middlewares, overlay.Middlewares) - mergeMaps(base.Services, overlay.Services) - mergeMaps(base.TCPRouters, overlay.TCPRouters) - mergeMaps(base.TCPMiddlewares, overlay.TCPMiddlewares) - mergeMaps(base.TCPServices, overlay.TCPServices) - mergeMaps(base.UDPRouters, overlay.UDPRouters) - mergeMaps(base.UDPServices, overlay.UDPServices) - - return base -} - -// Initialize nil maps in the configuration -func initializeMaps(config *db.TraefikConfiguration) { - if config.Routers == nil { - config.Routers = make(map[string]*runtime.RouterInfo) - } - if config.Middlewares == nil { - config.Middlewares = make(map[string]*runtime.MiddlewareInfo) - } - if config.Services == nil { - config.Services = make(map[string]*db.ServiceInfo) - } - if config.TCPRouters == nil { - config.TCPRouters = make(map[string]*runtime.TCPRouterInfo) - } - if config.TCPMiddlewares == nil { - config.TCPMiddlewares = make(map[string]*runtime.TCPMiddlewareInfo) - } - if config.TCPServices == nil { - config.TCPServices = make(map[string]*runtime.TCPServiceInfo) - } - if config.UDPRouters == nil { - config.UDPRouters = make(map[string]*runtime.UDPRouterInfo) - } - if config.UDPServices == nil { - config.UDPServices = make(map[string]*runtime.UDPServiceInfo) - } -} - -// Generic merge function for maps -func mergeMaps[K comparable, V any](base, overlay map[K]V) { - if base == nil || overlay == nil { - return - } - - maps.Copy(base, overlay) -} diff --git a/internal/util/tools.go b/internal/util/tools.go index d533484..b3278f6 100644 --- a/internal/util/tools.go +++ b/internal/util/tools.go @@ -7,11 +7,13 @@ import ( "crypto/tls" "encoding/hex" "fmt" + "log" "math/big" "net" "net/http" "net/url" "os" + "path/filepath" "regexp" "strconv" "strings" @@ -25,11 +27,23 @@ func IsTest() bool { return strings.HasSuffix(os.Args[0], ".test") } -func SafeDeref(s *string) string { - if s == nil { - return "" +func ResolvePath(path string) string { + basePath := "data" + if dbPath := os.Getenv("BASE_PATH"); dbPath != "" { + basePath = dbPath } - return *s + + // If the provided path is absolute, return it as-is + if filepath.IsAbs(path) { + return path + } + + // Create the base directory if it doesn't exist + if err := os.MkdirAll(basePath, 0755); err != nil { + log.Printf("Warning: failed to create base directory: %v", err) + } + + return filepath.Join(basePath, path) } // GenPassword generates a random password of the specified length diff --git a/proto/gen/mantrae/v1/agent.pb.go b/proto/gen/mantrae/v1/agent.pb.go index c0dada0..039f78e 100644 --- a/proto/gen/mantrae/v1/agent.pb.go +++ b/proto/gen/mantrae/v1/agent.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/agent.proto @@ -316,45 +316,80 @@ func (x *HealthCheckResponse) GetToken() string { var File_mantrae_v1_agent_proto protoreflect.FileDescriptor -const file_mantrae_v1_agent_proto_rawDesc = "" + - "\n" + - "\x16mantrae/v1/agent.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x03\n" + - "\tContainer\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x129\n" + - "\x06labels\x18\x03 \x03(\v2!.mantrae.v1.Container.LabelsEntryR\x06labels\x12\x14\n" + - "\x05image\x18\x04 \x01(\tR\x05image\x12<\n" + - "\aportmap\x18\x05 \x03(\v2\".mantrae.v1.Container.PortmapEntryR\aportmap\x12\x16\n" + - "\x06status\x18\x06 \x01(\tR\x06status\x124\n" + - "\acreated\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\acreated\x1a9\n" + - "\vLabelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a:\n" + - "\fPortmapEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\"\xdc\x01\n" + - "\x13GetContainerRequest\x12\x1a\n" + - "\bhostname\x18\x01 \x01(\tR\bhostname\x12\x1b\n" + - "\tpublic_ip\x18\x02 \x01(\tR\bpublicIp\x12\x1f\n" + - "\vprivate_ips\x18\x03 \x03(\tR\n" + - "privateIps\x125\n" + - "\n" + - "containers\x18\x04 \x03(\v2\x15.mantrae.v1.ContainerR\n" + - "containers\x124\n" + - "\aupdated\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\aupdated\"\x16\n" + - "\x14GetContainerResponse\"\x14\n" + - "\x12HealthCheckRequest\";\n" + - "\x13HealthCheckResponse\x12\x0e\n" + - "\x02ok\x18\x01 \x01(\bR\x02ok\x12\x14\n" + - "\x05token\x18\x02 \x01(\tR\x05token2\xb1\x01\n" + - "\fAgentService\x12Q\n" + - "\fGetContainer\x12\x1f.mantrae.v1.GetContainerRequest\x1a .mantrae.v1.GetContainerResponse\x12N\n" + - "\vHealthCheck\x12\x1e.mantrae.v1.HealthCheckRequest\x1a\x1f.mantrae.v1.HealthCheckResponseB\xa4\x01\n" + - "\x0ecom.mantrae.v1B\n" + - "AgentProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_agent_proto_rawDesc = string([]byte{ + 0x0a, 0x16, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x03, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x70, 0x6f, 0x72, 0x74, + 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, + 0x6f, 0x72, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, + 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3a, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdc, 0x01, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, 0x70, 0x73, 0x12, 0x35, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb1, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0b, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa4, 0x01, 0x0a, 0x0e, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, + 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_agent_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/agent_management.pb.go b/proto/gen/mantrae/v1/agent_management.pb.go new file mode 100644 index 0000000..baf6804 --- /dev/null +++ b/proto/gen/mantrae/v1/agent_management.pb.go @@ -0,0 +1,898 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: mantrae/v1/agent_management.proto + +package mantraev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Agent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ProfileId int64 `protobuf:"varint,2,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` + PublicIp string `protobuf:"bytes,4,opt,name=public_ip,json=publicIp,proto3" json:"public_ip,omitempty"` + ActiveIp string `protobuf:"bytes,5,opt,name=active_ip,json=activeIp,proto3" json:"active_ip,omitempty"` + Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"` + PrivateIps []string `protobuf:"bytes,7,rep,name=private_ips,json=privateIps,proto3" json:"private_ips,omitempty"` + Containers []*Container `protobuf:"bytes,8,rep,name=containers,proto3" json:"containers,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Agent) Reset() { + *x = Agent{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Agent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Agent) ProtoMessage() {} + +func (x *Agent) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Agent.ProtoReflect.Descriptor instead. +func (*Agent) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{0} +} + +func (x *Agent) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Agent) GetProfileId() int64 { + if x != nil { + return x.ProfileId + } + return 0 +} + +func (x *Agent) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *Agent) GetPublicIp() string { + if x != nil { + return x.PublicIp + } + return "" +} + +func (x *Agent) GetActiveIp() string { + if x != nil { + return x.ActiveIp + } + return "" +} + +func (x *Agent) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *Agent) GetPrivateIps() []string { + if x != nil { + return x.PrivateIps + } + return nil +} + +func (x *Agent) GetContainers() []*Container { + if x != nil { + return x.Containers + } + return nil +} + +func (x *Agent) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Agent) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type GetAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAgentRequest) Reset() { + *x = GetAgentRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAgentRequest) ProtoMessage() {} + +func (x *GetAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAgentRequest.ProtoReflect.Descriptor instead. +func (*GetAgentRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAgentRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Agent *Agent `protobuf:"bytes,1,opt,name=agent,proto3" json:"agent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAgentResponse) Reset() { + *x = GetAgentResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAgentResponse) ProtoMessage() {} + +func (x *GetAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAgentResponse.ProtoReflect.Descriptor instead. +func (*GetAgentResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{2} +} + +func (x *GetAgentResponse) GetAgent() *Agent { + if x != nil { + return x.Agent + } + return nil +} + +type CreateAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentRequest) Reset() { + *x = CreateAgentRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentRequest) ProtoMessage() {} + +func (x *CreateAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentRequest.ProtoReflect.Descriptor instead. +func (*CreateAgentRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAgentRequest) GetProfileId() int64 { + if x != nil { + return x.ProfileId + } + return 0 +} + +type CreateAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Agent *Agent `protobuf:"bytes,1,opt,name=agent,proto3" json:"agent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentResponse) Reset() { + *x = CreateAgentResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentResponse) ProtoMessage() {} + +func (x *CreateAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentResponse.ProtoReflect.Descriptor instead. +func (*CreateAgentResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateAgentResponse) GetAgent() *Agent { + if x != nil { + return x.Agent + } + return nil +} + +type UpdateAgentIPRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentIPRequest) Reset() { + *x = UpdateAgentIPRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentIPRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentIPRequest) ProtoMessage() {} + +func (x *UpdateAgentIPRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentIPRequest.ProtoReflect.Descriptor instead. +func (*UpdateAgentIPRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateAgentIPRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateAgentIPRequest) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type UpdateAgentIPResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Agent *Agent `protobuf:"bytes,1,opt,name=agent,proto3" json:"agent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentIPResponse) Reset() { + *x = UpdateAgentIPResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentIPResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentIPResponse) ProtoMessage() {} + +func (x *UpdateAgentIPResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentIPResponse.ProtoReflect.Descriptor instead. +func (*UpdateAgentIPResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateAgentIPResponse) GetAgent() *Agent { + if x != nil { + return x.Agent + } + return nil +} + +type DeleteAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAgentRequest) Reset() { + *x = DeleteAgentRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAgentRequest) ProtoMessage() {} + +func (x *DeleteAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAgentRequest.ProtoReflect.Descriptor instead. +func (*DeleteAgentRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteAgentRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAgentResponse) Reset() { + *x = DeleteAgentResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAgentResponse) ProtoMessage() {} + +func (x *DeleteAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAgentResponse.ProtoReflect.Descriptor instead. +func (*DeleteAgentResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{8} +} + +type ListAgentsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` + Limit *int64 `protobuf:"varint,2,opt,name=limit,proto3,oneof" json:"limit,omitempty"` + Offset *int64 `protobuf:"varint,3,opt,name=offset,proto3,oneof" json:"offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentsRequest) Reset() { + *x = ListAgentsRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentsRequest) ProtoMessage() {} + +func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentsRequest.ProtoReflect.Descriptor instead. +func (*ListAgentsRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{9} +} + +func (x *ListAgentsRequest) GetProfileId() int64 { + if x != nil { + return x.ProfileId + } + return 0 +} + +func (x *ListAgentsRequest) GetLimit() int64 { + if x != nil && x.Limit != nil { + return *x.Limit + } + return 0 +} + +func (x *ListAgentsRequest) GetOffset() int64 { + if x != nil && x.Offset != nil { + return *x.Offset + } + return 0 +} + +type ListAgentsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Agents []*Agent `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` + TotalCount int64 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentsResponse) Reset() { + *x = ListAgentsResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentsResponse) ProtoMessage() {} + +func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentsResponse.ProtoReflect.Descriptor instead. +func (*ListAgentsResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{10} +} + +func (x *ListAgentsResponse) GetAgents() []*Agent { + if x != nil { + return x.Agents + } + return nil +} + +func (x *ListAgentsResponse) GetTotalCount() int64 { + if x != nil { + return x.TotalCount + } + return 0 +} + +type RotateAgentTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RotateAgentTokenRequest) Reset() { + *x = RotateAgentTokenRequest{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RotateAgentTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateAgentTokenRequest) ProtoMessage() {} + +func (x *RotateAgentTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RotateAgentTokenRequest.ProtoReflect.Descriptor instead. +func (*RotateAgentTokenRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{11} +} + +func (x *RotateAgentTokenRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RotateAgentTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RotateAgentTokenResponse) Reset() { + *x = RotateAgentTokenResponse{} + mi := &file_mantrae_v1_agent_management_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RotateAgentTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RotateAgentTokenResponse) ProtoMessage() {} + +func (x *RotateAgentTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_agent_management_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RotateAgentTokenResponse.ProtoReflect.Descriptor instead. +func (*RotateAgentTokenResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_agent_management_proto_rawDescGZIP(), []int{12} +} + +func (x *RotateAgentTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_mantrae_v1_agent_management_proto protoreflect.FileDescriptor + +var file_mantrae_v1_agent_management_proto_rawDesc = string([]byte{ + 0x0a, 0x21, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x16, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x02, 0x0a, 0x05, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, 0x70, 0x73, 0x12, 0x35, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x21, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x22, 0x33, 0x0a, 0x12, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, + 0x22, 0x3e, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x22, 0x36, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, + 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x40, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x12, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7f, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, + 0x07, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x60, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, + 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x17, 0x52, 0x6f, + 0x74, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x18, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x8b, 0x04, 0x0a, 0x16, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x4e, + 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x12, + 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x5d, 0x0a, 0x10, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x74, + 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xae, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, + 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_mantrae_v1_agent_management_proto_rawDescOnce sync.Once + file_mantrae_v1_agent_management_proto_rawDescData []byte +) + +func file_mantrae_v1_agent_management_proto_rawDescGZIP() []byte { + file_mantrae_v1_agent_management_proto_rawDescOnce.Do(func() { + file_mantrae_v1_agent_management_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mantrae_v1_agent_management_proto_rawDesc), len(file_mantrae_v1_agent_management_proto_rawDesc))) + }) + return file_mantrae_v1_agent_management_proto_rawDescData +} + +var file_mantrae_v1_agent_management_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_mantrae_v1_agent_management_proto_goTypes = []any{ + (*Agent)(nil), // 0: mantrae.v1.Agent + (*GetAgentRequest)(nil), // 1: mantrae.v1.GetAgentRequest + (*GetAgentResponse)(nil), // 2: mantrae.v1.GetAgentResponse + (*CreateAgentRequest)(nil), // 3: mantrae.v1.CreateAgentRequest + (*CreateAgentResponse)(nil), // 4: mantrae.v1.CreateAgentResponse + (*UpdateAgentIPRequest)(nil), // 5: mantrae.v1.UpdateAgentIPRequest + (*UpdateAgentIPResponse)(nil), // 6: mantrae.v1.UpdateAgentIPResponse + (*DeleteAgentRequest)(nil), // 7: mantrae.v1.DeleteAgentRequest + (*DeleteAgentResponse)(nil), // 8: mantrae.v1.DeleteAgentResponse + (*ListAgentsRequest)(nil), // 9: mantrae.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 10: mantrae.v1.ListAgentsResponse + (*RotateAgentTokenRequest)(nil), // 11: mantrae.v1.RotateAgentTokenRequest + (*RotateAgentTokenResponse)(nil), // 12: mantrae.v1.RotateAgentTokenResponse + (*Container)(nil), // 13: mantrae.v1.Container + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp +} +var file_mantrae_v1_agent_management_proto_depIdxs = []int32{ + 13, // 0: mantrae.v1.Agent.containers:type_name -> mantrae.v1.Container + 14, // 1: mantrae.v1.Agent.created_at:type_name -> google.protobuf.Timestamp + 14, // 2: mantrae.v1.Agent.updated_at:type_name -> google.protobuf.Timestamp + 0, // 3: mantrae.v1.GetAgentResponse.agent:type_name -> mantrae.v1.Agent + 0, // 4: mantrae.v1.CreateAgentResponse.agent:type_name -> mantrae.v1.Agent + 0, // 5: mantrae.v1.UpdateAgentIPResponse.agent:type_name -> mantrae.v1.Agent + 0, // 6: mantrae.v1.ListAgentsResponse.agents:type_name -> mantrae.v1.Agent + 1, // 7: mantrae.v1.AgentManagementService.GetAgent:input_type -> mantrae.v1.GetAgentRequest + 3, // 8: mantrae.v1.AgentManagementService.CreateAgent:input_type -> mantrae.v1.CreateAgentRequest + 5, // 9: mantrae.v1.AgentManagementService.UpdateAgentIP:input_type -> mantrae.v1.UpdateAgentIPRequest + 7, // 10: mantrae.v1.AgentManagementService.DeleteAgent:input_type -> mantrae.v1.DeleteAgentRequest + 9, // 11: mantrae.v1.AgentManagementService.ListAgents:input_type -> mantrae.v1.ListAgentsRequest + 11, // 12: mantrae.v1.AgentManagementService.RotateAgentToken:input_type -> mantrae.v1.RotateAgentTokenRequest + 2, // 13: mantrae.v1.AgentManagementService.GetAgent:output_type -> mantrae.v1.GetAgentResponse + 4, // 14: mantrae.v1.AgentManagementService.CreateAgent:output_type -> mantrae.v1.CreateAgentResponse + 6, // 15: mantrae.v1.AgentManagementService.UpdateAgentIP:output_type -> mantrae.v1.UpdateAgentIPResponse + 8, // 16: mantrae.v1.AgentManagementService.DeleteAgent:output_type -> mantrae.v1.DeleteAgentResponse + 10, // 17: mantrae.v1.AgentManagementService.ListAgents:output_type -> mantrae.v1.ListAgentsResponse + 12, // 18: mantrae.v1.AgentManagementService.RotateAgentToken:output_type -> mantrae.v1.RotateAgentTokenResponse + 13, // [13:19] is the sub-list for method output_type + 7, // [7:13] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_mantrae_v1_agent_management_proto_init() } +func file_mantrae_v1_agent_management_proto_init() { + if File_mantrae_v1_agent_management_proto != nil { + return + } + file_mantrae_v1_agent_proto_init() + file_mantrae_v1_agent_management_proto_msgTypes[9].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_agent_management_proto_rawDesc), len(file_mantrae_v1_agent_management_proto_rawDesc)), + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mantrae_v1_agent_management_proto_goTypes, + DependencyIndexes: file_mantrae_v1_agent_management_proto_depIdxs, + MessageInfos: file_mantrae_v1_agent_management_proto_msgTypes, + }.Build() + File_mantrae_v1_agent_management_proto = out.File + file_mantrae_v1_agent_management_proto_goTypes = nil + file_mantrae_v1_agent_management_proto_depIdxs = nil +} diff --git a/proto/gen/mantrae/v1/backup.pb.go b/proto/gen/mantrae/v1/backup.pb.go new file mode 100644 index 0000000..98d2e3e --- /dev/null +++ b/proto/gen/mantrae/v1/backup.pb.go @@ -0,0 +1,726 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc (unknown) +// source: mantrae/v1/backup.proto + +package mantraev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Backup struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Backup) Reset() { + *x = Backup{} + mi := &file_mantrae_v1_backup_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Backup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Backup) ProtoMessage() {} + +func (x *Backup) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Backup.ProtoReflect.Descriptor instead. +func (*Backup) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{0} +} + +func (x *Backup) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Backup) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *Backup) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type CreateBackupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateBackupRequest) Reset() { + *x = CreateBackupRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBackupRequest) ProtoMessage() {} + +func (x *CreateBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBackupRequest.ProtoReflect.Descriptor instead. +func (*CreateBackupRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{1} +} + +type CreateBackupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateBackupResponse) Reset() { + *x = CreateBackupResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBackupResponse) ProtoMessage() {} + +func (x *CreateBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBackupResponse.ProtoReflect.Descriptor instead. +func (*CreateBackupResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{2} +} + +type RestoreBackupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RestoreBackupRequest) Reset() { + *x = RestoreBackupRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RestoreBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestoreBackupRequest) ProtoMessage() {} + +func (x *RestoreBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RestoreBackupRequest.ProtoReflect.Descriptor instead. +func (*RestoreBackupRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{3} +} + +func (x *RestoreBackupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type RestoreBackupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RestoreBackupResponse) Reset() { + *x = RestoreBackupResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RestoreBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestoreBackupResponse) ProtoMessage() {} + +func (x *RestoreBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RestoreBackupResponse.ProtoReflect.Descriptor instead. +func (*RestoreBackupResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{4} +} + +type ListBackupsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBackupsRequest) Reset() { + *x = ListBackupsRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBackupsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupsRequest) ProtoMessage() {} + +func (x *ListBackupsRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBackupsRequest.ProtoReflect.Descriptor instead. +func (*ListBackupsRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{5} +} + +type ListBackupsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Backups []*Backup `protobuf:"bytes,1,rep,name=backups,proto3" json:"backups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBackupsResponse) Reset() { + *x = ListBackupsResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBackupsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBackupsResponse) ProtoMessage() {} + +func (x *ListBackupsResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBackupsResponse.ProtoReflect.Descriptor instead. +func (*ListBackupsResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{6} +} + +func (x *ListBackupsResponse) GetBackups() []*Backup { + if x != nil { + return x.Backups + } + return nil +} + +type DeleteBackupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteBackupRequest) Reset() { + *x = DeleteBackupRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBackupRequest) ProtoMessage() {} + +func (x *DeleteBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBackupRequest.ProtoReflect.Descriptor instead. +func (*DeleteBackupRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteBackupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteBackupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteBackupResponse) Reset() { + *x = DeleteBackupResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBackupResponse) ProtoMessage() {} + +func (x *DeleteBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBackupResponse.ProtoReflect.Descriptor instead. +func (*DeleteBackupResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{8} +} + +type DownloadBackupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DownloadBackupRequest) Reset() { + *x = DownloadBackupRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DownloadBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadBackupRequest) ProtoMessage() {} + +func (x *DownloadBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DownloadBackupRequest.ProtoReflect.Descriptor instead. +func (*DownloadBackupRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{9} +} + +func (x *DownloadBackupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DownloadBackupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DownloadBackupResponse) Reset() { + *x = DownloadBackupResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DownloadBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadBackupResponse) ProtoMessage() {} + +func (x *DownloadBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DownloadBackupResponse.ProtoReflect.Descriptor instead. +func (*DownloadBackupResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{10} +} + +func (x *DownloadBackupResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type UploadBackupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UploadBackupRequest) Reset() { + *x = UploadBackupRequest{} + mi := &file_mantrae_v1_backup_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBackupRequest) ProtoMessage() {} + +func (x *UploadBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBackupRequest.ProtoReflect.Descriptor instead. +func (*UploadBackupRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{11} +} + +func (x *UploadBackupRequest) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type UploadBackupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UploadBackupResponse) Reset() { + *x = UploadBackupResponse{} + mi := &file_mantrae_v1_backup_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBackupResponse) ProtoMessage() {} + +func (x *UploadBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_backup_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBackupResponse.ProtoReflect.Descriptor instead. +func (*UploadBackupResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_backup_proto_rawDescGZIP(), []int{12} +} + +var File_mantrae_v1_backup_proto protoreflect.FileDescriptor + +var file_mantrae_v1_backup_proto_rawDesc = string([]byte{ + 0x0a, 0x17, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x06, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x17, + 0x0a, 0x15, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x73, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x16, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x29, 0x0a, 0x13, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x16, 0x0a, 0x14, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x90, 0x04, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, + 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x12, 0x1e, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, + 0x90, 0x02, 0x01, 0x12, 0x51, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x53, 0x0a, 0x0c, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x42, 0xa5, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, + 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_mantrae_v1_backup_proto_rawDescOnce sync.Once + file_mantrae_v1_backup_proto_rawDescData []byte +) + +func file_mantrae_v1_backup_proto_rawDescGZIP() []byte { + file_mantrae_v1_backup_proto_rawDescOnce.Do(func() { + file_mantrae_v1_backup_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mantrae_v1_backup_proto_rawDesc), len(file_mantrae_v1_backup_proto_rawDesc))) + }) + return file_mantrae_v1_backup_proto_rawDescData +} + +var file_mantrae_v1_backup_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_mantrae_v1_backup_proto_goTypes = []any{ + (*Backup)(nil), // 0: mantrae.v1.Backup + (*CreateBackupRequest)(nil), // 1: mantrae.v1.CreateBackupRequest + (*CreateBackupResponse)(nil), // 2: mantrae.v1.CreateBackupResponse + (*RestoreBackupRequest)(nil), // 3: mantrae.v1.RestoreBackupRequest + (*RestoreBackupResponse)(nil), // 4: mantrae.v1.RestoreBackupResponse + (*ListBackupsRequest)(nil), // 5: mantrae.v1.ListBackupsRequest + (*ListBackupsResponse)(nil), // 6: mantrae.v1.ListBackupsResponse + (*DeleteBackupRequest)(nil), // 7: mantrae.v1.DeleteBackupRequest + (*DeleteBackupResponse)(nil), // 8: mantrae.v1.DeleteBackupResponse + (*DownloadBackupRequest)(nil), // 9: mantrae.v1.DownloadBackupRequest + (*DownloadBackupResponse)(nil), // 10: mantrae.v1.DownloadBackupResponse + (*UploadBackupRequest)(nil), // 11: mantrae.v1.UploadBackupRequest + (*UploadBackupResponse)(nil), // 12: mantrae.v1.UploadBackupResponse + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp +} +var file_mantrae_v1_backup_proto_depIdxs = []int32{ + 13, // 0: mantrae.v1.Backup.created_at:type_name -> google.protobuf.Timestamp + 0, // 1: mantrae.v1.ListBackupsResponse.backups:type_name -> mantrae.v1.Backup + 1, // 2: mantrae.v1.BackupService.CreateBackup:input_type -> mantrae.v1.CreateBackupRequest + 3, // 3: mantrae.v1.BackupService.RestoreBackup:input_type -> mantrae.v1.RestoreBackupRequest + 5, // 4: mantrae.v1.BackupService.ListBackups:input_type -> mantrae.v1.ListBackupsRequest + 7, // 5: mantrae.v1.BackupService.DeleteBackup:input_type -> mantrae.v1.DeleteBackupRequest + 9, // 6: mantrae.v1.BackupService.DownloadBackup:input_type -> mantrae.v1.DownloadBackupRequest + 11, // 7: mantrae.v1.BackupService.UploadBackup:input_type -> mantrae.v1.UploadBackupRequest + 2, // 8: mantrae.v1.BackupService.CreateBackup:output_type -> mantrae.v1.CreateBackupResponse + 4, // 9: mantrae.v1.BackupService.RestoreBackup:output_type -> mantrae.v1.RestoreBackupResponse + 6, // 10: mantrae.v1.BackupService.ListBackups:output_type -> mantrae.v1.ListBackupsResponse + 8, // 11: mantrae.v1.BackupService.DeleteBackup:output_type -> mantrae.v1.DeleteBackupResponse + 10, // 12: mantrae.v1.BackupService.DownloadBackup:output_type -> mantrae.v1.DownloadBackupResponse + 12, // 13: mantrae.v1.BackupService.UploadBackup:output_type -> mantrae.v1.UploadBackupResponse + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_mantrae_v1_backup_proto_init() } +func file_mantrae_v1_backup_proto_init() { + if File_mantrae_v1_backup_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_backup_proto_rawDesc), len(file_mantrae_v1_backup_proto_rawDesc)), + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mantrae_v1_backup_proto_goTypes, + DependencyIndexes: file_mantrae_v1_backup_proto_depIdxs, + MessageInfos: file_mantrae_v1_backup_proto_msgTypes, + }.Build() + File_mantrae_v1_backup_proto = out.File + file_mantrae_v1_backup_proto_goTypes = nil + file_mantrae_v1_backup_proto_depIdxs = nil +} diff --git a/proto/gen/mantrae/v1/entry_point.pb.go b/proto/gen/mantrae/v1/entry_point.pb.go index 85f3f56..f965348 100644 --- a/proto/gen/mantrae/v1/entry_point.pb.go +++ b/proto/gen/mantrae/v1/entry_point.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/entry_point.proto @@ -596,64 +596,120 @@ func (x *ListEntryPointsResponse) GetTotalCount() int64 { var File_mantrae_v1_entry_point_proto protoreflect.FileDescriptor -const file_mantrae_v1_entry_point_proto_rawDesc = "" + - "\n" + - "\x1cmantrae/v1/entry_point.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x01\n" + - "\n" + - "EntryPoint\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "is_default\x18\x04 \x01(\bR\tisDefault\x129\n" + - "\n" + - "created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"&\n" + - "\x14GetEntryPointRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"P\n" + - "\x15GetEntryPointResponse\x127\n" + - "\ventry_point\x18\x01 \x01(\v2\x16.mantrae.v1.EntryPointR\n" + - "entryPoint\"f\n" + - "\x17CreateEntryPointRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + - "\aaddress\x18\x02 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "is_default\x18\x03 \x01(\bR\tisDefault\"S\n" + - "\x18CreateEntryPointResponse\x127\n" + - "\ventry_point\x18\x01 \x01(\v2\x16.mantrae.v1.EntryPointR\n" + - "entryPoint\"v\n" + - "\x17UpdateEntryPointRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" + - "\aaddress\x18\x03 \x01(\tR\aaddress\x12\x1d\n" + - "\n" + - "is_default\x18\x04 \x01(\bR\tisDefault\"S\n" + - "\x18UpdateEntryPointResponse\x127\n" + - "\ventry_point\x18\x01 \x01(\v2\x16.mantrae.v1.EntryPointR\n" + - "entryPoint\")\n" + - "\x17DeleteEntryPointRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"\x1a\n" + - "\x18DeleteEntryPointResponse\"e\n" + - "\x16ListEntryPointsRequest\x12\x19\n" + - "\x05limit\x18\x01 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x02 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"u\n" + - "\x17ListEntryPointsResponse\x129\n" + - "\fentry_points\x18\x01 \x03(\v2\x16.mantrae.v1.EntryPointR\ventryPoints\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount2\xec\x03\n" + - "\x11EntryPointService\x12Y\n" + - "\rGetEntryPoint\x12 .mantrae.v1.GetEntryPointRequest\x1a!.mantrae.v1.GetEntryPointResponse\"\x03\x90\x02\x01\x12]\n" + - "\x10CreateEntryPoint\x12#.mantrae.v1.CreateEntryPointRequest\x1a$.mantrae.v1.CreateEntryPointResponse\x12]\n" + - "\x10UpdateEntryPoint\x12#.mantrae.v1.UpdateEntryPointRequest\x1a$.mantrae.v1.UpdateEntryPointResponse\x12]\n" + - "\x10DeleteEntryPoint\x12#.mantrae.v1.DeleteEntryPointRequest\x1a$.mantrae.v1.DeleteEntryPointResponse\x12_\n" + - "\x0fListEntryPoints\x12\".mantrae.v1.ListEntryPointsRequest\x1a#.mantrae.v1.ListEntryPointsResponse\"\x03\x90\x02\x01B\xa9\x01\n" + - "\x0ecom.mantrae.v1B\x0fEntryPointProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_entry_point_proto_rawDesc = string([]byte{ + 0x0a, 0x1c, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x01, 0x0a, 0x0a, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x26, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x50, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, + 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x66, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, + 0x53, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x65, + 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x76, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x53, 0x0a, 0x18, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, + 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x22, 0x29, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1a, 0x0a, 0x18, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, + 0x75, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xec, 0x03, 0x0a, 0x11, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x20, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x5d, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, + 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, + 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_entry_point_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/mantraev1connect/agent_management.connect.go b/proto/gen/mantrae/v1/mantraev1connect/agent_management.connect.go new file mode 100644 index 0000000..79d5f8f --- /dev/null +++ b/proto/gen/mantrae/v1/mantraev1connect/agent_management.connect.go @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: mantrae/v1/agent_management.proto + +package mantraev1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // AgentManagementServiceName is the fully-qualified name of the AgentManagementService service. + AgentManagementServiceName = "mantrae.v1.AgentManagementService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // AgentManagementServiceGetAgentProcedure is the fully-qualified name of the + // AgentManagementService's GetAgent RPC. + AgentManagementServiceGetAgentProcedure = "/mantrae.v1.AgentManagementService/GetAgent" + // AgentManagementServiceCreateAgentProcedure is the fully-qualified name of the + // AgentManagementService's CreateAgent RPC. + AgentManagementServiceCreateAgentProcedure = "/mantrae.v1.AgentManagementService/CreateAgent" + // AgentManagementServiceUpdateAgentIPProcedure is the fully-qualified name of the + // AgentManagementService's UpdateAgentIP RPC. + AgentManagementServiceUpdateAgentIPProcedure = "/mantrae.v1.AgentManagementService/UpdateAgentIP" + // AgentManagementServiceDeleteAgentProcedure is the fully-qualified name of the + // AgentManagementService's DeleteAgent RPC. + AgentManagementServiceDeleteAgentProcedure = "/mantrae.v1.AgentManagementService/DeleteAgent" + // AgentManagementServiceListAgentsProcedure is the fully-qualified name of the + // AgentManagementService's ListAgents RPC. + AgentManagementServiceListAgentsProcedure = "/mantrae.v1.AgentManagementService/ListAgents" + // AgentManagementServiceRotateAgentTokenProcedure is the fully-qualified name of the + // AgentManagementService's RotateAgentToken RPC. + AgentManagementServiceRotateAgentTokenProcedure = "/mantrae.v1.AgentManagementService/RotateAgentToken" +) + +// AgentManagementServiceClient is a client for the mantrae.v1.AgentManagementService service. +type AgentManagementServiceClient interface { + GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error) + CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.CreateAgentResponse], error) + UpdateAgentIP(context.Context, *connect.Request[v1.UpdateAgentIPRequest]) (*connect.Response[v1.UpdateAgentIPResponse], error) + DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) + ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error) + RotateAgentToken(context.Context, *connect.Request[v1.RotateAgentTokenRequest]) (*connect.Response[v1.RotateAgentTokenResponse], error) +} + +// NewAgentManagementServiceClient constructs a client for the mantrae.v1.AgentManagementService +// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for +// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply +// the connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewAgentManagementServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentManagementServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + agentManagementServiceMethods := v1.File_mantrae_v1_agent_management_proto.Services().ByName("AgentManagementService").Methods() + return &agentManagementServiceClient{ + getAgent: connect.NewClient[v1.GetAgentRequest, v1.GetAgentResponse]( + httpClient, + baseURL+AgentManagementServiceGetAgentProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("GetAgent")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + createAgent: connect.NewClient[v1.CreateAgentRequest, v1.CreateAgentResponse]( + httpClient, + baseURL+AgentManagementServiceCreateAgentProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("CreateAgent")), + connect.WithClientOptions(opts...), + ), + updateAgentIP: connect.NewClient[v1.UpdateAgentIPRequest, v1.UpdateAgentIPResponse]( + httpClient, + baseURL+AgentManagementServiceUpdateAgentIPProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("UpdateAgentIP")), + connect.WithClientOptions(opts...), + ), + deleteAgent: connect.NewClient[v1.DeleteAgentRequest, v1.DeleteAgentResponse]( + httpClient, + baseURL+AgentManagementServiceDeleteAgentProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("DeleteAgent")), + connect.WithClientOptions(opts...), + ), + listAgents: connect.NewClient[v1.ListAgentsRequest, v1.ListAgentsResponse]( + httpClient, + baseURL+AgentManagementServiceListAgentsProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("ListAgents")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + rotateAgentToken: connect.NewClient[v1.RotateAgentTokenRequest, v1.RotateAgentTokenResponse]( + httpClient, + baseURL+AgentManagementServiceRotateAgentTokenProcedure, + connect.WithSchema(agentManagementServiceMethods.ByName("RotateAgentToken")), + connect.WithClientOptions(opts...), + ), + } +} + +// agentManagementServiceClient implements AgentManagementServiceClient. +type agentManagementServiceClient struct { + getAgent *connect.Client[v1.GetAgentRequest, v1.GetAgentResponse] + createAgent *connect.Client[v1.CreateAgentRequest, v1.CreateAgentResponse] + updateAgentIP *connect.Client[v1.UpdateAgentIPRequest, v1.UpdateAgentIPResponse] + deleteAgent *connect.Client[v1.DeleteAgentRequest, v1.DeleteAgentResponse] + listAgents *connect.Client[v1.ListAgentsRequest, v1.ListAgentsResponse] + rotateAgentToken *connect.Client[v1.RotateAgentTokenRequest, v1.RotateAgentTokenResponse] +} + +// GetAgent calls mantrae.v1.AgentManagementService.GetAgent. +func (c *agentManagementServiceClient) GetAgent(ctx context.Context, req *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error) { + return c.getAgent.CallUnary(ctx, req) +} + +// CreateAgent calls mantrae.v1.AgentManagementService.CreateAgent. +func (c *agentManagementServiceClient) CreateAgent(ctx context.Context, req *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.CreateAgentResponse], error) { + return c.createAgent.CallUnary(ctx, req) +} + +// UpdateAgentIP calls mantrae.v1.AgentManagementService.UpdateAgentIP. +func (c *agentManagementServiceClient) UpdateAgentIP(ctx context.Context, req *connect.Request[v1.UpdateAgentIPRequest]) (*connect.Response[v1.UpdateAgentIPResponse], error) { + return c.updateAgentIP.CallUnary(ctx, req) +} + +// DeleteAgent calls mantrae.v1.AgentManagementService.DeleteAgent. +func (c *agentManagementServiceClient) DeleteAgent(ctx context.Context, req *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) { + return c.deleteAgent.CallUnary(ctx, req) +} + +// ListAgents calls mantrae.v1.AgentManagementService.ListAgents. +func (c *agentManagementServiceClient) ListAgents(ctx context.Context, req *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error) { + return c.listAgents.CallUnary(ctx, req) +} + +// RotateAgentToken calls mantrae.v1.AgentManagementService.RotateAgentToken. +func (c *agentManagementServiceClient) RotateAgentToken(ctx context.Context, req *connect.Request[v1.RotateAgentTokenRequest]) (*connect.Response[v1.RotateAgentTokenResponse], error) { + return c.rotateAgentToken.CallUnary(ctx, req) +} + +// AgentManagementServiceHandler is an implementation of the mantrae.v1.AgentManagementService +// service. +type AgentManagementServiceHandler interface { + GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error) + CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.CreateAgentResponse], error) + UpdateAgentIP(context.Context, *connect.Request[v1.UpdateAgentIPRequest]) (*connect.Response[v1.UpdateAgentIPResponse], error) + DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) + ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error) + RotateAgentToken(context.Context, *connect.Request[v1.RotateAgentTokenRequest]) (*connect.Response[v1.RotateAgentTokenResponse], error) +} + +// NewAgentManagementServiceHandler builds an HTTP handler from the service implementation. It +// returns the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewAgentManagementServiceHandler(svc AgentManagementServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + agentManagementServiceMethods := v1.File_mantrae_v1_agent_management_proto.Services().ByName("AgentManagementService").Methods() + agentManagementServiceGetAgentHandler := connect.NewUnaryHandler( + AgentManagementServiceGetAgentProcedure, + svc.GetAgent, + connect.WithSchema(agentManagementServiceMethods.ByName("GetAgent")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + agentManagementServiceCreateAgentHandler := connect.NewUnaryHandler( + AgentManagementServiceCreateAgentProcedure, + svc.CreateAgent, + connect.WithSchema(agentManagementServiceMethods.ByName("CreateAgent")), + connect.WithHandlerOptions(opts...), + ) + agentManagementServiceUpdateAgentIPHandler := connect.NewUnaryHandler( + AgentManagementServiceUpdateAgentIPProcedure, + svc.UpdateAgentIP, + connect.WithSchema(agentManagementServiceMethods.ByName("UpdateAgentIP")), + connect.WithHandlerOptions(opts...), + ) + agentManagementServiceDeleteAgentHandler := connect.NewUnaryHandler( + AgentManagementServiceDeleteAgentProcedure, + svc.DeleteAgent, + connect.WithSchema(agentManagementServiceMethods.ByName("DeleteAgent")), + connect.WithHandlerOptions(opts...), + ) + agentManagementServiceListAgentsHandler := connect.NewUnaryHandler( + AgentManagementServiceListAgentsProcedure, + svc.ListAgents, + connect.WithSchema(agentManagementServiceMethods.ByName("ListAgents")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + agentManagementServiceRotateAgentTokenHandler := connect.NewUnaryHandler( + AgentManagementServiceRotateAgentTokenProcedure, + svc.RotateAgentToken, + connect.WithSchema(agentManagementServiceMethods.ByName("RotateAgentToken")), + connect.WithHandlerOptions(opts...), + ) + return "/mantrae.v1.AgentManagementService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AgentManagementServiceGetAgentProcedure: + agentManagementServiceGetAgentHandler.ServeHTTP(w, r) + case AgentManagementServiceCreateAgentProcedure: + agentManagementServiceCreateAgentHandler.ServeHTTP(w, r) + case AgentManagementServiceUpdateAgentIPProcedure: + agentManagementServiceUpdateAgentIPHandler.ServeHTTP(w, r) + case AgentManagementServiceDeleteAgentProcedure: + agentManagementServiceDeleteAgentHandler.ServeHTTP(w, r) + case AgentManagementServiceListAgentsProcedure: + agentManagementServiceListAgentsHandler.ServeHTTP(w, r) + case AgentManagementServiceRotateAgentTokenProcedure: + agentManagementServiceRotateAgentTokenHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAgentManagementServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedAgentManagementServiceHandler struct{} + +func (UnimplementedAgentManagementServiceHandler) GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.GetAgent is not implemented")) +} + +func (UnimplementedAgentManagementServiceHandler) CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.CreateAgentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.CreateAgent is not implemented")) +} + +func (UnimplementedAgentManagementServiceHandler) UpdateAgentIP(context.Context, *connect.Request[v1.UpdateAgentIPRequest]) (*connect.Response[v1.UpdateAgentIPResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.UpdateAgentIP is not implemented")) +} + +func (UnimplementedAgentManagementServiceHandler) DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.DeleteAgent is not implemented")) +} + +func (UnimplementedAgentManagementServiceHandler) ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.ListAgents is not implemented")) +} + +func (UnimplementedAgentManagementServiceHandler) RotateAgentToken(context.Context, *connect.Request[v1.RotateAgentTokenRequest]) (*connect.Response[v1.RotateAgentTokenResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.AgentManagementService.RotateAgentToken is not implemented")) +} diff --git a/proto/gen/mantrae/v1/mantraev1connect/backup.connect.go b/proto/gen/mantrae/v1/mantraev1connect/backup.connect.go new file mode 100644 index 0000000..ae9438e --- /dev/null +++ b/proto/gen/mantrae/v1/mantraev1connect/backup.connect.go @@ -0,0 +1,256 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: mantrae/v1/backup.proto + +package mantraev1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // BackupServiceName is the fully-qualified name of the BackupService service. + BackupServiceName = "mantrae.v1.BackupService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // BackupServiceCreateBackupProcedure is the fully-qualified name of the BackupService's + // CreateBackup RPC. + BackupServiceCreateBackupProcedure = "/mantrae.v1.BackupService/CreateBackup" + // BackupServiceRestoreBackupProcedure is the fully-qualified name of the BackupService's + // RestoreBackup RPC. + BackupServiceRestoreBackupProcedure = "/mantrae.v1.BackupService/RestoreBackup" + // BackupServiceListBackupsProcedure is the fully-qualified name of the BackupService's ListBackups + // RPC. + BackupServiceListBackupsProcedure = "/mantrae.v1.BackupService/ListBackups" + // BackupServiceDeleteBackupProcedure is the fully-qualified name of the BackupService's + // DeleteBackup RPC. + BackupServiceDeleteBackupProcedure = "/mantrae.v1.BackupService/DeleteBackup" + // BackupServiceDownloadBackupProcedure is the fully-qualified name of the BackupService's + // DownloadBackup RPC. + BackupServiceDownloadBackupProcedure = "/mantrae.v1.BackupService/DownloadBackup" + // BackupServiceUploadBackupProcedure is the fully-qualified name of the BackupService's + // UploadBackup RPC. + BackupServiceUploadBackupProcedure = "/mantrae.v1.BackupService/UploadBackup" +) + +// BackupServiceClient is a client for the mantrae.v1.BackupService service. +type BackupServiceClient interface { + CreateBackup(context.Context, *connect.Request[v1.CreateBackupRequest]) (*connect.Response[v1.CreateBackupResponse], error) + RestoreBackup(context.Context, *connect.Request[v1.RestoreBackupRequest]) (*connect.Response[v1.RestoreBackupResponse], error) + ListBackups(context.Context, *connect.Request[v1.ListBackupsRequest]) (*connect.Response[v1.ListBackupsResponse], error) + DeleteBackup(context.Context, *connect.Request[v1.DeleteBackupRequest]) (*connect.Response[v1.DeleteBackupResponse], error) + DownloadBackup(context.Context, *connect.Request[v1.DownloadBackupRequest]) (*connect.ServerStreamForClient[v1.DownloadBackupResponse], error) + UploadBackup(context.Context) *connect.ClientStreamForClient[v1.UploadBackupRequest, v1.UploadBackupResponse] +} + +// NewBackupServiceClient constructs a client for the mantrae.v1.BackupService service. By default, +// it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and +// sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() +// or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewBackupServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BackupServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + backupServiceMethods := v1.File_mantrae_v1_backup_proto.Services().ByName("BackupService").Methods() + return &backupServiceClient{ + createBackup: connect.NewClient[v1.CreateBackupRequest, v1.CreateBackupResponse]( + httpClient, + baseURL+BackupServiceCreateBackupProcedure, + connect.WithSchema(backupServiceMethods.ByName("CreateBackup")), + connect.WithClientOptions(opts...), + ), + restoreBackup: connect.NewClient[v1.RestoreBackupRequest, v1.RestoreBackupResponse]( + httpClient, + baseURL+BackupServiceRestoreBackupProcedure, + connect.WithSchema(backupServiceMethods.ByName("RestoreBackup")), + connect.WithClientOptions(opts...), + ), + listBackups: connect.NewClient[v1.ListBackupsRequest, v1.ListBackupsResponse]( + httpClient, + baseURL+BackupServiceListBackupsProcedure, + connect.WithSchema(backupServiceMethods.ByName("ListBackups")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + deleteBackup: connect.NewClient[v1.DeleteBackupRequest, v1.DeleteBackupResponse]( + httpClient, + baseURL+BackupServiceDeleteBackupProcedure, + connect.WithSchema(backupServiceMethods.ByName("DeleteBackup")), + connect.WithClientOptions(opts...), + ), + downloadBackup: connect.NewClient[v1.DownloadBackupRequest, v1.DownloadBackupResponse]( + httpClient, + baseURL+BackupServiceDownloadBackupProcedure, + connect.WithSchema(backupServiceMethods.ByName("DownloadBackup")), + connect.WithClientOptions(opts...), + ), + uploadBackup: connect.NewClient[v1.UploadBackupRequest, v1.UploadBackupResponse]( + httpClient, + baseURL+BackupServiceUploadBackupProcedure, + connect.WithSchema(backupServiceMethods.ByName("UploadBackup")), + connect.WithClientOptions(opts...), + ), + } +} + +// backupServiceClient implements BackupServiceClient. +type backupServiceClient struct { + createBackup *connect.Client[v1.CreateBackupRequest, v1.CreateBackupResponse] + restoreBackup *connect.Client[v1.RestoreBackupRequest, v1.RestoreBackupResponse] + listBackups *connect.Client[v1.ListBackupsRequest, v1.ListBackupsResponse] + deleteBackup *connect.Client[v1.DeleteBackupRequest, v1.DeleteBackupResponse] + downloadBackup *connect.Client[v1.DownloadBackupRequest, v1.DownloadBackupResponse] + uploadBackup *connect.Client[v1.UploadBackupRequest, v1.UploadBackupResponse] +} + +// CreateBackup calls mantrae.v1.BackupService.CreateBackup. +func (c *backupServiceClient) CreateBackup(ctx context.Context, req *connect.Request[v1.CreateBackupRequest]) (*connect.Response[v1.CreateBackupResponse], error) { + return c.createBackup.CallUnary(ctx, req) +} + +// RestoreBackup calls mantrae.v1.BackupService.RestoreBackup. +func (c *backupServiceClient) RestoreBackup(ctx context.Context, req *connect.Request[v1.RestoreBackupRequest]) (*connect.Response[v1.RestoreBackupResponse], error) { + return c.restoreBackup.CallUnary(ctx, req) +} + +// ListBackups calls mantrae.v1.BackupService.ListBackups. +func (c *backupServiceClient) ListBackups(ctx context.Context, req *connect.Request[v1.ListBackupsRequest]) (*connect.Response[v1.ListBackupsResponse], error) { + return c.listBackups.CallUnary(ctx, req) +} + +// DeleteBackup calls mantrae.v1.BackupService.DeleteBackup. +func (c *backupServiceClient) DeleteBackup(ctx context.Context, req *connect.Request[v1.DeleteBackupRequest]) (*connect.Response[v1.DeleteBackupResponse], error) { + return c.deleteBackup.CallUnary(ctx, req) +} + +// DownloadBackup calls mantrae.v1.BackupService.DownloadBackup. +func (c *backupServiceClient) DownloadBackup(ctx context.Context, req *connect.Request[v1.DownloadBackupRequest]) (*connect.ServerStreamForClient[v1.DownloadBackupResponse], error) { + return c.downloadBackup.CallServerStream(ctx, req) +} + +// UploadBackup calls mantrae.v1.BackupService.UploadBackup. +func (c *backupServiceClient) UploadBackup(ctx context.Context) *connect.ClientStreamForClient[v1.UploadBackupRequest, v1.UploadBackupResponse] { + return c.uploadBackup.CallClientStream(ctx) +} + +// BackupServiceHandler is an implementation of the mantrae.v1.BackupService service. +type BackupServiceHandler interface { + CreateBackup(context.Context, *connect.Request[v1.CreateBackupRequest]) (*connect.Response[v1.CreateBackupResponse], error) + RestoreBackup(context.Context, *connect.Request[v1.RestoreBackupRequest]) (*connect.Response[v1.RestoreBackupResponse], error) + ListBackups(context.Context, *connect.Request[v1.ListBackupsRequest]) (*connect.Response[v1.ListBackupsResponse], error) + DeleteBackup(context.Context, *connect.Request[v1.DeleteBackupRequest]) (*connect.Response[v1.DeleteBackupResponse], error) + DownloadBackup(context.Context, *connect.Request[v1.DownloadBackupRequest], *connect.ServerStream[v1.DownloadBackupResponse]) error + UploadBackup(context.Context, *connect.ClientStream[v1.UploadBackupRequest]) (*connect.Response[v1.UploadBackupResponse], error) +} + +// NewBackupServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewBackupServiceHandler(svc BackupServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + backupServiceMethods := v1.File_mantrae_v1_backup_proto.Services().ByName("BackupService").Methods() + backupServiceCreateBackupHandler := connect.NewUnaryHandler( + BackupServiceCreateBackupProcedure, + svc.CreateBackup, + connect.WithSchema(backupServiceMethods.ByName("CreateBackup")), + connect.WithHandlerOptions(opts...), + ) + backupServiceRestoreBackupHandler := connect.NewUnaryHandler( + BackupServiceRestoreBackupProcedure, + svc.RestoreBackup, + connect.WithSchema(backupServiceMethods.ByName("RestoreBackup")), + connect.WithHandlerOptions(opts...), + ) + backupServiceListBackupsHandler := connect.NewUnaryHandler( + BackupServiceListBackupsProcedure, + svc.ListBackups, + connect.WithSchema(backupServiceMethods.ByName("ListBackups")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + backupServiceDeleteBackupHandler := connect.NewUnaryHandler( + BackupServiceDeleteBackupProcedure, + svc.DeleteBackup, + connect.WithSchema(backupServiceMethods.ByName("DeleteBackup")), + connect.WithHandlerOptions(opts...), + ) + backupServiceDownloadBackupHandler := connect.NewServerStreamHandler( + BackupServiceDownloadBackupProcedure, + svc.DownloadBackup, + connect.WithSchema(backupServiceMethods.ByName("DownloadBackup")), + connect.WithHandlerOptions(opts...), + ) + backupServiceUploadBackupHandler := connect.NewClientStreamHandler( + BackupServiceUploadBackupProcedure, + svc.UploadBackup, + connect.WithSchema(backupServiceMethods.ByName("UploadBackup")), + connect.WithHandlerOptions(opts...), + ) + return "/mantrae.v1.BackupService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case BackupServiceCreateBackupProcedure: + backupServiceCreateBackupHandler.ServeHTTP(w, r) + case BackupServiceRestoreBackupProcedure: + backupServiceRestoreBackupHandler.ServeHTTP(w, r) + case BackupServiceListBackupsProcedure: + backupServiceListBackupsHandler.ServeHTTP(w, r) + case BackupServiceDeleteBackupProcedure: + backupServiceDeleteBackupHandler.ServeHTTP(w, r) + case BackupServiceDownloadBackupProcedure: + backupServiceDownloadBackupHandler.ServeHTTP(w, r) + case BackupServiceUploadBackupProcedure: + backupServiceUploadBackupHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedBackupServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedBackupServiceHandler struct{} + +func (UnimplementedBackupServiceHandler) CreateBackup(context.Context, *connect.Request[v1.CreateBackupRequest]) (*connect.Response[v1.CreateBackupResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.CreateBackup is not implemented")) +} + +func (UnimplementedBackupServiceHandler) RestoreBackup(context.Context, *connect.Request[v1.RestoreBackupRequest]) (*connect.Response[v1.RestoreBackupResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.RestoreBackup is not implemented")) +} + +func (UnimplementedBackupServiceHandler) ListBackups(context.Context, *connect.Request[v1.ListBackupsRequest]) (*connect.Response[v1.ListBackupsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.ListBackups is not implemented")) +} + +func (UnimplementedBackupServiceHandler) DeleteBackup(context.Context, *connect.Request[v1.DeleteBackupRequest]) (*connect.Response[v1.DeleteBackupResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.DeleteBackup is not implemented")) +} + +func (UnimplementedBackupServiceHandler) DownloadBackup(context.Context, *connect.Request[v1.DownloadBackupRequest], *connect.ServerStream[v1.DownloadBackupResponse]) error { + return connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.DownloadBackup is not implemented")) +} + +func (UnimplementedBackupServiceHandler) UploadBackup(context.Context, *connect.ClientStream[v1.UploadBackupRequest]) (*connect.Response[v1.UploadBackupResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.BackupService.UploadBackup is not implemented")) +} diff --git a/proto/gen/mantrae/v1/mantraev1connect/middleware.connect.go b/proto/gen/mantrae/v1/mantraev1connect/middleware.connect.go index 398ccf3..690c9b9 100644 --- a/proto/gen/mantrae/v1/mantraev1connect/middleware.connect.go +++ b/proto/gen/mantrae/v1/mantraev1connect/middleware.connect.go @@ -48,6 +48,9 @@ const ( // MiddlewareServiceListMiddlewaresProcedure is the fully-qualified name of the MiddlewareService's // ListMiddlewares RPC. MiddlewareServiceListMiddlewaresProcedure = "/mantrae.v1.MiddlewareService/ListMiddlewares" + // MiddlewareServiceGetMiddlewarePluginsProcedure is the fully-qualified name of the + // MiddlewareService's GetMiddlewarePlugins RPC. + MiddlewareServiceGetMiddlewarePluginsProcedure = "/mantrae.v1.MiddlewareService/GetMiddlewarePlugins" ) // MiddlewareServiceClient is a client for the mantrae.v1.MiddlewareService service. @@ -57,6 +60,7 @@ type MiddlewareServiceClient interface { UpdateMiddleware(context.Context, *connect.Request[v1.UpdateMiddlewareRequest]) (*connect.Response[v1.UpdateMiddlewareResponse], error) DeleteMiddleware(context.Context, *connect.Request[v1.DeleteMiddlewareRequest]) (*connect.Response[v1.DeleteMiddlewareResponse], error) ListMiddlewares(context.Context, *connect.Request[v1.ListMiddlewaresRequest]) (*connect.Response[v1.ListMiddlewaresResponse], error) + GetMiddlewarePlugins(context.Context, *connect.Request[v1.GetMiddlewarePluginsRequest]) (*connect.Response[v1.GetMiddlewarePluginsResponse], error) } // NewMiddlewareServiceClient constructs a client for the mantrae.v1.MiddlewareService service. By @@ -102,16 +106,24 @@ func NewMiddlewareServiceClient(httpClient connect.HTTPClient, baseURL string, o connect.WithIdempotency(connect.IdempotencyNoSideEffects), connect.WithClientOptions(opts...), ), + getMiddlewarePlugins: connect.NewClient[v1.GetMiddlewarePluginsRequest, v1.GetMiddlewarePluginsResponse]( + httpClient, + baseURL+MiddlewareServiceGetMiddlewarePluginsProcedure, + connect.WithSchema(middlewareServiceMethods.ByName("GetMiddlewarePlugins")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), } } // middlewareServiceClient implements MiddlewareServiceClient. type middlewareServiceClient struct { - getMiddleware *connect.Client[v1.GetMiddlewareRequest, v1.GetMiddlewareResponse] - createMiddleware *connect.Client[v1.CreateMiddlewareRequest, v1.CreateMiddlewareResponse] - updateMiddleware *connect.Client[v1.UpdateMiddlewareRequest, v1.UpdateMiddlewareResponse] - deleteMiddleware *connect.Client[v1.DeleteMiddlewareRequest, v1.DeleteMiddlewareResponse] - listMiddlewares *connect.Client[v1.ListMiddlewaresRequest, v1.ListMiddlewaresResponse] + getMiddleware *connect.Client[v1.GetMiddlewareRequest, v1.GetMiddlewareResponse] + createMiddleware *connect.Client[v1.CreateMiddlewareRequest, v1.CreateMiddlewareResponse] + updateMiddleware *connect.Client[v1.UpdateMiddlewareRequest, v1.UpdateMiddlewareResponse] + deleteMiddleware *connect.Client[v1.DeleteMiddlewareRequest, v1.DeleteMiddlewareResponse] + listMiddlewares *connect.Client[v1.ListMiddlewaresRequest, v1.ListMiddlewaresResponse] + getMiddlewarePlugins *connect.Client[v1.GetMiddlewarePluginsRequest, v1.GetMiddlewarePluginsResponse] } // GetMiddleware calls mantrae.v1.MiddlewareService.GetMiddleware. @@ -139,6 +151,11 @@ func (c *middlewareServiceClient) ListMiddlewares(ctx context.Context, req *conn return c.listMiddlewares.CallUnary(ctx, req) } +// GetMiddlewarePlugins calls mantrae.v1.MiddlewareService.GetMiddlewarePlugins. +func (c *middlewareServiceClient) GetMiddlewarePlugins(ctx context.Context, req *connect.Request[v1.GetMiddlewarePluginsRequest]) (*connect.Response[v1.GetMiddlewarePluginsResponse], error) { + return c.getMiddlewarePlugins.CallUnary(ctx, req) +} + // MiddlewareServiceHandler is an implementation of the mantrae.v1.MiddlewareService service. type MiddlewareServiceHandler interface { GetMiddleware(context.Context, *connect.Request[v1.GetMiddlewareRequest]) (*connect.Response[v1.GetMiddlewareResponse], error) @@ -146,6 +163,7 @@ type MiddlewareServiceHandler interface { UpdateMiddleware(context.Context, *connect.Request[v1.UpdateMiddlewareRequest]) (*connect.Response[v1.UpdateMiddlewareResponse], error) DeleteMiddleware(context.Context, *connect.Request[v1.DeleteMiddlewareRequest]) (*connect.Response[v1.DeleteMiddlewareResponse], error) ListMiddlewares(context.Context, *connect.Request[v1.ListMiddlewaresRequest]) (*connect.Response[v1.ListMiddlewaresResponse], error) + GetMiddlewarePlugins(context.Context, *connect.Request[v1.GetMiddlewarePluginsRequest]) (*connect.Response[v1.GetMiddlewarePluginsResponse], error) } // NewMiddlewareServiceHandler builds an HTTP handler from the service implementation. It returns @@ -187,6 +205,13 @@ func NewMiddlewareServiceHandler(svc MiddlewareServiceHandler, opts ...connect.H connect.WithIdempotency(connect.IdempotencyNoSideEffects), connect.WithHandlerOptions(opts...), ) + middlewareServiceGetMiddlewarePluginsHandler := connect.NewUnaryHandler( + MiddlewareServiceGetMiddlewarePluginsProcedure, + svc.GetMiddlewarePlugins, + connect.WithSchema(middlewareServiceMethods.ByName("GetMiddlewarePlugins")), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) return "/mantrae.v1.MiddlewareService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case MiddlewareServiceGetMiddlewareProcedure: @@ -199,6 +224,8 @@ func NewMiddlewareServiceHandler(svc MiddlewareServiceHandler, opts ...connect.H middlewareServiceDeleteMiddlewareHandler.ServeHTTP(w, r) case MiddlewareServiceListMiddlewaresProcedure: middlewareServiceListMiddlewaresHandler.ServeHTTP(w, r) + case MiddlewareServiceGetMiddlewarePluginsProcedure: + middlewareServiceGetMiddlewarePluginsHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -227,3 +254,7 @@ func (UnimplementedMiddlewareServiceHandler) DeleteMiddleware(context.Context, * func (UnimplementedMiddlewareServiceHandler) ListMiddlewares(context.Context, *connect.Request[v1.ListMiddlewaresRequest]) (*connect.Response[v1.ListMiddlewaresResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.MiddlewareService.ListMiddlewares is not implemented")) } + +func (UnimplementedMiddlewareServiceHandler) GetMiddlewarePlugins(context.Context, *connect.Request[v1.GetMiddlewarePluginsRequest]) (*connect.Response[v1.GetMiddlewarePluginsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.MiddlewareService.GetMiddlewarePlugins is not implemented")) +} diff --git a/proto/gen/mantrae/v1/middleware.pb.go b/proto/gen/mantrae/v1/middleware.pb.go index 4cd0742..3012f69 100644 --- a/proto/gen/mantrae/v1/middleware.pb.go +++ b/proto/gen/mantrae/v1/middleware.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/middleware.proto @@ -75,9 +75,9 @@ type Middleware struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` ProfileId int64 `protobuf:"varint,2,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` Type MiddlewareType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` @@ -129,6 +129,13 @@ func (x *Middleware) GetProfileId() int64 { return 0 } +func (x *Middleware) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *Middleware) GetName() string { if x != nil { return x.Name @@ -143,13 +150,6 @@ func (x *Middleware) GetConfig() string { return "" } -func (x *Middleware) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *Middleware) GetType() MiddlewareType { if x != nil { return x.Type @@ -171,6 +171,206 @@ func (x *Middleware) GetUpdatedAt() *timestamppb.Timestamp { return nil } +type Plugin struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Import string `protobuf:"bytes,6,opt,name=import,proto3" json:"import,omitempty"` + Summary string `protobuf:"bytes,7,opt,name=summary,proto3" json:"summary,omitempty"` + IconUrl string `protobuf:"bytes,8,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` + BannerUrl string `protobuf:"bytes,9,opt,name=banner_url,json=bannerUrl,proto3" json:"banner_url,omitempty"` + Readme string `protobuf:"bytes,10,opt,name=readme,proto3" json:"readme,omitempty"` + LatestVersion string `protobuf:"bytes,11,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` + Versions []string `protobuf:"bytes,12,rep,name=versions,proto3" json:"versions,omitempty"` + Stars int64 `protobuf:"varint,13,opt,name=stars,proto3" json:"stars,omitempty"` + Snippet *PluginSnippet `protobuf:"bytes,14,opt,name=snippet,proto3" json:"snippet,omitempty"` + CreatedAt string `protobuf:"bytes,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Plugin) Reset() { + *x = Plugin{} + mi := &file_mantrae_v1_middleware_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Plugin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Plugin) ProtoMessage() {} + +func (x *Plugin) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_middleware_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Plugin.ProtoReflect.Descriptor instead. +func (*Plugin) Descriptor() ([]byte, []int) { + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{1} +} + +func (x *Plugin) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Plugin) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Plugin) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Plugin) GetAuthor() string { + if x != nil { + return x.Author + } + return "" +} + +func (x *Plugin) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Plugin) GetImport() string { + if x != nil { + return x.Import + } + return "" +} + +func (x *Plugin) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *Plugin) GetIconUrl() string { + if x != nil { + return x.IconUrl + } + return "" +} + +func (x *Plugin) GetBannerUrl() string { + if x != nil { + return x.BannerUrl + } + return "" +} + +func (x *Plugin) GetReadme() string { + if x != nil { + return x.Readme + } + return "" +} + +func (x *Plugin) GetLatestVersion() string { + if x != nil { + return x.LatestVersion + } + return "" +} + +func (x *Plugin) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +func (x *Plugin) GetStars() int64 { + if x != nil { + return x.Stars + } + return 0 +} + +func (x *Plugin) GetSnippet() *PluginSnippet { + if x != nil { + return x.Snippet + } + return nil +} + +func (x *Plugin) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +type PluginSnippet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Yaml string `protobuf:"bytes,1,opt,name=yaml,proto3" json:"yaml,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PluginSnippet) Reset() { + *x = PluginSnippet{} + mi := &file_mantrae_v1_middleware_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PluginSnippet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginSnippet) ProtoMessage() {} + +func (x *PluginSnippet) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_middleware_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PluginSnippet.ProtoReflect.Descriptor instead. +func (*PluginSnippet) Descriptor() ([]byte, []int) { + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{2} +} + +func (x *PluginSnippet) GetYaml() string { + if x != nil { + return x.Yaml + } + return "" +} + type GetMiddlewareRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -181,7 +381,7 @@ type GetMiddlewareRequest struct { func (x *GetMiddlewareRequest) Reset() { *x = GetMiddlewareRequest{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[1] + mi := &file_mantrae_v1_middleware_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -193,7 +393,7 @@ func (x *GetMiddlewareRequest) String() string { func (*GetMiddlewareRequest) ProtoMessage() {} func (x *GetMiddlewareRequest) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[1] + mi := &file_mantrae_v1_middleware_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -206,7 +406,7 @@ func (x *GetMiddlewareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMiddlewareRequest.ProtoReflect.Descriptor instead. func (*GetMiddlewareRequest) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{1} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{3} } func (x *GetMiddlewareRequest) GetId() int64 { @@ -232,7 +432,7 @@ type GetMiddlewareResponse struct { func (x *GetMiddlewareResponse) Reset() { *x = GetMiddlewareResponse{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[2] + mi := &file_mantrae_v1_middleware_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -244,7 +444,7 @@ func (x *GetMiddlewareResponse) String() string { func (*GetMiddlewareResponse) ProtoMessage() {} func (x *GetMiddlewareResponse) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[2] + mi := &file_mantrae_v1_middleware_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -257,7 +457,7 @@ func (x *GetMiddlewareResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMiddlewareResponse.ProtoReflect.Descriptor instead. func (*GetMiddlewareResponse) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{2} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{4} } func (x *GetMiddlewareResponse) GetMiddleware() *Middleware { @@ -270,9 +470,9 @@ func (x *GetMiddlewareResponse) GetMiddleware() *Middleware { type CreateMiddlewareRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` Type MiddlewareType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -280,7 +480,7 @@ type CreateMiddlewareRequest struct { func (x *CreateMiddlewareRequest) Reset() { *x = CreateMiddlewareRequest{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[3] + mi := &file_mantrae_v1_middleware_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +492,7 @@ func (x *CreateMiddlewareRequest) String() string { func (*CreateMiddlewareRequest) ProtoMessage() {} func (x *CreateMiddlewareRequest) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[3] + mi := &file_mantrae_v1_middleware_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,7 +505,7 @@ func (x *CreateMiddlewareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateMiddlewareRequest.ProtoReflect.Descriptor instead. func (*CreateMiddlewareRequest) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{3} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{5} } func (x *CreateMiddlewareRequest) GetProfileId() int64 { @@ -315,6 +515,13 @@ func (x *CreateMiddlewareRequest) GetProfileId() int64 { return 0 } +func (x *CreateMiddlewareRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *CreateMiddlewareRequest) GetName() string { if x != nil { return x.Name @@ -329,13 +536,6 @@ func (x *CreateMiddlewareRequest) GetConfig() string { return "" } -func (x *CreateMiddlewareRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *CreateMiddlewareRequest) GetType() MiddlewareType { if x != nil { return x.Type @@ -352,7 +552,7 @@ type CreateMiddlewareResponse struct { func (x *CreateMiddlewareResponse) Reset() { *x = CreateMiddlewareResponse{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[4] + mi := &file_mantrae_v1_middleware_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -364,7 +564,7 @@ func (x *CreateMiddlewareResponse) String() string { func (*CreateMiddlewareResponse) ProtoMessage() {} func (x *CreateMiddlewareResponse) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[4] + mi := &file_mantrae_v1_middleware_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -377,7 +577,7 @@ func (x *CreateMiddlewareResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateMiddlewareResponse.ProtoReflect.Descriptor instead. func (*CreateMiddlewareResponse) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{4} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{6} } func (x *CreateMiddlewareResponse) GetMiddleware() *Middleware { @@ -392,15 +592,14 @@ type UpdateMiddlewareRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` - Type MiddlewareType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"` + Type MiddlewareType `protobuf:"varint,4,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateMiddlewareRequest) Reset() { *x = UpdateMiddlewareRequest{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[5] + mi := &file_mantrae_v1_middleware_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -412,7 +611,7 @@ func (x *UpdateMiddlewareRequest) String() string { func (*UpdateMiddlewareRequest) ProtoMessage() {} func (x *UpdateMiddlewareRequest) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[5] + mi := &file_mantrae_v1_middleware_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -425,7 +624,7 @@ func (x *UpdateMiddlewareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateMiddlewareRequest.ProtoReflect.Descriptor instead. func (*UpdateMiddlewareRequest) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{5} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{7} } func (x *UpdateMiddlewareRequest) GetId() int64 { @@ -449,13 +648,6 @@ func (x *UpdateMiddlewareRequest) GetConfig() string { return "" } -func (x *UpdateMiddlewareRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *UpdateMiddlewareRequest) GetType() MiddlewareType { if x != nil { return x.Type @@ -472,7 +664,7 @@ type UpdateMiddlewareResponse struct { func (x *UpdateMiddlewareResponse) Reset() { *x = UpdateMiddlewareResponse{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[6] + mi := &file_mantrae_v1_middleware_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -484,7 +676,7 @@ func (x *UpdateMiddlewareResponse) String() string { func (*UpdateMiddlewareResponse) ProtoMessage() {} func (x *UpdateMiddlewareResponse) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[6] + mi := &file_mantrae_v1_middleware_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -497,7 +689,7 @@ func (x *UpdateMiddlewareResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateMiddlewareResponse.ProtoReflect.Descriptor instead. func (*UpdateMiddlewareResponse) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{6} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{8} } func (x *UpdateMiddlewareResponse) GetMiddleware() *Middleware { @@ -516,7 +708,7 @@ type DeleteMiddlewareRequest struct { func (x *DeleteMiddlewareRequest) Reset() { *x = DeleteMiddlewareRequest{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[7] + mi := &file_mantrae_v1_middleware_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -528,7 +720,7 @@ func (x *DeleteMiddlewareRequest) String() string { func (*DeleteMiddlewareRequest) ProtoMessage() {} func (x *DeleteMiddlewareRequest) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[7] + mi := &file_mantrae_v1_middleware_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -541,7 +733,7 @@ func (x *DeleteMiddlewareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMiddlewareRequest.ProtoReflect.Descriptor instead. func (*DeleteMiddlewareRequest) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{7} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{9} } func (x *DeleteMiddlewareRequest) GetId() int64 { @@ -559,7 +751,7 @@ type DeleteMiddlewareResponse struct { func (x *DeleteMiddlewareResponse) Reset() { *x = DeleteMiddlewareResponse{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[8] + mi := &file_mantrae_v1_middleware_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -571,7 +763,7 @@ func (x *DeleteMiddlewareResponse) String() string { func (*DeleteMiddlewareResponse) ProtoMessage() {} func (x *DeleteMiddlewareResponse) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[8] + mi := &file_mantrae_v1_middleware_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -584,7 +776,7 @@ func (x *DeleteMiddlewareResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMiddlewareResponse.ProtoReflect.Descriptor instead. func (*DeleteMiddlewareResponse) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{8} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{10} } type ListMiddlewaresRequest struct { @@ -598,7 +790,7 @@ type ListMiddlewaresRequest struct { func (x *ListMiddlewaresRequest) Reset() { *x = ListMiddlewaresRequest{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[9] + mi := &file_mantrae_v1_middleware_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +802,7 @@ func (x *ListMiddlewaresRequest) String() string { func (*ListMiddlewaresRequest) ProtoMessage() {} func (x *ListMiddlewaresRequest) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[9] + mi := &file_mantrae_v1_middleware_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +815,7 @@ func (x *ListMiddlewaresRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMiddlewaresRequest.ProtoReflect.Descriptor instead. func (*ListMiddlewaresRequest) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{9} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{11} } func (x *ListMiddlewaresRequest) GetType() MiddlewareType { @@ -657,7 +849,7 @@ type ListMiddlewaresResponse struct { func (x *ListMiddlewaresResponse) Reset() { *x = ListMiddlewaresResponse{} - mi := &file_mantrae_v1_middleware_proto_msgTypes[10] + mi := &file_mantrae_v1_middleware_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -669,7 +861,7 @@ func (x *ListMiddlewaresResponse) String() string { func (*ListMiddlewaresResponse) ProtoMessage() {} func (x *ListMiddlewaresResponse) ProtoReflect() protoreflect.Message { - mi := &file_mantrae_v1_middleware_proto_msgTypes[10] + mi := &file_mantrae_v1_middleware_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -682,7 +874,7 @@ func (x *ListMiddlewaresResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMiddlewaresResponse.ProtoReflect.Descriptor instead. func (*ListMiddlewaresResponse) Descriptor() ([]byte, []int) { - return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{10} + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{12} } func (x *ListMiddlewaresResponse) GetMiddlewares() []*Middleware { @@ -699,79 +891,267 @@ func (x *ListMiddlewaresResponse) GetTotalCount() int64 { return 0 } +type GetMiddlewarePluginsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMiddlewarePluginsRequest) Reset() { + *x = GetMiddlewarePluginsRequest{} + mi := &file_mantrae_v1_middleware_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMiddlewarePluginsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMiddlewarePluginsRequest) ProtoMessage() {} + +func (x *GetMiddlewarePluginsRequest) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_middleware_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMiddlewarePluginsRequest.ProtoReflect.Descriptor instead. +func (*GetMiddlewarePluginsRequest) Descriptor() ([]byte, []int) { + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{13} +} + +type GetMiddlewarePluginsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Plugins []*Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMiddlewarePluginsResponse) Reset() { + *x = GetMiddlewarePluginsResponse{} + mi := &file_mantrae_v1_middleware_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMiddlewarePluginsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMiddlewarePluginsResponse) ProtoMessage() {} + +func (x *GetMiddlewarePluginsResponse) ProtoReflect() protoreflect.Message { + mi := &file_mantrae_v1_middleware_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMiddlewarePluginsResponse.ProtoReflect.Descriptor instead. +func (*GetMiddlewarePluginsResponse) Descriptor() ([]byte, []int) { + return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{14} +} + +func (x *GetMiddlewarePluginsResponse) GetPlugins() []*Plugin { + if x != nil { + return x.Plugins + } + return nil +} + var File_mantrae_v1_middleware_proto protoreflect.FileDescriptor -const file_mantrae_v1_middleware_proto_rawDesc = "" + - "\n" + - "\x1bmantrae/v1/middleware.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa5\x02\n" + - "\n" + - "Middleware\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" + - "\n" + - "profile_id\x18\x02 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x04 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x05 \x01(\tR\x06source\x12.\n" + - "\x04type\x18\x06 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\x129\n" + - "\n" + - "created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"V\n" + - "\x14GetMiddlewareRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12.\n" + - "\x04type\x18\x02 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\"O\n" + - "\x15GetMiddlewareResponse\x126\n" + - "\n" + - "middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" + - "middleware\"\xac\x01\n" + - "\x17CreateMiddlewareRequest\x12\x1d\n" + - "\n" + - "profile_id\x18\x01 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12.\n" + - "\x04type\x18\x05 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\"R\n" + - "\x18CreateMiddlewareResponse\x126\n" + - "\n" + - "middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" + - "middleware\"\x9d\x01\n" + - "\x17UpdateMiddlewareRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12.\n" + - "\x04type\x18\x05 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\"R\n" + - "\x18UpdateMiddlewareResponse\x126\n" + - "\n" + - "middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" + - "middleware\")\n" + - "\x17DeleteMiddlewareRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"\x1a\n" + - "\x18DeleteMiddlewareResponse\"\x95\x01\n" + - "\x16ListMiddlewaresRequest\x12.\n" + - "\x04type\x18\x01 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\x12\x19\n" + - "\x05limit\x18\x02 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x03 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"t\n" + - "\x17ListMiddlewaresResponse\x128\n" + - "\vmiddlewares\x18\x01 \x03(\v2\x16.mantrae.v1.MiddlewareR\vmiddlewares\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount*d\n" + - "\x0eMiddlewareType\x12\x1f\n" + - "\x1bMIDDLEWARE_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" + - "\x14MIDDLEWARE_TYPE_HTTP\x10\x01\x12\x17\n" + - "\x13MIDDLEWARE_TYPE_TCP\x10\x022\xec\x03\n" + - "\x11MiddlewareService\x12Y\n" + - "\rGetMiddleware\x12 .mantrae.v1.GetMiddlewareRequest\x1a!.mantrae.v1.GetMiddlewareResponse\"\x03\x90\x02\x01\x12]\n" + - "\x10CreateMiddleware\x12#.mantrae.v1.CreateMiddlewareRequest\x1a$.mantrae.v1.CreateMiddlewareResponse\x12]\n" + - "\x10UpdateMiddleware\x12#.mantrae.v1.UpdateMiddlewareRequest\x1a$.mantrae.v1.UpdateMiddlewareResponse\x12]\n" + - "\x10DeleteMiddleware\x12#.mantrae.v1.DeleteMiddlewareRequest\x1a$.mantrae.v1.DeleteMiddlewareResponse\x12_\n" + - "\x0fListMiddlewares\x12\".mantrae.v1.ListMiddlewaresRequest\x1a#.mantrae.v1.ListMiddlewaresResponse\"\x03\x90\x02\x01B\xa9\x01\n" + - "\x0ecom.mantrae.v1B\x0fMiddlewareProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_middleware_proto_rawDesc = string([]byte{ + 0x0a, 0x1b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x02, 0x0a, 0x0a, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xac, 0x03, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, + 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, + 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x73, + 0x12, 0x33, 0x0a, 0x07, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x52, 0x07, 0x73, 0x6e, + 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x22, 0x23, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x6e, + 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x56, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1a, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x4f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x36, 0x0a, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x52, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, + 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0a, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x22, 0x29, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x1a, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, + 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x16, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x22, 0x74, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, + 0x0a, 0x0b, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x0b, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1d, 0x0a, 0x1b, 0x47, 0x65, 0x74, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4c, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2a, 0x64, 0x0a, 0x0e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x49, 0x44, 0x44, + 0x4c, 0x45, 0x57, 0x41, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x4d, 0x49, 0x44, + 0x44, 0x4c, 0x45, 0x57, 0x41, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x54, 0x54, + 0x50, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x49, 0x44, 0x44, 0x4c, 0x45, 0x57, 0x41, 0x52, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x43, 0x50, 0x10, 0x02, 0x32, 0xdc, 0x04, 0x0a, + 0x11, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, + 0x61, 0x72, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x5d, 0x0a, + 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, + 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, + 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x12, + 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0f, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x12, 0x22, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x6e, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x0e, + 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0f, + 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, + 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_middleware_proto_rawDescOnce sync.Once @@ -786,49 +1166,57 @@ func file_mantrae_v1_middleware_proto_rawDescGZIP() []byte { } var file_mantrae_v1_middleware_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_mantrae_v1_middleware_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_mantrae_v1_middleware_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_mantrae_v1_middleware_proto_goTypes = []any{ - (MiddlewareType)(0), // 0: mantrae.v1.MiddlewareType - (*Middleware)(nil), // 1: mantrae.v1.Middleware - (*GetMiddlewareRequest)(nil), // 2: mantrae.v1.GetMiddlewareRequest - (*GetMiddlewareResponse)(nil), // 3: mantrae.v1.GetMiddlewareResponse - (*CreateMiddlewareRequest)(nil), // 4: mantrae.v1.CreateMiddlewareRequest - (*CreateMiddlewareResponse)(nil), // 5: mantrae.v1.CreateMiddlewareResponse - (*UpdateMiddlewareRequest)(nil), // 6: mantrae.v1.UpdateMiddlewareRequest - (*UpdateMiddlewareResponse)(nil), // 7: mantrae.v1.UpdateMiddlewareResponse - (*DeleteMiddlewareRequest)(nil), // 8: mantrae.v1.DeleteMiddlewareRequest - (*DeleteMiddlewareResponse)(nil), // 9: mantrae.v1.DeleteMiddlewareResponse - (*ListMiddlewaresRequest)(nil), // 10: mantrae.v1.ListMiddlewaresRequest - (*ListMiddlewaresResponse)(nil), // 11: mantrae.v1.ListMiddlewaresResponse - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (MiddlewareType)(0), // 0: mantrae.v1.MiddlewareType + (*Middleware)(nil), // 1: mantrae.v1.Middleware + (*Plugin)(nil), // 2: mantrae.v1.Plugin + (*PluginSnippet)(nil), // 3: mantrae.v1.PluginSnippet + (*GetMiddlewareRequest)(nil), // 4: mantrae.v1.GetMiddlewareRequest + (*GetMiddlewareResponse)(nil), // 5: mantrae.v1.GetMiddlewareResponse + (*CreateMiddlewareRequest)(nil), // 6: mantrae.v1.CreateMiddlewareRequest + (*CreateMiddlewareResponse)(nil), // 7: mantrae.v1.CreateMiddlewareResponse + (*UpdateMiddlewareRequest)(nil), // 8: mantrae.v1.UpdateMiddlewareRequest + (*UpdateMiddlewareResponse)(nil), // 9: mantrae.v1.UpdateMiddlewareResponse + (*DeleteMiddlewareRequest)(nil), // 10: mantrae.v1.DeleteMiddlewareRequest + (*DeleteMiddlewareResponse)(nil), // 11: mantrae.v1.DeleteMiddlewareResponse + (*ListMiddlewaresRequest)(nil), // 12: mantrae.v1.ListMiddlewaresRequest + (*ListMiddlewaresResponse)(nil), // 13: mantrae.v1.ListMiddlewaresResponse + (*GetMiddlewarePluginsRequest)(nil), // 14: mantrae.v1.GetMiddlewarePluginsRequest + (*GetMiddlewarePluginsResponse)(nil), // 15: mantrae.v1.GetMiddlewarePluginsResponse + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp } var file_mantrae_v1_middleware_proto_depIdxs = []int32{ 0, // 0: mantrae.v1.Middleware.type:type_name -> mantrae.v1.MiddlewareType - 12, // 1: mantrae.v1.Middleware.created_at:type_name -> google.protobuf.Timestamp - 12, // 2: mantrae.v1.Middleware.updated_at:type_name -> google.protobuf.Timestamp - 0, // 3: mantrae.v1.GetMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType - 1, // 4: mantrae.v1.GetMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware - 0, // 5: mantrae.v1.CreateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType - 1, // 6: mantrae.v1.CreateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware - 0, // 7: mantrae.v1.UpdateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType - 1, // 8: mantrae.v1.UpdateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware - 0, // 9: mantrae.v1.ListMiddlewaresRequest.type:type_name -> mantrae.v1.MiddlewareType - 1, // 10: mantrae.v1.ListMiddlewaresResponse.middlewares:type_name -> mantrae.v1.Middleware - 2, // 11: mantrae.v1.MiddlewareService.GetMiddleware:input_type -> mantrae.v1.GetMiddlewareRequest - 4, // 12: mantrae.v1.MiddlewareService.CreateMiddleware:input_type -> mantrae.v1.CreateMiddlewareRequest - 6, // 13: mantrae.v1.MiddlewareService.UpdateMiddleware:input_type -> mantrae.v1.UpdateMiddlewareRequest - 8, // 14: mantrae.v1.MiddlewareService.DeleteMiddleware:input_type -> mantrae.v1.DeleteMiddlewareRequest - 10, // 15: mantrae.v1.MiddlewareService.ListMiddlewares:input_type -> mantrae.v1.ListMiddlewaresRequest - 3, // 16: mantrae.v1.MiddlewareService.GetMiddleware:output_type -> mantrae.v1.GetMiddlewareResponse - 5, // 17: mantrae.v1.MiddlewareService.CreateMiddleware:output_type -> mantrae.v1.CreateMiddlewareResponse - 7, // 18: mantrae.v1.MiddlewareService.UpdateMiddleware:output_type -> mantrae.v1.UpdateMiddlewareResponse - 9, // 19: mantrae.v1.MiddlewareService.DeleteMiddleware:output_type -> mantrae.v1.DeleteMiddlewareResponse - 11, // 20: mantrae.v1.MiddlewareService.ListMiddlewares:output_type -> mantrae.v1.ListMiddlewaresResponse - 16, // [16:21] is the sub-list for method output_type - 11, // [11:16] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 16, // 1: mantrae.v1.Middleware.created_at:type_name -> google.protobuf.Timestamp + 16, // 2: mantrae.v1.Middleware.updated_at:type_name -> google.protobuf.Timestamp + 3, // 3: mantrae.v1.Plugin.snippet:type_name -> mantrae.v1.PluginSnippet + 0, // 4: mantrae.v1.GetMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType + 1, // 5: mantrae.v1.GetMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware + 0, // 6: mantrae.v1.CreateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType + 1, // 7: mantrae.v1.CreateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware + 0, // 8: mantrae.v1.UpdateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType + 1, // 9: mantrae.v1.UpdateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware + 0, // 10: mantrae.v1.ListMiddlewaresRequest.type:type_name -> mantrae.v1.MiddlewareType + 1, // 11: mantrae.v1.ListMiddlewaresResponse.middlewares:type_name -> mantrae.v1.Middleware + 2, // 12: mantrae.v1.GetMiddlewarePluginsResponse.plugins:type_name -> mantrae.v1.Plugin + 4, // 13: mantrae.v1.MiddlewareService.GetMiddleware:input_type -> mantrae.v1.GetMiddlewareRequest + 6, // 14: mantrae.v1.MiddlewareService.CreateMiddleware:input_type -> mantrae.v1.CreateMiddlewareRequest + 8, // 15: mantrae.v1.MiddlewareService.UpdateMiddleware:input_type -> mantrae.v1.UpdateMiddlewareRequest + 10, // 16: mantrae.v1.MiddlewareService.DeleteMiddleware:input_type -> mantrae.v1.DeleteMiddlewareRequest + 12, // 17: mantrae.v1.MiddlewareService.ListMiddlewares:input_type -> mantrae.v1.ListMiddlewaresRequest + 14, // 18: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:input_type -> mantrae.v1.GetMiddlewarePluginsRequest + 5, // 19: mantrae.v1.MiddlewareService.GetMiddleware:output_type -> mantrae.v1.GetMiddlewareResponse + 7, // 20: mantrae.v1.MiddlewareService.CreateMiddleware:output_type -> mantrae.v1.CreateMiddlewareResponse + 9, // 21: mantrae.v1.MiddlewareService.UpdateMiddleware:output_type -> mantrae.v1.UpdateMiddlewareResponse + 11, // 22: mantrae.v1.MiddlewareService.DeleteMiddleware:output_type -> mantrae.v1.DeleteMiddlewareResponse + 13, // 23: mantrae.v1.MiddlewareService.ListMiddlewares:output_type -> mantrae.v1.ListMiddlewaresResponse + 15, // 24: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:output_type -> mantrae.v1.GetMiddlewarePluginsResponse + 19, // [19:25] is the sub-list for method output_type + 13, // [13:19] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_mantrae_v1_middleware_proto_init() } @@ -836,14 +1224,14 @@ func file_mantrae_v1_middleware_proto_init() { if File_mantrae_v1_middleware_proto != nil { return } - file_mantrae_v1_middleware_proto_msgTypes[9].OneofWrappers = []any{} + file_mantrae_v1_middleware_proto_msgTypes[11].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_middleware_proto_rawDesc), len(file_mantrae_v1_middleware_proto_rawDesc)), NumEnums: 1, - NumMessages: 11, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/mantrae/v1/profile.pb.go b/proto/gen/mantrae/v1/profile.pb.go index abf5e4d..4e031c7 100644 --- a/proto/gen/mantrae/v1/profile.pb.go +++ b/proto/gen/mantrae/v1/profile.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/profile.proto @@ -572,57 +572,110 @@ func (x *ListProfilesResponse) GetTotalCount() int64 { var File_mantrae_v1_profile_proto protoreflect.FileDescriptor -const file_mantrae_v1_profile_proto_rawDesc = "" + - "\n" + - "\x18mantrae/v1/profile.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc5\x01\n" + - "\aProfile\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x129\n" + - "\n" + - "created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"#\n" + - "\x11GetProfileRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"C\n" + - "\x12GetProfileResponse\x12-\n" + - "\aprofile\x18\x01 \x01(\v2\x13.mantrae.v1.ProfileR\aprofile\"a\n" + - "\x14CreateProfileRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" + - "\vdescription\x18\x02 \x01(\tH\x00R\vdescription\x88\x01\x01B\x0e\n" + - "\f_description\"F\n" + - "\x15CreateProfileResponse\x12-\n" + - "\aprofile\x18\x01 \x01(\v2\x13.mantrae.v1.ProfileR\aprofile\"q\n" + - "\x14UpdateProfileRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12%\n" + - "\vdescription\x18\x03 \x01(\tH\x00R\vdescription\x88\x01\x01B\x0e\n" + - "\f_description\"F\n" + - "\x15UpdateProfileResponse\x12-\n" + - "\aprofile\x18\x01 \x01(\v2\x13.mantrae.v1.ProfileR\aprofile\"&\n" + - "\x14DeleteProfileRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"\x17\n" + - "\x15DeleteProfileResponse\"b\n" + - "\x13ListProfilesRequest\x12\x19\n" + - "\x05limit\x18\x01 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x02 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"h\n" + - "\x14ListProfilesResponse\x12/\n" + - "\bprofiles\x18\x01 \x03(\v2\x13.mantrae.v1.ProfileR\bprofiles\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount2\xbc\x03\n" + - "\x0eProfileService\x12P\n" + - "\n" + - "GetProfile\x12\x1d.mantrae.v1.GetProfileRequest\x1a\x1e.mantrae.v1.GetProfileResponse\"\x03\x90\x02\x01\x12T\n" + - "\rCreateProfile\x12 .mantrae.v1.CreateProfileRequest\x1a!.mantrae.v1.CreateProfileResponse\x12T\n" + - "\rUpdateProfile\x12 .mantrae.v1.UpdateProfileRequest\x1a!.mantrae.v1.UpdateProfileResponse\x12T\n" + - "\rDeleteProfile\x12 .mantrae.v1.DeleteProfileRequest\x1a!.mantrae.v1.DeleteProfileResponse\x12V\n" + - "\fListProfiles\x12\x1f.mantrae.v1.ListProfilesRequest\x1a .mantrae.v1.ListProfilesResponse\"\x03\x90\x02\x01B\xa6\x01\n" + - "\x0ecom.mantrae.v1B\fProfileProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_profile_proto_rawDesc = string([]byte{ + 0x0a, 0x18, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, + 0x23, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x61, 0x0a, 0x14, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46, 0x0a, 0x15, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x22, 0x71, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, + 0x26, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x62, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, + 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, + 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x22, 0x68, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xbc, + 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, + 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, + 0x90, 0x02, 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x54, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa6, 0x01, + 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, + 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_profile_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/router.pb.go b/proto/gen/mantrae/v1/router.pb.go index 46fb675..665f003 100644 --- a/proto/gen/mantrae/v1/router.pb.go +++ b/proto/gen/mantrae/v1/router.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/router.proto @@ -78,9 +78,9 @@ type Router struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` ProfileId int64 `protobuf:"varint,2,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled,omitempty"` Type RouterType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` @@ -133,6 +133,13 @@ func (x *Router) GetProfileId() int64 { return 0 } +func (x *Router) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *Router) GetName() string { if x != nil { return x.Name @@ -147,13 +154,6 @@ func (x *Router) GetConfig() string { return "" } -func (x *Router) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *Router) GetEnabled() bool { if x != nil { return x.Enabled @@ -281,9 +281,9 @@ func (x *GetRouterResponse) GetRouter() *Router { type CreateRouterRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` Type RouterType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields @@ -327,6 +327,13 @@ func (x *CreateRouterRequest) GetProfileId() int64 { return 0 } +func (x *CreateRouterRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *CreateRouterRequest) GetName() string { if x != nil { return x.Name @@ -341,13 +348,6 @@ func (x *CreateRouterRequest) GetConfig() string { return "" } -func (x *CreateRouterRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *CreateRouterRequest) GetEnabled() bool { if x != nil { return x.Enabled @@ -411,9 +411,8 @@ type UpdateRouterRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` - Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type RouterType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type RouterType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -469,13 +468,6 @@ func (x *UpdateRouterRequest) GetConfig() string { return "" } -func (x *UpdateRouterRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *UpdateRouterRequest) GetEnabled() bool { if x != nil { return x.Enabled @@ -728,75 +720,136 @@ func (x *ListRoutersResponse) GetTotalCount() int64 { var File_mantrae_v1_router_proto protoreflect.FileDescriptor -const file_mantrae_v1_router_proto_rawDesc = "" + - "\n" + - "\x17mantrae/v1/router.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x02\n" + - "\x06Router\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" + - "\n" + - "profile_id\x18\x02 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x04 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x05 \x01(\tR\x06source\x12\x18\n" + - "\aenabled\x18\x06 \x01(\bR\aenabled\x12*\n" + - "\x04type\x18\a \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\x129\n" + - "\n" + - "created_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"N\n" + - "\x10GetRouterRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12*\n" + - "\x04type\x18\x02 \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\"?\n" + - "\x11GetRouterResponse\x12*\n" + - "\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\xbe\x01\n" + - "\x13CreateRouterRequest\x12\x1d\n" + - "\n" + - "profile_id\x18\x01 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12\x18\n" + - "\aenabled\x18\x05 \x01(\bR\aenabled\x12*\n" + - "\x04type\x18\x06 \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\"B\n" + - "\x14CreateRouterResponse\x12*\n" + - "\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\xaf\x01\n" + - "\x13UpdateRouterRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12\x18\n" + - "\aenabled\x18\x05 \x01(\bR\aenabled\x12*\n" + - "\x04type\x18\x06 \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\"B\n" + - "\x14UpdateRouterResponse\x12*\n" + - "\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"%\n" + - "\x13DeleteRouterRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"\x16\n" + - "\x14DeleteRouterResponse\"\x8d\x01\n" + - "\x12ListRoutersRequest\x12*\n" + - "\x04type\x18\x01 \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\x12\x19\n" + - "\x05limit\x18\x02 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x03 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"d\n" + - "\x13ListRoutersResponse\x12,\n" + - "\arouters\x18\x01 \x03(\v2\x12.mantrae.v1.RouterR\arouters\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount*i\n" + - "\n" + - "RouterType\x12\x1b\n" + - "\x17ROUTER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n" + - "\x10ROUTER_TYPE_HTTP\x10\x01\x12\x13\n" + - "\x0fROUTER_TYPE_TCP\x10\x02\x12\x13\n" + - "\x0fROUTER_TYPE_UDP\x10\x032\xac\x03\n" + - "\rRouterService\x12M\n" + - "\tGetRouter\x12\x1c.mantrae.v1.GetRouterRequest\x1a\x1d.mantrae.v1.GetRouterResponse\"\x03\x90\x02\x01\x12Q\n" + - "\fCreateRouter\x12\x1f.mantrae.v1.CreateRouterRequest\x1a .mantrae.v1.CreateRouterResponse\x12Q\n" + - "\fUpdateRouter\x12\x1f.mantrae.v1.UpdateRouterRequest\x1a .mantrae.v1.UpdateRouterResponse\x12Q\n" + - "\fDeleteRouter\x12\x1f.mantrae.v1.DeleteRouterRequest\x1a .mantrae.v1.DeleteRouterResponse\x12S\n" + - "\vListRouters\x12\x1e.mantrae.v1.ListRoutersRequest\x1a\x1f.mantrae.v1.ListRoutersResponse\"\x03\x90\x02\x01B\xa5\x01\n" + - "\x0ecom.mantrae.v1B\vRouterProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_router_proto_rawDesc = string([]byte{ + 0x0a, 0x17, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x02, 0x0a, 0x06, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, + 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x22, 0x4e, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x3f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x06, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x72, 0x22, 0xc1, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x42, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x72, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x22, 0x97, 0x01, 0x0a, + 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x42, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, + 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x22, 0x25, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x12, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, + 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x64, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, + 0x69, 0x0a, 0x0a, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x17, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, + 0x55, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, + 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x03, 0x32, 0xac, 0x03, 0x0a, 0x0d, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x51, 0x0a, 0x0c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x1f, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa5, 0x01, 0x0a, 0x0e, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, + 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, + 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_router_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/service.pb.go b/proto/gen/mantrae/v1/service.pb.go index 41495b3..c1afba7 100644 --- a/proto/gen/mantrae/v1/service.pb.go +++ b/proto/gen/mantrae/v1/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/service.proto @@ -78,9 +78,9 @@ type Service struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` ProfileId int64 `protobuf:"varint,2,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` Type ServiceType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` @@ -132,6 +132,13 @@ func (x *Service) GetProfileId() int64 { return 0 } +func (x *Service) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *Service) GetName() string { if x != nil { return x.Name @@ -146,13 +153,6 @@ func (x *Service) GetConfig() string { return "" } -func (x *Service) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *Service) GetType() ServiceType { if x != nil { return x.Type @@ -273,9 +273,9 @@ func (x *GetServiceResponse) GetService() *Service { type CreateServiceRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` + AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Config string `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` Type ServiceType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -318,6 +318,13 @@ func (x *CreateServiceRequest) GetProfileId() int64 { return 0 } +func (x *CreateServiceRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + func (x *CreateServiceRequest) GetName() string { if x != nil { return x.Name @@ -332,13 +339,6 @@ func (x *CreateServiceRequest) GetConfig() string { return "" } -func (x *CreateServiceRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *CreateServiceRequest) GetType() ServiceType { if x != nil { return x.Type @@ -395,8 +395,7 @@ type UpdateServiceRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` - Type ServiceType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"` + Type ServiceType `protobuf:"varint,4,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -452,13 +451,6 @@ func (x *UpdateServiceRequest) GetConfig() string { return "" } -func (x *UpdateServiceRequest) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - func (x *UpdateServiceRequest) GetType() ServiceType { if x != nil { return x.Type @@ -704,72 +696,134 @@ func (x *ListServicesResponse) GetTotalCount() int64 { var File_mantrae_v1_service_proto protoreflect.FileDescriptor -const file_mantrae_v1_service_proto_rawDesc = "" + - "\n" + - "\x18mantrae/v1/service.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9f\x02\n" + - "\aService\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" + - "\n" + - "profile_id\x18\x02 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x04 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x05 \x01(\tR\x06source\x12+\n" + - "\x04type\x18\x06 \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\x129\n" + - "\n" + - "created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"P\n" + - "\x11GetServiceRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12+\n" + - "\x04type\x18\x02 \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\"C\n" + - "\x12GetServiceResponse\x12-\n" + - "\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\xa6\x01\n" + - "\x14CreateServiceRequest\x12\x1d\n" + - "\n" + - "profile_id\x18\x01 \x01(\x03R\tprofileId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12+\n" + - "\x04type\x18\x05 \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\"F\n" + - "\x15CreateServiceResponse\x12-\n" + - "\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\x97\x01\n" + - "\x14UpdateServiceRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06config\x18\x03 \x01(\tR\x06config\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\x12+\n" + - "\x04type\x18\x05 \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\"F\n" + - "\x15UpdateServiceResponse\x12-\n" + - "\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"&\n" + - "\x14DeleteServiceRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"\x17\n" + - "\x15DeleteServiceResponse\"\x8f\x01\n" + - "\x13ListServicesRequest\x12+\n" + - "\x04type\x18\x01 \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\x12\x19\n" + - "\x05limit\x18\x02 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x03 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"h\n" + - "\x14ListServicesResponse\x12/\n" + - "\bservices\x18\x01 \x03(\v2\x13.mantrae.v1.ServiceR\bservices\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount*n\n" + - "\vServiceType\x12\x1c\n" + - "\x18SERVICE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11SERVICE_TYPE_HTTP\x10\x01\x12\x14\n" + - "\x10SERVICE_TYPE_TCP\x10\x02\x12\x14\n" + - "\x10SERVICE_TYPE_UDP\x10\x032\xbc\x03\n" + - "\x0eServiceService\x12P\n" + - "\n" + - "GetService\x12\x1d.mantrae.v1.GetServiceRequest\x1a\x1e.mantrae.v1.GetServiceResponse\"\x03\x90\x02\x01\x12T\n" + - "\rCreateService\x12 .mantrae.v1.CreateServiceRequest\x1a!.mantrae.v1.CreateServiceResponse\x12T\n" + - "\rUpdateService\x12 .mantrae.v1.UpdateServiceRequest\x1a!.mantrae.v1.UpdateServiceResponse\x12T\n" + - "\rDeleteService\x12 .mantrae.v1.DeleteServiceRequest\x1a!.mantrae.v1.DeleteServiceResponse\x12V\n" + - "\fListServices\x12\x1f.mantrae.v1.ListServicesRequest\x1a .mantrae.v1.ListServicesResponse\"\x03\x90\x02\x01B\xa6\x01\n" + - "\x0ecom.mantrae.v1B\fServiceProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_service_proto_rawDesc = string([]byte{ + 0x0a, 0x18, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x50, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x43, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x46, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x7f, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2b, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x46, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x26, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x22, 0x68, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x6e, 0x0a, + 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, + 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x10, + 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, 0x52, 0x56, 0x49, + 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x03, 0x32, 0xbc, 0x03, + 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x50, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, + 0x02, 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa6, 0x01, 0x0a, + 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, + 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_service_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/setting.pb.go b/proto/gen/mantrae/v1/setting.pb.go index 0ee4158..db76d36 100644 --- a/proto/gen/mantrae/v1/setting.pb.go +++ b/proto/gen/mantrae/v1/setting.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/setting.proto @@ -356,36 +356,71 @@ func (x *ListSettingsResponse) GetSettings() []*Setting { var File_mantrae_v1_setting_proto protoreflect.FileDescriptor -const file_mantrae_v1_setting_proto_rawDesc = "" + - "\n" + - "\x18mantrae/v1/setting.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8e\x01\n" + - "\aSetting\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x129\n" + - "\n" + - "updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"%\n" + - "\x11GetSettingRequest\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\"C\n" + - "\x12GetSettingResponse\x12-\n" + - "\asetting\x18\x01 \x01(\v2\x13.mantrae.v1.SettingR\asetting\">\n" + - "\x14UpdateSettingRequest\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\"F\n" + - "\x15UpdateSettingResponse\x12-\n" + - "\asetting\x18\x01 \x01(\v2\x13.mantrae.v1.SettingR\asetting\"\x15\n" + - "\x13ListSettingsRequest\"G\n" + - "\x14ListSettingsResponse\x12/\n" + - "\bsettings\x18\x01 \x03(\v2\x13.mantrae.v1.SettingR\bsettings2\x90\x02\n" + - "\x0eSettingService\x12P\n" + - "\n" + - "GetSetting\x12\x1d.mantrae.v1.GetSettingRequest\x1a\x1e.mantrae.v1.GetSettingResponse\"\x03\x90\x02\x01\x12T\n" + - "\rUpdateSetting\x12 .mantrae.v1.UpdateSettingRequest\x1a!.mantrae.v1.UpdateSettingResponse\x12V\n" + - "\fListSettings\x12\x1f.mantrae.v1.ListSettingsRequest\x1a .mantrae.v1.ListSettingsResponse\"\x03\x90\x02\x01B\xa6\x01\n" + - "\x0ecom.mantrae.v1B\fSettingProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_setting_proto_rawDesc = string([]byte{ + 0x0a, 0x18, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x25, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, + 0x43, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x22, 0x3e, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x15, 0x0a, 0x13, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x32, 0x90, 0x02, 0x0a, + 0x0e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x50, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, + 0x01, 0x12, 0x54, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, + 0xa6, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, + 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, + 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_setting_proto_rawDescOnce sync.Once diff --git a/proto/gen/mantrae/v1/user.pb.go b/proto/gen/mantrae/v1/user.pb.go index bc3aaf0..8b25a94 100644 --- a/proto/gen/mantrae/v1/user.pb.go +++ b/proto/gen/mantrae/v1/user.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.5 // protoc (unknown) // source: mantrae/v1/user.proto @@ -1172,103 +1172,172 @@ func (x *ListUsersResponse) GetTotalCount() int64 { var File_mantrae_v1_user_proto protoreflect.FileDescriptor -const file_mantrae_v1_user_proto_rawDesc = "" + - "\n" + - "\x15mantrae/v1/user.proto\x12\n" + - "mantrae.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfd\x02\n" + - "\x04User\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + - "\busername\x18\x02 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x14\n" + - "\x05email\x18\x04 \x01(\tR\x05email\x12\x19\n" + - "\bis_admin\x18\x05 \x01(\bR\aisAdmin\x12\x10\n" + - "\x03otp\x18\x06 \x01(\tR\x03otp\x129\n" + - "\n" + - "otp_expiry\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\totpExpiry\x129\n" + - "\n" + - "last_login\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tlastLogin\x129\n" + - "\n" + - "created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\n" + - " \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\x8e\x01\n" + - "\x10LoginUserRequest\x12\x1c\n" + - "\busername\x18\x01 \x01(\tH\x00R\busername\x12\x16\n" + - "\x05email\x18\x02 \x01(\tH\x00R\x05email\x12\x1a\n" + - "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x1a\n" + - "\bremember\x18\x04 \x01(\bR\brememberB\f\n" + - "\n" + - "identifier\")\n" + - "\x11LoginUserResponse\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\"(\n" + - "\x10VerifyJWTRequest\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\",\n" + - "\x11VerifyJWTResponse\x12\x17\n" + - "\auser_id\x18\x01 \x01(\tR\x06userId\"h\n" + - "\x10VerifyOTPRequest\x12\x1c\n" + - "\busername\x18\x01 \x01(\tH\x00R\busername\x12\x16\n" + - "\x05email\x18\x02 \x01(\tH\x00R\x05email\x12\x10\n" + - "\x03otp\x18\x03 \x01(\tR\x03otpB\f\n" + - "\n" + - "identifier\")\n" + - "\x11VerifyOTPResponse\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\"T\n" + - "\x0eSendOTPRequest\x12\x1c\n" + - "\busername\x18\x01 \x01(\tH\x00R\busername\x12\x16\n" + - "\x05email\x18\x02 \x01(\tH\x00R\x05emailB\f\n" + - "\n" + - "identifier\"\x11\n" + - "\x0fSendOTPResponse\"f\n" + - "\x0eGetUserRequest\x12\x10\n" + - "\x02id\x18\x01 \x01(\tH\x00R\x02id\x12\x1c\n" + - "\busername\x18\x02 \x01(\tH\x00R\busername\x12\x16\n" + - "\x05email\x18\x03 \x01(\tH\x00R\x05emailB\f\n" + - "\n" + - "identifier\"7\n" + - "\x0fGetUserResponse\x12$\n" + - "\x04user\x18\x01 \x01(\v2\x10.mantrae.v1.UserR\x04user\"|\n" + - "\x11CreateUserRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x14\n" + - "\x05email\x18\x03 \x01(\tR\x05email\x12\x19\n" + - "\bis_admin\x18\x04 \x01(\bR\aisAdmin\":\n" + - "\x12CreateUserResponse\x12$\n" + - "\x04user\x18\x01 \x01(\v2\x10.mantrae.v1.UserR\x04user\"p\n" + - "\x11UpdateUserRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + - "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + - "\x05email\x18\x03 \x01(\tR\x05email\x12\x19\n" + - "\bis_admin\x18\x04 \x01(\bR\aisAdmin\":\n" + - "\x12UpdateUserResponse\x12$\n" + - "\x04user\x18\x01 \x01(\v2\x10.mantrae.v1.UserR\x04user\"#\n" + - "\x11DeleteUserRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\x14\n" + - "\x12DeleteUserResponse\"_\n" + - "\x10ListUsersRequest\x12\x19\n" + - "\x05limit\x18\x01 \x01(\x03H\x00R\x05limit\x88\x01\x01\x12\x1b\n" + - "\x06offset\x18\x02 \x01(\x03H\x01R\x06offset\x88\x01\x01B\b\n" + - "\x06_limitB\t\n" + - "\a_offset\"\\\n" + - "\x11ListUsersResponse\x12&\n" + - "\x05users\x18\x01 \x03(\v2\x10.mantrae.v1.UserR\x05users\x12\x1f\n" + - "\vtotal_count\x18\x02 \x01(\x03R\n" + - "totalCount2\xae\x05\n" + - "\vUserService\x12H\n" + - "\tLoginUser\x12\x1c.mantrae.v1.LoginUserRequest\x1a\x1d.mantrae.v1.LoginUserResponse\x12H\n" + - "\tVerifyJWT\x12\x1c.mantrae.v1.VerifyJWTRequest\x1a\x1d.mantrae.v1.VerifyJWTResponse\x12H\n" + - "\tVerifyOTP\x12\x1c.mantrae.v1.VerifyOTPRequest\x1a\x1d.mantrae.v1.VerifyOTPResponse\x12B\n" + - "\aSendOTP\x12\x1a.mantrae.v1.SendOTPRequest\x1a\x1b.mantrae.v1.SendOTPResponse\x12G\n" + - "\aGetUser\x12\x1a.mantrae.v1.GetUserRequest\x1a\x1b.mantrae.v1.GetUserResponse\"\x03\x90\x02\x01\x12K\n" + - "\n" + - "CreateUser\x12\x1d.mantrae.v1.CreateUserRequest\x1a\x1e.mantrae.v1.CreateUserResponse\x12K\n" + - "\n" + - "UpdateUser\x12\x1d.mantrae.v1.UpdateUserRequest\x1a\x1e.mantrae.v1.UpdateUserResponse\x12K\n" + - "\n" + - "DeleteUser\x12\x1d.mantrae.v1.DeleteUserRequest\x1a\x1e.mantrae.v1.DeleteUserResponse\x12M\n" + - "\tListUsers\x12\x1c.mantrae.v1.ListUsersRequest\x1a\x1d.mantrae.v1.ListUsersResponse\"\x03\x90\x02\x01B\xa3\x01\n" + - "\x0ecom.mantrae.v1B\tUserProtoP\x01Z=github.com/mizuchilabs/mantrae/proto/gen/mantrae/v1;mantraev1\xa2\x02\x03MXX\xaa\x02\n" + - "Mantrae.V1\xca\x02\n" + - "Mantrae\\V1\xe2\x02\x16Mantrae\\V1\\GPBMetadata\xea\x02\vMantrae::V1b\x06proto3" +var file_mantrae_v1_user_proto_rawDesc = string([]byte{ + 0x0a, 0x15, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, + 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x74, 0x70, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x74, 0x70, 0x12, 0x39, 0x0a, 0x0a, 0x6f, 0x74, 0x70, 0x5f, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x6f, 0x74, 0x70, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, + 0x65, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, + 0x65, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x29, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x28, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4a, 0x57, 0x54, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x11, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x4a, 0x57, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x68, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x4f, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x74, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6f, 0x74, 0x70, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x22, 0x29, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4f, 0x54, 0x50, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x54, 0x0a, + 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x4f, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x4f, 0x54, 0x50, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x37, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x7c, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, + 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x3a, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x22, 0x70, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x22, 0x3a, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x10, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x5c, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xae, 0x05, 0x0a, 0x0b, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x09, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x09, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4a, 0x57, 0x54, + 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x4a, 0x57, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x4a, 0x57, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, + 0x09, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4f, 0x54, 0x50, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, + 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4f, 0x54, + 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x4f, 0x54, 0x50, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x4f, + 0x54, 0x50, 0x12, 0x1a, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x6e, 0x64, 0x4f, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, + 0x4f, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x03, 0x90, 0x02, 0x01, 0x12, 0x4b, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, + 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x6d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61, + 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x09, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, + 0x61, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x0e, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x7a, 0x75, 0x63, 0x68, 0x69, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, + 0x02, 0x0a, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x4d, + 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x4d, 0x61, 0x6e, 0x74, + 0x72, 0x61, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) var ( file_mantrae_v1_user_proto_rawDescOnce sync.Once diff --git a/proto/gen/openapi/openapi.yaml b/proto/gen/openapi/openapi.yaml index 99179bd..4d391f9 100644 --- a/proto/gen/openapi/openapi.yaml +++ b/proto/gen/openapi/openapi.yaml @@ -38,9 +38,6 @@ components: type: object google.protobuf.Timestamp: type: string - examples: - - 1s - - 1.000340012s format: date-time description: |- A Timestamp represents a point in time independent of any time zone or local @@ -289,6 +286,286 @@ components: additionalProperties: true additionalProperties: true description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + mantrae.v1.Agent: + type: object + properties: + id: + type: string + title: id + profileId: + type: + - integer + - string + title: profile_id + format: int64 + hostname: + type: string + title: hostname + publicIp: + type: string + title: public_ip + activeIp: + type: string + title: active_ip + token: + type: string + title: token + privateIps: + type: array + items: + type: string + title: private_ips + containers: + type: array + items: + $ref: '#/components/schemas/mantrae.v1.Container' + title: containers + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + updatedAt: + title: updated_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Agent + additionalProperties: false + mantrae.v1.CreateAgentRequest: + type: object + properties: + profileId: + type: + - integer + - string + title: profile_id + format: int64 + title: CreateAgentRequest + additionalProperties: false + mantrae.v1.CreateAgentResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/mantrae.v1.Agent' + title: CreateAgentResponse + additionalProperties: false + mantrae.v1.DeleteAgentRequest: + type: object + properties: + id: + type: string + title: id + title: DeleteAgentRequest + additionalProperties: false + mantrae.v1.DeleteAgentResponse: + type: object + title: DeleteAgentResponse + additionalProperties: false + mantrae.v1.GetAgentRequest: + type: object + properties: + id: + type: string + title: id + title: GetAgentRequest + additionalProperties: false + mantrae.v1.GetAgentResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/mantrae.v1.Agent' + title: GetAgentResponse + additionalProperties: false + mantrae.v1.ListAgentsRequest: + type: object + properties: + profileId: + type: + - integer + - string + title: profile_id + format: int64 + limit: + type: + - integer + - string + title: limit + format: int64 + nullable: true + offset: + type: + - integer + - string + title: offset + format: int64 + nullable: true + title: ListAgentsRequest + additionalProperties: false + mantrae.v1.ListAgentsResponse: + type: object + properties: + agents: + type: array + items: + $ref: '#/components/schemas/mantrae.v1.Agent' + title: agents + totalCount: + type: + - integer + - string + title: total_count + format: int64 + title: ListAgentsResponse + additionalProperties: false + mantrae.v1.RotateAgentTokenRequest: + type: object + properties: + id: + type: string + title: id + title: RotateAgentTokenRequest + additionalProperties: false + mantrae.v1.RotateAgentTokenResponse: + type: object + properties: + token: + type: string + title: token + title: RotateAgentTokenResponse + additionalProperties: false + mantrae.v1.UpdateAgentIPRequest: + type: object + properties: + id: + type: string + title: id + ip: + type: string + title: ip + title: UpdateAgentIPRequest + additionalProperties: false + mantrae.v1.UpdateAgentIPResponse: + type: object + properties: + agent: + title: agent + $ref: '#/components/schemas/mantrae.v1.Agent' + title: UpdateAgentIPResponse + additionalProperties: false + encoding: + title: encoding + enum: + - proto + - json + description: Define which encoding or 'Message-Codec' to use + base64: + type: boolean + title: base64 + description: Specifies if the message query param is base64 encoded, which may be required for binary data + compression: + title: compression + enum: + - identity + - gzip + - br + description: Which compression algorithm to use for this request + connect: + title: connect + enum: + - v1 + description: Define the version of the Connect protocol + mantrae.v1.Backup: + type: object + properties: + name: + type: string + title: name + size: + type: + - integer + - string + title: size + format: int64 + createdAt: + title: created_at + $ref: '#/components/schemas/google.protobuf.Timestamp' + title: Backup + additionalProperties: false + mantrae.v1.CreateBackupRequest: + type: object + title: CreateBackupRequest + additionalProperties: false + mantrae.v1.CreateBackupResponse: + type: object + title: CreateBackupResponse + additionalProperties: false + mantrae.v1.DeleteBackupRequest: + type: object + properties: + name: + type: string + title: name + title: DeleteBackupRequest + additionalProperties: false + mantrae.v1.DeleteBackupResponse: + type: object + title: DeleteBackupResponse + additionalProperties: false + mantrae.v1.DownloadBackupRequest: + type: object + properties: + name: + type: string + title: name + title: DownloadBackupRequest + additionalProperties: false + mantrae.v1.DownloadBackupResponse: + type: object + properties: + data: + type: string + title: data + format: byte + title: DownloadBackupResponse + additionalProperties: false + mantrae.v1.ListBackupsRequest: + type: object + title: ListBackupsRequest + additionalProperties: false + mantrae.v1.ListBackupsResponse: + type: object + properties: + backups: + type: array + items: + $ref: '#/components/schemas/mantrae.v1.Backup' + title: backups + title: ListBackupsResponse + additionalProperties: false + mantrae.v1.RestoreBackupRequest: + type: object + properties: + name: + type: string + title: name + title: RestoreBackupRequest + additionalProperties: false + mantrae.v1.RestoreBackupResponse: + type: object + title: RestoreBackupResponse + additionalProperties: false + mantrae.v1.UploadBackupRequest: + type: object + properties: + data: + type: string + title: data + format: byte + title: UploadBackupRequest + additionalProperties: false + mantrae.v1.UploadBackupResponse: + type: object + title: UploadBackupResponse + additionalProperties: false mantrae.v1.CreateEntryPointRequest: type: object properties: @@ -434,28 +711,6 @@ components: $ref: '#/components/schemas/mantrae.v1.EntryPoint' title: UpdateEntryPointResponse additionalProperties: false - encoding: - title: encoding - enum: - - proto - - json - description: Define which encoding or 'Message-Codec' to use - base64: - type: boolean - title: base64 - description: Specifies if the message query param is base64 encoded, which may be required for binary data - compression: - title: compression - enum: - - identity - - gzip - - br - description: Which compression algorithm to use for this request - connect: - title: connect - enum: - - v1 - description: Define the version of the Connect protocol mantrae.v1.MiddlewareType: type: string title: MiddlewareType @@ -472,15 +727,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.MiddlewareType' @@ -509,6 +764,20 @@ components: type: object title: DeleteMiddlewareResponse additionalProperties: false + mantrae.v1.GetMiddlewarePluginsRequest: + type: object + title: GetMiddlewarePluginsRequest + additionalProperties: false + mantrae.v1.GetMiddlewarePluginsResponse: + type: object + properties: + plugins: + type: array + items: + $ref: '#/components/schemas/mantrae.v1.Plugin' + title: plugins + title: GetMiddlewarePluginsResponse + additionalProperties: false mantrae.v1.GetMiddlewareRequest: type: object properties: @@ -584,15 +853,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.MiddlewareType' @@ -604,6 +873,69 @@ components: $ref: '#/components/schemas/google.protobuf.Timestamp' title: Middleware additionalProperties: false + mantrae.v1.Plugin: + type: object + properties: + id: + type: string + title: id + name: + type: string + title: name + displayName: + type: string + title: display_name + author: + type: string + title: author + type: + type: string + title: type + import: + type: string + title: import + summary: + type: string + title: summary + iconUrl: + type: string + title: icon_url + bannerUrl: + type: string + title: banner_url + readme: + type: string + title: readme + latestVersion: + type: string + title: latest_version + versions: + type: array + items: + type: string + title: versions + stars: + type: + - integer + - string + title: stars + format: int64 + snippet: + title: snippet + $ref: '#/components/schemas/mantrae.v1.PluginSnippet' + createdAt: + type: string + title: created_at + title: Plugin + additionalProperties: false + mantrae.v1.PluginSnippet: + type: object + properties: + yaml: + type: string + title: yaml + title: PluginSnippet + additionalProperties: false mantrae.v1.UpdateMiddlewareRequest: type: object properties: @@ -619,9 +951,6 @@ components: config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.MiddlewareType' @@ -790,15 +1119,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source enabled: type: boolean title: enabled @@ -905,15 +1234,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source enabled: type: boolean title: enabled @@ -943,9 +1272,6 @@ components: config: type: string title: config - source: - type: string - title: source enabled: type: boolean title: enabled @@ -979,15 +1305,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.ServiceType' @@ -1091,15 +1417,15 @@ components: - string title: profile_id format: int64 + agentId: + type: string + title: agent_id name: type: string title: name config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.ServiceType' @@ -1126,9 +1452,6 @@ components: config: type: string title: config - source: - type: string - title: source type: title: type $ref: '#/components/schemas/mantrae.v1.ServiceType' @@ -1247,28 +1570,31 @@ components: additionalProperties: false mantrae.v1.GetUserRequest: type: object - oneOf: - - properties: - email: - type: string - title: email - title: email - required: + anyOf: + - required: - email - - properties: - id: - type: string - title: id - title: id - required: + - required: - id - - properties: - username: - type: string - title: username - title: username - required: + - required: - username + - not: + anyOf: + - required: + - email + - required: + - id + - required: + - username + properties: + id: + type: string + title: id + username: + type: string + title: username + email: + type: string + title: email title: GetUserRequest additionalProperties: false mantrae.v1.GetUserResponse: @@ -1316,22 +1642,24 @@ components: additionalProperties: false mantrae.v1.LoginUserRequest: type: object - oneOf: - - properties: - email: - type: string - title: email - title: email - required: + anyOf: + - required: - email - - properties: - username: - type: string - title: username - title: username - required: + - required: - username + - not: + anyOf: + - required: + - email + - required: + - username properties: + username: + type: string + title: username + email: + type: string + title: email password: type: string title: password @@ -1350,21 +1678,24 @@ components: additionalProperties: false mantrae.v1.SendOTPRequest: type: object - oneOf: - - properties: - email: - type: string - title: email - title: email - required: + anyOf: + - required: - email - - properties: - username: - type: string - title: username - title: username - required: + - required: - username + - not: + anyOf: + - required: + - email + - required: + - username + properties: + username: + type: string + title: username + email: + type: string + title: email title: SendOTPRequest additionalProperties: false mantrae.v1.SendOTPResponse: @@ -1449,22 +1780,24 @@ components: additionalProperties: false mantrae.v1.VerifyOTPRequest: type: object - oneOf: - - properties: - email: - type: string - title: email - title: email - required: + anyOf: + - required: - email - - properties: - username: - type: string - title: username - title: username - required: + - required: - username + - not: + anyOf: + - required: + - email + - required: + - username properties: + username: + type: string + title: username + email: + type: string + title: email otp: type: string title: otp @@ -1551,6 +1884,705 @@ paths: application/json: schema: $ref: '#/components/schemas/mantrae.v1.HealthCheckResponse' + /mantrae.v1.AgentManagementService/GetAgent: + get: + tags: + - mantrae.v1.AgentManagementService + summary: GetAgent + operationId: mantrae.v1.AgentManagementService.GetAgent.get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + - name: message + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetAgentRequest' + - name: encoding + in: query + required: true + schema: + $ref: '#/components/schemas/encoding' + - name: base64 + in: query + schema: + $ref: '#/components/schemas/base64' + - name: compression + in: query + schema: + $ref: '#/components/schemas/compression' + - name: connect + in: query + schema: + $ref: '#/components/schemas/connect' + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetAgentResponse' + post: + tags: + - mantrae.v1.AgentManagementService + summary: GetAgent + operationId: mantrae.v1.AgentManagementService.GetAgent + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetAgentRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetAgentResponse' + /mantrae.v1.AgentManagementService/CreateAgent: + post: + tags: + - mantrae.v1.AgentManagementService + summary: CreateAgent + operationId: mantrae.v1.AgentManagementService.CreateAgent + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.CreateAgentRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.CreateAgentResponse' + /mantrae.v1.AgentManagementService/UpdateAgentIP: + post: + tags: + - mantrae.v1.AgentManagementService + summary: UpdateAgentIP + operationId: mantrae.v1.AgentManagementService.UpdateAgentIP + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.UpdateAgentIPRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.UpdateAgentIPResponse' + /mantrae.v1.AgentManagementService/DeleteAgent: + post: + tags: + - mantrae.v1.AgentManagementService + summary: DeleteAgent + operationId: mantrae.v1.AgentManagementService.DeleteAgent + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.DeleteAgentRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.DeleteAgentResponse' + /mantrae.v1.AgentManagementService/ListAgents: + get: + tags: + - mantrae.v1.AgentManagementService + summary: ListAgents + operationId: mantrae.v1.AgentManagementService.ListAgents.get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + - name: message + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListAgentsRequest' + - name: encoding + in: query + required: true + schema: + $ref: '#/components/schemas/encoding' + - name: base64 + in: query + schema: + $ref: '#/components/schemas/base64' + - name: compression + in: query + schema: + $ref: '#/components/schemas/compression' + - name: connect + in: query + schema: + $ref: '#/components/schemas/connect' + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListAgentsResponse' + post: + tags: + - mantrae.v1.AgentManagementService + summary: ListAgents + operationId: mantrae.v1.AgentManagementService.ListAgents + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListAgentsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListAgentsResponse' + /mantrae.v1.AgentManagementService/RotateAgentToken: + post: + tags: + - mantrae.v1.AgentManagementService + summary: RotateAgentToken + operationId: mantrae.v1.AgentManagementService.RotateAgentToken + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.RotateAgentTokenRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.RotateAgentTokenResponse' + /mantrae.v1.BackupService/CreateBackup: + post: + tags: + - mantrae.v1.BackupService + summary: CreateBackup + operationId: mantrae.v1.BackupService.CreateBackup + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.CreateBackupRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.CreateBackupResponse' + /mantrae.v1.BackupService/RestoreBackup: + post: + tags: + - mantrae.v1.BackupService + summary: RestoreBackup + operationId: mantrae.v1.BackupService.RestoreBackup + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.RestoreBackupRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.RestoreBackupResponse' + /mantrae.v1.BackupService/ListBackups: + get: + tags: + - mantrae.v1.BackupService + summary: ListBackups + operationId: mantrae.v1.BackupService.ListBackups.get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + - name: message + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListBackupsRequest' + - name: encoding + in: query + required: true + schema: + $ref: '#/components/schemas/encoding' + - name: base64 + in: query + schema: + $ref: '#/components/schemas/base64' + - name: compression + in: query + schema: + $ref: '#/components/schemas/compression' + - name: connect + in: query + schema: + $ref: '#/components/schemas/connect' + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListBackupsResponse' + post: + tags: + - mantrae.v1.BackupService + summary: ListBackups + operationId: mantrae.v1.BackupService.ListBackups + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListBackupsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.ListBackupsResponse' + /mantrae.v1.BackupService/DeleteBackup: + post: + tags: + - mantrae.v1.BackupService + summary: DeleteBackup + operationId: mantrae.v1.BackupService.DeleteBackup + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.DeleteBackupRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.DeleteBackupResponse' + /mantrae.v1.BackupService/DownloadBackup: + post: + tags: + - mantrae.v1.BackupService + summary: DownloadBackup + operationId: mantrae.v1.BackupService.DownloadBackup + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/connect+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/connect+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc-web: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupRequest' + required: true + responses: + default: + description: Error + content: + application/connect+json: + schema: + $ref: '#/components/schemas/connect.error' + application/connect+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc+json: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/connect+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/connect+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc-web: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/mantrae.v1.DownloadBackupResponse' + /mantrae.v1.BackupService/UploadBackup: + post: + tags: + - mantrae.v1.BackupService + summary: UploadBackup + operationId: mantrae.v1.BackupService.UploadBackup + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/connect+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/connect+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc-web: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupRequest' + required: true + responses: + default: + description: Error + content: + application/connect+json: + schema: + $ref: '#/components/schemas/connect.error' + application/connect+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc+json: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/connect.error' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/connect+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/connect+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc-web: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc-web+proto: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' + application/grpc-web+json: + schema: + $ref: '#/components/schemas/mantrae.v1.UploadBackupResponse' /mantrae.v1.EntryPointService/GetEntryPoint: get: tags: @@ -2105,6 +3137,92 @@ paths: application/json: schema: $ref: '#/components/schemas/mantrae.v1.ListMiddlewaresResponse' + /mantrae.v1.MiddlewareService/GetMiddlewarePlugins: + get: + tags: + - mantrae.v1.MiddlewareService + summary: GetMiddlewarePlugins + operationId: mantrae.v1.MiddlewareService.GetMiddlewarePlugins.get + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + - name: message + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetMiddlewarePluginsRequest' + - name: encoding + in: query + required: true + schema: + $ref: '#/components/schemas/encoding' + - name: base64 + in: query + schema: + $ref: '#/components/schemas/base64' + - name: compression + in: query + schema: + $ref: '#/components/schemas/compression' + - name: connect + in: query + schema: + $ref: '#/components/schemas/connect' + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetMiddlewarePluginsResponse' + post: + tags: + - mantrae.v1.MiddlewareService + summary: GetMiddlewarePlugins + operationId: mantrae.v1.MiddlewareService.GetMiddlewarePlugins + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetMiddlewarePluginsRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/mantrae.v1.GetMiddlewarePluginsResponse' /mantrae.v1.ProfileService/GetProfile: get: tags: @@ -3562,6 +4680,8 @@ paths: $ref: '#/components/schemas/mantrae.v1.ListUsersResponse' tags: - name: mantrae.v1.AgentService + - name: mantrae.v1.AgentManagementService + - name: mantrae.v1.BackupService - name: mantrae.v1.EntryPointService - name: mantrae.v1.MiddlewareService - name: mantrae.v1.ProfileService diff --git a/proto/mantrae/v1/agent_management.proto b/proto/mantrae/v1/agent_management.proto new file mode 100644 index 0000000..50edcfa --- /dev/null +++ b/proto/mantrae/v1/agent_management.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package mantrae.v1; + +import "google/protobuf/timestamp.proto"; +import "mantrae/v1/agent.proto"; + +service AgentManagementService { + rpc GetAgent(GetAgentRequest) returns (GetAgentResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + rpc CreateAgent(CreateAgentRequest) returns (CreateAgentResponse); + rpc UpdateAgentIP(UpdateAgentIPRequest) returns (UpdateAgentIPResponse); + rpc DeleteAgent(DeleteAgentRequest) returns (DeleteAgentResponse); + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + rpc RotateAgentToken(RotateAgentTokenRequest) returns (RotateAgentTokenResponse); +} + +message Agent { + string id = 1; + int64 profile_id = 2; + string hostname = 3; + string public_ip = 4; + string active_ip = 5; + string token = 6; + repeated string private_ips = 7; + repeated Container containers = 8; + google.protobuf.Timestamp created_at = 9; + google.protobuf.Timestamp updated_at = 10; +} + +message GetAgentRequest { + string id = 1; +} +message GetAgentResponse { + Agent agent = 1; +} + +message CreateAgentRequest { + int64 profile_id = 1; +} +message CreateAgentResponse { + Agent agent = 1; +} + +message UpdateAgentIPRequest { + string id = 1; + string ip = 2; +} +message UpdateAgentIPResponse { + Agent agent = 1; +} + +message DeleteAgentRequest { + string id = 1; +} +message DeleteAgentResponse {} + +message ListAgentsRequest { + int64 profile_id = 1; + optional int64 limit = 2; + optional int64 offset = 3; +} +message ListAgentsResponse { + repeated Agent agents = 1; + int64 total_count = 2; +} + +message RotateAgentTokenRequest { + string id = 1; +} +message RotateAgentTokenResponse { + string token = 1; +} diff --git a/proto/mantrae/v1/backup.proto b/proto/mantrae/v1/backup.proto new file mode 100644 index 0000000..116ffb7 --- /dev/null +++ b/proto/mantrae/v1/backup.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package mantrae.v1; + +import "google/protobuf/timestamp.proto"; + +service BackupService { + rpc CreateBackup(CreateBackupRequest) returns (CreateBackupResponse); + rpc RestoreBackup(RestoreBackupRequest) returns (RestoreBackupResponse); + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + rpc DeleteBackup(DeleteBackupRequest) returns (DeleteBackupResponse); + rpc DownloadBackup(DownloadBackupRequest) returns (stream DownloadBackupResponse); + rpc UploadBackup(stream UploadBackupRequest) returns (UploadBackupResponse); +} + +message Backup { + string name = 1; + int64 size = 2; + google.protobuf.Timestamp created_at = 3; +} + +message CreateBackupRequest {} +message CreateBackupResponse {} + +message RestoreBackupRequest { + string name = 1; +} +message RestoreBackupResponse {} + +message ListBackupsRequest {} +message ListBackupsResponse { + repeated Backup backups = 1; +} + +message DeleteBackupRequest { + string name = 1; +} +message DeleteBackupResponse {} + +message DownloadBackupRequest { + string name = 1; +} +message DownloadBackupResponse { + bytes data = 1; +} + +message UploadBackupRequest { + bytes data = 1; +} +message UploadBackupResponse {} diff --git a/proto/mantrae/v1/middleware.proto b/proto/mantrae/v1/middleware.proto index e817081..fc09837 100644 --- a/proto/mantrae/v1/middleware.proto +++ b/proto/mantrae/v1/middleware.proto @@ -14,6 +14,9 @@ service MiddlewareService { rpc ListMiddlewares(ListMiddlewaresRequest) returns (ListMiddlewaresResponse) { option idempotency_level = NO_SIDE_EFFECTS; } + rpc GetMiddlewarePlugins(GetMiddlewarePluginsRequest) returns (GetMiddlewarePluginsResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } } enum MiddlewareType { @@ -25,14 +28,36 @@ enum MiddlewareType { message Middleware { int64 id = 1; int64 profile_id = 2; - string name = 3; - string config = 4; - string source = 5; + string agent_id = 3; + string name = 4; + string config = 5; MiddlewareType type = 6; google.protobuf.Timestamp created_at = 7; google.protobuf.Timestamp updated_at = 8; } +message Plugin { + string id = 1; + string name = 2; + string display_name = 3; + string author = 4; + string type = 5; + string import = 6; + string summary = 7; + string icon_url = 8; + string banner_url = 9; + string readme = 10; + string latest_version = 11; + repeated string versions = 12; + int64 stars = 13; + PluginSnippet snippet = 14; + string created_at = 15; +} + +message PluginSnippet { + string yaml = 1; +} + message GetMiddlewareRequest { int64 id = 1; MiddlewareType type = 2; @@ -43,9 +68,9 @@ message GetMiddlewareResponse { message CreateMiddlewareRequest { int64 profile_id = 1; - string name = 2; - string config = 3; - string source = 4; + string agent_id = 2; + string name = 3; + string config = 4; MiddlewareType type = 5; } message CreateMiddlewareResponse { @@ -56,8 +81,7 @@ message UpdateMiddlewareRequest { int64 id = 1; string name = 2; string config = 3; - string source = 4; - MiddlewareType type = 5; + MiddlewareType type = 4; } message UpdateMiddlewareResponse { Middleware middleware = 1; @@ -77,3 +101,8 @@ message ListMiddlewaresResponse { repeated Middleware middlewares = 1; int64 total_count = 2; } + +message GetMiddlewarePluginsRequest {} +message GetMiddlewarePluginsResponse { + repeated Plugin plugins = 1; +} diff --git a/proto/mantrae/v1/router.proto b/proto/mantrae/v1/router.proto index 1f9fc0f..bb2f464 100644 --- a/proto/mantrae/v1/router.proto +++ b/proto/mantrae/v1/router.proto @@ -26,9 +26,9 @@ enum RouterType { message Router { int64 id = 1; int64 profile_id = 2; - string name = 3; - string config = 4; - string source = 5; + string agent_id = 3; + string name = 4; + string config = 5; bool enabled = 6; RouterType type = 7; google.protobuf.Timestamp created_at = 8; @@ -45,9 +45,9 @@ message GetRouterResponse { message CreateRouterRequest { int64 profile_id = 1; - string name = 2; - string config = 3; - string source = 4; + string agent_id = 2; + string name = 3; + string config = 4; bool enabled = 5; RouterType type = 6; } @@ -59,9 +59,8 @@ message UpdateRouterRequest { int64 id = 1; string name = 2; string config = 3; - string source = 4; - bool enabled = 5; - RouterType type = 6; + bool enabled = 4; + RouterType type = 5; } message UpdateRouterResponse { Router router = 1; diff --git a/proto/mantrae/v1/service.proto b/proto/mantrae/v1/service.proto index 9823083..447a161 100644 --- a/proto/mantrae/v1/service.proto +++ b/proto/mantrae/v1/service.proto @@ -26,9 +26,9 @@ enum ServiceType { message Service { int64 id = 1; int64 profile_id = 2; - string name = 3; - string config = 4; - string source = 5; + string agent_id = 3; + string name = 4; + string config = 5; ServiceType type = 6; google.protobuf.Timestamp created_at = 7; google.protobuf.Timestamp updated_at = 8; @@ -44,9 +44,9 @@ message GetServiceResponse { message CreateServiceRequest { int64 profile_id = 1; - string name = 2; - string config = 3; - string source = 4; + string agent_id = 2; + string name = 3; + string config = 4; ServiceType type = 5; } message CreateServiceResponse { @@ -57,8 +57,7 @@ message UpdateServiceRequest { int64 id = 1; string name = 2; string config = 3; - string source = 4; - ServiceType type = 5; + ServiceType type = 4; } message UpdateServiceResponse { Service service = 1; diff --git a/sqlc.yml b/sqlc.yml index 76cbfcc..0bcbf18 100644 --- a/sqlc.yml +++ b/sqlc.yml @@ -62,7 +62,7 @@ sql: - column: "traefik_instances.entrypoints" go_type: import: "github.com/mizuchilabs/mantrae/internal/store/schema" - type: "EntryPoint" + type: "EntryPoints" pointer: true - column: "traefik_instances.overview" go_type: diff --git a/web/src/lib/gen/mantrae/v1/agent_management_pb.ts b/web/src/lib/gen/mantrae/v1/agent_management_pb.ts new file mode 100644 index 0000000..46fa339 --- /dev/null +++ b/web/src/lib/gen/mantrae/v1/agent_management_pb.ts @@ -0,0 +1,355 @@ +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" +// @generated from file mantrae/v1/agent_management.proto (package mantrae.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Timestamp } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Container } from "./agent_pb"; +import { file_mantrae_v1_agent } from "./agent_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file mantrae/v1/agent_management.proto. + */ +export const file_mantrae_v1_agent_management: GenFile = /*@__PURE__*/ + fileDesc("CiFtYW50cmFlL3YxL2FnZW50X21hbmFnZW1lbnQucHJvdG8SCm1hbnRyYWUudjEijgIKBUFnZW50EgoKAmlkGAEgASgJEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIaG9zdG5hbWUYAyABKAkSEQoJcHVibGljX2lwGAQgASgJEhEKCWFjdGl2ZV9pcBgFIAEoCRINCgV0b2tlbhgGIAEoCRITCgtwcml2YXRlX2lwcxgHIAMoCRIpCgpjb250YWluZXJzGAggAygLMhUubWFudHJhZS52MS5Db250YWluZXISLgoKY3JlYXRlZF9hdBgJIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiHQoPR2V0QWdlbnRSZXF1ZXN0EgoKAmlkGAEgASgJIjQKEEdldEFnZW50UmVzcG9uc2USIAoFYWdlbnQYASABKAsyES5tYW50cmFlLnYxLkFnZW50IigKEkNyZWF0ZUFnZW50UmVxdWVzdBISCgpwcm9maWxlX2lkGAEgASgDIjcKE0NyZWF0ZUFnZW50UmVzcG9uc2USIAoFYWdlbnQYASABKAsyES5tYW50cmFlLnYxLkFnZW50Ii4KFFVwZGF0ZUFnZW50SVBSZXF1ZXN0EgoKAmlkGAEgASgJEgoKAmlwGAIgASgJIjkKFVVwZGF0ZUFnZW50SVBSZXNwb25zZRIgCgVhZ2VudBgBIAEoCzIRLm1hbnRyYWUudjEuQWdlbnQiIAoSRGVsZXRlQWdlbnRSZXF1ZXN0EgoKAmlkGAEgASgJIhUKE0RlbGV0ZUFnZW50UmVzcG9uc2UiZQoRTGlzdEFnZW50c1JlcXVlc3QSEgoKcHJvZmlsZV9pZBgBIAEoAxISCgVsaW1pdBgCIAEoA0gAiAEBEhMKBm9mZnNldBgDIAEoA0gBiAEBQggKBl9saW1pdEIJCgdfb2Zmc2V0IkwKEkxpc3RBZ2VudHNSZXNwb25zZRIhCgZhZ2VudHMYASADKAsyES5tYW50cmFlLnYxLkFnZW50EhMKC3RvdGFsX2NvdW50GAIgASgDIiUKF1JvdGF0ZUFnZW50VG9rZW5SZXF1ZXN0EgoKAmlkGAEgASgJIikKGFJvdGF0ZUFnZW50VG9rZW5SZXNwb25zZRINCgV0b2tlbhgBIAEoCTKLBAoWQWdlbnRNYW5hZ2VtZW50U2VydmljZRJKCghHZXRBZ2VudBIbLm1hbnRyYWUudjEuR2V0QWdlbnRSZXF1ZXN0GhwubWFudHJhZS52MS5HZXRBZ2VudFJlc3BvbnNlIgOQAgESTgoLQ3JlYXRlQWdlbnQSHi5tYW50cmFlLnYxLkNyZWF0ZUFnZW50UmVxdWVzdBofLm1hbnRyYWUudjEuQ3JlYXRlQWdlbnRSZXNwb25zZRJUCg1VcGRhdGVBZ2VudElQEiAubWFudHJhZS52MS5VcGRhdGVBZ2VudElQUmVxdWVzdBohLm1hbnRyYWUudjEuVXBkYXRlQWdlbnRJUFJlc3BvbnNlEk4KC0RlbGV0ZUFnZW50Eh4ubWFudHJhZS52MS5EZWxldGVBZ2VudFJlcXVlc3QaHy5tYW50cmFlLnYxLkRlbGV0ZUFnZW50UmVzcG9uc2USUAoKTGlzdEFnZW50cxIdLm1hbnRyYWUudjEuTGlzdEFnZW50c1JlcXVlc3QaHi5tYW50cmFlLnYxLkxpc3RBZ2VudHNSZXNwb25zZSIDkAIBEl0KEFJvdGF0ZUFnZW50VG9rZW4SIy5tYW50cmFlLnYxLlJvdGF0ZUFnZW50VG9rZW5SZXF1ZXN0GiQubWFudHJhZS52MS5Sb3RhdGVBZ2VudFRva2VuUmVzcG9uc2VCrgEKDmNvbS5tYW50cmFlLnYxQhRBZ2VudE1hbmFnZW1lbnRQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_google_protobuf_timestamp, file_mantrae_v1_agent]); + +/** + * @generated from message mantrae.v1.Agent + */ +export type Agent = Message<"mantrae.v1.Agent"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: int64 profile_id = 2; + */ + profileId: bigint; + + /** + * @generated from field: string hostname = 3; + */ + hostname: string; + + /** + * @generated from field: string public_ip = 4; + */ + publicIp: string; + + /** + * @generated from field: string active_ip = 5; + */ + activeIp: string; + + /** + * @generated from field: string token = 6; + */ + token: string; + + /** + * @generated from field: repeated string private_ips = 7; + */ + privateIps: string[]; + + /** + * @generated from field: repeated mantrae.v1.Container containers = 8; + */ + containers: Container[]; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 9; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 10; + */ + updatedAt?: Timestamp; +}; + +/** + * Describes the message mantrae.v1.Agent. + * Use `create(AgentSchema)` to create a new message. + */ +export const AgentSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 0); + +/** + * @generated from message mantrae.v1.GetAgentRequest + */ +export type GetAgentRequest = Message<"mantrae.v1.GetAgentRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; +}; + +/** + * Describes the message mantrae.v1.GetAgentRequest. + * Use `create(GetAgentRequestSchema)` to create a new message. + */ +export const GetAgentRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 1); + +/** + * @generated from message mantrae.v1.GetAgentResponse + */ +export type GetAgentResponse = Message<"mantrae.v1.GetAgentResponse"> & { + /** + * @generated from field: mantrae.v1.Agent agent = 1; + */ + agent?: Agent; +}; + +/** + * Describes the message mantrae.v1.GetAgentResponse. + * Use `create(GetAgentResponseSchema)` to create a new message. + */ +export const GetAgentResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 2); + +/** + * @generated from message mantrae.v1.CreateAgentRequest + */ +export type CreateAgentRequest = Message<"mantrae.v1.CreateAgentRequest"> & { + /** + * @generated from field: int64 profile_id = 1; + */ + profileId: bigint; +}; + +/** + * Describes the message mantrae.v1.CreateAgentRequest. + * Use `create(CreateAgentRequestSchema)` to create a new message. + */ +export const CreateAgentRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 3); + +/** + * @generated from message mantrae.v1.CreateAgentResponse + */ +export type CreateAgentResponse = Message<"mantrae.v1.CreateAgentResponse"> & { + /** + * @generated from field: mantrae.v1.Agent agent = 1; + */ + agent?: Agent; +}; + +/** + * Describes the message mantrae.v1.CreateAgentResponse. + * Use `create(CreateAgentResponseSchema)` to create a new message. + */ +export const CreateAgentResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 4); + +/** + * @generated from message mantrae.v1.UpdateAgentIPRequest + */ +export type UpdateAgentIPRequest = Message<"mantrae.v1.UpdateAgentIPRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: string ip = 2; + */ + ip: string; +}; + +/** + * Describes the message mantrae.v1.UpdateAgentIPRequest. + * Use `create(UpdateAgentIPRequestSchema)` to create a new message. + */ +export const UpdateAgentIPRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 5); + +/** + * @generated from message mantrae.v1.UpdateAgentIPResponse + */ +export type UpdateAgentIPResponse = Message<"mantrae.v1.UpdateAgentIPResponse"> & { + /** + * @generated from field: mantrae.v1.Agent agent = 1; + */ + agent?: Agent; +}; + +/** + * Describes the message mantrae.v1.UpdateAgentIPResponse. + * Use `create(UpdateAgentIPResponseSchema)` to create a new message. + */ +export const UpdateAgentIPResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 6); + +/** + * @generated from message mantrae.v1.DeleteAgentRequest + */ +export type DeleteAgentRequest = Message<"mantrae.v1.DeleteAgentRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; +}; + +/** + * Describes the message mantrae.v1.DeleteAgentRequest. + * Use `create(DeleteAgentRequestSchema)` to create a new message. + */ +export const DeleteAgentRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 7); + +/** + * @generated from message mantrae.v1.DeleteAgentResponse + */ +export type DeleteAgentResponse = Message<"mantrae.v1.DeleteAgentResponse"> & { +}; + +/** + * Describes the message mantrae.v1.DeleteAgentResponse. + * Use `create(DeleteAgentResponseSchema)` to create a new message. + */ +export const DeleteAgentResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 8); + +/** + * @generated from message mantrae.v1.ListAgentsRequest + */ +export type ListAgentsRequest = Message<"mantrae.v1.ListAgentsRequest"> & { + /** + * @generated from field: int64 profile_id = 1; + */ + profileId: bigint; + + /** + * @generated from field: optional int64 limit = 2; + */ + limit?: bigint; + + /** + * @generated from field: optional int64 offset = 3; + */ + offset?: bigint; +}; + +/** + * Describes the message mantrae.v1.ListAgentsRequest. + * Use `create(ListAgentsRequestSchema)` to create a new message. + */ +export const ListAgentsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 9); + +/** + * @generated from message mantrae.v1.ListAgentsResponse + */ +export type ListAgentsResponse = Message<"mantrae.v1.ListAgentsResponse"> & { + /** + * @generated from field: repeated mantrae.v1.Agent agents = 1; + */ + agents: Agent[]; + + /** + * @generated from field: int64 total_count = 2; + */ + totalCount: bigint; +}; + +/** + * Describes the message mantrae.v1.ListAgentsResponse. + * Use `create(ListAgentsResponseSchema)` to create a new message. + */ +export const ListAgentsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 10); + +/** + * @generated from message mantrae.v1.RotateAgentTokenRequest + */ +export type RotateAgentTokenRequest = Message<"mantrae.v1.RotateAgentTokenRequest"> & { + /** + * @generated from field: string id = 1; + */ + id: string; +}; + +/** + * Describes the message mantrae.v1.RotateAgentTokenRequest. + * Use `create(RotateAgentTokenRequestSchema)` to create a new message. + */ +export const RotateAgentTokenRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 11); + +/** + * @generated from message mantrae.v1.RotateAgentTokenResponse + */ +export type RotateAgentTokenResponse = Message<"mantrae.v1.RotateAgentTokenResponse"> & { + /** + * @generated from field: string token = 1; + */ + token: string; +}; + +/** + * Describes the message mantrae.v1.RotateAgentTokenResponse. + * Use `create(RotateAgentTokenResponseSchema)` to create a new message. + */ +export const RotateAgentTokenResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_agent_management, 12); + +/** + * @generated from service mantrae.v1.AgentManagementService + */ +export const AgentManagementService: GenService<{ + /** + * @generated from rpc mantrae.v1.AgentManagementService.GetAgent + */ + getAgent: { + methodKind: "unary"; + input: typeof GetAgentRequestSchema; + output: typeof GetAgentResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.AgentManagementService.CreateAgent + */ + createAgent: { + methodKind: "unary"; + input: typeof CreateAgentRequestSchema; + output: typeof CreateAgentResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.AgentManagementService.UpdateAgentIP + */ + updateAgentIP: { + methodKind: "unary"; + input: typeof UpdateAgentIPRequestSchema; + output: typeof UpdateAgentIPResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.AgentManagementService.DeleteAgent + */ + deleteAgent: { + methodKind: "unary"; + input: typeof DeleteAgentRequestSchema; + output: typeof DeleteAgentResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.AgentManagementService.ListAgents + */ + listAgents: { + methodKind: "unary"; + input: typeof ListAgentsRequestSchema; + output: typeof ListAgentsResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.AgentManagementService.RotateAgentToken + */ + rotateAgentToken: { + methodKind: "unary"; + input: typeof RotateAgentTokenRequestSchema; + output: typeof RotateAgentTokenResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_mantrae_v1_agent_management, 0); + diff --git a/web/src/lib/gen/mantrae/v1/agent_pb.ts b/web/src/lib/gen/mantrae/v1/agent_pb.ts index 56e4f97..a1e7466 100644 --- a/web/src/lib/gen/mantrae/v1/agent_pb.ts +++ b/web/src/lib/gen/mantrae/v1/agent_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/agent.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; diff --git a/web/src/lib/gen/mantrae/v1/backup_pb.ts b/web/src/lib/gen/mantrae/v1/backup_pb.ts new file mode 100644 index 0000000..731a781 --- /dev/null +++ b/web/src/lib/gen/mantrae/v1/backup_pb.ts @@ -0,0 +1,278 @@ +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" +// @generated from file mantrae/v1/backup.proto (package mantrae.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Timestamp } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file mantrae/v1/backup.proto. + */ +export const file_mantrae_v1_backup: GenFile = /*@__PURE__*/ + fileDesc("ChdtYW50cmFlL3YxL2JhY2t1cC5wcm90bxIKbWFudHJhZS52MSJUCgZCYWNrdXASDAoEbmFtZRgBIAEoCRIMCgRzaXplGAIgASgDEi4KCmNyZWF0ZWRfYXQYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIhUKE0NyZWF0ZUJhY2t1cFJlcXVlc3QiFgoUQ3JlYXRlQmFja3VwUmVzcG9uc2UiJAoUUmVzdG9yZUJhY2t1cFJlcXVlc3QSDAoEbmFtZRgBIAEoCSIXChVSZXN0b3JlQmFja3VwUmVzcG9uc2UiFAoSTGlzdEJhY2t1cHNSZXF1ZXN0IjoKE0xpc3RCYWNrdXBzUmVzcG9uc2USIwoHYmFja3VwcxgBIAMoCzISLm1hbnRyYWUudjEuQmFja3VwIiMKE0RlbGV0ZUJhY2t1cFJlcXVlc3QSDAoEbmFtZRgBIAEoCSIWChREZWxldGVCYWNrdXBSZXNwb25zZSIlChVEb3dubG9hZEJhY2t1cFJlcXVlc3QSDAoEbmFtZRgBIAEoCSImChZEb3dubG9hZEJhY2t1cFJlc3BvbnNlEgwKBGRhdGEYASABKAwiIwoTVXBsb2FkQmFja3VwUmVxdWVzdBIMCgRkYXRhGAEgASgMIhYKFFVwbG9hZEJhY2t1cFJlc3BvbnNlMpAECg1CYWNrdXBTZXJ2aWNlElEKDENyZWF0ZUJhY2t1cBIfLm1hbnRyYWUudjEuQ3JlYXRlQmFja3VwUmVxdWVzdBogLm1hbnRyYWUudjEuQ3JlYXRlQmFja3VwUmVzcG9uc2USVAoNUmVzdG9yZUJhY2t1cBIgLm1hbnRyYWUudjEuUmVzdG9yZUJhY2t1cFJlcXVlc3QaIS5tYW50cmFlLnYxLlJlc3RvcmVCYWNrdXBSZXNwb25zZRJTCgtMaXN0QmFja3VwcxIeLm1hbnRyYWUudjEuTGlzdEJhY2t1cHNSZXF1ZXN0Gh8ubWFudHJhZS52MS5MaXN0QmFja3Vwc1Jlc3BvbnNlIgOQAgESUQoMRGVsZXRlQmFja3VwEh8ubWFudHJhZS52MS5EZWxldGVCYWNrdXBSZXF1ZXN0GiAubWFudHJhZS52MS5EZWxldGVCYWNrdXBSZXNwb25zZRJZCg5Eb3dubG9hZEJhY2t1cBIhLm1hbnRyYWUudjEuRG93bmxvYWRCYWNrdXBSZXF1ZXN0GiIubWFudHJhZS52MS5Eb3dubG9hZEJhY2t1cFJlc3BvbnNlMAESUwoMVXBsb2FkQmFja3VwEh8ubWFudHJhZS52MS5VcGxvYWRCYWNrdXBSZXF1ZXN0GiAubWFudHJhZS52MS5VcGxvYWRCYWNrdXBSZXNwb25zZSgBQqUBCg5jb20ubWFudHJhZS52MUILQmFja3VwUHJvdG9QAVo9Z2l0aHViLmNvbS9taXp1Y2hpbGFicy9tYW50cmFlL3Byb3RvL2dlbi9tYW50cmFlL3YxO21hbnRyYWV2MaICA01YWKoCCk1hbnRyYWUuVjHKAgpNYW50cmFlXFYx4gIWTWFudHJhZVxWMVxHUEJNZXRhZGF0YeoCC01hbnRyYWU6OlYxYgZwcm90bzM", [file_google_protobuf_timestamp]); + +/** + * @generated from message mantrae.v1.Backup + */ +export type Backup = Message<"mantrae.v1.Backup"> & { + /** + * @generated from field: string name = 1; + */ + name: string; + + /** + * @generated from field: int64 size = 2; + */ + size: bigint; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 3; + */ + createdAt?: Timestamp; +}; + +/** + * Describes the message mantrae.v1.Backup. + * Use `create(BackupSchema)` to create a new message. + */ +export const BackupSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 0); + +/** + * @generated from message mantrae.v1.CreateBackupRequest + */ +export type CreateBackupRequest = Message<"mantrae.v1.CreateBackupRequest"> & { +}; + +/** + * Describes the message mantrae.v1.CreateBackupRequest. + * Use `create(CreateBackupRequestSchema)` to create a new message. + */ +export const CreateBackupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 1); + +/** + * @generated from message mantrae.v1.CreateBackupResponse + */ +export type CreateBackupResponse = Message<"mantrae.v1.CreateBackupResponse"> & { +}; + +/** + * Describes the message mantrae.v1.CreateBackupResponse. + * Use `create(CreateBackupResponseSchema)` to create a new message. + */ +export const CreateBackupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 2); + +/** + * @generated from message mantrae.v1.RestoreBackupRequest + */ +export type RestoreBackupRequest = Message<"mantrae.v1.RestoreBackupRequest"> & { + /** + * @generated from field: string name = 1; + */ + name: string; +}; + +/** + * Describes the message mantrae.v1.RestoreBackupRequest. + * Use `create(RestoreBackupRequestSchema)` to create a new message. + */ +export const RestoreBackupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 3); + +/** + * @generated from message mantrae.v1.RestoreBackupResponse + */ +export type RestoreBackupResponse = Message<"mantrae.v1.RestoreBackupResponse"> & { +}; + +/** + * Describes the message mantrae.v1.RestoreBackupResponse. + * Use `create(RestoreBackupResponseSchema)` to create a new message. + */ +export const RestoreBackupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 4); + +/** + * @generated from message mantrae.v1.ListBackupsRequest + */ +export type ListBackupsRequest = Message<"mantrae.v1.ListBackupsRequest"> & { +}; + +/** + * Describes the message mantrae.v1.ListBackupsRequest. + * Use `create(ListBackupsRequestSchema)` to create a new message. + */ +export const ListBackupsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 5); + +/** + * @generated from message mantrae.v1.ListBackupsResponse + */ +export type ListBackupsResponse = Message<"mantrae.v1.ListBackupsResponse"> & { + /** + * @generated from field: repeated mantrae.v1.Backup backups = 1; + */ + backups: Backup[]; +}; + +/** + * Describes the message mantrae.v1.ListBackupsResponse. + * Use `create(ListBackupsResponseSchema)` to create a new message. + */ +export const ListBackupsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 6); + +/** + * @generated from message mantrae.v1.DeleteBackupRequest + */ +export type DeleteBackupRequest = Message<"mantrae.v1.DeleteBackupRequest"> & { + /** + * @generated from field: string name = 1; + */ + name: string; +}; + +/** + * Describes the message mantrae.v1.DeleteBackupRequest. + * Use `create(DeleteBackupRequestSchema)` to create a new message. + */ +export const DeleteBackupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 7); + +/** + * @generated from message mantrae.v1.DeleteBackupResponse + */ +export type DeleteBackupResponse = Message<"mantrae.v1.DeleteBackupResponse"> & { +}; + +/** + * Describes the message mantrae.v1.DeleteBackupResponse. + * Use `create(DeleteBackupResponseSchema)` to create a new message. + */ +export const DeleteBackupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 8); + +/** + * @generated from message mantrae.v1.DownloadBackupRequest + */ +export type DownloadBackupRequest = Message<"mantrae.v1.DownloadBackupRequest"> & { + /** + * @generated from field: string name = 1; + */ + name: string; +}; + +/** + * Describes the message mantrae.v1.DownloadBackupRequest. + * Use `create(DownloadBackupRequestSchema)` to create a new message. + */ +export const DownloadBackupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 9); + +/** + * @generated from message mantrae.v1.DownloadBackupResponse + */ +export type DownloadBackupResponse = Message<"mantrae.v1.DownloadBackupResponse"> & { + /** + * @generated from field: bytes data = 1; + */ + data: Uint8Array; +}; + +/** + * Describes the message mantrae.v1.DownloadBackupResponse. + * Use `create(DownloadBackupResponseSchema)` to create a new message. + */ +export const DownloadBackupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 10); + +/** + * @generated from message mantrae.v1.UploadBackupRequest + */ +export type UploadBackupRequest = Message<"mantrae.v1.UploadBackupRequest"> & { + /** + * @generated from field: bytes data = 1; + */ + data: Uint8Array; +}; + +/** + * Describes the message mantrae.v1.UploadBackupRequest. + * Use `create(UploadBackupRequestSchema)` to create a new message. + */ +export const UploadBackupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 11); + +/** + * @generated from message mantrae.v1.UploadBackupResponse + */ +export type UploadBackupResponse = Message<"mantrae.v1.UploadBackupResponse"> & { +}; + +/** + * Describes the message mantrae.v1.UploadBackupResponse. + * Use `create(UploadBackupResponseSchema)` to create a new message. + */ +export const UploadBackupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_backup, 12); + +/** + * @generated from service mantrae.v1.BackupService + */ +export const BackupService: GenService<{ + /** + * @generated from rpc mantrae.v1.BackupService.CreateBackup + */ + createBackup: { + methodKind: "unary"; + input: typeof CreateBackupRequestSchema; + output: typeof CreateBackupResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.BackupService.RestoreBackup + */ + restoreBackup: { + methodKind: "unary"; + input: typeof RestoreBackupRequestSchema; + output: typeof RestoreBackupResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.BackupService.ListBackups + */ + listBackups: { + methodKind: "unary"; + input: typeof ListBackupsRequestSchema; + output: typeof ListBackupsResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.BackupService.DeleteBackup + */ + deleteBackup: { + methodKind: "unary"; + input: typeof DeleteBackupRequestSchema; + output: typeof DeleteBackupResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.BackupService.DownloadBackup + */ + downloadBackup: { + methodKind: "server_streaming"; + input: typeof DownloadBackupRequestSchema; + output: typeof DownloadBackupResponseSchema; + }, + /** + * @generated from rpc mantrae.v1.BackupService.UploadBackup + */ + uploadBackup: { + methodKind: "client_streaming"; + input: typeof UploadBackupRequestSchema; + output: typeof UploadBackupResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_mantrae_v1_backup, 0); + diff --git a/web/src/lib/gen/mantrae/v1/entry_point_pb.ts b/web/src/lib/gen/mantrae/v1/entry_point_pb.ts index 1f61918..a890c5c 100644 --- a/web/src/lib/gen/mantrae/v1/entry_point_pb.ts +++ b/web/src/lib/gen/mantrae/v1/entry_point_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/entry_point.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; diff --git a/web/src/lib/gen/mantrae/v1/middleware_pb.ts b/web/src/lib/gen/mantrae/v1/middleware_pb.ts index 6d251fa..d244636 100644 --- a/web/src/lib/gen/mantrae/v1/middleware_pb.ts +++ b/web/src/lib/gen/mantrae/v1/middleware_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/middleware.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; @@ -12,7 +12,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file mantrae/v1/middleware.proto. */ export const file_mantrae_v1_middleware: GenFile = /*@__PURE__*/ - fileDesc("ChttYW50cmFlL3YxL21pZGRsZXdhcmUucHJvdG8SCm1hbnRyYWUudjEi5AEKCk1pZGRsZXdhcmUSCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIMCgRuYW1lGAMgASgJEg4KBmNvbmZpZxgEIAEoCRIOCgZzb3VyY2UYBSABKAkSKAoEdHlwZRgGIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUSLgoKY3JlYXRlZF9hdBgHIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgIIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiTAoUR2V0TWlkZGxld2FyZVJlcXVlc3QSCgoCaWQYASABKAMSKAoEdHlwZRgCIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUiQwoVR2V0TWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUihQEKF0NyZWF0ZU1pZGRsZXdhcmVSZXF1ZXN0EhIKCnByb2ZpbGVfaWQYASABKAMSDAoEbmFtZRgCIAEoCRIOCgZjb25maWcYAyABKAkSDgoGc291cmNlGAQgASgJEigKBHR5cGUYBSABKA4yGi5tYW50cmFlLnYxLk1pZGRsZXdhcmVUeXBlIkYKGENyZWF0ZU1pZGRsZXdhcmVSZXNwb25zZRIqCgptaWRkbGV3YXJlGAEgASgLMhYubWFudHJhZS52MS5NaWRkbGV3YXJlIn0KF1VwZGF0ZU1pZGRsZXdhcmVSZXF1ZXN0EgoKAmlkGAEgASgDEgwKBG5hbWUYAiABKAkSDgoGY29uZmlnGAMgASgJEg4KBnNvdXJjZRgEIAEoCRIoCgR0eXBlGAUgASgOMhoubWFudHJhZS52MS5NaWRkbGV3YXJlVHlwZSJGChhVcGRhdGVNaWRkbGV3YXJlUmVzcG9uc2USKgoKbWlkZGxld2FyZRgBIAEoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZSIlChdEZWxldGVNaWRkbGV3YXJlUmVxdWVzdBIKCgJpZBgBIAEoAyIaChhEZWxldGVNaWRkbGV3YXJlUmVzcG9uc2UigAEKFkxpc3RNaWRkbGV3YXJlc1JlcXVlc3QSKAoEdHlwZRgBIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUSEgoFbGltaXQYAiABKANIAIgBARITCgZvZmZzZXQYAyABKANIAYgBAUIICgZfbGltaXRCCQoHX29mZnNldCJbChdMaXN0TWlkZGxld2FyZXNSZXNwb25zZRIrCgttaWRkbGV3YXJlcxgBIAMoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZRITCgt0b3RhbF9jb3VudBgCIAEoAypkCg5NaWRkbGV3YXJlVHlwZRIfChtNSURETEVXQVJFX1RZUEVfVU5TUEVDSUZJRUQQABIYChRNSURETEVXQVJFX1RZUEVfSFRUUBABEhcKE01JRERMRVdBUkVfVFlQRV9UQ1AQAjLsAwoRTWlkZGxld2FyZVNlcnZpY2USWQoNR2V0TWlkZGxld2FyZRIgLm1hbnRyYWUudjEuR2V0TWlkZGxld2FyZVJlcXVlc3QaIS5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVSZXNwb25zZSIDkAIBEl0KEENyZWF0ZU1pZGRsZXdhcmUSIy5tYW50cmFlLnYxLkNyZWF0ZU1pZGRsZXdhcmVSZXF1ZXN0GiQubWFudHJhZS52MS5DcmVhdGVNaWRkbGV3YXJlUmVzcG9uc2USXQoQVXBkYXRlTWlkZGxld2FyZRIjLm1hbnRyYWUudjEuVXBkYXRlTWlkZGxld2FyZVJlcXVlc3QaJC5tYW50cmFlLnYxLlVwZGF0ZU1pZGRsZXdhcmVSZXNwb25zZRJdChBEZWxldGVNaWRkbGV3YXJlEiMubWFudHJhZS52MS5EZWxldGVNaWRkbGV3YXJlUmVxdWVzdBokLm1hbnRyYWUudjEuRGVsZXRlTWlkZGxld2FyZVJlc3BvbnNlEl8KD0xpc3RNaWRkbGV3YXJlcxIiLm1hbnRyYWUudjEuTGlzdE1pZGRsZXdhcmVzUmVxdWVzdBojLm1hbnRyYWUudjEuTGlzdE1pZGRsZXdhcmVzUmVzcG9uc2UiA5ACAUKpAQoOY29tLm1hbnRyYWUudjFCD01pZGRsZXdhcmVQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_google_protobuf_timestamp]); + fileDesc("ChttYW50cmFlL3YxL21pZGRsZXdhcmUucHJvdG8SCm1hbnRyYWUudjEi5gEKCk1pZGRsZXdhcmUSCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEg4KBmNvbmZpZxgFIAEoCRIoCgR0eXBlGAYgASgOMhoubWFudHJhZS52MS5NaWRkbGV3YXJlVHlwZRIuCgpjcmVhdGVkX2F0GAcgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAggASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCKmAgoGUGx1Z2luEgoKAmlkGAEgASgJEgwKBG5hbWUYAiABKAkSFAoMZGlzcGxheV9uYW1lGAMgASgJEg4KBmF1dGhvchgEIAEoCRIMCgR0eXBlGAUgASgJEg4KBmltcG9ydBgGIAEoCRIPCgdzdW1tYXJ5GAcgASgJEhAKCGljb25fdXJsGAggASgJEhIKCmJhbm5lcl91cmwYCSABKAkSDgoGcmVhZG1lGAogASgJEhYKDmxhdGVzdF92ZXJzaW9uGAsgASgJEhAKCHZlcnNpb25zGAwgAygJEg0KBXN0YXJzGA0gASgDEioKB3NuaXBwZXQYDiABKAsyGS5tYW50cmFlLnYxLlBsdWdpblNuaXBwZXQSEgoKY3JlYXRlZF9hdBgPIAEoCSIdCg1QbHVnaW5TbmlwcGV0EgwKBHlhbWwYASABKAkiTAoUR2V0TWlkZGxld2FyZVJlcXVlc3QSCgoCaWQYASABKAMSKAoEdHlwZRgCIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUiQwoVR2V0TWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUihwEKF0NyZWF0ZU1pZGRsZXdhcmVSZXF1ZXN0EhIKCnByb2ZpbGVfaWQYASABKAMSEAoIYWdlbnRfaWQYAiABKAkSDAoEbmFtZRgDIAEoCRIOCgZjb25maWcYBCABKAkSKAoEdHlwZRgFIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUiRgoYQ3JlYXRlTWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUibQoXVXBkYXRlTWlkZGxld2FyZVJlcXVlc3QSCgoCaWQYASABKAMSDAoEbmFtZRgCIAEoCRIOCgZjb25maWcYAyABKAkSKAoEdHlwZRgEIAEoDjIaLm1hbnRyYWUudjEuTWlkZGxld2FyZVR5cGUiRgoYVXBkYXRlTWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUiJQoXRGVsZXRlTWlkZGxld2FyZVJlcXVlc3QSCgoCaWQYASABKAMiGgoYRGVsZXRlTWlkZGxld2FyZVJlc3BvbnNlIoABChZMaXN0TWlkZGxld2FyZXNSZXF1ZXN0EigKBHR5cGUYASABKA4yGi5tYW50cmFlLnYxLk1pZGRsZXdhcmVUeXBlEhIKBWxpbWl0GAIgASgDSACIAQESEwoGb2Zmc2V0GAMgASgDSAGIAQFCCAoGX2xpbWl0QgkKB19vZmZzZXQiWwoXTGlzdE1pZGRsZXdhcmVzUmVzcG9uc2USKwoLbWlkZGxld2FyZXMYASADKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUSEwoLdG90YWxfY291bnQYAiABKAMiHQobR2V0TWlkZGxld2FyZVBsdWdpbnNSZXF1ZXN0IkMKHEdldE1pZGRsZXdhcmVQbHVnaW5zUmVzcG9uc2USIwoHcGx1Z2lucxgBIAMoCzISLm1hbnRyYWUudjEuUGx1Z2luKmQKDk1pZGRsZXdhcmVUeXBlEh8KG01JRERMRVdBUkVfVFlQRV9VTlNQRUNJRklFRBAAEhgKFE1JRERMRVdBUkVfVFlQRV9IVFRQEAESFwoTTUlERExFV0FSRV9UWVBFX1RDUBACMtwEChFNaWRkbGV3YXJlU2VydmljZRJZCg1HZXRNaWRkbGV3YXJlEiAubWFudHJhZS52MS5HZXRNaWRkbGV3YXJlUmVxdWVzdBohLm1hbnRyYWUudjEuR2V0TWlkZGxld2FyZVJlc3BvbnNlIgOQAgESXQoQQ3JlYXRlTWlkZGxld2FyZRIjLm1hbnRyYWUudjEuQ3JlYXRlTWlkZGxld2FyZVJlcXVlc3QaJC5tYW50cmFlLnYxLkNyZWF0ZU1pZGRsZXdhcmVSZXNwb25zZRJdChBVcGRhdGVNaWRkbGV3YXJlEiMubWFudHJhZS52MS5VcGRhdGVNaWRkbGV3YXJlUmVxdWVzdBokLm1hbnRyYWUudjEuVXBkYXRlTWlkZGxld2FyZVJlc3BvbnNlEl0KEERlbGV0ZU1pZGRsZXdhcmUSIy5tYW50cmFlLnYxLkRlbGV0ZU1pZGRsZXdhcmVSZXF1ZXN0GiQubWFudHJhZS52MS5EZWxldGVNaWRkbGV3YXJlUmVzcG9uc2USXwoPTGlzdE1pZGRsZXdhcmVzEiIubWFudHJhZS52MS5MaXN0TWlkZGxld2FyZXNSZXF1ZXN0GiMubWFudHJhZS52MS5MaXN0TWlkZGxld2FyZXNSZXNwb25zZSIDkAIBEm4KFEdldE1pZGRsZXdhcmVQbHVnaW5zEicubWFudHJhZS52MS5HZXRNaWRkbGV3YXJlUGx1Z2luc1JlcXVlc3QaKC5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVQbHVnaW5zUmVzcG9uc2UiA5ACAUKpAQoOY29tLm1hbnRyYWUudjFCD01pZGRsZXdhcmVQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_google_protobuf_timestamp]); /** * @generated from message mantrae.v1.Middleware @@ -29,20 +29,20 @@ export type Middleware = Message<"mantrae.v1.Middleware"> & { profileId: bigint; /** - * @generated from field: string name = 3; + * @generated from field: string agent_id = 3; + */ + agentId: string; + + /** + * @generated from field: string name = 4; */ name: string; /** - * @generated from field: string config = 4; + * @generated from field: string config = 5; */ config: string; - /** - * @generated from field: string source = 5; - */ - source: string; - /** * @generated from field: mantrae.v1.MiddlewareType type = 6; */ @@ -66,6 +66,110 @@ export type Middleware = Message<"mantrae.v1.Middleware"> & { export const MiddlewareSchema: GenMessage = /*@__PURE__*/ messageDesc(file_mantrae_v1_middleware, 0); +/** + * @generated from message mantrae.v1.Plugin + */ +export type Plugin = Message<"mantrae.v1.Plugin"> & { + /** + * @generated from field: string id = 1; + */ + id: string; + + /** + * @generated from field: string name = 2; + */ + name: string; + + /** + * @generated from field: string display_name = 3; + */ + displayName: string; + + /** + * @generated from field: string author = 4; + */ + author: string; + + /** + * @generated from field: string type = 5; + */ + type: string; + + /** + * @generated from field: string import = 6; + */ + import: string; + + /** + * @generated from field: string summary = 7; + */ + summary: string; + + /** + * @generated from field: string icon_url = 8; + */ + iconUrl: string; + + /** + * @generated from field: string banner_url = 9; + */ + bannerUrl: string; + + /** + * @generated from field: string readme = 10; + */ + readme: string; + + /** + * @generated from field: string latest_version = 11; + */ + latestVersion: string; + + /** + * @generated from field: repeated string versions = 12; + */ + versions: string[]; + + /** + * @generated from field: int64 stars = 13; + */ + stars: bigint; + + /** + * @generated from field: mantrae.v1.PluginSnippet snippet = 14; + */ + snippet?: PluginSnippet; + + /** + * @generated from field: string created_at = 15; + */ + createdAt: string; +}; + +/** + * Describes the message mantrae.v1.Plugin. + * Use `create(PluginSchema)` to create a new message. + */ +export const PluginSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_middleware, 1); + +/** + * @generated from message mantrae.v1.PluginSnippet + */ +export type PluginSnippet = Message<"mantrae.v1.PluginSnippet"> & { + /** + * @generated from field: string yaml = 1; + */ + yaml: string; +}; + +/** + * Describes the message mantrae.v1.PluginSnippet. + * Use `create(PluginSnippetSchema)` to create a new message. + */ +export const PluginSnippetSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_middleware, 2); + /** * @generated from message mantrae.v1.GetMiddlewareRequest */ @@ -86,7 +190,7 @@ export type GetMiddlewareRequest = Message<"mantrae.v1.GetMiddlewareRequest"> & * Use `create(GetMiddlewareRequestSchema)` to create a new message. */ export const GetMiddlewareRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 1); + messageDesc(file_mantrae_v1_middleware, 3); /** * @generated from message mantrae.v1.GetMiddlewareResponse @@ -103,7 +207,7 @@ export type GetMiddlewareResponse = Message<"mantrae.v1.GetMiddlewareResponse"> * Use `create(GetMiddlewareResponseSchema)` to create a new message. */ export const GetMiddlewareResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 2); + messageDesc(file_mantrae_v1_middleware, 4); /** * @generated from message mantrae.v1.CreateMiddlewareRequest @@ -115,20 +219,20 @@ export type CreateMiddlewareRequest = Message<"mantrae.v1.CreateMiddlewareReques profileId: bigint; /** - * @generated from field: string name = 2; + * @generated from field: string agent_id = 2; + */ + agentId: string; + + /** + * @generated from field: string name = 3; */ name: string; /** - * @generated from field: string config = 3; + * @generated from field: string config = 4; */ config: string; - /** - * @generated from field: string source = 4; - */ - source: string; - /** * @generated from field: mantrae.v1.MiddlewareType type = 5; */ @@ -140,7 +244,7 @@ export type CreateMiddlewareRequest = Message<"mantrae.v1.CreateMiddlewareReques * Use `create(CreateMiddlewareRequestSchema)` to create a new message. */ export const CreateMiddlewareRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 3); + messageDesc(file_mantrae_v1_middleware, 5); /** * @generated from message mantrae.v1.CreateMiddlewareResponse @@ -157,7 +261,7 @@ export type CreateMiddlewareResponse = Message<"mantrae.v1.CreateMiddlewareRespo * Use `create(CreateMiddlewareResponseSchema)` to create a new message. */ export const CreateMiddlewareResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 4); + messageDesc(file_mantrae_v1_middleware, 6); /** * @generated from message mantrae.v1.UpdateMiddlewareRequest @@ -179,12 +283,7 @@ export type UpdateMiddlewareRequest = Message<"mantrae.v1.UpdateMiddlewareReques config: string; /** - * @generated from field: string source = 4; - */ - source: string; - - /** - * @generated from field: mantrae.v1.MiddlewareType type = 5; + * @generated from field: mantrae.v1.MiddlewareType type = 4; */ type: MiddlewareType; }; @@ -194,7 +293,7 @@ export type UpdateMiddlewareRequest = Message<"mantrae.v1.UpdateMiddlewareReques * Use `create(UpdateMiddlewareRequestSchema)` to create a new message. */ export const UpdateMiddlewareRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 5); + messageDesc(file_mantrae_v1_middleware, 7); /** * @generated from message mantrae.v1.UpdateMiddlewareResponse @@ -211,7 +310,7 @@ export type UpdateMiddlewareResponse = Message<"mantrae.v1.UpdateMiddlewareRespo * Use `create(UpdateMiddlewareResponseSchema)` to create a new message. */ export const UpdateMiddlewareResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 6); + messageDesc(file_mantrae_v1_middleware, 8); /** * @generated from message mantrae.v1.DeleteMiddlewareRequest @@ -228,7 +327,7 @@ export type DeleteMiddlewareRequest = Message<"mantrae.v1.DeleteMiddlewareReques * Use `create(DeleteMiddlewareRequestSchema)` to create a new message. */ export const DeleteMiddlewareRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 7); + messageDesc(file_mantrae_v1_middleware, 9); /** * @generated from message mantrae.v1.DeleteMiddlewareResponse @@ -241,7 +340,7 @@ export type DeleteMiddlewareResponse = Message<"mantrae.v1.DeleteMiddlewareRespo * Use `create(DeleteMiddlewareResponseSchema)` to create a new message. */ export const DeleteMiddlewareResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 8); + messageDesc(file_mantrae_v1_middleware, 10); /** * @generated from message mantrae.v1.ListMiddlewaresRequest @@ -268,7 +367,7 @@ export type ListMiddlewaresRequest = Message<"mantrae.v1.ListMiddlewaresRequest" * Use `create(ListMiddlewaresRequestSchema)` to create a new message. */ export const ListMiddlewaresRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 9); + messageDesc(file_mantrae_v1_middleware, 11); /** * @generated from message mantrae.v1.ListMiddlewaresResponse @@ -290,7 +389,37 @@ export type ListMiddlewaresResponse = Message<"mantrae.v1.ListMiddlewaresRespons * Use `create(ListMiddlewaresResponseSchema)` to create a new message. */ export const ListMiddlewaresResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_mantrae_v1_middleware, 10); + messageDesc(file_mantrae_v1_middleware, 12); + +/** + * @generated from message mantrae.v1.GetMiddlewarePluginsRequest + */ +export type GetMiddlewarePluginsRequest = Message<"mantrae.v1.GetMiddlewarePluginsRequest"> & { +}; + +/** + * Describes the message mantrae.v1.GetMiddlewarePluginsRequest. + * Use `create(GetMiddlewarePluginsRequestSchema)` to create a new message. + */ +export const GetMiddlewarePluginsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_middleware, 13); + +/** + * @generated from message mantrae.v1.GetMiddlewarePluginsResponse + */ +export type GetMiddlewarePluginsResponse = Message<"mantrae.v1.GetMiddlewarePluginsResponse"> & { + /** + * @generated from field: repeated mantrae.v1.Plugin plugins = 1; + */ + plugins: Plugin[]; +}; + +/** + * Describes the message mantrae.v1.GetMiddlewarePluginsResponse. + * Use `create(GetMiddlewarePluginsResponseSchema)` to create a new message. + */ +export const GetMiddlewarePluginsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_mantrae_v1_middleware, 14); /** * @generated from enum mantrae.v1.MiddlewareType @@ -362,6 +491,14 @@ export const MiddlewareService: GenService<{ input: typeof ListMiddlewaresRequestSchema; output: typeof ListMiddlewaresResponseSchema; }, + /** + * @generated from rpc mantrae.v1.MiddlewareService.GetMiddlewarePlugins + */ + getMiddlewarePlugins: { + methodKind: "unary"; + input: typeof GetMiddlewarePluginsRequestSchema; + output: typeof GetMiddlewarePluginsResponseSchema; + }, }> = /*@__PURE__*/ serviceDesc(file_mantrae_v1_middleware, 0); diff --git a/web/src/lib/gen/mantrae/v1/profile_pb.ts b/web/src/lib/gen/mantrae/v1/profile_pb.ts index 57f69a9..eff7ae1 100644 --- a/web/src/lib/gen/mantrae/v1/profile_pb.ts +++ b/web/src/lib/gen/mantrae/v1/profile_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/profile.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; diff --git a/web/src/lib/gen/mantrae/v1/router_pb.ts b/web/src/lib/gen/mantrae/v1/router_pb.ts index c84e19f..83385ea 100644 --- a/web/src/lib/gen/mantrae/v1/router_pb.ts +++ b/web/src/lib/gen/mantrae/v1/router_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/router.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; @@ -12,7 +12,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file mantrae/v1/router.proto. */ export const file_mantrae_v1_router: GenFile = /*@__PURE__*/ - fileDesc("ChdtYW50cmFlL3YxL3JvdXRlci5wcm90bxIKbWFudHJhZS52MSLtAQoGUm91dGVyEgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSDAoEbmFtZRgDIAEoCRIOCgZjb25maWcYBCABKAkSDgoGc291cmNlGAUgASgJEg8KB2VuYWJsZWQYBiABKAgSJAoEdHlwZRgHIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZRIuCgpjcmVhdGVkX2F0GAggASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCJEChBHZXRSb3V0ZXJSZXF1ZXN0EgoKAmlkGAEgASgDEiQKBHR5cGUYAiABKA4yFi5tYW50cmFlLnYxLlJvdXRlclR5cGUiNwoRR2V0Um91dGVyUmVzcG9uc2USIgoGcm91dGVyGAEgASgLMhIubWFudHJhZS52MS5Sb3V0ZXIijgEKE0NyZWF0ZVJvdXRlclJlcXVlc3QSEgoKcHJvZmlsZV9pZBgBIAEoAxIMCgRuYW1lGAIgASgJEg4KBmNvbmZpZxgDIAEoCRIOCgZzb3VyY2UYBCABKAkSDwoHZW5hYmxlZBgFIAEoCBIkCgR0eXBlGAYgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlIjoKFENyZWF0ZVJvdXRlclJlc3BvbnNlEiIKBnJvdXRlchgBIAEoCzISLm1hbnRyYWUudjEuUm91dGVyIoYBChNVcGRhdGVSb3V0ZXJSZXF1ZXN0EgoKAmlkGAEgASgDEgwKBG5hbWUYAiABKAkSDgoGY29uZmlnGAMgASgJEg4KBnNvdXJjZRgEIAEoCRIPCgdlbmFibGVkGAUgASgIEiQKBHR5cGUYBiABKA4yFi5tYW50cmFlLnYxLlJvdXRlclR5cGUiOgoUVXBkYXRlUm91dGVyUmVzcG9uc2USIgoGcm91dGVyGAEgASgLMhIubWFudHJhZS52MS5Sb3V0ZXIiIQoTRGVsZXRlUm91dGVyUmVxdWVzdBIKCgJpZBgBIAEoAyIWChREZWxldGVSb3V0ZXJSZXNwb25zZSJ4ChJMaXN0Um91dGVyc1JlcXVlc3QSJAoEdHlwZRgBIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZRISCgVsaW1pdBgCIAEoA0gAiAEBEhMKBm9mZnNldBgDIAEoA0gBiAEBQggKBl9saW1pdEIJCgdfb2Zmc2V0Ik8KE0xpc3RSb3V0ZXJzUmVzcG9uc2USIwoHcm91dGVycxgBIAMoCzISLm1hbnRyYWUudjEuUm91dGVyEhMKC3RvdGFsX2NvdW50GAIgASgDKmkKClJvdXRlclR5cGUSGwoXUk9VVEVSX1RZUEVfVU5TUEVDSUZJRUQQABIUChBST1VURVJfVFlQRV9IVFRQEAESEwoPUk9VVEVSX1RZUEVfVENQEAISEwoPUk9VVEVSX1RZUEVfVURQEAMyrAMKDVJvdXRlclNlcnZpY2USTQoJR2V0Um91dGVyEhwubWFudHJhZS52MS5HZXRSb3V0ZXJSZXF1ZXN0Gh0ubWFudHJhZS52MS5HZXRSb3V0ZXJSZXNwb25zZSIDkAIBElEKDENyZWF0ZVJvdXRlchIfLm1hbnRyYWUudjEuQ3JlYXRlUm91dGVyUmVxdWVzdBogLm1hbnRyYWUudjEuQ3JlYXRlUm91dGVyUmVzcG9uc2USUQoMVXBkYXRlUm91dGVyEh8ubWFudHJhZS52MS5VcGRhdGVSb3V0ZXJSZXF1ZXN0GiAubWFudHJhZS52MS5VcGRhdGVSb3V0ZXJSZXNwb25zZRJRCgxEZWxldGVSb3V0ZXISHy5tYW50cmFlLnYxLkRlbGV0ZVJvdXRlclJlcXVlc3QaIC5tYW50cmFlLnYxLkRlbGV0ZVJvdXRlclJlc3BvbnNlElMKC0xpc3RSb3V0ZXJzEh4ubWFudHJhZS52MS5MaXN0Um91dGVyc1JlcXVlc3QaHy5tYW50cmFlLnYxLkxpc3RSb3V0ZXJzUmVzcG9uc2UiA5ACAUKlAQoOY29tLm1hbnRyYWUudjFCC1JvdXRlclByb3RvUAFaPWdpdGh1Yi5jb20vbWl6dWNoaWxhYnMvbWFudHJhZS9wcm90by9nZW4vbWFudHJhZS92MTttYW50cmFldjGiAgNNWFiqAgpNYW50cmFlLlYxygIKTWFudHJhZVxWMeICFk1hbnRyYWVcVjFcR1BCTWV0YWRhdGHqAgtNYW50cmFlOjpWMWIGcHJvdG8z", [file_google_protobuf_timestamp]); + fileDesc("ChdtYW50cmFlL3YxL3JvdXRlci5wcm90bxIKbWFudHJhZS52MSLvAQoGUm91dGVyEgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIYWdlbnRfaWQYAyABKAkSDAoEbmFtZRgEIAEoCRIOCgZjb25maWcYBSABKAkSDwoHZW5hYmxlZBgGIAEoCBIkCgR0eXBlGAcgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlEi4KCmNyZWF0ZWRfYXQYCCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIkQKEEdldFJvdXRlclJlcXVlc3QSCgoCaWQYASABKAMSJAoEdHlwZRgCIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZSI3ChFHZXRSb3V0ZXJSZXNwb25zZRIiCgZyb3V0ZXIYASABKAsyEi5tYW50cmFlLnYxLlJvdXRlciKQAQoTQ3JlYXRlUm91dGVyUmVxdWVzdBISCgpwcm9maWxlX2lkGAEgASgDEhAKCGFnZW50X2lkGAIgASgJEgwKBG5hbWUYAyABKAkSDgoGY29uZmlnGAQgASgJEg8KB2VuYWJsZWQYBSABKAgSJAoEdHlwZRgGIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZSI6ChRDcmVhdGVSb3V0ZXJSZXNwb25zZRIiCgZyb3V0ZXIYASABKAsyEi5tYW50cmFlLnYxLlJvdXRlciJ2ChNVcGRhdGVSb3V0ZXJSZXF1ZXN0EgoKAmlkGAEgASgDEgwKBG5hbWUYAiABKAkSDgoGY29uZmlnGAMgASgJEg8KB2VuYWJsZWQYBCABKAgSJAoEdHlwZRgFIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZSI6ChRVcGRhdGVSb3V0ZXJSZXNwb25zZRIiCgZyb3V0ZXIYASABKAsyEi5tYW50cmFlLnYxLlJvdXRlciIhChNEZWxldGVSb3V0ZXJSZXF1ZXN0EgoKAmlkGAEgASgDIhYKFERlbGV0ZVJvdXRlclJlc3BvbnNlIngKEkxpc3RSb3V0ZXJzUmVxdWVzdBIkCgR0eXBlGAEgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlEhIKBWxpbWl0GAIgASgDSACIAQESEwoGb2Zmc2V0GAMgASgDSAGIAQFCCAoGX2xpbWl0QgkKB19vZmZzZXQiTwoTTGlzdFJvdXRlcnNSZXNwb25zZRIjCgdyb3V0ZXJzGAEgAygLMhIubWFudHJhZS52MS5Sb3V0ZXISEwoLdG90YWxfY291bnQYAiABKAMqaQoKUm91dGVyVHlwZRIbChdST1VURVJfVFlQRV9VTlNQRUNJRklFRBAAEhQKEFJPVVRFUl9UWVBFX0hUVFAQARITCg9ST1VURVJfVFlQRV9UQ1AQAhITCg9ST1VURVJfVFlQRV9VRFAQAzKsAwoNUm91dGVyU2VydmljZRJNCglHZXRSb3V0ZXISHC5tYW50cmFlLnYxLkdldFJvdXRlclJlcXVlc3QaHS5tYW50cmFlLnYxLkdldFJvdXRlclJlc3BvbnNlIgOQAgESUQoMQ3JlYXRlUm91dGVyEh8ubWFudHJhZS52MS5DcmVhdGVSb3V0ZXJSZXF1ZXN0GiAubWFudHJhZS52MS5DcmVhdGVSb3V0ZXJSZXNwb25zZRJRCgxVcGRhdGVSb3V0ZXISHy5tYW50cmFlLnYxLlVwZGF0ZVJvdXRlclJlcXVlc3QaIC5tYW50cmFlLnYxLlVwZGF0ZVJvdXRlclJlc3BvbnNlElEKDERlbGV0ZVJvdXRlchIfLm1hbnRyYWUudjEuRGVsZXRlUm91dGVyUmVxdWVzdBogLm1hbnRyYWUudjEuRGVsZXRlUm91dGVyUmVzcG9uc2USUwoLTGlzdFJvdXRlcnMSHi5tYW50cmFlLnYxLkxpc3RSb3V0ZXJzUmVxdWVzdBofLm1hbnRyYWUudjEuTGlzdFJvdXRlcnNSZXNwb25zZSIDkAIBQqUBCg5jb20ubWFudHJhZS52MUILUm91dGVyUHJvdG9QAVo9Z2l0aHViLmNvbS9taXp1Y2hpbGFicy9tYW50cmFlL3Byb3RvL2dlbi9tYW50cmFlL3YxO21hbnRyYWV2MaICA01YWKoCCk1hbnRyYWUuVjHKAgpNYW50cmFlXFYx4gIWTWFudHJhZVxWMVxHUEJNZXRhZGF0YeoCC01hbnRyYWU6OlYxYgZwcm90bzM", [file_google_protobuf_timestamp]); /** * @generated from message mantrae.v1.Router @@ -29,20 +29,20 @@ export type Router = Message<"mantrae.v1.Router"> & { profileId: bigint; /** - * @generated from field: string name = 3; + * @generated from field: string agent_id = 3; + */ + agentId: string; + + /** + * @generated from field: string name = 4; */ name: string; /** - * @generated from field: string config = 4; + * @generated from field: string config = 5; */ config: string; - /** - * @generated from field: string source = 5; - */ - source: string; - /** * @generated from field: bool enabled = 6; */ @@ -120,20 +120,20 @@ export type CreateRouterRequest = Message<"mantrae.v1.CreateRouterRequest"> & { profileId: bigint; /** - * @generated from field: string name = 2; + * @generated from field: string agent_id = 2; + */ + agentId: string; + + /** + * @generated from field: string name = 3; */ name: string; /** - * @generated from field: string config = 3; + * @generated from field: string config = 4; */ config: string; - /** - * @generated from field: string source = 4; - */ - source: string; - /** * @generated from field: bool enabled = 5; */ @@ -189,17 +189,12 @@ export type UpdateRouterRequest = Message<"mantrae.v1.UpdateRouterRequest"> & { config: string; /** - * @generated from field: string source = 4; - */ - source: string; - - /** - * @generated from field: bool enabled = 5; + * @generated from field: bool enabled = 4; */ enabled: boolean; /** - * @generated from field: mantrae.v1.RouterType type = 6; + * @generated from field: mantrae.v1.RouterType type = 5; */ type: RouterType; }; diff --git a/web/src/lib/gen/mantrae/v1/service_pb.ts b/web/src/lib/gen/mantrae/v1/service_pb.ts index e17cd50..df0c881 100644 --- a/web/src/lib/gen/mantrae/v1/service_pb.ts +++ b/web/src/lib/gen/mantrae/v1/service_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/service.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; @@ -12,7 +12,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file mantrae/v1/service.proto. */ export const file_mantrae_v1_service: GenFile = /*@__PURE__*/ - fileDesc("ChhtYW50cmFlL3YxL3NlcnZpY2UucHJvdG8SCm1hbnRyYWUudjEi3gEKB1NlcnZpY2USCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIMCgRuYW1lGAMgASgJEg4KBmNvbmZpZxgEIAEoCRIOCgZzb3VyY2UYBSABKAkSJQoEdHlwZRgGIAEoDjIXLm1hbnRyYWUudjEuU2VydmljZVR5cGUSLgoKY3JlYXRlZF9hdBgHIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgIIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiRgoRR2V0U2VydmljZVJlcXVlc3QSCgoCaWQYASABKAMSJQoEdHlwZRgCIAEoDjIXLm1hbnRyYWUudjEuU2VydmljZVR5cGUiOgoSR2V0U2VydmljZVJlc3BvbnNlEiQKB3NlcnZpY2UYASABKAsyEy5tYW50cmFlLnYxLlNlcnZpY2UifwoUQ3JlYXRlU2VydmljZVJlcXVlc3QSEgoKcHJvZmlsZV9pZBgBIAEoAxIMCgRuYW1lGAIgASgJEg4KBmNvbmZpZxgDIAEoCRIOCgZzb3VyY2UYBCABKAkSJQoEdHlwZRgFIAEoDjIXLm1hbnRyYWUudjEuU2VydmljZVR5cGUiPQoVQ3JlYXRlU2VydmljZVJlc3BvbnNlEiQKB3NlcnZpY2UYASABKAsyEy5tYW50cmFlLnYxLlNlcnZpY2UidwoUVXBkYXRlU2VydmljZVJlcXVlc3QSCgoCaWQYASABKAMSDAoEbmFtZRgCIAEoCRIOCgZjb25maWcYAyABKAkSDgoGc291cmNlGAQgASgJEiUKBHR5cGUYBSABKA4yFy5tYW50cmFlLnYxLlNlcnZpY2VUeXBlIj0KFVVwZGF0ZVNlcnZpY2VSZXNwb25zZRIkCgdzZXJ2aWNlGAEgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlIiIKFERlbGV0ZVNlcnZpY2VSZXF1ZXN0EgoKAmlkGAEgASgDIhcKFURlbGV0ZVNlcnZpY2VSZXNwb25zZSJ6ChNMaXN0U2VydmljZXNSZXF1ZXN0EiUKBHR5cGUYASABKA4yFy5tYW50cmFlLnYxLlNlcnZpY2VUeXBlEhIKBWxpbWl0GAIgASgDSACIAQESEwoGb2Zmc2V0GAMgASgDSAGIAQFCCAoGX2xpbWl0QgkKB19vZmZzZXQiUgoUTGlzdFNlcnZpY2VzUmVzcG9uc2USJQoIc2VydmljZXMYASADKAsyEy5tYW50cmFlLnYxLlNlcnZpY2USEwoLdG90YWxfY291bnQYAiABKAMqbgoLU2VydmljZVR5cGUSHAoYU0VSVklDRV9UWVBFX1VOU1BFQ0lGSUVEEAASFQoRU0VSVklDRV9UWVBFX0hUVFAQARIUChBTRVJWSUNFX1RZUEVfVENQEAISFAoQU0VSVklDRV9UWVBFX1VEUBADMrwDCg5TZXJ2aWNlU2VydmljZRJQCgpHZXRTZXJ2aWNlEh0ubWFudHJhZS52MS5HZXRTZXJ2aWNlUmVxdWVzdBoeLm1hbnRyYWUudjEuR2V0U2VydmljZVJlc3BvbnNlIgOQAgESVAoNQ3JlYXRlU2VydmljZRIgLm1hbnRyYWUudjEuQ3JlYXRlU2VydmljZVJlcXVlc3QaIS5tYW50cmFlLnYxLkNyZWF0ZVNlcnZpY2VSZXNwb25zZRJUCg1VcGRhdGVTZXJ2aWNlEiAubWFudHJhZS52MS5VcGRhdGVTZXJ2aWNlUmVxdWVzdBohLm1hbnRyYWUudjEuVXBkYXRlU2VydmljZVJlc3BvbnNlElQKDURlbGV0ZVNlcnZpY2USIC5tYW50cmFlLnYxLkRlbGV0ZVNlcnZpY2VSZXF1ZXN0GiEubWFudHJhZS52MS5EZWxldGVTZXJ2aWNlUmVzcG9uc2USVgoMTGlzdFNlcnZpY2VzEh8ubWFudHJhZS52MS5MaXN0U2VydmljZXNSZXF1ZXN0GiAubWFudHJhZS52MS5MaXN0U2VydmljZXNSZXNwb25zZSIDkAIBQqYBCg5jb20ubWFudHJhZS52MUIMU2VydmljZVByb3RvUAFaPWdpdGh1Yi5jb20vbWl6dWNoaWxhYnMvbWFudHJhZS9wcm90by9nZW4vbWFudHJhZS92MTttYW50cmFldjGiAgNNWFiqAgpNYW50cmFlLlYxygIKTWFudHJhZVxWMeICFk1hbnRyYWVcVjFcR1BCTWV0YWRhdGHqAgtNYW50cmFlOjpWMWIGcHJvdG8z", [file_google_protobuf_timestamp]); + fileDesc("ChhtYW50cmFlL3YxL3NlcnZpY2UucHJvdG8SCm1hbnRyYWUudjEi4AEKB1NlcnZpY2USCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEg4KBmNvbmZpZxgFIAEoCRIlCgR0eXBlGAYgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZRIuCgpjcmVhdGVkX2F0GAcgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAggASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCJGChFHZXRTZXJ2aWNlUmVxdWVzdBIKCgJpZBgBIAEoAxIlCgR0eXBlGAIgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZSI6ChJHZXRTZXJ2aWNlUmVzcG9uc2USJAoHc2VydmljZRgBIAEoCzITLm1hbnRyYWUudjEuU2VydmljZSKBAQoUQ3JlYXRlU2VydmljZVJlcXVlc3QSEgoKcHJvZmlsZV9pZBgBIAEoAxIQCghhZ2VudF9pZBgCIAEoCRIMCgRuYW1lGAMgASgJEg4KBmNvbmZpZxgEIAEoCRIlCgR0eXBlGAUgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZSI9ChVDcmVhdGVTZXJ2aWNlUmVzcG9uc2USJAoHc2VydmljZRgBIAEoCzITLm1hbnRyYWUudjEuU2VydmljZSJnChRVcGRhdGVTZXJ2aWNlUmVxdWVzdBIKCgJpZBgBIAEoAxIMCgRuYW1lGAIgASgJEg4KBmNvbmZpZxgDIAEoCRIlCgR0eXBlGAQgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZSI9ChVVcGRhdGVTZXJ2aWNlUmVzcG9uc2USJAoHc2VydmljZRgBIAEoCzITLm1hbnRyYWUudjEuU2VydmljZSIiChREZWxldGVTZXJ2aWNlUmVxdWVzdBIKCgJpZBgBIAEoAyIXChVEZWxldGVTZXJ2aWNlUmVzcG9uc2UiegoTTGlzdFNlcnZpY2VzUmVxdWVzdBIlCgR0eXBlGAEgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZRISCgVsaW1pdBgCIAEoA0gAiAEBEhMKBm9mZnNldBgDIAEoA0gBiAEBQggKBl9saW1pdEIJCgdfb2Zmc2V0IlIKFExpc3RTZXJ2aWNlc1Jlc3BvbnNlEiUKCHNlcnZpY2VzGAEgAygLMhMubWFudHJhZS52MS5TZXJ2aWNlEhMKC3RvdGFsX2NvdW50GAIgASgDKm4KC1NlcnZpY2VUeXBlEhwKGFNFUlZJQ0VfVFlQRV9VTlNQRUNJRklFRBAAEhUKEVNFUlZJQ0VfVFlQRV9IVFRQEAESFAoQU0VSVklDRV9UWVBFX1RDUBACEhQKEFNFUlZJQ0VfVFlQRV9VRFAQAzK8AwoOU2VydmljZVNlcnZpY2USUAoKR2V0U2VydmljZRIdLm1hbnRyYWUudjEuR2V0U2VydmljZVJlcXVlc3QaHi5tYW50cmFlLnYxLkdldFNlcnZpY2VSZXNwb25zZSIDkAIBElQKDUNyZWF0ZVNlcnZpY2USIC5tYW50cmFlLnYxLkNyZWF0ZVNlcnZpY2VSZXF1ZXN0GiEubWFudHJhZS52MS5DcmVhdGVTZXJ2aWNlUmVzcG9uc2USVAoNVXBkYXRlU2VydmljZRIgLm1hbnRyYWUudjEuVXBkYXRlU2VydmljZVJlcXVlc3QaIS5tYW50cmFlLnYxLlVwZGF0ZVNlcnZpY2VSZXNwb25zZRJUCg1EZWxldGVTZXJ2aWNlEiAubWFudHJhZS52MS5EZWxldGVTZXJ2aWNlUmVxdWVzdBohLm1hbnRyYWUudjEuRGVsZXRlU2VydmljZVJlc3BvbnNlElYKDExpc3RTZXJ2aWNlcxIfLm1hbnRyYWUudjEuTGlzdFNlcnZpY2VzUmVxdWVzdBogLm1hbnRyYWUudjEuTGlzdFNlcnZpY2VzUmVzcG9uc2UiA5ACAUKmAQoOY29tLm1hbnRyYWUudjFCDFNlcnZpY2VQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_google_protobuf_timestamp]); /** * @generated from message mantrae.v1.Service @@ -29,20 +29,20 @@ export type Service = Message<"mantrae.v1.Service"> & { profileId: bigint; /** - * @generated from field: string name = 3; + * @generated from field: string agent_id = 3; + */ + agentId: string; + + /** + * @generated from field: string name = 4; */ name: string; /** - * @generated from field: string config = 4; + * @generated from field: string config = 5; */ config: string; - /** - * @generated from field: string source = 5; - */ - source: string; - /** * @generated from field: mantrae.v1.ServiceType type = 6; */ @@ -115,20 +115,20 @@ export type CreateServiceRequest = Message<"mantrae.v1.CreateServiceRequest"> & profileId: bigint; /** - * @generated from field: string name = 2; + * @generated from field: string agent_id = 2; + */ + agentId: string; + + /** + * @generated from field: string name = 3; */ name: string; /** - * @generated from field: string config = 3; + * @generated from field: string config = 4; */ config: string; - /** - * @generated from field: string source = 4; - */ - source: string; - /** * @generated from field: mantrae.v1.ServiceType type = 5; */ @@ -179,12 +179,7 @@ export type UpdateServiceRequest = Message<"mantrae.v1.UpdateServiceRequest"> & config: string; /** - * @generated from field: string source = 4; - */ - source: string; - - /** - * @generated from field: mantrae.v1.ServiceType type = 5; + * @generated from field: mantrae.v1.ServiceType type = 4; */ type: ServiceType; }; diff --git a/web/src/lib/gen/mantrae/v1/setting_pb.ts b/web/src/lib/gen/mantrae/v1/setting_pb.ts index 0c226d6..f23e9ca 100644 --- a/web/src/lib/gen/mantrae/v1/setting_pb.ts +++ b/web/src/lib/gen/mantrae/v1/setting_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/setting.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf"; diff --git a/web/src/lib/gen/mantrae/v1/user_pb.ts b/web/src/lib/gen/mantrae/v1/user_pb.ts index 978eccd..6f455b2 100644 --- a/web/src/lib/gen/mantrae/v1/user_pb.ts +++ b/web/src/lib/gen/mantrae/v1/user_pb.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-es v2.5.2 with parameter "target=ts" +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" // @generated from file mantrae/v1/user.proto (package mantrae.v1, syntax proto3) /* eslint-disable */ -import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; -import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; import type { Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Message } from "@bufbuild/protobuf";