mirror of
https://github.com/MizuchiLabs/mantrae.git
synced 2025-12-16 20:05:17 -06:00
cleanup protocols
This commit is contained in:
@@ -104,7 +104,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertRouters(
|
||||
ctx,
|
||||
routerClient,
|
||||
mantraev1.RouterType_ROUTER_TYPE_HTTP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
ToAnyMap(dyn.HTTP.Routers),
|
||||
syncedRouters,
|
||||
); err != nil {
|
||||
@@ -113,7 +113,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertRouters(
|
||||
ctx,
|
||||
routerClient,
|
||||
mantraev1.RouterType_ROUTER_TYPE_TCP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
ToAnyMap(dyn.TCP.Routers),
|
||||
syncedRouters,
|
||||
); err != nil {
|
||||
@@ -122,7 +122,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertRouters(
|
||||
ctx,
|
||||
routerClient,
|
||||
mantraev1.RouterType_ROUTER_TYPE_UDP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_UDP,
|
||||
ToAnyMap(dyn.UDP.Routers),
|
||||
syncedRouters,
|
||||
); err != nil {
|
||||
@@ -133,7 +133,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertServices(
|
||||
ctx,
|
||||
serviceClient,
|
||||
mantraev1.ServiceType_SERVICE_TYPE_HTTP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
ToAnyMap(dyn.HTTP.Services),
|
||||
syncedServices,
|
||||
); err != nil {
|
||||
@@ -142,7 +142,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertServices(
|
||||
ctx,
|
||||
serviceClient,
|
||||
mantraev1.ServiceType_SERVICE_TYPE_TCP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
ToAnyMap(dyn.TCP.Services),
|
||||
syncedServices,
|
||||
); err != nil {
|
||||
@@ -151,7 +151,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertServices(
|
||||
ctx,
|
||||
serviceClient,
|
||||
mantraev1.ServiceType_SERVICE_TYPE_UDP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_UDP,
|
||||
ToAnyMap(dyn.UDP.Services),
|
||||
syncedServices,
|
||||
); err != nil {
|
||||
@@ -162,7 +162,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertMiddlewares(
|
||||
ctx,
|
||||
middlewareClient,
|
||||
mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
ToAnyMap(dyn.HTTP.Middlewares),
|
||||
syncedMiddlewares,
|
||||
); err != nil {
|
||||
@@ -171,7 +171,7 @@ func (t *TokenSource) Update(ctx context.Context) error {
|
||||
if err := t.upsertMiddlewares(
|
||||
ctx,
|
||||
middlewareClient,
|
||||
mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP,
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
ToAnyMap(dyn.TCP.Middlewares),
|
||||
syncedMiddlewares,
|
||||
); err != nil {
|
||||
@@ -206,7 +206,7 @@ func injectServiceAddresses(d *dynamic.Configuration, ip string, port uint16) {
|
||||
func (t *TokenSource) upsertRouters(
|
||||
ctx context.Context,
|
||||
client mantraev1connect.RouterServiceClient,
|
||||
typ mantraev1.RouterType,
|
||||
typ mantraev1.ProtocolType,
|
||||
routers map[string]any,
|
||||
synced map[string]struct{},
|
||||
) error {
|
||||
@@ -270,7 +270,7 @@ func (t *TokenSource) upsertRouters(
|
||||
func (t *TokenSource) upsertServices(
|
||||
ctx context.Context,
|
||||
client mantraev1connect.ServiceServiceClient,
|
||||
typ mantraev1.ServiceType,
|
||||
typ mantraev1.ProtocolType,
|
||||
services map[string]any,
|
||||
synced map[string]struct{},
|
||||
) error {
|
||||
@@ -332,7 +332,7 @@ func (t *TokenSource) upsertServices(
|
||||
func (t *TokenSource) upsertMiddlewares(
|
||||
ctx context.Context,
|
||||
client mantraev1connect.MiddlewareServiceClient,
|
||||
typ mantraev1.MiddlewareType,
|
||||
typ mantraev1.ProtocolType,
|
||||
middlewares map[string]any,
|
||||
synced map[string]struct{},
|
||||
) error {
|
||||
|
||||
@@ -25,6 +25,6 @@ plugins:
|
||||
- allow-get
|
||||
- with-streaming
|
||||
- path=openapi.yaml
|
||||
- base=proto/gen/openapi/base.yaml
|
||||
- base=proto/base.yaml
|
||||
inputs:
|
||||
- directory: proto
|
||||
|
||||
@@ -158,6 +158,7 @@ func (s *Server) registerServices() {
|
||||
mantraev1connect.ServersTransportServiceName,
|
||||
mantraev1connect.BackupServiceName,
|
||||
mantraev1connect.UtilServiceName,
|
||||
mantraev1connect.TraefikInstanceServiceName,
|
||||
mantraev1connect.AuditLogServiceName,
|
||||
}
|
||||
|
||||
@@ -251,6 +252,10 @@ func (s *Server) registerServices() {
|
||||
service.NewUtilService(s.app),
|
||||
opts...,
|
||||
))
|
||||
s.mux.Handle(mantraev1connect.NewTraefikInstanceServiceHandler(
|
||||
service.NewTraefikInstanceService(s.app),
|
||||
opts...,
|
||||
))
|
||||
s.mux.Handle(mantraev1connect.NewAuditLogServiceHandler(
|
||||
service.NewAuditLogService(s.app),
|
||||
opts...,
|
||||
|
||||
@@ -17,15 +17,15 @@ import (
|
||||
|
||||
type MiddlewareService struct {
|
||||
app *config.App
|
||||
dispatch map[mantraev1.MiddlewareType]MiddlewareOps
|
||||
dispatch map[mantraev1.ProtocolType]MiddlewareOps
|
||||
}
|
||||
|
||||
func NewMiddlewareService(app *config.App) *MiddlewareService {
|
||||
return &MiddlewareService{
|
||||
app: app,
|
||||
dispatch: map[mantraev1.MiddlewareType]MiddlewareOps{
|
||||
mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP: NewHTTPMiddlewareOps(app),
|
||||
mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP: NewTCPMiddlewareOps(app),
|
||||
dispatch: map[mantraev1.ProtocolType]MiddlewareOps{
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP: NewHTTPMiddlewareOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP: NewTCPMiddlewareOps(app),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -126,14 +126,14 @@ func (s *MiddlewareService) ListMiddlewares(
|
||||
return connect.NewResponse(result), nil
|
||||
} else {
|
||||
// Get HTTP middlewares
|
||||
httpOps := s.dispatch[mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP]
|
||||
httpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP]
|
||||
httpResult, err := httpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
// Get TCP middlewares
|
||||
tcpOps := s.dispatch[mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP]
|
||||
tcpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_TCP]
|
||||
tcpResult, err := tcpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
|
||||
@@ -12,16 +12,16 @@ import (
|
||||
|
||||
type RouterService struct {
|
||||
app *config.App
|
||||
dispatch map[mantraev1.RouterType]RouterOps
|
||||
dispatch map[mantraev1.ProtocolType]RouterOps
|
||||
}
|
||||
|
||||
func NewRouterService(app *config.App) *RouterService {
|
||||
return &RouterService{
|
||||
app: app,
|
||||
dispatch: map[mantraev1.RouterType]RouterOps{
|
||||
mantraev1.RouterType_ROUTER_TYPE_HTTP: NewHTTPRouterOps(app),
|
||||
mantraev1.RouterType_ROUTER_TYPE_TCP: NewTCPRouterOps(app),
|
||||
mantraev1.RouterType_ROUTER_TYPE_UDP: NewUDPRouterOps(app),
|
||||
dispatch: map[mantraev1.ProtocolType]RouterOps{
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP: NewHTTPRouterOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP: NewTCPRouterOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_UDP: NewUDPRouterOps(app),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -122,21 +122,21 @@ func (s *RouterService) ListRouters(
|
||||
return connect.NewResponse(result), nil
|
||||
} else {
|
||||
// Get HTTP routers
|
||||
httpOps := s.dispatch[mantraev1.RouterType_ROUTER_TYPE_HTTP]
|
||||
httpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP]
|
||||
httpResult, err := httpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
// Get TCP routers
|
||||
tcpOps := s.dispatch[mantraev1.RouterType_ROUTER_TYPE_TCP]
|
||||
tcpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_TCP]
|
||||
tcpResult, err := tcpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
// Get UDP routers
|
||||
udpOps := s.dispatch[mantraev1.RouterType_ROUTER_TYPE_UDP]
|
||||
udpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_UDP]
|
||||
udpResult, err := udpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
|
||||
@@ -197,7 +197,11 @@ func (s *HTTPRouterOps) Delete(
|
||||
return nil, err
|
||||
}
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().GetHttpServiceByName(ctx, router.Config.Service)
|
||||
service, err := s.app.Conn.GetQuery().
|
||||
GetHttpServiceByName(ctx, db.GetHttpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("failed to get http service", "err", err)
|
||||
}
|
||||
@@ -362,7 +366,10 @@ func (s *TCPRouterOps) Delete(
|
||||
return nil, err
|
||||
}
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().GetTcpServiceByName(ctx, router.Config.Service)
|
||||
service, err := s.app.Conn.GetQuery().GetTcpServiceByName(ctx, db.GetTcpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("failed to get tcp service", "err", err)
|
||||
}
|
||||
@@ -485,7 +492,10 @@ func (s *UDPRouterOps) Delete(
|
||||
return nil, err
|
||||
}
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().GetUdpServiceByName(ctx, router.Config.Service)
|
||||
service, err := s.app.Conn.GetQuery().GetUdpServiceByName(ctx, db.GetUdpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("failed to get udp service", "err", err)
|
||||
}
|
||||
|
||||
@@ -11,19 +11,15 @@ import (
|
||||
|
||||
type ServersTransportService struct {
|
||||
app *config.App
|
||||
dispatch map[mantraev1.ServersTransportType]ServersTransportOps
|
||||
dispatch map[mantraev1.ProtocolType]ServersTransportOps
|
||||
}
|
||||
|
||||
func NewServersTransportService(app *config.App) *ServersTransportService {
|
||||
return &ServersTransportService{
|
||||
app: app,
|
||||
dispatch: map[mantraev1.ServersTransportType]ServersTransportOps{
|
||||
mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_HTTP: NewHTTPServersTransportOps(
|
||||
app,
|
||||
),
|
||||
mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_TCP: NewTCPServersTransportOps(
|
||||
app,
|
||||
),
|
||||
dispatch: map[mantraev1.ProtocolType]ServersTransportOps{
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP: NewHTTPServersTransportOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP: NewTCPServersTransportOps(app),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -124,14 +120,14 @@ func (s *ServersTransportService) ListServersTransports(
|
||||
return connect.NewResponse(result), nil
|
||||
} else {
|
||||
// Get HTTP servers transports
|
||||
httpOps := s.dispatch[mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_HTTP]
|
||||
httpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP]
|
||||
httpResult, err := httpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get TCP servers transports
|
||||
tcpOps := s.dispatch[mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_TCP]
|
||||
tcpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_TCP]
|
||||
tcpResult, err := tcpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -13,16 +13,16 @@ import (
|
||||
|
||||
type Service struct {
|
||||
app *config.App
|
||||
dispatch map[mantraev1.ServiceType]ServiceOps
|
||||
dispatch map[mantraev1.ProtocolType]ServiceOps
|
||||
}
|
||||
|
||||
func NewServiceService(app *config.App) *Service {
|
||||
return &Service{
|
||||
app: app,
|
||||
dispatch: map[mantraev1.ServiceType]ServiceOps{
|
||||
mantraev1.ServiceType_SERVICE_TYPE_HTTP: NewHTTPServiceOps(app),
|
||||
mantraev1.ServiceType_SERVICE_TYPE_TCP: NewTCPServiceOps(app),
|
||||
mantraev1.ServiceType_SERVICE_TYPE_UDP: NewUDPServiceOps(app),
|
||||
dispatch: map[mantraev1.ProtocolType]ServiceOps{
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP: NewHTTPServiceOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_TCP: NewTCPServiceOps(app),
|
||||
mantraev1.ProtocolType_PROTOCOL_TYPE_UDP: NewUDPServiceOps(app),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -123,21 +123,21 @@ func (s *Service) ListServices(
|
||||
return connect.NewResponse(result), nil
|
||||
} else {
|
||||
// Get HTTP services
|
||||
httpOps := s.dispatch[mantraev1.ServiceType_SERVICE_TYPE_HTTP]
|
||||
httpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP]
|
||||
httpResult, err := httpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
// Get TCP services
|
||||
tcpOps := s.dispatch[mantraev1.ServiceType_SERVICE_TYPE_TCP]
|
||||
tcpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_TCP]
|
||||
tcpResult, err := tcpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
// Get UDP services
|
||||
udpOps := s.dispatch[mantraev1.ServiceType_SERVICE_TYPE_UDP]
|
||||
udpOps := s.dispatch[mantraev1.ProtocolType_PROTOCOL_TYPE_UDP]
|
||||
udpResult, err := udpOps.List(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
@@ -154,22 +154,3 @@ func (s *Service) ListServices(
|
||||
}), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Service) GetServiceByRouter(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.GetServiceByRouterRequest],
|
||||
) (*connect.Response[mantraev1.GetServiceByRouterResponse], error) {
|
||||
ops, ok := s.dispatch[req.Msg.Type]
|
||||
if !ok {
|
||||
return nil, connect.NewError(
|
||||
connect.CodeInvalidArgument,
|
||||
errors.New("invalid service type"),
|
||||
)
|
||||
}
|
||||
|
||||
result, err := ops.GetByRouter(ctx, req.Msg)
|
||||
if err != nil {
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
return connect.NewResponse(result), nil
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/mizuchilabs/mantrae/internal/config"
|
||||
"github.com/mizuchilabs/mantrae/internal/store/db"
|
||||
@@ -14,10 +15,6 @@ type ServiceOps interface {
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error)
|
||||
GetByRouter(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceByRouterRequest,
|
||||
) (*mantraev1.GetServiceByRouterResponse, error)
|
||||
Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServiceRequest,
|
||||
@@ -66,24 +63,33 @@ func (s *HTTPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetHttpService(ctx, req.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
var result db.HttpService
|
||||
var err error
|
||||
|
||||
func (s *HTTPServiceOps) GetByRouter(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceByRouterRequest,
|
||||
) (*mantraev1.GetServiceByRouterResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetHttpServiceByName(ctx, req.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
case *mantraev1.GetServiceRequest_Id:
|
||||
result, err = s.app.Conn.GetQuery().GetHttpServiceByID(ctx, db.GetHttpServiceByIDParams{
|
||||
ProfileID: req.ProfileId,
|
||||
ID: id.Id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetHttpServiceByName(ctx, db.GetHttpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
default:
|
||||
return nil, errors.New("invalid service identifier")
|
||||
}
|
||||
return &mantraev1.GetServiceByRouterResponse{
|
||||
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
@@ -186,24 +192,33 @@ func (s *TCPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetTcpService(ctx, req.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
var result db.TcpService
|
||||
var err error
|
||||
|
||||
func (s *TCPServiceOps) GetByRouter(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceByRouterRequest,
|
||||
) (*mantraev1.GetServiceByRouterResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetTcpServiceByName(ctx, req.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
case *mantraev1.GetServiceRequest_Id:
|
||||
result, err = s.app.Conn.GetQuery().GetTcpServiceByID(ctx, db.GetTcpServiceByIDParams{
|
||||
ProfileID: req.ProfileId,
|
||||
ID: id.Id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetTcpServiceByName(ctx, db.GetTcpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
default:
|
||||
return nil, errors.New("invalid service identifier")
|
||||
}
|
||||
return &mantraev1.GetServiceByRouterResponse{
|
||||
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
@@ -306,24 +321,33 @@ func (s *UDPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetUdpService(ctx, req.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
var result db.UdpService
|
||||
var err error
|
||||
|
||||
func (s *UDPServiceOps) GetByRouter(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceByRouterRequest,
|
||||
) (*mantraev1.GetServiceByRouterResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().GetUdpServiceByName(ctx, req.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
case *mantraev1.GetServiceRequest_Id:
|
||||
result, err = s.app.Conn.GetQuery().GetUdpServiceByID(ctx, db.GetUdpServiceByIDParams{
|
||||
ProfileID: req.ProfileId,
|
||||
ID: id.Id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetUdpServiceByName(ctx, db.GetUdpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
break
|
||||
default:
|
||||
return nil, errors.New("invalid service identifier")
|
||||
}
|
||||
return &mantraev1.GetServiceByRouterResponse{
|
||||
|
||||
return &mantraev1.GetServiceResponse{
|
||||
Service: result.ToProto(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
70
internal/api/service/traefik_instance.go
Normal file
70
internal/api/service/traefik_instance.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"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 TraefikInstanceService struct {
|
||||
app *config.App
|
||||
}
|
||||
|
||||
func NewTraefikInstanceService(app *config.App) *TraefikInstanceService {
|
||||
return &TraefikInstanceService{app: app}
|
||||
}
|
||||
|
||||
func (s *TraefikInstanceService) GetTraefikInstance(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.GetTraefikInstanceRequest],
|
||||
) (*connect.Response[mantraev1.GetTraefikInstanceResponse], error) {
|
||||
result, err := s.app.Conn.GetQuery().GetTraefikInstanceByID(ctx, req.Msg.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return connect.NewResponse(&mantraev1.GetTraefikInstanceResponse{
|
||||
TraefikInstance: result.ToProto(),
|
||||
}), nil
|
||||
}
|
||||
|
||||
func (s *TraefikInstanceService) DeleteTraefikInstance(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.DeleteTraefikInstanceRequest],
|
||||
) (*connect.Response[mantraev1.DeleteTraefikInstanceResponse], error) {
|
||||
if err := s.app.Conn.GetQuery().DeleteTraefikInstance(ctx, req.Msg.Id); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return connect.NewResponse(&mantraev1.DeleteTraefikInstanceResponse{}), nil
|
||||
}
|
||||
|
||||
func (s *TraefikInstanceService) ListTraefikInstances(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListTraefikInstancesRequest],
|
||||
) (*connect.Response[mantraev1.ListTraefikInstancesResponse], error) {
|
||||
params := db.ListTraefikInstancesParams{
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
}
|
||||
|
||||
result, err := s.app.Conn.GetQuery().ListTraefikInstances(ctx, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTraefikInstances(ctx, req.Msg.ProfileId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
instances := make([]*mantraev1.TraefikInstance, 0, len(result))
|
||||
for _, i := range result {
|
||||
instances = append(instances, i.ToProto())
|
||||
}
|
||||
return connect.NewResponse(&mantraev1.ListTraefikInstancesResponse{
|
||||
TraefikInstances: instances,
|
||||
TotalCount: totalCount,
|
||||
}), nil
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/hypersequent/zen"
|
||||
@@ -16,23 +17,7 @@ import (
|
||||
// StructToZodSchema converts a struct to a zod schema (for use in the frontend)
|
||||
func StructToZodSchema() {
|
||||
types := map[string]any{
|
||||
// Routers
|
||||
"httpRouter": dynamic.Router{},
|
||||
"tcpRouter": dynamic.TCPRouter{},
|
||||
"udpRouter": dynamic.UDPRouter{},
|
||||
|
||||
// Services
|
||||
"httpService": dynamic.Service{},
|
||||
"tcpService": dynamic.TCPService{},
|
||||
"udpService": dynamic.UDPService{},
|
||||
|
||||
// Middlewares
|
||||
"httpMiddleware": dynamic.Middleware{},
|
||||
"tcpMiddleware": dynamic.TCPMiddleware{},
|
||||
|
||||
// Servers Transports
|
||||
"httpServersTransport": dynamic.ServersTransport{},
|
||||
"tcpServersTransport": dynamic.TCPServersTransport{},
|
||||
"config": dynamic.Configuration{},
|
||||
}
|
||||
|
||||
var builder strings.Builder
|
||||
@@ -42,8 +27,14 @@ func StructToZodSchema() {
|
||||
builder.WriteString("// Do not edit manually.\n\n")
|
||||
builder.WriteString("import { z } from 'zod';\n\n")
|
||||
|
||||
withDesc := map[string]zen.CustomFn{
|
||||
"zodDesc": func(c *zen.Converter, t reflect.Type, desc string, indent int) string {
|
||||
return fmt.Sprintf(".describe(%q)", desc)
|
||||
},
|
||||
}
|
||||
|
||||
for _, strct := range types {
|
||||
schema := zen.StructToZodSchema(strct)
|
||||
schema := zen.StructToZodSchema(strct, zen.WithCustomTags(withDesc))
|
||||
builder.WriteString(fmt.Sprintf("%s\n", schema))
|
||||
}
|
||||
|
||||
@@ -57,4 +48,5 @@ func StructToZodSchema() {
|
||||
}
|
||||
|
||||
fmt.Printf("Zod schemas written to %s\n", out)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"time"
|
||||
|
||||
"github.com/mizuchilabs/mantrae/internal/store/schema"
|
||||
@@ -38,183 +39,142 @@ func (e *EntryPoint) ToProto() *mantraev1.EntryPoint {
|
||||
}
|
||||
|
||||
func (r *HttpRouter) ToProto() *mantraev1.Router {
|
||||
config, err := MarshalStruct(r.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &mantraev1.Router{
|
||||
Id: r.ID,
|
||||
ProfileId: r.ProfileID,
|
||||
AgentId: SafeString(r.AgentID),
|
||||
Name: r.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(r.Config),
|
||||
Enabled: r.Enabled,
|
||||
Type: mantraev1.RouterType_ROUTER_TYPE_HTTP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
CreatedAt: SafeTimestamp(r.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(r.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *TcpRouter) ToProto() *mantraev1.Router {
|
||||
config, err := MarshalStruct(r.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Router{
|
||||
Id: r.ID,
|
||||
ProfileId: r.ProfileID,
|
||||
AgentId: SafeString(r.AgentID),
|
||||
Name: r.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(r.Config),
|
||||
Enabled: r.Enabled,
|
||||
Type: mantraev1.RouterType_ROUTER_TYPE_TCP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
CreatedAt: SafeTimestamp(r.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(r.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *UdpRouter) ToProto() *mantraev1.Router {
|
||||
config, err := MarshalStruct(r.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Router{
|
||||
Id: r.ID,
|
||||
ProfileId: r.ProfileID,
|
||||
AgentId: SafeString(r.AgentID),
|
||||
Name: r.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(r.Config),
|
||||
Enabled: r.Enabled,
|
||||
Type: mantraev1.RouterType_ROUTER_TYPE_UDP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_UDP,
|
||||
CreatedAt: SafeTimestamp(r.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(r.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *HttpService) ToProto() *mantraev1.Service {
|
||||
config, err := MarshalStruct(s.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Service{
|
||||
Id: s.ID,
|
||||
ProfileId: s.ProfileID,
|
||||
AgentId: SafeString(s.AgentID),
|
||||
Name: s.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(s.Config),
|
||||
Enabled: s.Enabled,
|
||||
Type: mantraev1.ServiceType_SERVICE_TYPE_HTTP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
CreatedAt: SafeTimestamp(s.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(s.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *TcpService) ToProto() *mantraev1.Service {
|
||||
config, err := MarshalStruct(s.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Service{
|
||||
Id: s.ID,
|
||||
ProfileId: s.ProfileID,
|
||||
AgentId: SafeString(s.AgentID),
|
||||
Name: s.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(s.Config),
|
||||
Enabled: s.Enabled,
|
||||
Type: mantraev1.ServiceType_SERVICE_TYPE_TCP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
CreatedAt: SafeTimestamp(s.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(s.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *UdpService) ToProto() *mantraev1.Service {
|
||||
config, err := MarshalStruct(s.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Service{
|
||||
Id: s.ID,
|
||||
ProfileId: s.ProfileID,
|
||||
AgentId: SafeString(s.AgentID),
|
||||
Name: s.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(s.Config),
|
||||
Enabled: s.Enabled,
|
||||
Type: mantraev1.ServiceType_SERVICE_TYPE_UDP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_UDP,
|
||||
CreatedAt: SafeTimestamp(s.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(s.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *HttpMiddleware) ToProto() *mantraev1.Middleware {
|
||||
config, err := MarshalStruct(m.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Middleware{
|
||||
Id: m.ID,
|
||||
ProfileId: m.ProfileID,
|
||||
AgentId: SafeString(m.AgentID),
|
||||
Name: m.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(m.Config),
|
||||
Enabled: m.Enabled,
|
||||
IsDefault: m.IsDefault,
|
||||
Type: mantraev1.MiddlewareType_MIDDLEWARE_TYPE_HTTP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
CreatedAt: SafeTimestamp(m.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(m.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *TcpMiddleware) ToProto() *mantraev1.Middleware {
|
||||
config, err := MarshalStruct(m.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.Middleware{
|
||||
Id: m.ID,
|
||||
ProfileId: m.ProfileID,
|
||||
AgentId: SafeString(m.AgentID),
|
||||
Name: m.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(m.Config),
|
||||
Enabled: m.Enabled,
|
||||
IsDefault: m.IsDefault,
|
||||
Type: mantraev1.MiddlewareType_MIDDLEWARE_TYPE_TCP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
CreatedAt: SafeTimestamp(m.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(m.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *HttpServersTransport) ToProto() *mantraev1.ServersTransport {
|
||||
config, err := MarshalStruct(m.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.ServersTransport{
|
||||
Id: m.ID,
|
||||
ProfileId: m.ProfileID,
|
||||
AgentId: SafeString(m.AgentID),
|
||||
Name: m.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(m.Config),
|
||||
Enabled: m.Enabled,
|
||||
Type: mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_HTTP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP,
|
||||
CreatedAt: SafeTimestamp(m.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(m.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *TcpServersTransport) ToProto() *mantraev1.ServersTransport {
|
||||
config, err := MarshalStruct(m.Config)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return &mantraev1.ServersTransport{
|
||||
Id: m.ID,
|
||||
ProfileId: m.ProfileID,
|
||||
AgentId: SafeString(m.AgentID),
|
||||
Name: m.Name,
|
||||
Config: config,
|
||||
Config: MustMarshalStruct(m.Config),
|
||||
Enabled: m.Enabled,
|
||||
Type: mantraev1.ServersTransportType_SERVERS_TRANSPORT_TYPE_TCP,
|
||||
Type: mantraev1.ProtocolType_PROTOCOL_TYPE_TCP,
|
||||
CreatedAt: SafeTimestamp(m.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(m.UpdatedAt),
|
||||
}
|
||||
@@ -295,6 +255,21 @@ func (d *DnsProvider) ToProto() *mantraev1.DnsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TraefikInstance) ToProto() *mantraev1.TraefikInstance {
|
||||
return &mantraev1.TraefikInstance{
|
||||
Id: t.ID,
|
||||
Name: t.Name,
|
||||
Url: t.Url,
|
||||
Tls: t.Tls,
|
||||
EntryPoints: MustMarshalStruct(t.Entrypoints),
|
||||
Overview: MustMarshalStruct(t.Overview),
|
||||
Config: MustMarshalStruct(t.Config),
|
||||
Version: MustMarshalStruct(t.Version),
|
||||
CreatedAt: SafeTimestamp(t.CreatedAt),
|
||||
UpdatedAt: SafeTimestamp(t.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func (a *ListAuditLogsRow) ToProto() *mantraev1.AuditLog {
|
||||
return &mantraev1.AuditLog{
|
||||
Id: a.ID,
|
||||
@@ -313,7 +288,7 @@ func (a *ListAuditLogsRow) ToProto() *mantraev1.AuditLog {
|
||||
// Proto to SQL ---------------------------------------------------------------
|
||||
|
||||
func (r *HttpRouter) FromProto(proto *mantraev1.Router) error {
|
||||
if proto.Type != mantraev1.RouterType_ROUTER_TYPE_HTTP {
|
||||
if proto.Type != mantraev1.ProtocolType_PROTOCOL_TYPE_HTTP {
|
||||
return errors.New("invalid router type for HTTP router")
|
||||
}
|
||||
|
||||
@@ -421,3 +396,33 @@ func MarshalStruct[T any](s *T) (*structpb.Struct, error) {
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func MustMarshalStruct[T any](s *T) *structpb.Struct {
|
||||
data, err := json.Marshal(s)
|
||||
if err != nil {
|
||||
slog.Error("failed to marshal struct", "error", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
var out structpb.Struct
|
||||
if err := out.UnmarshalJSON(data); err != nil {
|
||||
slog.Error("failed to unmarshal struct", "error", err)
|
||||
return nil
|
||||
}
|
||||
return &out
|
||||
}
|
||||
|
||||
func MustUnmarshalStruct[T any](s *structpb.Struct) *T {
|
||||
data, err := s.MarshalJSON()
|
||||
if err != nil {
|
||||
slog.Error("failed to marshal struct", "error", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
var out T
|
||||
if err := json.Unmarshal(data, &out); err != nil {
|
||||
slog.Error("failed to unmarshal struct", "error", err)
|
||||
return nil
|
||||
}
|
||||
return &out
|
||||
}
|
||||
|
||||
@@ -51,24 +51,12 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.countProfilesStmt, err = db.PrepareContext(ctx, countProfiles); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountProfiles: %w", err)
|
||||
}
|
||||
if q.countRoutersByAgentStmt, err = db.PrepareContext(ctx, countRoutersByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountRoutersByAgent: %w", err)
|
||||
}
|
||||
if q.countRoutersByProfileStmt, err = db.PrepareContext(ctx, countRoutersByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountRoutersByProfile: %w", err)
|
||||
}
|
||||
if q.countServersTransportsByAgentStmt, err = db.PrepareContext(ctx, countServersTransportsByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountServersTransportsByAgent: %w", err)
|
||||
}
|
||||
if q.countServersTransportsByProfileStmt, err = db.PrepareContext(ctx, countServersTransportsByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountServersTransportsByProfile: %w", err)
|
||||
}
|
||||
if q.countServicesByAgentStmt, err = db.PrepareContext(ctx, countServicesByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountServicesByAgent: %w", err)
|
||||
}
|
||||
if q.countServicesByProfileStmt, err = db.PrepareContext(ctx, countServicesByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountServicesByProfile: %w", err)
|
||||
}
|
||||
if q.countTcpMiddlewaresStmt, err = db.PrepareContext(ctx, countTcpMiddlewares); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query CountTcpMiddlewares: %w", err)
|
||||
}
|
||||
@@ -204,8 +192,8 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.deleteTcpServiceStmt, err = db.PrepareContext(ctx, deleteTcpService); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query DeleteTcpService: %w", err)
|
||||
}
|
||||
if q.deleteTraefikInstanceByIDStmt, err = db.PrepareContext(ctx, deleteTraefikInstanceByID); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query DeleteTraefikInstanceByID: %w", err)
|
||||
if q.deleteTraefikInstanceStmt, err = db.PrepareContext(ctx, deleteTraefikInstance); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query DeleteTraefikInstance: %w", err)
|
||||
}
|
||||
if q.deleteUdpRouterStmt, err = db.PrepareContext(ctx, deleteUdpRouter); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query DeleteUdpRouter: %w", err)
|
||||
@@ -261,8 +249,8 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.getHttpServersTransportStmt, err = db.PrepareContext(ctx, getHttpServersTransport); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetHttpServersTransport: %w", err)
|
||||
}
|
||||
if q.getHttpServiceStmt, err = db.PrepareContext(ctx, getHttpService); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetHttpService: %w", err)
|
||||
if q.getHttpServiceByIDStmt, err = db.PrepareContext(ctx, getHttpServiceByID); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetHttpServiceByID: %w", err)
|
||||
}
|
||||
if q.getHttpServiceByNameStmt, err = db.PrepareContext(ctx, getHttpServiceByName); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetHttpServiceByName: %w", err)
|
||||
@@ -294,8 +282,8 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.getTcpServersTransportStmt, err = db.PrepareContext(ctx, getTcpServersTransport); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetTcpServersTransport: %w", err)
|
||||
}
|
||||
if q.getTcpServiceStmt, err = db.PrepareContext(ctx, getTcpService); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetTcpService: %w", err)
|
||||
if q.getTcpServiceByIDStmt, err = db.PrepareContext(ctx, getTcpServiceByID); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetTcpServiceByID: %w", err)
|
||||
}
|
||||
if q.getTcpServiceByNameStmt, err = db.PrepareContext(ctx, getTcpServiceByName); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetTcpServiceByName: %w", err)
|
||||
@@ -312,8 +300,8 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.getUdpRoutersUsingEntryPointStmt, err = db.PrepareContext(ctx, getUdpRoutersUsingEntryPoint); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetUdpRoutersUsingEntryPoint: %w", err)
|
||||
}
|
||||
if q.getUdpServiceStmt, err = db.PrepareContext(ctx, getUdpService); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetUdpService: %w", err)
|
||||
if q.getUdpServiceByIDStmt, err = db.PrepareContext(ctx, getUdpServiceByID); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetUdpServiceByID: %w", err)
|
||||
}
|
||||
if q.getUdpServiceByNameStmt, err = db.PrepareContext(ctx, getUdpServiceByName); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query GetUdpServiceByName: %w", err)
|
||||
@@ -369,24 +357,12 @@ func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
|
||||
if q.listProfilesStmt, err = db.PrepareContext(ctx, listProfiles); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListProfiles: %w", err)
|
||||
}
|
||||
if q.listRoutersByAgentStmt, err = db.PrepareContext(ctx, listRoutersByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListRoutersByAgent: %w", err)
|
||||
}
|
||||
if q.listRoutersByProfileStmt, err = db.PrepareContext(ctx, listRoutersByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListRoutersByProfile: %w", err)
|
||||
}
|
||||
if q.listServersTransportsByAgentStmt, err = db.PrepareContext(ctx, listServersTransportsByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListServersTransportsByAgent: %w", err)
|
||||
}
|
||||
if q.listServersTransportsByProfileStmt, err = db.PrepareContext(ctx, listServersTransportsByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListServersTransportsByProfile: %w", err)
|
||||
}
|
||||
if q.listServicesByAgentStmt, err = db.PrepareContext(ctx, listServicesByAgent); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListServicesByAgent: %w", err)
|
||||
}
|
||||
if q.listServicesByProfileStmt, err = db.PrepareContext(ctx, listServicesByProfile); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListServicesByProfile: %w", err)
|
||||
}
|
||||
if q.listSettingsStmt, err = db.PrepareContext(ctx, listSettings); err != nil {
|
||||
return nil, fmt.Errorf("error preparing query ListSettings: %w", err)
|
||||
}
|
||||
@@ -566,16 +542,6 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing countProfilesStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countRoutersByAgentStmt != nil {
|
||||
if cerr := q.countRoutersByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countRoutersByAgentStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countRoutersByProfileStmt != nil {
|
||||
if cerr := q.countRoutersByProfileStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countRoutersByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countServersTransportsByAgentStmt != nil {
|
||||
if cerr := q.countServersTransportsByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countServersTransportsByAgentStmt: %w", cerr)
|
||||
@@ -586,16 +552,6 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing countServersTransportsByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countServicesByAgentStmt != nil {
|
||||
if cerr := q.countServicesByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countServicesByAgentStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countServicesByProfileStmt != nil {
|
||||
if cerr := q.countServicesByProfileStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countServicesByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.countTcpMiddlewaresStmt != nil {
|
||||
if cerr := q.countTcpMiddlewaresStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing countTcpMiddlewaresStmt: %w", cerr)
|
||||
@@ -821,9 +777,9 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing deleteTcpServiceStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.deleteTraefikInstanceByIDStmt != nil {
|
||||
if cerr := q.deleteTraefikInstanceByIDStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing deleteTraefikInstanceByIDStmt: %w", cerr)
|
||||
if q.deleteTraefikInstanceStmt != nil {
|
||||
if cerr := q.deleteTraefikInstanceStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing deleteTraefikInstanceStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.deleteUdpRouterStmt != nil {
|
||||
@@ -916,9 +872,9 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing getHttpServersTransportStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getHttpServiceStmt != nil {
|
||||
if cerr := q.getHttpServiceStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getHttpServiceStmt: %w", cerr)
|
||||
if q.getHttpServiceByIDStmt != nil {
|
||||
if cerr := q.getHttpServiceByIDStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getHttpServiceByIDStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getHttpServiceByNameStmt != nil {
|
||||
@@ -971,9 +927,9 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing getTcpServersTransportStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getTcpServiceStmt != nil {
|
||||
if cerr := q.getTcpServiceStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getTcpServiceStmt: %w", cerr)
|
||||
if q.getTcpServiceByIDStmt != nil {
|
||||
if cerr := q.getTcpServiceByIDStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getTcpServiceByIDStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getTcpServiceByNameStmt != nil {
|
||||
@@ -1001,9 +957,9 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing getUdpRoutersUsingEntryPointStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getUdpServiceStmt != nil {
|
||||
if cerr := q.getUdpServiceStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getUdpServiceStmt: %w", cerr)
|
||||
if q.getUdpServiceByIDStmt != nil {
|
||||
if cerr := q.getUdpServiceByIDStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing getUdpServiceByIDStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.getUdpServiceByNameStmt != nil {
|
||||
@@ -1096,16 +1052,6 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing listProfilesStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listRoutersByAgentStmt != nil {
|
||||
if cerr := q.listRoutersByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listRoutersByAgentStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listRoutersByProfileStmt != nil {
|
||||
if cerr := q.listRoutersByProfileStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listRoutersByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listServersTransportsByAgentStmt != nil {
|
||||
if cerr := q.listServersTransportsByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listServersTransportsByAgentStmt: %w", cerr)
|
||||
@@ -1116,16 +1062,6 @@ func (q *Queries) Close() error {
|
||||
err = fmt.Errorf("error closing listServersTransportsByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listServicesByAgentStmt != nil {
|
||||
if cerr := q.listServicesByAgentStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listServicesByAgentStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listServicesByProfileStmt != nil {
|
||||
if cerr := q.listServicesByProfileStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listServicesByProfileStmt: %w", cerr)
|
||||
}
|
||||
}
|
||||
if q.listSettingsStmt != nil {
|
||||
if cerr := q.listSettingsStmt.Close(); cerr != nil {
|
||||
err = fmt.Errorf("error closing listSettingsStmt: %w", cerr)
|
||||
@@ -1389,12 +1325,8 @@ type Queries struct {
|
||||
countHttpServersTransportsStmt *sql.Stmt
|
||||
countHttpServicesStmt *sql.Stmt
|
||||
countProfilesStmt *sql.Stmt
|
||||
countRoutersByAgentStmt *sql.Stmt
|
||||
countRoutersByProfileStmt *sql.Stmt
|
||||
countServersTransportsByAgentStmt *sql.Stmt
|
||||
countServersTransportsByProfileStmt *sql.Stmt
|
||||
countServicesByAgentStmt *sql.Stmt
|
||||
countServicesByProfileStmt *sql.Stmt
|
||||
countTcpMiddlewaresStmt *sql.Stmt
|
||||
countTcpRoutersStmt *sql.Stmt
|
||||
countTcpServersTransportsStmt *sql.Stmt
|
||||
@@ -1440,7 +1372,7 @@ type Queries struct {
|
||||
deleteTcpRouterDNSProviderStmt *sql.Stmt
|
||||
deleteTcpServersTransportStmt *sql.Stmt
|
||||
deleteTcpServiceStmt *sql.Stmt
|
||||
deleteTraefikInstanceByIDStmt *sql.Stmt
|
||||
deleteTraefikInstanceStmt *sql.Stmt
|
||||
deleteUdpRouterStmt *sql.Stmt
|
||||
deleteUdpServiceStmt *sql.Stmt
|
||||
deleteUserStmt *sql.Stmt
|
||||
@@ -1459,7 +1391,7 @@ type Queries struct {
|
||||
getHttpRoutersUsingEntryPointStmt *sql.Stmt
|
||||
getHttpRoutersUsingMiddlewareStmt *sql.Stmt
|
||||
getHttpServersTransportStmt *sql.Stmt
|
||||
getHttpServiceStmt *sql.Stmt
|
||||
getHttpServiceByIDStmt *sql.Stmt
|
||||
getHttpServiceByNameStmt *sql.Stmt
|
||||
getProfileStmt *sql.Stmt
|
||||
getProfileByNameStmt *sql.Stmt
|
||||
@@ -1470,13 +1402,13 @@ type Queries struct {
|
||||
getTcpRoutersUsingEntryPointStmt *sql.Stmt
|
||||
getTcpRoutersUsingMiddlewareStmt *sql.Stmt
|
||||
getTcpServersTransportStmt *sql.Stmt
|
||||
getTcpServiceStmt *sql.Stmt
|
||||
getTcpServiceByIDStmt *sql.Stmt
|
||||
getTcpServiceByNameStmt *sql.Stmt
|
||||
getTraefikInstanceByIDStmt *sql.Stmt
|
||||
getTraefikInstanceByNameStmt *sql.Stmt
|
||||
getUdpRouterStmt *sql.Stmt
|
||||
getUdpRoutersUsingEntryPointStmt *sql.Stmt
|
||||
getUdpServiceStmt *sql.Stmt
|
||||
getUdpServiceByIDStmt *sql.Stmt
|
||||
getUdpServiceByNameStmt *sql.Stmt
|
||||
getUserByEmailStmt *sql.Stmt
|
||||
getUserByIDStmt *sql.Stmt
|
||||
@@ -1495,12 +1427,8 @@ type Queries struct {
|
||||
listHttpServicesStmt *sql.Stmt
|
||||
listHttpServicesEnabledStmt *sql.Stmt
|
||||
listProfilesStmt *sql.Stmt
|
||||
listRoutersByAgentStmt *sql.Stmt
|
||||
listRoutersByProfileStmt *sql.Stmt
|
||||
listServersTransportsByAgentStmt *sql.Stmt
|
||||
listServersTransportsByProfileStmt *sql.Stmt
|
||||
listServicesByAgentStmt *sql.Stmt
|
||||
listServicesByProfileStmt *sql.Stmt
|
||||
listSettingsStmt *sql.Stmt
|
||||
listTcpMiddlewaresStmt *sql.Stmt
|
||||
listTcpMiddlewaresEnabledStmt *sql.Stmt
|
||||
@@ -1559,12 +1487,8 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
|
||||
countHttpServersTransportsStmt: q.countHttpServersTransportsStmt,
|
||||
countHttpServicesStmt: q.countHttpServicesStmt,
|
||||
countProfilesStmt: q.countProfilesStmt,
|
||||
countRoutersByAgentStmt: q.countRoutersByAgentStmt,
|
||||
countRoutersByProfileStmt: q.countRoutersByProfileStmt,
|
||||
countServersTransportsByAgentStmt: q.countServersTransportsByAgentStmt,
|
||||
countServersTransportsByProfileStmt: q.countServersTransportsByProfileStmt,
|
||||
countServicesByAgentStmt: q.countServicesByAgentStmt,
|
||||
countServicesByProfileStmt: q.countServicesByProfileStmt,
|
||||
countTcpMiddlewaresStmt: q.countTcpMiddlewaresStmt,
|
||||
countTcpRoutersStmt: q.countTcpRoutersStmt,
|
||||
countTcpServersTransportsStmt: q.countTcpServersTransportsStmt,
|
||||
@@ -1610,7 +1534,7 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
|
||||
deleteTcpRouterDNSProviderStmt: q.deleteTcpRouterDNSProviderStmt,
|
||||
deleteTcpServersTransportStmt: q.deleteTcpServersTransportStmt,
|
||||
deleteTcpServiceStmt: q.deleteTcpServiceStmt,
|
||||
deleteTraefikInstanceByIDStmt: q.deleteTraefikInstanceByIDStmt,
|
||||
deleteTraefikInstanceStmt: q.deleteTraefikInstanceStmt,
|
||||
deleteUdpRouterStmt: q.deleteUdpRouterStmt,
|
||||
deleteUdpServiceStmt: q.deleteUdpServiceStmt,
|
||||
deleteUserStmt: q.deleteUserStmt,
|
||||
@@ -1629,7 +1553,7 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
|
||||
getHttpRoutersUsingEntryPointStmt: q.getHttpRoutersUsingEntryPointStmt,
|
||||
getHttpRoutersUsingMiddlewareStmt: q.getHttpRoutersUsingMiddlewareStmt,
|
||||
getHttpServersTransportStmt: q.getHttpServersTransportStmt,
|
||||
getHttpServiceStmt: q.getHttpServiceStmt,
|
||||
getHttpServiceByIDStmt: q.getHttpServiceByIDStmt,
|
||||
getHttpServiceByNameStmt: q.getHttpServiceByNameStmt,
|
||||
getProfileStmt: q.getProfileStmt,
|
||||
getProfileByNameStmt: q.getProfileByNameStmt,
|
||||
@@ -1640,13 +1564,13 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
|
||||
getTcpRoutersUsingEntryPointStmt: q.getTcpRoutersUsingEntryPointStmt,
|
||||
getTcpRoutersUsingMiddlewareStmt: q.getTcpRoutersUsingMiddlewareStmt,
|
||||
getTcpServersTransportStmt: q.getTcpServersTransportStmt,
|
||||
getTcpServiceStmt: q.getTcpServiceStmt,
|
||||
getTcpServiceByIDStmt: q.getTcpServiceByIDStmt,
|
||||
getTcpServiceByNameStmt: q.getTcpServiceByNameStmt,
|
||||
getTraefikInstanceByIDStmt: q.getTraefikInstanceByIDStmt,
|
||||
getTraefikInstanceByNameStmt: q.getTraefikInstanceByNameStmt,
|
||||
getUdpRouterStmt: q.getUdpRouterStmt,
|
||||
getUdpRoutersUsingEntryPointStmt: q.getUdpRoutersUsingEntryPointStmt,
|
||||
getUdpServiceStmt: q.getUdpServiceStmt,
|
||||
getUdpServiceByIDStmt: q.getUdpServiceByIDStmt,
|
||||
getUdpServiceByNameStmt: q.getUdpServiceByNameStmt,
|
||||
getUserByEmailStmt: q.getUserByEmailStmt,
|
||||
getUserByIDStmt: q.getUserByIDStmt,
|
||||
@@ -1665,12 +1589,8 @@ func (q *Queries) WithTx(tx *sql.Tx) *Queries {
|
||||
listHttpServicesStmt: q.listHttpServicesStmt,
|
||||
listHttpServicesEnabledStmt: q.listHttpServicesEnabledStmt,
|
||||
listProfilesStmt: q.listProfilesStmt,
|
||||
listRoutersByAgentStmt: q.listRoutersByAgentStmt,
|
||||
listRoutersByProfileStmt: q.listRoutersByProfileStmt,
|
||||
listServersTransportsByAgentStmt: q.listServersTransportsByAgentStmt,
|
||||
listServersTransportsByProfileStmt: q.listServersTransportsByProfileStmt,
|
||||
listServicesByAgentStmt: q.listServicesByAgentStmt,
|
||||
listServicesByProfileStmt: q.listServicesByProfileStmt,
|
||||
listSettingsStmt: q.listSettingsStmt,
|
||||
listTcpMiddlewaresStmt: q.listTcpMiddlewaresStmt,
|
||||
listTcpMiddlewaresEnabledStmt: q.listTcpMiddlewaresEnabledStmt,
|
||||
|
||||
@@ -89,17 +89,23 @@ func (q *Queries) DeleteHttpService(ctx context.Context, id int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const getHttpService = `-- name: GetHttpService :one
|
||||
const getHttpServiceByID = `-- name: GetHttpServiceByID :one
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
id = ?
|
||||
profile_id = ?
|
||||
AND id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpService(ctx context.Context, id int64) (HttpService, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServiceStmt, getHttpService, id)
|
||||
type GetHttpServiceByIDParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpServiceByID(ctx context.Context, arg GetHttpServiceByIDParams) (HttpService, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServiceByIDStmt, getHttpServiceByID, arg.ProfileID, arg.ID)
|
||||
var i HttpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
@@ -120,11 +126,17 @@ SELECT
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
name = ?
|
||||
profile_id = ?
|
||||
AND name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpServiceByName(ctx context.Context, name string) (HttpService, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServiceByNameStmt, getHttpServiceByName, name)
|
||||
type GetHttpServiceByNameParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpServiceByName(ctx context.Context, arg GetHttpServiceByNameParams) (HttpService, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServiceByNameStmt, getHttpServiceByName, arg.ProfileID, arg.Name)
|
||||
var i HttpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
|
||||
@@ -18,17 +18,13 @@ type Querier interface {
|
||||
CountHttpServersTransports(ctx context.Context, arg CountHttpServersTransportsParams) (int64, error)
|
||||
CountHttpServices(ctx context.Context, arg CountHttpServicesParams) (int64, error)
|
||||
CountProfiles(ctx context.Context) (int64, error)
|
||||
CountRoutersByAgent(ctx context.Context, arg CountRoutersByAgentParams) (int64, error)
|
||||
CountRoutersByProfile(ctx context.Context, arg CountRoutersByProfileParams) (int64, error)
|
||||
CountServersTransportsByAgent(ctx context.Context, arg CountServersTransportsByAgentParams) (int64, error)
|
||||
CountServersTransportsByProfile(ctx context.Context, arg CountServersTransportsByProfileParams) (int64, error)
|
||||
CountServicesByAgent(ctx context.Context, arg CountServicesByAgentParams) (int64, error)
|
||||
CountServicesByProfile(ctx context.Context, arg CountServicesByProfileParams) (int64, error)
|
||||
CountTcpMiddlewares(ctx context.Context, arg CountTcpMiddlewaresParams) (int64, error)
|
||||
CountTcpRouters(ctx context.Context, arg CountTcpRoutersParams) (int64, error)
|
||||
CountTcpServersTransports(ctx context.Context, arg CountTcpServersTransportsParams) (int64, error)
|
||||
CountTcpServices(ctx context.Context, arg CountTcpServicesParams) (int64, error)
|
||||
CountTraefikInstances(ctx context.Context) (int64, error)
|
||||
CountTraefikInstances(ctx context.Context, profileID int64) (int64, error)
|
||||
CountUdpRouters(ctx context.Context, arg CountUdpRoutersParams) (int64, error)
|
||||
CountUdpServices(ctx context.Context, arg CountUdpServicesParams) (int64, error)
|
||||
CountUsers(ctx context.Context) (int64, error)
|
||||
@@ -69,7 +65,7 @@ type Querier interface {
|
||||
DeleteTcpRouterDNSProvider(ctx context.Context, arg DeleteTcpRouterDNSProviderParams) error
|
||||
DeleteTcpServersTransport(ctx context.Context, id int64) error
|
||||
DeleteTcpService(ctx context.Context, id int64) error
|
||||
DeleteTraefikInstanceByID(ctx context.Context, id int64) error
|
||||
DeleteTraefikInstance(ctx context.Context, id int64) error
|
||||
DeleteUdpRouter(ctx context.Context, id int64) error
|
||||
DeleteUdpService(ctx context.Context, id int64) error
|
||||
DeleteUser(ctx context.Context, id string) error
|
||||
@@ -88,8 +84,8 @@ type Querier interface {
|
||||
GetHttpRoutersUsingEntryPoint(ctx context.Context, arg GetHttpRoutersUsingEntryPointParams) ([]GetHttpRoutersUsingEntryPointRow, error)
|
||||
GetHttpRoutersUsingMiddleware(ctx context.Context, arg GetHttpRoutersUsingMiddlewareParams) ([]GetHttpRoutersUsingMiddlewareRow, error)
|
||||
GetHttpServersTransport(ctx context.Context, id int64) (HttpServersTransport, error)
|
||||
GetHttpService(ctx context.Context, id int64) (HttpService, error)
|
||||
GetHttpServiceByName(ctx context.Context, name string) (HttpService, error)
|
||||
GetHttpServiceByID(ctx context.Context, arg GetHttpServiceByIDParams) (HttpService, error)
|
||||
GetHttpServiceByName(ctx context.Context, arg GetHttpServiceByNameParams) (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)
|
||||
@@ -99,14 +95,14 @@ type Querier interface {
|
||||
GetTcpRoutersUsingEntryPoint(ctx context.Context, arg GetTcpRoutersUsingEntryPointParams) ([]GetTcpRoutersUsingEntryPointRow, error)
|
||||
GetTcpRoutersUsingMiddleware(ctx context.Context, arg GetTcpRoutersUsingMiddlewareParams) ([]GetTcpRoutersUsingMiddlewareRow, error)
|
||||
GetTcpServersTransport(ctx context.Context, id int64) (TcpServersTransport, error)
|
||||
GetTcpService(ctx context.Context, id int64) (TcpService, error)
|
||||
GetTcpServiceByName(ctx context.Context, name string) (TcpService, error)
|
||||
GetTcpServiceByID(ctx context.Context, arg GetTcpServiceByIDParams) (TcpService, error)
|
||||
GetTcpServiceByName(ctx context.Context, arg GetTcpServiceByNameParams) (TcpService, error)
|
||||
GetTraefikInstanceByID(ctx context.Context, id int64) (TraefikInstance, error)
|
||||
GetTraefikInstanceByName(ctx context.Context, name string) (TraefikInstance, error)
|
||||
GetTraefikInstanceByName(ctx context.Context, arg GetTraefikInstanceByNameParams) (TraefikInstance, error)
|
||||
GetUdpRouter(ctx context.Context, id int64) (UdpRouter, error)
|
||||
GetUdpRoutersUsingEntryPoint(ctx context.Context, arg GetUdpRoutersUsingEntryPointParams) ([]GetUdpRoutersUsingEntryPointRow, error)
|
||||
GetUdpService(ctx context.Context, id int64) (UdpService, error)
|
||||
GetUdpServiceByName(ctx context.Context, name string) (UdpService, error)
|
||||
GetUdpServiceByID(ctx context.Context, arg GetUdpServiceByIDParams) (UdpService, error)
|
||||
GetUdpServiceByName(ctx context.Context, arg GetUdpServiceByNameParams) (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)
|
||||
@@ -124,12 +120,8 @@ type Querier interface {
|
||||
ListHttpServices(ctx context.Context, arg ListHttpServicesParams) ([]HttpService, error)
|
||||
ListHttpServicesEnabled(ctx context.Context, profileID int64) ([]HttpService, error)
|
||||
ListProfiles(ctx context.Context, arg ListProfilesParams) ([]Profile, error)
|
||||
ListRoutersByAgent(ctx context.Context, arg ListRoutersByAgentParams) ([]ListRoutersByAgentRow, error)
|
||||
ListRoutersByProfile(ctx context.Context, arg ListRoutersByProfileParams) ([]ListRoutersByProfileRow, error)
|
||||
ListServersTransportsByAgent(ctx context.Context, arg ListServersTransportsByAgentParams) ([]ListServersTransportsByAgentRow, error)
|
||||
ListServersTransportsByProfile(ctx context.Context, arg ListServersTransportsByProfileParams) ([]ListServersTransportsByProfileRow, error)
|
||||
ListServicesByAgent(ctx context.Context, arg ListServicesByAgentParams) ([]ListServicesByAgentRow, error)
|
||||
ListServicesByProfile(ctx context.Context, arg ListServicesByProfileParams) ([]ListServicesByProfileRow, error)
|
||||
ListSettings(ctx context.Context) ([]Setting, error)
|
||||
ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewaresParams) ([]TcpMiddleware, error)
|
||||
ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]TcpMiddleware, error)
|
||||
|
||||
@@ -1,267 +0,0 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.29.0
|
||||
// source: routers.sql
|
||||
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/mizuchilabs/mantrae/internal/store/schema"
|
||||
)
|
||||
|
||||
const countRoutersByAgent = `-- name: CountRoutersByAgent :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.agent_id = ?
|
||||
`
|
||||
|
||||
type CountRoutersByAgentParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
AgentID_2 *string `json:"agentId2"`
|
||||
AgentID_3 *string `json:"agentId3"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountRoutersByAgent(ctx context.Context, arg CountRoutersByAgentParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countRoutersByAgentStmt, countRoutersByAgent, arg.AgentID, arg.AgentID_2, arg.AgentID_3)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const countRoutersByProfile = `-- name: CountRoutersByProfile :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.profile_id = ?
|
||||
`
|
||||
|
||||
type CountRoutersByProfileParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ProfileID_2 int64 `json:"profileId2"`
|
||||
ProfileID_3 int64 `json:"profileId3"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountRoutersByProfile(ctx context.Context, arg CountRoutersByProfileParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countRoutersByProfileStmt, countRoutersByProfile, arg.ProfileID, arg.ProfileID_2, arg.ProfileID_3)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const listRoutersByAgent = `-- name: ListRoutersByAgent :many
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.agent_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?
|
||||
`
|
||||
|
||||
type ListRoutersByAgentParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
AgentID_2 *string `json:"agentId2"`
|
||||
AgentID_3 *string `json:"agentId3"`
|
||||
Limit int64 `json:"limit"`
|
||||
Offset int64 `json:"offset"`
|
||||
}
|
||||
|
||||
type ListRoutersByAgentRow struct {
|
||||
ID int64 `json:"id"`
|
||||
ProfileID int64 `json:"profileId"`
|
||||
AgentID *string `json:"agentId"`
|
||||
Name string `json:"name"`
|
||||
Config *schema.HTTPRouter `json:"config"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListRoutersByAgent(ctx context.Context, arg ListRoutersByAgentParams) ([]ListRoutersByAgentRow, error) {
|
||||
rows, err := q.query(ctx, q.listRoutersByAgentStmt, listRoutersByAgent,
|
||||
arg.AgentID,
|
||||
arg.AgentID_2,
|
||||
arg.AgentID_3,
|
||||
arg.Limit,
|
||||
arg.Offset,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListRoutersByAgentRow
|
||||
for rows.Next() {
|
||||
var i ListRoutersByAgentRow
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.ProfileID,
|
||||
&i.AgentID,
|
||||
&i.Name,
|
||||
&i.Config,
|
||||
&i.Enabled,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Type,
|
||||
); 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 listRoutersByProfile = `-- name: ListRoutersByProfile :many
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.profile_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?
|
||||
`
|
||||
|
||||
type ListRoutersByProfileParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ProfileID_2 int64 `json:"profileId2"`
|
||||
ProfileID_3 int64 `json:"profileId3"`
|
||||
Limit int64 `json:"limit"`
|
||||
Offset int64 `json:"offset"`
|
||||
}
|
||||
|
||||
type ListRoutersByProfileRow struct {
|
||||
ID int64 `json:"id"`
|
||||
ProfileID int64 `json:"profileId"`
|
||||
AgentID *string `json:"agentId"`
|
||||
Name string `json:"name"`
|
||||
Config *schema.HTTPRouter `json:"config"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListRoutersByProfile(ctx context.Context, arg ListRoutersByProfileParams) ([]ListRoutersByProfileRow, error) {
|
||||
rows, err := q.query(ctx, q.listRoutersByProfileStmt, listRoutersByProfile,
|
||||
arg.ProfileID,
|
||||
arg.ProfileID_2,
|
||||
arg.ProfileID_3,
|
||||
arg.Limit,
|
||||
arg.Offset,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListRoutersByProfileRow
|
||||
for rows.Next() {
|
||||
var i ListRoutersByProfileRow
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.ProfileID,
|
||||
&i.AgentID,
|
||||
&i.Name,
|
||||
&i.Config,
|
||||
&i.Enabled,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Type,
|
||||
); 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
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.29.0
|
||||
// source: services.sql
|
||||
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/mizuchilabs/mantrae/internal/store/schema"
|
||||
)
|
||||
|
||||
const countServicesByAgent = `-- name: CountServicesByAgent :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.agent_id = ?
|
||||
`
|
||||
|
||||
type CountServicesByAgentParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
AgentID_2 *string `json:"agentId2"`
|
||||
AgentID_3 *string `json:"agentId3"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountServicesByAgent(ctx context.Context, arg CountServicesByAgentParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countServicesByAgentStmt, countServicesByAgent, arg.AgentID, arg.AgentID_2, arg.AgentID_3)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const countServicesByProfile = `-- name: CountServicesByProfile :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.profile_id = ?
|
||||
`
|
||||
|
||||
type CountServicesByProfileParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ProfileID_2 int64 `json:"profileId2"`
|
||||
ProfileID_3 int64 `json:"profileId3"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountServicesByProfile(ctx context.Context, arg CountServicesByProfileParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countServicesByProfileStmt, countServicesByProfile, arg.ProfileID, arg.ProfileID_2, arg.ProfileID_3)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const listServicesByAgent = `-- name: ListServicesByAgent :many
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.agent_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?
|
||||
`
|
||||
|
||||
type ListServicesByAgentParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
AgentID_2 *string `json:"agentId2"`
|
||||
AgentID_3 *string `json:"agentId3"`
|
||||
Limit int64 `json:"limit"`
|
||||
Offset int64 `json:"offset"`
|
||||
}
|
||||
|
||||
type ListServicesByAgentRow struct {
|
||||
ID int64 `json:"id"`
|
||||
ProfileID int64 `json:"profileId"`
|
||||
AgentID *string `json:"agentId"`
|
||||
Name string `json:"name"`
|
||||
Config *schema.HTTPService `json:"config"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListServicesByAgent(ctx context.Context, arg ListServicesByAgentParams) ([]ListServicesByAgentRow, error) {
|
||||
rows, err := q.query(ctx, q.listServicesByAgentStmt, listServicesByAgent,
|
||||
arg.AgentID,
|
||||
arg.AgentID_2,
|
||||
arg.AgentID_3,
|
||||
arg.Limit,
|
||||
arg.Offset,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListServicesByAgentRow
|
||||
for rows.Next() {
|
||||
var i ListServicesByAgentRow
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.ProfileID,
|
||||
&i.AgentID,
|
||||
&i.Name,
|
||||
&i.Config,
|
||||
&i.Enabled,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Type,
|
||||
); 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 listServicesByProfile = `-- name: ListServicesByProfile :many
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.profile_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?
|
||||
`
|
||||
|
||||
type ListServicesByProfileParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ProfileID_2 int64 `json:"profileId2"`
|
||||
ProfileID_3 int64 `json:"profileId3"`
|
||||
Limit int64 `json:"limit"`
|
||||
Offset int64 `json:"offset"`
|
||||
}
|
||||
|
||||
type ListServicesByProfileRow struct {
|
||||
ID int64 `json:"id"`
|
||||
ProfileID int64 `json:"profileId"`
|
||||
AgentID *string `json:"agentId"`
|
||||
Name string `json:"name"`
|
||||
Config *schema.HTTPService `json:"config"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListServicesByProfile(ctx context.Context, arg ListServicesByProfileParams) ([]ListServicesByProfileRow, error) {
|
||||
rows, err := q.query(ctx, q.listServicesByProfileStmt, listServicesByProfile,
|
||||
arg.ProfileID,
|
||||
arg.ProfileID_2,
|
||||
arg.ProfileID_3,
|
||||
arg.Limit,
|
||||
arg.Offset,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListServicesByProfileRow
|
||||
for rows.Next() {
|
||||
var i ListServicesByProfileRow
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.ProfileID,
|
||||
&i.AgentID,
|
||||
&i.Name,
|
||||
&i.Config,
|
||||
&i.Enabled,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.Type,
|
||||
); 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
|
||||
}
|
||||
@@ -89,17 +89,23 @@ func (q *Queries) DeleteTcpService(ctx context.Context, id int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const getTcpService = `-- name: GetTcpService :one
|
||||
const getTcpServiceByID = `-- name: GetTcpServiceByID :one
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
id = ?
|
||||
profile_id = ?
|
||||
AND id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpService(ctx context.Context, id int64) (TcpService, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServiceStmt, getTcpService, id)
|
||||
type GetTcpServiceByIDParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpServiceByID(ctx context.Context, arg GetTcpServiceByIDParams) (TcpService, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServiceByIDStmt, getTcpServiceByID, arg.ProfileID, arg.ID)
|
||||
var i TcpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
@@ -120,11 +126,17 @@ SELECT
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
name = ?
|
||||
profile_id = ?
|
||||
AND name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpServiceByName(ctx context.Context, name string) (TcpService, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServiceByNameStmt, getTcpServiceByName, name)
|
||||
type GetTcpServiceByNameParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpServiceByName(ctx context.Context, arg GetTcpServiceByNameParams) (TcpService, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServiceByNameStmt, getTcpServiceByName, arg.ProfileID, arg.Name)
|
||||
var i TcpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
|
||||
@@ -16,23 +16,25 @@ SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
traefik_instances
|
||||
WHERE
|
||||
profile_id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) CountTraefikInstances(ctx context.Context) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTraefikInstancesStmt, countTraefikInstances)
|
||||
func (q *Queries) CountTraefikInstances(ctx context.Context, profileID int64) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTraefikInstancesStmt, countTraefikInstances, profileID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const deleteTraefikInstanceByID = `-- name: DeleteTraefikInstanceByID :exec
|
||||
const deleteTraefikInstance = `-- name: DeleteTraefikInstance :exec
|
||||
DELETE FROM traefik_instances
|
||||
WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) DeleteTraefikInstanceByID(ctx context.Context, id int64) error {
|
||||
_, err := q.exec(ctx, q.deleteTraefikInstanceByIDStmt, deleteTraefikInstanceByID, id)
|
||||
func (q *Queries) DeleteTraefikInstance(ctx context.Context, id int64) error {
|
||||
_, err := q.exec(ctx, q.deleteTraefikInstanceStmt, deleteTraefikInstance, id)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -72,11 +74,17 @@ SELECT
|
||||
FROM
|
||||
traefik_instances
|
||||
WHERE
|
||||
name = ?
|
||||
profile_id = ?
|
||||
AND name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTraefikInstanceByName(ctx context.Context, name string) (TraefikInstance, error) {
|
||||
row := q.queryRow(ctx, q.getTraefikInstanceByNameStmt, getTraefikInstanceByName, name)
|
||||
type GetTraefikInstanceByNameParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTraefikInstanceByName(ctx context.Context, arg GetTraefikInstanceByNameParams) (TraefikInstance, error) {
|
||||
row := q.queryRow(ctx, q.getTraefikInstanceByNameStmt, getTraefikInstanceByName, arg.ProfileID, arg.Name)
|
||||
var i TraefikInstance
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
@@ -102,23 +110,23 @@ SELECT
|
||||
FROM
|
||||
traefik_instances
|
||||
WHERE
|
||||
profile_id = ?
|
||||
profile_id = ?1
|
||||
ORDER BY
|
||||
created_at DESC
|
||||
LIMIT
|
||||
?
|
||||
COALESCE(CAST(?3 AS INTEGER), -1)
|
||||
OFFSET
|
||||
?
|
||||
COALESCE(CAST(?2 AS INTEGER), 0)
|
||||
`
|
||||
|
||||
type ListTraefikInstancesParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Limit int64 `json:"limit"`
|
||||
Offset int64 `json:"offset"`
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Offset *int64 `json:"offset"`
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTraefikInstances(ctx context.Context, arg ListTraefikInstancesParams) ([]TraefikInstance, error) {
|
||||
rows, err := q.query(ctx, q.listTraefikInstancesStmt, listTraefikInstances, arg.ProfileID, arg.Limit, arg.Offset)
|
||||
rows, err := q.query(ctx, q.listTraefikInstancesStmt, listTraefikInstances, arg.ProfileID, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -89,17 +89,23 @@ func (q *Queries) DeleteUdpService(ctx context.Context, id int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const getUdpService = `-- name: GetUdpService :one
|
||||
const getUdpServiceByID = `-- name: GetUdpServiceByID :one
|
||||
SELECT
|
||||
id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
id = ?
|
||||
profile_id = ?
|
||||
AND id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUdpService(ctx context.Context, id int64) (UdpService, error) {
|
||||
row := q.queryRow(ctx, q.getUdpServiceStmt, getUdpService, id)
|
||||
type GetUdpServiceByIDParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetUdpServiceByID(ctx context.Context, arg GetUdpServiceByIDParams) (UdpService, error) {
|
||||
row := q.queryRow(ctx, q.getUdpServiceByIDStmt, getUdpServiceByID, arg.ProfileID, arg.ID)
|
||||
var i UdpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
@@ -120,11 +126,17 @@ SELECT
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
name = ?
|
||||
profile_id = ?
|
||||
AND name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUdpServiceByName(ctx context.Context, name string) (UdpService, error) {
|
||||
row := q.queryRow(ctx, q.getUdpServiceByNameStmt, getUdpServiceByName, name)
|
||||
type GetUdpServiceByNameParams struct {
|
||||
ProfileID int64 `json:"profileId"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetUdpServiceByName(ctx context.Context, arg GetUdpServiceByNameParams) (UdpService, error) {
|
||||
row := q.queryRow(ctx, q.getUdpServiceByNameStmt, getUdpServiceByName, arg.ProfileID, arg.Name)
|
||||
var i UdpService
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
|
||||
@@ -11,13 +11,14 @@ INSERT INTO
|
||||
VALUES
|
||||
(?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *;
|
||||
|
||||
-- name: GetHttpService :one
|
||||
-- name: GetHttpServiceByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
id = ?;
|
||||
profile_id = ?
|
||||
AND id = ?;
|
||||
|
||||
-- name: GetHttpServiceByName :one
|
||||
SELECT
|
||||
@@ -25,7 +26,8 @@ SELECT
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
name = ?;
|
||||
profile_id = ?
|
||||
AND name = ?;
|
||||
|
||||
-- name: ListHttpServices :many
|
||||
SELECT
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
-- name: ListRoutersByProfile :many
|
||||
SELECT
|
||||
*,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.profile_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?;
|
||||
|
||||
-- name: ListRoutersByAgent :many
|
||||
SELECT
|
||||
*,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.agent_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?;
|
||||
|
||||
-- name: CountRoutersByProfile :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.profile_id = ?;
|
||||
|
||||
-- name: CountRoutersByAgent :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_routers
|
||||
WHERE
|
||||
http_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_routers
|
||||
WHERE
|
||||
tcp_routers.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_routers
|
||||
WHERE
|
||||
udp_routers.agent_id = ?;
|
||||
@@ -1,105 +0,0 @@
|
||||
-- name: ListServicesByProfile :many
|
||||
SELECT
|
||||
*,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.profile_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?;
|
||||
|
||||
-- name: ListServicesByAgent :many
|
||||
SELECT
|
||||
*,
|
||||
'http' AS type
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'tcp' AS type
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
*,
|
||||
'udp' AS type
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.agent_id = ?
|
||||
ORDER BY
|
||||
name
|
||||
LIMIT
|
||||
?
|
||||
OFFSET
|
||||
?;
|
||||
|
||||
-- name: CountServicesByProfile :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.profile_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.profile_id = ?;
|
||||
|
||||
-- name: CountServicesByAgent :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
http_services
|
||||
WHERE
|
||||
http_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
tcp_services.agent_id = ?
|
||||
UNION ALL
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
udp_services.agent_id = ?;
|
||||
@@ -11,13 +11,14 @@ INSERT INTO
|
||||
VALUES
|
||||
(?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *;
|
||||
|
||||
-- name: GetTcpService :one
|
||||
-- name: GetTcpServiceByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
id = ?;
|
||||
profile_id = ?
|
||||
AND id = ?;
|
||||
|
||||
-- name: GetTcpServiceByName :one
|
||||
SELECT
|
||||
@@ -25,7 +26,8 @@ SELECT
|
||||
FROM
|
||||
tcp_services
|
||||
WHERE
|
||||
name = ?;
|
||||
profile_id = ?
|
||||
AND name = ?;
|
||||
|
||||
-- name: ListTcpServices :many
|
||||
SELECT
|
||||
|
||||
@@ -12,7 +12,8 @@ SELECT
|
||||
FROM
|
||||
traefik_instances
|
||||
WHERE
|
||||
name = ?;
|
||||
profile_id = ?
|
||||
AND name = ?;
|
||||
|
||||
-- name: ListTraefikInstances :many
|
||||
SELECT
|
||||
@@ -20,19 +21,21 @@ SELECT
|
||||
FROM
|
||||
traefik_instances
|
||||
WHERE
|
||||
profile_id = ?
|
||||
profile_id = sqlc.arg ('profile_id')
|
||||
ORDER BY
|
||||
created_at DESC
|
||||
LIMIT
|
||||
?
|
||||
COALESCE(CAST(sqlc.narg ('limit') AS INTEGER), -1)
|
||||
OFFSET
|
||||
?;
|
||||
COALESCE(CAST(sqlc.narg ('offset') AS INTEGER), 0);
|
||||
|
||||
-- name: CountTraefikInstances :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
traefik_instances;
|
||||
traefik_instances
|
||||
WHERE
|
||||
profile_id = ?;
|
||||
|
||||
-- name: UpsertTraefikInstance :one
|
||||
INSERT INTO
|
||||
@@ -77,7 +80,7 @@ SET
|
||||
version = EXCLUDED.version,
|
||||
updated_at = CURRENT_TIMESTAMP RETURNING *;
|
||||
|
||||
-- name: DeleteTraefikInstanceByID :exec
|
||||
-- name: DeleteTraefikInstance :exec
|
||||
DELETE FROM traefik_instances
|
||||
WHERE
|
||||
id = ?;
|
||||
|
||||
@@ -11,13 +11,14 @@ INSERT INTO
|
||||
VALUES
|
||||
(?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *;
|
||||
|
||||
-- name: GetUdpService :one
|
||||
-- name: GetUdpServiceByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
id = ?;
|
||||
profile_id = ?
|
||||
AND id = ?;
|
||||
|
||||
-- name: GetUdpServiceByName :one
|
||||
SELECT
|
||||
@@ -25,7 +26,8 @@ SELECT
|
||||
FROM
|
||||
udp_services
|
||||
WHERE
|
||||
name = ?;
|
||||
profile_id = ?
|
||||
AND name = ?;
|
||||
|
||||
-- name: ListUdpServices :many
|
||||
SELECT
|
||||
|
||||
@@ -37,7 +37,13 @@ func UpdateTraefikInstance(r *http.Request, q *db.Queries, profileID int64) {
|
||||
return
|
||||
}
|
||||
|
||||
instance, err := q.GetTraefikInstanceByName(context.Background(), instanceName)
|
||||
instance, err := q.GetTraefikInstanceByName(
|
||||
context.Background(),
|
||||
db.GetTraefikInstanceByNameParams{
|
||||
ProfileID: profileID,
|
||||
Name: instanceName,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// Create new temporary instance
|
||||
instance = db.TraefikInstance{
|
||||
|
||||
@@ -48,9 +48,6 @@ const (
|
||||
// ServiceServiceListServicesProcedure is the fully-qualified name of the ServiceService's
|
||||
// ListServices RPC.
|
||||
ServiceServiceListServicesProcedure = "/mantrae.v1.ServiceService/ListServices"
|
||||
// ServiceServiceGetServiceByRouterProcedure is the fully-qualified name of the ServiceService's
|
||||
// GetServiceByRouter RPC.
|
||||
ServiceServiceGetServiceByRouterProcedure = "/mantrae.v1.ServiceService/GetServiceByRouter"
|
||||
)
|
||||
|
||||
// ServiceServiceClient is a client for the mantrae.v1.ServiceService service.
|
||||
@@ -60,7 +57,6 @@ type ServiceServiceClient interface {
|
||||
UpdateService(context.Context, *connect.Request[v1.UpdateServiceRequest]) (*connect.Response[v1.UpdateServiceResponse], error)
|
||||
DeleteService(context.Context, *connect.Request[v1.DeleteServiceRequest]) (*connect.Response[v1.DeleteServiceResponse], error)
|
||||
ListServices(context.Context, *connect.Request[v1.ListServicesRequest]) (*connect.Response[v1.ListServicesResponse], error)
|
||||
GetServiceByRouter(context.Context, *connect.Request[v1.GetServiceByRouterRequest]) (*connect.Response[v1.GetServiceByRouterResponse], error)
|
||||
}
|
||||
|
||||
// NewServiceServiceClient constructs a client for the mantrae.v1.ServiceService service. By
|
||||
@@ -106,24 +102,16 @@ func NewServiceServiceClient(httpClient connect.HTTPClient, baseURL string, opts
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
getServiceByRouter: connect.NewClient[v1.GetServiceByRouterRequest, v1.GetServiceByRouterResponse](
|
||||
httpClient,
|
||||
baseURL+ServiceServiceGetServiceByRouterProcedure,
|
||||
connect.WithSchema(serviceServiceMethods.ByName("GetServiceByRouter")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// serviceServiceClient implements ServiceServiceClient.
|
||||
type serviceServiceClient struct {
|
||||
getService *connect.Client[v1.GetServiceRequest, v1.GetServiceResponse]
|
||||
createService *connect.Client[v1.CreateServiceRequest, v1.CreateServiceResponse]
|
||||
updateService *connect.Client[v1.UpdateServiceRequest, v1.UpdateServiceResponse]
|
||||
deleteService *connect.Client[v1.DeleteServiceRequest, v1.DeleteServiceResponse]
|
||||
listServices *connect.Client[v1.ListServicesRequest, v1.ListServicesResponse]
|
||||
getServiceByRouter *connect.Client[v1.GetServiceByRouterRequest, v1.GetServiceByRouterResponse]
|
||||
getService *connect.Client[v1.GetServiceRequest, v1.GetServiceResponse]
|
||||
createService *connect.Client[v1.CreateServiceRequest, v1.CreateServiceResponse]
|
||||
updateService *connect.Client[v1.UpdateServiceRequest, v1.UpdateServiceResponse]
|
||||
deleteService *connect.Client[v1.DeleteServiceRequest, v1.DeleteServiceResponse]
|
||||
listServices *connect.Client[v1.ListServicesRequest, v1.ListServicesResponse]
|
||||
}
|
||||
|
||||
// GetService calls mantrae.v1.ServiceService.GetService.
|
||||
@@ -151,11 +139,6 @@ func (c *serviceServiceClient) ListServices(ctx context.Context, req *connect.Re
|
||||
return c.listServices.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// GetServiceByRouter calls mantrae.v1.ServiceService.GetServiceByRouter.
|
||||
func (c *serviceServiceClient) GetServiceByRouter(ctx context.Context, req *connect.Request[v1.GetServiceByRouterRequest]) (*connect.Response[v1.GetServiceByRouterResponse], error) {
|
||||
return c.getServiceByRouter.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ServiceServiceHandler is an implementation of the mantrae.v1.ServiceService service.
|
||||
type ServiceServiceHandler interface {
|
||||
GetService(context.Context, *connect.Request[v1.GetServiceRequest]) (*connect.Response[v1.GetServiceResponse], error)
|
||||
@@ -163,7 +146,6 @@ type ServiceServiceHandler interface {
|
||||
UpdateService(context.Context, *connect.Request[v1.UpdateServiceRequest]) (*connect.Response[v1.UpdateServiceResponse], error)
|
||||
DeleteService(context.Context, *connect.Request[v1.DeleteServiceRequest]) (*connect.Response[v1.DeleteServiceResponse], error)
|
||||
ListServices(context.Context, *connect.Request[v1.ListServicesRequest]) (*connect.Response[v1.ListServicesResponse], error)
|
||||
GetServiceByRouter(context.Context, *connect.Request[v1.GetServiceByRouterRequest]) (*connect.Response[v1.GetServiceByRouterResponse], error)
|
||||
}
|
||||
|
||||
// NewServiceServiceHandler builds an HTTP handler from the service implementation. It returns the
|
||||
@@ -205,13 +187,6 @@ func NewServiceServiceHandler(svc ServiceServiceHandler, opts ...connect.Handler
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
serviceServiceGetServiceByRouterHandler := connect.NewUnaryHandler(
|
||||
ServiceServiceGetServiceByRouterProcedure,
|
||||
svc.GetServiceByRouter,
|
||||
connect.WithSchema(serviceServiceMethods.ByName("GetServiceByRouter")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
return "/mantrae.v1.ServiceService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case ServiceServiceGetServiceProcedure:
|
||||
@@ -224,8 +199,6 @@ func NewServiceServiceHandler(svc ServiceServiceHandler, opts ...connect.Handler
|
||||
serviceServiceDeleteServiceHandler.ServeHTTP(w, r)
|
||||
case ServiceServiceListServicesProcedure:
|
||||
serviceServiceListServicesHandler.ServeHTTP(w, r)
|
||||
case ServiceServiceGetServiceByRouterProcedure:
|
||||
serviceServiceGetServiceByRouterHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
@@ -254,7 +227,3 @@ func (UnimplementedServiceServiceHandler) DeleteService(context.Context, *connec
|
||||
func (UnimplementedServiceServiceHandler) ListServices(context.Context, *connect.Request[v1.ListServicesRequest]) (*connect.Response[v1.ListServicesResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.ServiceService.ListServices is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedServiceServiceHandler) GetServiceByRouter(context.Context, *connect.Request[v1.GetServiceByRouterRequest]) (*connect.Response[v1.GetServiceByRouterResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.ServiceService.GetServiceByRouter is not implemented"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: mantrae/v1/traefik_instance.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 (
|
||||
// TraefikInstanceServiceName is the fully-qualified name of the TraefikInstanceService service.
|
||||
TraefikInstanceServiceName = "mantrae.v1.TraefikInstanceService"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
// TraefikInstanceServiceGetTraefikInstanceProcedure is the fully-qualified name of the
|
||||
// TraefikInstanceService's GetTraefikInstance RPC.
|
||||
TraefikInstanceServiceGetTraefikInstanceProcedure = "/mantrae.v1.TraefikInstanceService/GetTraefikInstance"
|
||||
// TraefikInstanceServiceDeleteTraefikInstanceProcedure is the fully-qualified name of the
|
||||
// TraefikInstanceService's DeleteTraefikInstance RPC.
|
||||
TraefikInstanceServiceDeleteTraefikInstanceProcedure = "/mantrae.v1.TraefikInstanceService/DeleteTraefikInstance"
|
||||
// TraefikInstanceServiceListTraefikInstancesProcedure is the fully-qualified name of the
|
||||
// TraefikInstanceService's ListTraefikInstances RPC.
|
||||
TraefikInstanceServiceListTraefikInstancesProcedure = "/mantrae.v1.TraefikInstanceService/ListTraefikInstances"
|
||||
)
|
||||
|
||||
// TraefikInstanceServiceClient is a client for the mantrae.v1.TraefikInstanceService service.
|
||||
type TraefikInstanceServiceClient interface {
|
||||
GetTraefikInstance(context.Context, *connect.Request[v1.GetTraefikInstanceRequest]) (*connect.Response[v1.GetTraefikInstanceResponse], error)
|
||||
DeleteTraefikInstance(context.Context, *connect.Request[v1.DeleteTraefikInstanceRequest]) (*connect.Response[v1.DeleteTraefikInstanceResponse], error)
|
||||
ListTraefikInstances(context.Context, *connect.Request[v1.ListTraefikInstancesRequest]) (*connect.Response[v1.ListTraefikInstancesResponse], error)
|
||||
}
|
||||
|
||||
// NewTraefikInstanceServiceClient constructs a client for the mantrae.v1.TraefikInstanceService
|
||||
// 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 NewTraefikInstanceServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TraefikInstanceServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
traefikInstanceServiceMethods := v1.File_mantrae_v1_traefik_instance_proto.Services().ByName("TraefikInstanceService").Methods()
|
||||
return &traefikInstanceServiceClient{
|
||||
getTraefikInstance: connect.NewClient[v1.GetTraefikInstanceRequest, v1.GetTraefikInstanceResponse](
|
||||
httpClient,
|
||||
baseURL+TraefikInstanceServiceGetTraefikInstanceProcedure,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("GetTraefikInstance")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
deleteTraefikInstance: connect.NewClient[v1.DeleteTraefikInstanceRequest, v1.DeleteTraefikInstanceResponse](
|
||||
httpClient,
|
||||
baseURL+TraefikInstanceServiceDeleteTraefikInstanceProcedure,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("DeleteTraefikInstance")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listTraefikInstances: connect.NewClient[v1.ListTraefikInstancesRequest, v1.ListTraefikInstancesResponse](
|
||||
httpClient,
|
||||
baseURL+TraefikInstanceServiceListTraefikInstancesProcedure,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("ListTraefikInstances")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// traefikInstanceServiceClient implements TraefikInstanceServiceClient.
|
||||
type traefikInstanceServiceClient struct {
|
||||
getTraefikInstance *connect.Client[v1.GetTraefikInstanceRequest, v1.GetTraefikInstanceResponse]
|
||||
deleteTraefikInstance *connect.Client[v1.DeleteTraefikInstanceRequest, v1.DeleteTraefikInstanceResponse]
|
||||
listTraefikInstances *connect.Client[v1.ListTraefikInstancesRequest, v1.ListTraefikInstancesResponse]
|
||||
}
|
||||
|
||||
// GetTraefikInstance calls mantrae.v1.TraefikInstanceService.GetTraefikInstance.
|
||||
func (c *traefikInstanceServiceClient) GetTraefikInstance(ctx context.Context, req *connect.Request[v1.GetTraefikInstanceRequest]) (*connect.Response[v1.GetTraefikInstanceResponse], error) {
|
||||
return c.getTraefikInstance.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteTraefikInstance calls mantrae.v1.TraefikInstanceService.DeleteTraefikInstance.
|
||||
func (c *traefikInstanceServiceClient) DeleteTraefikInstance(ctx context.Context, req *connect.Request[v1.DeleteTraefikInstanceRequest]) (*connect.Response[v1.DeleteTraefikInstanceResponse], error) {
|
||||
return c.deleteTraefikInstance.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListTraefikInstances calls mantrae.v1.TraefikInstanceService.ListTraefikInstances.
|
||||
func (c *traefikInstanceServiceClient) ListTraefikInstances(ctx context.Context, req *connect.Request[v1.ListTraefikInstancesRequest]) (*connect.Response[v1.ListTraefikInstancesResponse], error) {
|
||||
return c.listTraefikInstances.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// TraefikInstanceServiceHandler is an implementation of the mantrae.v1.TraefikInstanceService
|
||||
// service.
|
||||
type TraefikInstanceServiceHandler interface {
|
||||
GetTraefikInstance(context.Context, *connect.Request[v1.GetTraefikInstanceRequest]) (*connect.Response[v1.GetTraefikInstanceResponse], error)
|
||||
DeleteTraefikInstance(context.Context, *connect.Request[v1.DeleteTraefikInstanceRequest]) (*connect.Response[v1.DeleteTraefikInstanceResponse], error)
|
||||
ListTraefikInstances(context.Context, *connect.Request[v1.ListTraefikInstancesRequest]) (*connect.Response[v1.ListTraefikInstancesResponse], error)
|
||||
}
|
||||
|
||||
// NewTraefikInstanceServiceHandler 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 NewTraefikInstanceServiceHandler(svc TraefikInstanceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||
traefikInstanceServiceMethods := v1.File_mantrae_v1_traefik_instance_proto.Services().ByName("TraefikInstanceService").Methods()
|
||||
traefikInstanceServiceGetTraefikInstanceHandler := connect.NewUnaryHandler(
|
||||
TraefikInstanceServiceGetTraefikInstanceProcedure,
|
||||
svc.GetTraefikInstance,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("GetTraefikInstance")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
traefikInstanceServiceDeleteTraefikInstanceHandler := connect.NewUnaryHandler(
|
||||
TraefikInstanceServiceDeleteTraefikInstanceProcedure,
|
||||
svc.DeleteTraefikInstance,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("DeleteTraefikInstance")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
traefikInstanceServiceListTraefikInstancesHandler := connect.NewUnaryHandler(
|
||||
TraefikInstanceServiceListTraefikInstancesProcedure,
|
||||
svc.ListTraefikInstances,
|
||||
connect.WithSchema(traefikInstanceServiceMethods.ByName("ListTraefikInstances")),
|
||||
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
return "/mantrae.v1.TraefikInstanceService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case TraefikInstanceServiceGetTraefikInstanceProcedure:
|
||||
traefikInstanceServiceGetTraefikInstanceHandler.ServeHTTP(w, r)
|
||||
case TraefikInstanceServiceDeleteTraefikInstanceProcedure:
|
||||
traefikInstanceServiceDeleteTraefikInstanceHandler.ServeHTTP(w, r)
|
||||
case TraefikInstanceServiceListTraefikInstancesProcedure:
|
||||
traefikInstanceServiceListTraefikInstancesHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// UnimplementedTraefikInstanceServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedTraefikInstanceServiceHandler struct{}
|
||||
|
||||
func (UnimplementedTraefikInstanceServiceHandler) GetTraefikInstance(context.Context, *connect.Request[v1.GetTraefikInstanceRequest]) (*connect.Response[v1.GetTraefikInstanceResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.TraefikInstanceService.GetTraefikInstance is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedTraefikInstanceServiceHandler) DeleteTraefikInstance(context.Context, *connect.Request[v1.DeleteTraefikInstanceRequest]) (*connect.Response[v1.DeleteTraefikInstanceResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.TraefikInstanceService.DeleteTraefikInstance is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedTraefikInstanceServiceHandler) ListTraefikInstances(context.Context, *connect.Request[v1.ListTraefikInstancesRequest]) (*connect.Response[v1.ListTraefikInstancesResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mantrae.v1.TraefikInstanceService.ListTraefikInstances is not implemented"))
|
||||
}
|
||||
@@ -24,55 +24,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type MiddlewareType int32
|
||||
|
||||
const (
|
||||
MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED MiddlewareType = 0
|
||||
MiddlewareType_MIDDLEWARE_TYPE_HTTP MiddlewareType = 1
|
||||
MiddlewareType_MIDDLEWARE_TYPE_TCP MiddlewareType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for MiddlewareType.
|
||||
var (
|
||||
MiddlewareType_name = map[int32]string{
|
||||
0: "MIDDLEWARE_TYPE_UNSPECIFIED",
|
||||
1: "MIDDLEWARE_TYPE_HTTP",
|
||||
2: "MIDDLEWARE_TYPE_TCP",
|
||||
}
|
||||
MiddlewareType_value = map[string]int32{
|
||||
"MIDDLEWARE_TYPE_UNSPECIFIED": 0,
|
||||
"MIDDLEWARE_TYPE_HTTP": 1,
|
||||
"MIDDLEWARE_TYPE_TCP": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x MiddlewareType) Enum() *MiddlewareType {
|
||||
p := new(MiddlewareType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x MiddlewareType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (MiddlewareType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_mantrae_v1_middleware_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (MiddlewareType) Type() protoreflect.EnumType {
|
||||
return &file_mantrae_v1_middleware_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x MiddlewareType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MiddlewareType.Descriptor instead.
|
||||
func (MiddlewareType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_middleware_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Middleware struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
@@ -82,7 +33,7 @@ type Middleware struct {
|
||||
Config *structpb.Struct `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
IsDefault bool `protobuf:"varint,7,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"`
|
||||
Type MiddlewareType `protobuf:"varint,8,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,8,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,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
|
||||
@@ -168,11 +119,11 @@ func (x *Middleware) GetIsDefault() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Middleware) GetType() MiddlewareType {
|
||||
func (x *Middleware) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Middleware) GetCreatedAt() *timestamppb.Timestamp {
|
||||
@@ -408,7 +359,7 @@ func (x *PluginSnippet) GetToml() string {
|
||||
type GetMiddlewareRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type MiddlewareType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -450,11 +401,11 @@ func (x *GetMiddlewareRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetMiddlewareRequest) GetType() MiddlewareType {
|
||||
func (x *GetMiddlewareRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type GetMiddlewareResponse struct {
|
||||
@@ -506,7 +457,7 @@ type CreateMiddlewareRequest struct {
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
AgentId *string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3,oneof" json:"agent_id,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Type MiddlewareType `protobuf:"varint,4,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,4,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
IsDefault bool `protobuf:"varint,5,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,6,opt,name=config,proto3" json:"config,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -564,11 +515,11 @@ func (x *CreateMiddlewareRequest) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateMiddlewareRequest) GetType() MiddlewareType {
|
||||
func (x *CreateMiddlewareRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *CreateMiddlewareRequest) GetIsDefault() bool {
|
||||
@@ -633,7 +584,7 @@ type UpdateMiddlewareRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Type MiddlewareType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
IsDefault bool `protobuf:"varint,6,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"`
|
||||
@@ -685,11 +636,11 @@ func (x *UpdateMiddlewareRequest) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateMiddlewareRequest) GetType() MiddlewareType {
|
||||
func (x *UpdateMiddlewareRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *UpdateMiddlewareRequest) GetConfig() *structpb.Struct {
|
||||
@@ -759,8 +710,8 @@ func (x *UpdateMiddlewareResponse) GetMiddleware() *Middleware {
|
||||
|
||||
type DeleteMiddlewareRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type MiddlewareType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType" json:"type,omitempty"`
|
||||
Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -802,11 +753,11 @@ func (x *DeleteMiddlewareRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DeleteMiddlewareRequest) GetType() MiddlewareType {
|
||||
func (x *DeleteMiddlewareRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type DeleteMiddlewareResponse struct {
|
||||
@@ -849,7 +800,7 @@ type ListMiddlewaresRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
AgentId *string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3,oneof" json:"agent_id,omitempty"`
|
||||
Type *MiddlewareType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.MiddlewareType,oneof" json:"type,omitempty"`
|
||||
Type *ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType,oneof" json:"type,omitempty"`
|
||||
Limit *int64 `protobuf:"varint,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
|
||||
Offset *int64 `protobuf:"varint,5,opt,name=offset,proto3,oneof" json:"offset,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -900,11 +851,11 @@ func (x *ListMiddlewaresRequest) GetAgentId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListMiddlewaresRequest) GetType() MiddlewareType {
|
||||
func (x *ListMiddlewaresRequest) GetType() ProtocolType {
|
||||
if x != nil && x.Type != nil {
|
||||
return *x.Type
|
||||
}
|
||||
return MiddlewareType_MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ListMiddlewaresRequest) GetLimit() int64 {
|
||||
@@ -1058,7 +1009,7 @@ 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\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfa\x02\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19mantrae/v1/protocol.proto\"\xf8\x02\n" +
|
||||
"\n" +
|
||||
"Middleware\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
|
||||
@@ -1069,8 +1020,8 @@ const file_mantrae_v1_middleware_proto_rawDesc = "" +
|
||||
"\x06config\x18\x05 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x06 \x01(\bR\aenabled\x12\x1d\n" +
|
||||
"\n" +
|
||||
"is_default\x18\a \x01(\bR\tisDefault\x12.\n" +
|
||||
"\x04type\x18\b \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeR\x04type\x129\n" +
|
||||
"is_default\x18\a \x01(\bR\tisDefault\x12,\n" +
|
||||
"\x04type\x18\b \x01(\x0e2\x18.mantrae.v1.ProtocolTypeR\x04type\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
@@ -1098,20 +1049,20 @@ const file_mantrae_v1_middleware_proto_rawDesc = "" +
|
||||
"\rPluginSnippet\x12\x10\n" +
|
||||
"\x03k8s\x18\x01 \x01(\tR\x03k8s\x12\x12\n" +
|
||||
"\x04yaml\x18\x02 \x01(\tR\x04yaml\x12\x12\n" +
|
||||
"\x04toml\x18\x03 \x01(\tR\x04toml\"i\n" +
|
||||
"\x04toml\x18\x03 \x01(\tR\x04toml\"g\n" +
|
||||
"\x14GetMiddlewareRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x128\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"O\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"O\n" +
|
||||
"\x15GetMiddlewareResponse\x126\n" +
|
||||
"\n" +
|
||||
"middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" +
|
||||
"middleware\"\x95\x02\n" +
|
||||
"middleware\"\x93\x02\n" +
|
||||
"\x17CreateMiddlewareRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12\x1e\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tH\x00R\aagentId\x88\x01\x01\x12\x1b\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x128\n" +
|
||||
"\x04type\x18\x04 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x1d\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x126\n" +
|
||||
"\x04type\x18\x04 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x1d\n" +
|
||||
"\n" +
|
||||
"is_default\x18\x05 \x01(\bR\tisDefault\x12/\n" +
|
||||
"\x06config\x18\x06 \x01(\v2\x17.google.protobuf.StructR\x06configB\v\n" +
|
||||
@@ -1119,11 +1070,11 @@ const file_mantrae_v1_middleware_proto_rawDesc = "" +
|
||||
"\x18CreateMiddlewareResponse\x126\n" +
|
||||
"\n" +
|
||||
"middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" +
|
||||
"middleware\"\xf3\x01\n" +
|
||||
"middleware\"\xf1\x01\n" +
|
||||
"\x17UpdateMiddlewareRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12\x1b\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x128\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12/\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x126\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x12\x1d\n" +
|
||||
"\n" +
|
||||
@@ -1131,16 +1082,16 @@ const file_mantrae_v1_middleware_proto_rawDesc = "" +
|
||||
"\x18UpdateMiddlewareResponse\x126\n" +
|
||||
"\n" +
|
||||
"middleware\x18\x01 \x01(\v2\x16.mantrae.v1.MiddlewareR\n" +
|
||||
"middleware\"l\n" +
|
||||
"middleware\"j\n" +
|
||||
"\x17DeleteMiddlewareRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x128\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x1a\n" +
|
||||
"\x18DeleteMiddlewareResponse\"\xe2\x02\n" +
|
||||
"\x02id\x18\x02 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x1a\n" +
|
||||
"\x18DeleteMiddlewareResponse\"\xe0\x02\n" +
|
||||
"\x16ListMiddlewaresRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12'\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x123\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x1a.mantrae.v1.MiddlewareTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x121\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\x05limit\x18\x04 \x01(\x03BV\xbaHS\xba\x01P\n" +
|
||||
"\vlimit.valid\x12)limit must be either -1 or greater than 0\x1a\x16this == -1 || this > 0H\x02R\x05limit\x88\x01\x01\x12$\n" +
|
||||
"\x06offset\x18\x05 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x03R\x06offset\x88\x01\x01B\v\n" +
|
||||
@@ -1154,11 +1105,7 @@ const file_mantrae_v1_middleware_proto_rawDesc = "" +
|
||||
"totalCount\"\x1d\n" +
|
||||
"\x1bGetMiddlewarePluginsRequest\"L\n" +
|
||||
"\x1cGetMiddlewarePluginsResponse\x12,\n" +
|
||||
"\aplugins\x18\x01 \x03(\v2\x12.mantrae.v1.PluginR\aplugins*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\xdc\x04\n" +
|
||||
"\aplugins\x18\x01 \x03(\v2\x12.mantrae.v1.PluginR\aplugins2\xdc\x04\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" +
|
||||
@@ -1182,58 +1129,57 @@ func file_mantrae_v1_middleware_proto_rawDescGZIP() []byte {
|
||||
return file_mantrae_v1_middleware_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_middleware_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
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
|
||||
(*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
|
||||
(*structpb.Struct)(nil), // 16: google.protobuf.Struct
|
||||
(*Middleware)(nil), // 0: mantrae.v1.Middleware
|
||||
(*Plugin)(nil), // 1: mantrae.v1.Plugin
|
||||
(*PluginSnippet)(nil), // 2: mantrae.v1.PluginSnippet
|
||||
(*GetMiddlewareRequest)(nil), // 3: mantrae.v1.GetMiddlewareRequest
|
||||
(*GetMiddlewareResponse)(nil), // 4: mantrae.v1.GetMiddlewareResponse
|
||||
(*CreateMiddlewareRequest)(nil), // 5: mantrae.v1.CreateMiddlewareRequest
|
||||
(*CreateMiddlewareResponse)(nil), // 6: mantrae.v1.CreateMiddlewareResponse
|
||||
(*UpdateMiddlewareRequest)(nil), // 7: mantrae.v1.UpdateMiddlewareRequest
|
||||
(*UpdateMiddlewareResponse)(nil), // 8: mantrae.v1.UpdateMiddlewareResponse
|
||||
(*DeleteMiddlewareRequest)(nil), // 9: mantrae.v1.DeleteMiddlewareRequest
|
||||
(*DeleteMiddlewareResponse)(nil), // 10: mantrae.v1.DeleteMiddlewareResponse
|
||||
(*ListMiddlewaresRequest)(nil), // 11: mantrae.v1.ListMiddlewaresRequest
|
||||
(*ListMiddlewaresResponse)(nil), // 12: mantrae.v1.ListMiddlewaresResponse
|
||||
(*GetMiddlewarePluginsRequest)(nil), // 13: mantrae.v1.GetMiddlewarePluginsRequest
|
||||
(*GetMiddlewarePluginsResponse)(nil), // 14: mantrae.v1.GetMiddlewarePluginsResponse
|
||||
(*structpb.Struct)(nil), // 15: google.protobuf.Struct
|
||||
(ProtocolType)(0), // 16: mantrae.v1.ProtocolType
|
||||
(*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
|
||||
}
|
||||
var file_mantrae_v1_middleware_proto_depIdxs = []int32{
|
||||
16, // 0: mantrae.v1.Middleware.config:type_name -> google.protobuf.Struct
|
||||
0, // 1: mantrae.v1.Middleware.type:type_name -> mantrae.v1.MiddlewareType
|
||||
15, // 0: mantrae.v1.Middleware.config:type_name -> google.protobuf.Struct
|
||||
16, // 1: mantrae.v1.Middleware.type:type_name -> mantrae.v1.ProtocolType
|
||||
17, // 2: mantrae.v1.Middleware.created_at:type_name -> google.protobuf.Timestamp
|
||||
17, // 3: mantrae.v1.Middleware.updated_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 4: mantrae.v1.Plugin.snippet:type_name -> mantrae.v1.PluginSnippet
|
||||
0, // 5: mantrae.v1.GetMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType
|
||||
1, // 6: mantrae.v1.GetMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
0, // 7: mantrae.v1.CreateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType
|
||||
16, // 8: mantrae.v1.CreateMiddlewareRequest.config:type_name -> google.protobuf.Struct
|
||||
1, // 9: mantrae.v1.CreateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
0, // 10: mantrae.v1.UpdateMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType
|
||||
16, // 11: mantrae.v1.UpdateMiddlewareRequest.config:type_name -> google.protobuf.Struct
|
||||
1, // 12: mantrae.v1.UpdateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
0, // 13: mantrae.v1.DeleteMiddlewareRequest.type:type_name -> mantrae.v1.MiddlewareType
|
||||
0, // 14: mantrae.v1.ListMiddlewaresRequest.type:type_name -> mantrae.v1.MiddlewareType
|
||||
1, // 15: mantrae.v1.ListMiddlewaresResponse.middlewares:type_name -> mantrae.v1.Middleware
|
||||
2, // 16: mantrae.v1.GetMiddlewarePluginsResponse.plugins:type_name -> mantrae.v1.Plugin
|
||||
4, // 17: mantrae.v1.MiddlewareService.GetMiddleware:input_type -> mantrae.v1.GetMiddlewareRequest
|
||||
6, // 18: mantrae.v1.MiddlewareService.CreateMiddleware:input_type -> mantrae.v1.CreateMiddlewareRequest
|
||||
8, // 19: mantrae.v1.MiddlewareService.UpdateMiddleware:input_type -> mantrae.v1.UpdateMiddlewareRequest
|
||||
10, // 20: mantrae.v1.MiddlewareService.DeleteMiddleware:input_type -> mantrae.v1.DeleteMiddlewareRequest
|
||||
12, // 21: mantrae.v1.MiddlewareService.ListMiddlewares:input_type -> mantrae.v1.ListMiddlewaresRequest
|
||||
14, // 22: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:input_type -> mantrae.v1.GetMiddlewarePluginsRequest
|
||||
5, // 23: mantrae.v1.MiddlewareService.GetMiddleware:output_type -> mantrae.v1.GetMiddlewareResponse
|
||||
7, // 24: mantrae.v1.MiddlewareService.CreateMiddleware:output_type -> mantrae.v1.CreateMiddlewareResponse
|
||||
9, // 25: mantrae.v1.MiddlewareService.UpdateMiddleware:output_type -> mantrae.v1.UpdateMiddlewareResponse
|
||||
11, // 26: mantrae.v1.MiddlewareService.DeleteMiddleware:output_type -> mantrae.v1.DeleteMiddlewareResponse
|
||||
13, // 27: mantrae.v1.MiddlewareService.ListMiddlewares:output_type -> mantrae.v1.ListMiddlewaresResponse
|
||||
15, // 28: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:output_type -> mantrae.v1.GetMiddlewarePluginsResponse
|
||||
2, // 4: mantrae.v1.Plugin.snippet:type_name -> mantrae.v1.PluginSnippet
|
||||
16, // 5: mantrae.v1.GetMiddlewareRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 6: mantrae.v1.GetMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
16, // 7: mantrae.v1.CreateMiddlewareRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
15, // 8: mantrae.v1.CreateMiddlewareRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 9: mantrae.v1.CreateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
16, // 10: mantrae.v1.UpdateMiddlewareRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
15, // 11: mantrae.v1.UpdateMiddlewareRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 12: mantrae.v1.UpdateMiddlewareResponse.middleware:type_name -> mantrae.v1.Middleware
|
||||
16, // 13: mantrae.v1.DeleteMiddlewareRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
16, // 14: mantrae.v1.ListMiddlewaresRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 15: mantrae.v1.ListMiddlewaresResponse.middlewares:type_name -> mantrae.v1.Middleware
|
||||
1, // 16: mantrae.v1.GetMiddlewarePluginsResponse.plugins:type_name -> mantrae.v1.Plugin
|
||||
3, // 17: mantrae.v1.MiddlewareService.GetMiddleware:input_type -> mantrae.v1.GetMiddlewareRequest
|
||||
5, // 18: mantrae.v1.MiddlewareService.CreateMiddleware:input_type -> mantrae.v1.CreateMiddlewareRequest
|
||||
7, // 19: mantrae.v1.MiddlewareService.UpdateMiddleware:input_type -> mantrae.v1.UpdateMiddlewareRequest
|
||||
9, // 20: mantrae.v1.MiddlewareService.DeleteMiddleware:input_type -> mantrae.v1.DeleteMiddlewareRequest
|
||||
11, // 21: mantrae.v1.MiddlewareService.ListMiddlewares:input_type -> mantrae.v1.ListMiddlewaresRequest
|
||||
13, // 22: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:input_type -> mantrae.v1.GetMiddlewarePluginsRequest
|
||||
4, // 23: mantrae.v1.MiddlewareService.GetMiddleware:output_type -> mantrae.v1.GetMiddlewareResponse
|
||||
6, // 24: mantrae.v1.MiddlewareService.CreateMiddleware:output_type -> mantrae.v1.CreateMiddlewareResponse
|
||||
8, // 25: mantrae.v1.MiddlewareService.UpdateMiddleware:output_type -> mantrae.v1.UpdateMiddlewareResponse
|
||||
10, // 26: mantrae.v1.MiddlewareService.DeleteMiddleware:output_type -> mantrae.v1.DeleteMiddlewareResponse
|
||||
12, // 27: mantrae.v1.MiddlewareService.ListMiddlewares:output_type -> mantrae.v1.ListMiddlewaresResponse
|
||||
14, // 28: mantrae.v1.MiddlewareService.GetMiddlewarePlugins:output_type -> mantrae.v1.GetMiddlewarePluginsResponse
|
||||
23, // [23:29] is the sub-list for method output_type
|
||||
17, // [17:23] is the sub-list for method input_type
|
||||
17, // [17:17] is the sub-list for extension type_name
|
||||
@@ -1246,6 +1192,7 @@ func file_mantrae_v1_middleware_proto_init() {
|
||||
if File_mantrae_v1_middleware_proto != nil {
|
||||
return
|
||||
}
|
||||
file_mantrae_v1_protocol_proto_init()
|
||||
file_mantrae_v1_middleware_proto_msgTypes[5].OneofWrappers = []any{}
|
||||
file_mantrae_v1_middleware_proto_msgTypes[11].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
@@ -1253,14 +1200,13 @@ func file_mantrae_v1_middleware_proto_init() {
|
||||
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,
|
||||
NumEnums: 0,
|
||||
NumMessages: 15,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_middleware_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_middleware_proto_depIdxs,
|
||||
EnumInfos: file_mantrae_v1_middleware_proto_enumTypes,
|
||||
MessageInfos: file_mantrae_v1_middleware_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_middleware_proto = out.File
|
||||
|
||||
137
proto/gen/mantrae/v1/protocol.pb.go
Normal file
137
proto/gen/mantrae/v1/protocol.pb.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc (unknown)
|
||||
// source: mantrae/v1/protocol.proto
|
||||
|
||||
package mantraev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
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 ProtocolType int32
|
||||
|
||||
const (
|
||||
ProtocolType_PROTOCOL_TYPE_UNSPECIFIED ProtocolType = 0
|
||||
ProtocolType_PROTOCOL_TYPE_HTTP ProtocolType = 1
|
||||
ProtocolType_PROTOCOL_TYPE_TCP ProtocolType = 2
|
||||
ProtocolType_PROTOCOL_TYPE_UDP ProtocolType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for ProtocolType.
|
||||
var (
|
||||
ProtocolType_name = map[int32]string{
|
||||
0: "PROTOCOL_TYPE_UNSPECIFIED",
|
||||
1: "PROTOCOL_TYPE_HTTP",
|
||||
2: "PROTOCOL_TYPE_TCP",
|
||||
3: "PROTOCOL_TYPE_UDP",
|
||||
}
|
||||
ProtocolType_value = map[string]int32{
|
||||
"PROTOCOL_TYPE_UNSPECIFIED": 0,
|
||||
"PROTOCOL_TYPE_HTTP": 1,
|
||||
"PROTOCOL_TYPE_TCP": 2,
|
||||
"PROTOCOL_TYPE_UDP": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ProtocolType) Enum() *ProtocolType {
|
||||
p := new(ProtocolType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ProtocolType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ProtocolType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_mantrae_v1_protocol_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ProtocolType) Type() protoreflect.EnumType {
|
||||
return &file_mantrae_v1_protocol_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ProtocolType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProtocolType.Descriptor instead.
|
||||
func (ProtocolType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_protocol_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_mantrae_v1_protocol_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_mantrae_v1_protocol_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x19mantrae/v1/protocol.proto\x12\n" +
|
||||
"mantrae.v1*s\n" +
|
||||
"\fProtocolType\x12\x1d\n" +
|
||||
"\x19PROTOCOL_TYPE_UNSPECIFIED\x10\x00\x12\x16\n" +
|
||||
"\x12PROTOCOL_TYPE_HTTP\x10\x01\x12\x15\n" +
|
||||
"\x11PROTOCOL_TYPE_TCP\x10\x02\x12\x15\n" +
|
||||
"\x11PROTOCOL_TYPE_UDP\x10\x03B\xa7\x01\n" +
|
||||
"\x0ecom.mantrae.v1B\rProtocolProtoP\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_protocol_proto_rawDescOnce sync.Once
|
||||
file_mantrae_v1_protocol_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_mantrae_v1_protocol_proto_rawDescGZIP() []byte {
|
||||
file_mantrae_v1_protocol_proto_rawDescOnce.Do(func() {
|
||||
file_mantrae_v1_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mantrae_v1_protocol_proto_rawDesc), len(file_mantrae_v1_protocol_proto_rawDesc)))
|
||||
})
|
||||
return file_mantrae_v1_protocol_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_protocol_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_mantrae_v1_protocol_proto_goTypes = []any{
|
||||
(ProtocolType)(0), // 0: mantrae.v1.ProtocolType
|
||||
}
|
||||
var file_mantrae_v1_protocol_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_mantrae_v1_protocol_proto_init() }
|
||||
func file_mantrae_v1_protocol_proto_init() {
|
||||
if File_mantrae_v1_protocol_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_protocol_proto_rawDesc), len(file_mantrae_v1_protocol_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_protocol_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_protocol_proto_depIdxs,
|
||||
EnumInfos: file_mantrae_v1_protocol_proto_enumTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_protocol_proto = out.File
|
||||
file_mantrae_v1_protocol_proto_goTypes = nil
|
||||
file_mantrae_v1_protocol_proto_depIdxs = nil
|
||||
}
|
||||
@@ -24,58 +24,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RouterType int32
|
||||
|
||||
const (
|
||||
RouterType_ROUTER_TYPE_UNSPECIFIED RouterType = 0
|
||||
RouterType_ROUTER_TYPE_HTTP RouterType = 1
|
||||
RouterType_ROUTER_TYPE_TCP RouterType = 2
|
||||
RouterType_ROUTER_TYPE_UDP RouterType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for RouterType.
|
||||
var (
|
||||
RouterType_name = map[int32]string{
|
||||
0: "ROUTER_TYPE_UNSPECIFIED",
|
||||
1: "ROUTER_TYPE_HTTP",
|
||||
2: "ROUTER_TYPE_TCP",
|
||||
3: "ROUTER_TYPE_UDP",
|
||||
}
|
||||
RouterType_value = map[string]int32{
|
||||
"ROUTER_TYPE_UNSPECIFIED": 0,
|
||||
"ROUTER_TYPE_HTTP": 1,
|
||||
"ROUTER_TYPE_TCP": 2,
|
||||
"ROUTER_TYPE_UDP": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x RouterType) Enum() *RouterType {
|
||||
p := new(RouterType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x RouterType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (RouterType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_mantrae_v1_router_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (RouterType) Type() protoreflect.EnumType {
|
||||
return &file_mantrae_v1_router_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x RouterType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RouterType.Descriptor instead.
|
||||
func (RouterType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_router_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Router struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
@@ -84,7 +32,7 @@ type Router struct {
|
||||
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Config *structpb.Struct `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"`
|
||||
Type ProtocolType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
DnsProviders []*DnsProvider `protobuf:"bytes,8,rep,name=dns_providers,json=dnsProviders,proto3" json:"dns_providers,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"`
|
||||
@@ -164,11 +112,11 @@ func (x *Router) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Router) GetType() RouterType {
|
||||
func (x *Router) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Router) GetDnsProviders() []*DnsProvider {
|
||||
@@ -195,7 +143,7 @@ func (x *Router) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
type GetRouterRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type RouterType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -237,11 +185,11 @@ func (x *GetRouterRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetRouterRequest) GetType() RouterType {
|
||||
func (x *GetRouterRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type GetRouterResponse struct {
|
||||
@@ -295,7 +243,7 @@ type CreateRouterRequest struct {
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Config *structpb.Struct `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"`
|
||||
Type ProtocolType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -365,11 +313,11 @@ func (x *CreateRouterRequest) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *CreateRouterRequest) GetType() RouterType {
|
||||
func (x *CreateRouterRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type CreateRouterResponse struct {
|
||||
@@ -420,7 +368,7 @@ type UpdateRouterRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Type RouterType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
DnsProviders []*DnsProvider `protobuf:"bytes,6,rep,name=dns_providers,json=dnsProviders,proto3" json:"dns_providers,omitempty"`
|
||||
@@ -472,11 +420,11 @@ func (x *UpdateRouterRequest) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateRouterRequest) GetType() RouterType {
|
||||
func (x *UpdateRouterRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *UpdateRouterRequest) GetConfig() *structpb.Struct {
|
||||
@@ -547,7 +495,7 @@ func (x *UpdateRouterResponse) GetRouter() *Router {
|
||||
type DeleteRouterRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type RouterType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.RouterType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -589,11 +537,11 @@ func (x *DeleteRouterRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DeleteRouterRequest) GetType() RouterType {
|
||||
func (x *DeleteRouterRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type DeleteRouterResponse struct {
|
||||
@@ -636,7 +584,7 @@ type ListRoutersRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
AgentId *string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3,oneof" json:"agent_id,omitempty"`
|
||||
Type *RouterType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.RouterType,oneof" json:"type,omitempty"`
|
||||
Type *ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType,oneof" json:"type,omitempty"`
|
||||
Limit *int64 `protobuf:"varint,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
|
||||
Offset *int64 `protobuf:"varint,5,opt,name=offset,proto3,oneof" json:"offset,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -687,11 +635,11 @@ func (x *ListRoutersRequest) GetAgentId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListRoutersRequest) GetType() RouterType {
|
||||
func (x *ListRoutersRequest) GetType() ProtocolType {
|
||||
if x != nil && x.Type != nil {
|
||||
return *x.Type
|
||||
}
|
||||
return RouterType_ROUTER_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ListRoutersRequest) GetLimit() int64 {
|
||||
@@ -765,7 +713,7 @@ 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\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dmantrae/v1/dns_provider.proto\"\x91\x03\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dmantrae/v1/dns_provider.proto\x1a\x19mantrae/v1/protocol.proto\"\x93\x03\n" +
|
||||
"\x06Router\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
|
||||
"\n" +
|
||||
@@ -773,48 +721,48 @@ const file_mantrae_v1_router_proto_rawDesc = "" +
|
||||
"\bagent_id\x18\x03 \x01(\tR\aagentId\x12\x12\n" +
|
||||
"\x04name\x18\x04 \x01(\tR\x04name\x12/\n" +
|
||||
"\x06config\x18\x05 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x06 \x01(\bR\aenabled\x12*\n" +
|
||||
"\x04type\x18\a \x01(\x0e2\x16.mantrae.v1.RouterTypeR\x04type\x12<\n" +
|
||||
"\aenabled\x18\x06 \x01(\bR\aenabled\x12,\n" +
|
||||
"\x04type\x18\a \x01(\x0e2\x18.mantrae.v1.ProtocolTypeR\x04type\x12<\n" +
|
||||
"\rdns_providers\x18\b \x03(\v2\x17.mantrae.v1.DnsProviderR\fdnsProviders\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\"a\n" +
|
||||
" \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"c\n" +
|
||||
"\x10GetRouterRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x124\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x16.mantrae.v1.RouterTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"?\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"?\n" +
|
||||
"\x11GetRouterResponse\x12*\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\x88\x02\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\x8a\x02\n" +
|
||||
"\x13CreateRouterRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12\x1e\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tH\x00R\aagentId\x88\x01\x01\x12\x1b\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x124\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2\x16.mantrae.v1.RouterTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x126\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\t_agent_id\"B\n" +
|
||||
"\x14CreateRouterResponse\x12*\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\x8a\x02\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"\x8c\x02\n" +
|
||||
"\x13UpdateRouterRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12\x1b\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x124\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x16.mantrae.v1.RouterTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12/\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x126\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x12<\n" +
|
||||
"\rdns_providers\x18\x06 \x03(\v2\x17.mantrae.v1.DnsProviderR\fdnsProviders\"B\n" +
|
||||
"\x14UpdateRouterResponse\x12*\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"d\n" +
|
||||
"\x06router\x18\x01 \x01(\v2\x12.mantrae.v1.RouterR\x06router\"f\n" +
|
||||
"\x13DeleteRouterRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x124\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x16.mantrae.v1.RouterTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x16\n" +
|
||||
"\x14DeleteRouterResponse\"\xda\x02\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x16\n" +
|
||||
"\x14DeleteRouterResponse\"\xdc\x02\n" +
|
||||
"\x12ListRoutersRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12'\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x12/\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x16.mantrae.v1.RouterTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x121\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\x05limit\x18\x04 \x01(\x03BV\xbaHS\xba\x01P\n" +
|
||||
"\vlimit.valid\x12)limit must be either -1 or greater than 0\x1a\x16this == -1 || this > 0H\x02R\x05limit\x88\x01\x01\x12$\n" +
|
||||
"\x06offset\x18\x05 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x03R\x06offset\x88\x01\x01B\v\n" +
|
||||
@@ -825,13 +773,7 @@ const file_mantrae_v1_router_proto_rawDesc = "" +
|
||||
"\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" +
|
||||
"totalCount2\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" +
|
||||
@@ -854,53 +796,52 @@ func file_mantrae_v1_router_proto_rawDescGZIP() []byte {
|
||||
return file_mantrae_v1_router_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_router_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_mantrae_v1_router_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_mantrae_v1_router_proto_goTypes = []any{
|
||||
(RouterType)(0), // 0: mantrae.v1.RouterType
|
||||
(*Router)(nil), // 1: mantrae.v1.Router
|
||||
(*GetRouterRequest)(nil), // 2: mantrae.v1.GetRouterRequest
|
||||
(*GetRouterResponse)(nil), // 3: mantrae.v1.GetRouterResponse
|
||||
(*CreateRouterRequest)(nil), // 4: mantrae.v1.CreateRouterRequest
|
||||
(*CreateRouterResponse)(nil), // 5: mantrae.v1.CreateRouterResponse
|
||||
(*UpdateRouterRequest)(nil), // 6: mantrae.v1.UpdateRouterRequest
|
||||
(*UpdateRouterResponse)(nil), // 7: mantrae.v1.UpdateRouterResponse
|
||||
(*DeleteRouterRequest)(nil), // 8: mantrae.v1.DeleteRouterRequest
|
||||
(*DeleteRouterResponse)(nil), // 9: mantrae.v1.DeleteRouterResponse
|
||||
(*ListRoutersRequest)(nil), // 10: mantrae.v1.ListRoutersRequest
|
||||
(*ListRoutersResponse)(nil), // 11: mantrae.v1.ListRoutersResponse
|
||||
(*structpb.Struct)(nil), // 12: google.protobuf.Struct
|
||||
(*Router)(nil), // 0: mantrae.v1.Router
|
||||
(*GetRouterRequest)(nil), // 1: mantrae.v1.GetRouterRequest
|
||||
(*GetRouterResponse)(nil), // 2: mantrae.v1.GetRouterResponse
|
||||
(*CreateRouterRequest)(nil), // 3: mantrae.v1.CreateRouterRequest
|
||||
(*CreateRouterResponse)(nil), // 4: mantrae.v1.CreateRouterResponse
|
||||
(*UpdateRouterRequest)(nil), // 5: mantrae.v1.UpdateRouterRequest
|
||||
(*UpdateRouterResponse)(nil), // 6: mantrae.v1.UpdateRouterResponse
|
||||
(*DeleteRouterRequest)(nil), // 7: mantrae.v1.DeleteRouterRequest
|
||||
(*DeleteRouterResponse)(nil), // 8: mantrae.v1.DeleteRouterResponse
|
||||
(*ListRoutersRequest)(nil), // 9: mantrae.v1.ListRoutersRequest
|
||||
(*ListRoutersResponse)(nil), // 10: mantrae.v1.ListRoutersResponse
|
||||
(*structpb.Struct)(nil), // 11: google.protobuf.Struct
|
||||
(ProtocolType)(0), // 12: mantrae.v1.ProtocolType
|
||||
(*DnsProvider)(nil), // 13: mantrae.v1.DnsProvider
|
||||
(*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp
|
||||
}
|
||||
var file_mantrae_v1_router_proto_depIdxs = []int32{
|
||||
12, // 0: mantrae.v1.Router.config:type_name -> google.protobuf.Struct
|
||||
0, // 1: mantrae.v1.Router.type:type_name -> mantrae.v1.RouterType
|
||||
11, // 0: mantrae.v1.Router.config:type_name -> google.protobuf.Struct
|
||||
12, // 1: mantrae.v1.Router.type:type_name -> mantrae.v1.ProtocolType
|
||||
13, // 2: mantrae.v1.Router.dns_providers:type_name -> mantrae.v1.DnsProvider
|
||||
14, // 3: mantrae.v1.Router.created_at:type_name -> google.protobuf.Timestamp
|
||||
14, // 4: mantrae.v1.Router.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 5: mantrae.v1.GetRouterRequest.type:type_name -> mantrae.v1.RouterType
|
||||
1, // 6: mantrae.v1.GetRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
12, // 7: mantrae.v1.CreateRouterRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 8: mantrae.v1.CreateRouterRequest.type:type_name -> mantrae.v1.RouterType
|
||||
1, // 9: mantrae.v1.CreateRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
0, // 10: mantrae.v1.UpdateRouterRequest.type:type_name -> mantrae.v1.RouterType
|
||||
12, // 11: mantrae.v1.UpdateRouterRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 5: mantrae.v1.GetRouterRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 6: mantrae.v1.GetRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
11, // 7: mantrae.v1.CreateRouterRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 8: mantrae.v1.CreateRouterRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 9: mantrae.v1.CreateRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
12, // 10: mantrae.v1.UpdateRouterRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
11, // 11: mantrae.v1.UpdateRouterRequest.config:type_name -> google.protobuf.Struct
|
||||
13, // 12: mantrae.v1.UpdateRouterRequest.dns_providers:type_name -> mantrae.v1.DnsProvider
|
||||
1, // 13: mantrae.v1.UpdateRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
0, // 14: mantrae.v1.DeleteRouterRequest.type:type_name -> mantrae.v1.RouterType
|
||||
0, // 15: mantrae.v1.ListRoutersRequest.type:type_name -> mantrae.v1.RouterType
|
||||
1, // 16: mantrae.v1.ListRoutersResponse.routers:type_name -> mantrae.v1.Router
|
||||
2, // 17: mantrae.v1.RouterService.GetRouter:input_type -> mantrae.v1.GetRouterRequest
|
||||
4, // 18: mantrae.v1.RouterService.CreateRouter:input_type -> mantrae.v1.CreateRouterRequest
|
||||
6, // 19: mantrae.v1.RouterService.UpdateRouter:input_type -> mantrae.v1.UpdateRouterRequest
|
||||
8, // 20: mantrae.v1.RouterService.DeleteRouter:input_type -> mantrae.v1.DeleteRouterRequest
|
||||
10, // 21: mantrae.v1.RouterService.ListRouters:input_type -> mantrae.v1.ListRoutersRequest
|
||||
3, // 22: mantrae.v1.RouterService.GetRouter:output_type -> mantrae.v1.GetRouterResponse
|
||||
5, // 23: mantrae.v1.RouterService.CreateRouter:output_type -> mantrae.v1.CreateRouterResponse
|
||||
7, // 24: mantrae.v1.RouterService.UpdateRouter:output_type -> mantrae.v1.UpdateRouterResponse
|
||||
9, // 25: mantrae.v1.RouterService.DeleteRouter:output_type -> mantrae.v1.DeleteRouterResponse
|
||||
11, // 26: mantrae.v1.RouterService.ListRouters:output_type -> mantrae.v1.ListRoutersResponse
|
||||
0, // 13: mantrae.v1.UpdateRouterResponse.router:type_name -> mantrae.v1.Router
|
||||
12, // 14: mantrae.v1.DeleteRouterRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
12, // 15: mantrae.v1.ListRoutersRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 16: mantrae.v1.ListRoutersResponse.routers:type_name -> mantrae.v1.Router
|
||||
1, // 17: mantrae.v1.RouterService.GetRouter:input_type -> mantrae.v1.GetRouterRequest
|
||||
3, // 18: mantrae.v1.RouterService.CreateRouter:input_type -> mantrae.v1.CreateRouterRequest
|
||||
5, // 19: mantrae.v1.RouterService.UpdateRouter:input_type -> mantrae.v1.UpdateRouterRequest
|
||||
7, // 20: mantrae.v1.RouterService.DeleteRouter:input_type -> mantrae.v1.DeleteRouterRequest
|
||||
9, // 21: mantrae.v1.RouterService.ListRouters:input_type -> mantrae.v1.ListRoutersRequest
|
||||
2, // 22: mantrae.v1.RouterService.GetRouter:output_type -> mantrae.v1.GetRouterResponse
|
||||
4, // 23: mantrae.v1.RouterService.CreateRouter:output_type -> mantrae.v1.CreateRouterResponse
|
||||
6, // 24: mantrae.v1.RouterService.UpdateRouter:output_type -> mantrae.v1.UpdateRouterResponse
|
||||
8, // 25: mantrae.v1.RouterService.DeleteRouter:output_type -> mantrae.v1.DeleteRouterResponse
|
||||
10, // 26: mantrae.v1.RouterService.ListRouters:output_type -> mantrae.v1.ListRoutersResponse
|
||||
22, // [22:27] is the sub-list for method output_type
|
||||
17, // [17:22] is the sub-list for method input_type
|
||||
17, // [17:17] is the sub-list for extension type_name
|
||||
@@ -914,6 +855,7 @@ func file_mantrae_v1_router_proto_init() {
|
||||
return
|
||||
}
|
||||
file_mantrae_v1_dns_provider_proto_init()
|
||||
file_mantrae_v1_protocol_proto_init()
|
||||
file_mantrae_v1_router_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
file_mantrae_v1_router_proto_msgTypes[9].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
@@ -921,14 +863,13 @@ func file_mantrae_v1_router_proto_init() {
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_router_proto_rawDesc), len(file_mantrae_v1_router_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_router_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_router_proto_depIdxs,
|
||||
EnumInfos: file_mantrae_v1_router_proto_enumTypes,
|
||||
MessageInfos: file_mantrae_v1_router_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_router_proto = out.File
|
||||
|
||||
@@ -24,55 +24,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ServersTransportType int32
|
||||
|
||||
const (
|
||||
ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED ServersTransportType = 0
|
||||
ServersTransportType_SERVERS_TRANSPORT_TYPE_HTTP ServersTransportType = 1
|
||||
ServersTransportType_SERVERS_TRANSPORT_TYPE_TCP ServersTransportType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for ServersTransportType.
|
||||
var (
|
||||
ServersTransportType_name = map[int32]string{
|
||||
0: "SERVERS_TRANSPORT_TYPE_UNSPECIFIED",
|
||||
1: "SERVERS_TRANSPORT_TYPE_HTTP",
|
||||
2: "SERVERS_TRANSPORT_TYPE_TCP",
|
||||
}
|
||||
ServersTransportType_value = map[string]int32{
|
||||
"SERVERS_TRANSPORT_TYPE_UNSPECIFIED": 0,
|
||||
"SERVERS_TRANSPORT_TYPE_HTTP": 1,
|
||||
"SERVERS_TRANSPORT_TYPE_TCP": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ServersTransportType) Enum() *ServersTransportType {
|
||||
p := new(ServersTransportType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ServersTransportType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ServersTransportType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_mantrae_v1_servers_transport_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ServersTransportType) Type() protoreflect.EnumType {
|
||||
return &file_mantrae_v1_servers_transport_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ServersTransportType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServersTransportType.Descriptor instead.
|
||||
func (ServersTransportType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_servers_transport_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type ServersTransport struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
@@ -81,7 +32,7 @@ type ServersTransport struct {
|
||||
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,6,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Type ServersTransportType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -160,11 +111,11 @@ func (x *ServersTransport) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ServersTransport) GetType() ServersTransportType {
|
||||
func (x *ServersTransport) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ServersTransport) GetCreatedAt() *timestamppb.Timestamp {
|
||||
@@ -184,7 +135,7 @@ func (x *ServersTransport) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
type GetServersTransportRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type ServersTransportType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -226,11 +177,11 @@ func (x *GetServersTransportRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetServersTransportRequest) GetType() ServersTransportType {
|
||||
func (x *GetServersTransportRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type GetServersTransportResponse struct {
|
||||
@@ -284,7 +235,7 @@ type CreateServersTransportRequest struct {
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Type ServersTransportType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -354,11 +305,11 @@ func (x *CreateServersTransportRequest) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *CreateServersTransportRequest) GetType() ServersTransportType {
|
||||
func (x *CreateServersTransportRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type CreateServersTransportResponse struct {
|
||||
@@ -409,9 +360,9 @@ type UpdateServersTransportRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
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 *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Type ServersTransportType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType" json:"type,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -474,11 +425,11 @@ func (x *UpdateServersTransportRequest) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *UpdateServersTransportRequest) GetType() ServersTransportType {
|
||||
func (x *UpdateServersTransportRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type UpdateServersTransportResponse struct {
|
||||
@@ -528,7 +479,7 @@ func (x *UpdateServersTransportResponse) GetServersTransport() *ServersTransport
|
||||
type DeleteServersTransportRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type ServersTransportType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -570,11 +521,11 @@ func (x *DeleteServersTransportRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DeleteServersTransportRequest) GetType() ServersTransportType {
|
||||
func (x *DeleteServersTransportRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type DeleteServersTransportResponse struct {
|
||||
@@ -617,7 +568,7 @@ type ListServersTransportsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
AgentId *string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3,oneof" json:"agent_id,omitempty"`
|
||||
Type *ServersTransportType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ServersTransportType,oneof" json:"type,omitempty"`
|
||||
Type *ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType,oneof" json:"type,omitempty"`
|
||||
Limit *int64 `protobuf:"varint,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
|
||||
Offset *int64 `protobuf:"varint,5,opt,name=offset,proto3,oneof" json:"offset,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -668,11 +619,11 @@ func (x *ListServersTransportsRequest) GetAgentId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListServersTransportsRequest) GetType() ServersTransportType {
|
||||
func (x *ListServersTransportsRequest) GetType() ProtocolType {
|
||||
if x != nil && x.Type != nil {
|
||||
return *x.Type
|
||||
}
|
||||
return ServersTransportType_SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ListServersTransportsRequest) GetLimit() int64 {
|
||||
@@ -746,7 +697,7 @@ var File_mantrae_v1_servers_transport_proto protoreflect.FileDescriptor
|
||||
const file_mantrae_v1_servers_transport_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\"mantrae/v1/servers_transport.proto\x12\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\x02\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19mantrae/v1/protocol.proto\"\xdf\x02\n" +
|
||||
"\x10ServersTransport\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
|
||||
"\n" +
|
||||
@@ -754,45 +705,45 @@ const file_mantrae_v1_servers_transport_proto_rawDesc = "" +
|
||||
"\bagent_id\x18\x03 \x01(\tR\aagentId\x12\x12\n" +
|
||||
"\x04name\x18\x04 \x01(\tR\x04name\x12/\n" +
|
||||
"\x06config\x18\x05 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x06 \x01(\bR\aenabled\x124\n" +
|
||||
"\x04type\x18\a \x01(\x0e2 .mantrae.v1.ServersTransportTypeR\x04type\x129\n" +
|
||||
"\aenabled\x18\x06 \x01(\bR\aenabled\x12,\n" +
|
||||
"\x04type\x18\a \x01(\x0e2\x18.mantrae.v1.ProtocolTypeR\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\"u\n" +
|
||||
"updated_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"m\n" +
|
||||
"\x1aGetServersTransportRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12>\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2 .mantrae.v1.ServersTransportTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"h\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"h\n" +
|
||||
"\x1bGetServersTransportResponse\x12I\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"\x9c\x02\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"\x94\x02\n" +
|
||||
"\x1dCreateServersTransportRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12\x1e\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tH\x00R\aagentId\x88\x01\x01\x12\x1b\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x12>\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2 .mantrae.v1.ServersTransportTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x126\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\t_agent_id\"k\n" +
|
||||
"\x1eCreateServersTransportResponse\x12I\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"\xe0\x01\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"\xd8\x01\n" +
|
||||
"\x1dUpdateServersTransportRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12\x1b\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x12>\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2 .mantrae.v1.ServersTransportTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"k\n" +
|
||||
"\x06config\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x04 \x01(\bR\aenabled\x126\n" +
|
||||
"\x04type\x18\x05 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"k\n" +
|
||||
"\x1eUpdateServersTransportResponse\x12I\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"x\n" +
|
||||
"\x11servers_transport\x18\x01 \x01(\v2\x1c.mantrae.v1.ServersTransportR\x10serversTransport\"p\n" +
|
||||
"\x1dDeleteServersTransportRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12>\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2 .mantrae.v1.ServersTransportTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\" \n" +
|
||||
"\x1eDeleteServersTransportResponse\"\xee\x02\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\" \n" +
|
||||
"\x1eDeleteServersTransportResponse\"\xe6\x02\n" +
|
||||
"\x1cListServersTransportsRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12'\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x129\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2 .mantrae.v1.ServersTransportTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x121\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\x05limit\x18\x04 \x01(\x03BV\xbaHS\xba\x01P\n" +
|
||||
"\vlimit.valid\x12)limit must be either -1 or greater than 0\x1a\x16this == -1 || this > 0H\x02R\x05limit\x88\x01\x01\x12$\n" +
|
||||
"\x06offset\x18\x05 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x03R\x06offset\x88\x01\x01B\v\n" +
|
||||
@@ -803,11 +754,7 @@ const file_mantrae_v1_servers_transport_proto_rawDesc = "" +
|
||||
"\x1dListServersTransportsResponse\x12K\n" +
|
||||
"\x12servers_transports\x18\x01 \x03(\v2\x1c.mantrae.v1.ServersTransportR\x11serversTransports\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x03R\n" +
|
||||
"totalCount*\x7f\n" +
|
||||
"\x14ServersTransportType\x12&\n" +
|
||||
"\"SERVERS_TRANSPORT_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n" +
|
||||
"\x1bSERVERS_TRANSPORT_TYPE_HTTP\x10\x01\x12\x1e\n" +
|
||||
"\x1aSERVERS_TRANSPORT_TYPE_TCP\x10\x022\xcc\x04\n" +
|
||||
"totalCount2\xcc\x04\n" +
|
||||
"\x17ServersTransportService\x12k\n" +
|
||||
"\x13GetServersTransport\x12&.mantrae.v1.GetServersTransportRequest\x1a'.mantrae.v1.GetServersTransportResponse\"\x03\x90\x02\x01\x12o\n" +
|
||||
"\x16CreateServersTransport\x12).mantrae.v1.CreateServersTransportRequest\x1a*.mantrae.v1.CreateServersTransportResponse\x12o\n" +
|
||||
@@ -830,50 +777,49 @@ func file_mantrae_v1_servers_transport_proto_rawDescGZIP() []byte {
|
||||
return file_mantrae_v1_servers_transport_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_servers_transport_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_mantrae_v1_servers_transport_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_mantrae_v1_servers_transport_proto_goTypes = []any{
|
||||
(ServersTransportType)(0), // 0: mantrae.v1.ServersTransportType
|
||||
(*ServersTransport)(nil), // 1: mantrae.v1.ServersTransport
|
||||
(*GetServersTransportRequest)(nil), // 2: mantrae.v1.GetServersTransportRequest
|
||||
(*GetServersTransportResponse)(nil), // 3: mantrae.v1.GetServersTransportResponse
|
||||
(*CreateServersTransportRequest)(nil), // 4: mantrae.v1.CreateServersTransportRequest
|
||||
(*CreateServersTransportResponse)(nil), // 5: mantrae.v1.CreateServersTransportResponse
|
||||
(*UpdateServersTransportRequest)(nil), // 6: mantrae.v1.UpdateServersTransportRequest
|
||||
(*UpdateServersTransportResponse)(nil), // 7: mantrae.v1.UpdateServersTransportResponse
|
||||
(*DeleteServersTransportRequest)(nil), // 8: mantrae.v1.DeleteServersTransportRequest
|
||||
(*DeleteServersTransportResponse)(nil), // 9: mantrae.v1.DeleteServersTransportResponse
|
||||
(*ListServersTransportsRequest)(nil), // 10: mantrae.v1.ListServersTransportsRequest
|
||||
(*ListServersTransportsResponse)(nil), // 11: mantrae.v1.ListServersTransportsResponse
|
||||
(*structpb.Struct)(nil), // 12: google.protobuf.Struct
|
||||
(*ServersTransport)(nil), // 0: mantrae.v1.ServersTransport
|
||||
(*GetServersTransportRequest)(nil), // 1: mantrae.v1.GetServersTransportRequest
|
||||
(*GetServersTransportResponse)(nil), // 2: mantrae.v1.GetServersTransportResponse
|
||||
(*CreateServersTransportRequest)(nil), // 3: mantrae.v1.CreateServersTransportRequest
|
||||
(*CreateServersTransportResponse)(nil), // 4: mantrae.v1.CreateServersTransportResponse
|
||||
(*UpdateServersTransportRequest)(nil), // 5: mantrae.v1.UpdateServersTransportRequest
|
||||
(*UpdateServersTransportResponse)(nil), // 6: mantrae.v1.UpdateServersTransportResponse
|
||||
(*DeleteServersTransportRequest)(nil), // 7: mantrae.v1.DeleteServersTransportRequest
|
||||
(*DeleteServersTransportResponse)(nil), // 8: mantrae.v1.DeleteServersTransportResponse
|
||||
(*ListServersTransportsRequest)(nil), // 9: mantrae.v1.ListServersTransportsRequest
|
||||
(*ListServersTransportsResponse)(nil), // 10: mantrae.v1.ListServersTransportsResponse
|
||||
(*structpb.Struct)(nil), // 11: google.protobuf.Struct
|
||||
(ProtocolType)(0), // 12: mantrae.v1.ProtocolType
|
||||
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
|
||||
}
|
||||
var file_mantrae_v1_servers_transport_proto_depIdxs = []int32{
|
||||
12, // 0: mantrae.v1.ServersTransport.config:type_name -> google.protobuf.Struct
|
||||
0, // 1: mantrae.v1.ServersTransport.type:type_name -> mantrae.v1.ServersTransportType
|
||||
11, // 0: mantrae.v1.ServersTransport.config:type_name -> google.protobuf.Struct
|
||||
12, // 1: mantrae.v1.ServersTransport.type:type_name -> mantrae.v1.ProtocolType
|
||||
13, // 2: mantrae.v1.ServersTransport.created_at:type_name -> google.protobuf.Timestamp
|
||||
13, // 3: mantrae.v1.ServersTransport.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 4: mantrae.v1.GetServersTransportRequest.type:type_name -> mantrae.v1.ServersTransportType
|
||||
1, // 5: mantrae.v1.GetServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
12, // 6: mantrae.v1.CreateServersTransportRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 7: mantrae.v1.CreateServersTransportRequest.type:type_name -> mantrae.v1.ServersTransportType
|
||||
1, // 8: mantrae.v1.CreateServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
12, // 9: mantrae.v1.UpdateServersTransportRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 10: mantrae.v1.UpdateServersTransportRequest.type:type_name -> mantrae.v1.ServersTransportType
|
||||
1, // 11: mantrae.v1.UpdateServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
0, // 12: mantrae.v1.DeleteServersTransportRequest.type:type_name -> mantrae.v1.ServersTransportType
|
||||
0, // 13: mantrae.v1.ListServersTransportsRequest.type:type_name -> mantrae.v1.ServersTransportType
|
||||
1, // 14: mantrae.v1.ListServersTransportsResponse.servers_transports:type_name -> mantrae.v1.ServersTransport
|
||||
2, // 15: mantrae.v1.ServersTransportService.GetServersTransport:input_type -> mantrae.v1.GetServersTransportRequest
|
||||
4, // 16: mantrae.v1.ServersTransportService.CreateServersTransport:input_type -> mantrae.v1.CreateServersTransportRequest
|
||||
6, // 17: mantrae.v1.ServersTransportService.UpdateServersTransport:input_type -> mantrae.v1.UpdateServersTransportRequest
|
||||
8, // 18: mantrae.v1.ServersTransportService.DeleteServersTransport:input_type -> mantrae.v1.DeleteServersTransportRequest
|
||||
10, // 19: mantrae.v1.ServersTransportService.ListServersTransports:input_type -> mantrae.v1.ListServersTransportsRequest
|
||||
3, // 20: mantrae.v1.ServersTransportService.GetServersTransport:output_type -> mantrae.v1.GetServersTransportResponse
|
||||
5, // 21: mantrae.v1.ServersTransportService.CreateServersTransport:output_type -> mantrae.v1.CreateServersTransportResponse
|
||||
7, // 22: mantrae.v1.ServersTransportService.UpdateServersTransport:output_type -> mantrae.v1.UpdateServersTransportResponse
|
||||
9, // 23: mantrae.v1.ServersTransportService.DeleteServersTransport:output_type -> mantrae.v1.DeleteServersTransportResponse
|
||||
11, // 24: mantrae.v1.ServersTransportService.ListServersTransports:output_type -> mantrae.v1.ListServersTransportsResponse
|
||||
12, // 4: mantrae.v1.GetServersTransportRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 5: mantrae.v1.GetServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
11, // 6: mantrae.v1.CreateServersTransportRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 7: mantrae.v1.CreateServersTransportRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 8: mantrae.v1.CreateServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
11, // 9: mantrae.v1.UpdateServersTransportRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 10: mantrae.v1.UpdateServersTransportRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 11: mantrae.v1.UpdateServersTransportResponse.servers_transport:type_name -> mantrae.v1.ServersTransport
|
||||
12, // 12: mantrae.v1.DeleteServersTransportRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
12, // 13: mantrae.v1.ListServersTransportsRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 14: mantrae.v1.ListServersTransportsResponse.servers_transports:type_name -> mantrae.v1.ServersTransport
|
||||
1, // 15: mantrae.v1.ServersTransportService.GetServersTransport:input_type -> mantrae.v1.GetServersTransportRequest
|
||||
3, // 16: mantrae.v1.ServersTransportService.CreateServersTransport:input_type -> mantrae.v1.CreateServersTransportRequest
|
||||
5, // 17: mantrae.v1.ServersTransportService.UpdateServersTransport:input_type -> mantrae.v1.UpdateServersTransportRequest
|
||||
7, // 18: mantrae.v1.ServersTransportService.DeleteServersTransport:input_type -> mantrae.v1.DeleteServersTransportRequest
|
||||
9, // 19: mantrae.v1.ServersTransportService.ListServersTransports:input_type -> mantrae.v1.ListServersTransportsRequest
|
||||
2, // 20: mantrae.v1.ServersTransportService.GetServersTransport:output_type -> mantrae.v1.GetServersTransportResponse
|
||||
4, // 21: mantrae.v1.ServersTransportService.CreateServersTransport:output_type -> mantrae.v1.CreateServersTransportResponse
|
||||
6, // 22: mantrae.v1.ServersTransportService.UpdateServersTransport:output_type -> mantrae.v1.UpdateServersTransportResponse
|
||||
8, // 23: mantrae.v1.ServersTransportService.DeleteServersTransport:output_type -> mantrae.v1.DeleteServersTransportResponse
|
||||
10, // 24: mantrae.v1.ServersTransportService.ListServersTransports:output_type -> mantrae.v1.ListServersTransportsResponse
|
||||
20, // [20:25] is the sub-list for method output_type
|
||||
15, // [15:20] is the sub-list for method input_type
|
||||
15, // [15:15] is the sub-list for extension type_name
|
||||
@@ -886,6 +832,7 @@ func file_mantrae_v1_servers_transport_proto_init() {
|
||||
if File_mantrae_v1_servers_transport_proto != nil {
|
||||
return
|
||||
}
|
||||
file_mantrae_v1_protocol_proto_init()
|
||||
file_mantrae_v1_servers_transport_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
file_mantrae_v1_servers_transport_proto_msgTypes[9].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
@@ -893,14 +840,13 @@ func file_mantrae_v1_servers_transport_proto_init() {
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_servers_transport_proto_rawDesc), len(file_mantrae_v1_servers_transport_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_servers_transport_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_servers_transport_proto_depIdxs,
|
||||
EnumInfos: file_mantrae_v1_servers_transport_proto_enumTypes,
|
||||
MessageInfos: file_mantrae_v1_servers_transport_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_servers_transport_proto = out.File
|
||||
|
||||
@@ -24,58 +24,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ServiceType int32
|
||||
|
||||
const (
|
||||
ServiceType_SERVICE_TYPE_UNSPECIFIED ServiceType = 0
|
||||
ServiceType_SERVICE_TYPE_HTTP ServiceType = 1
|
||||
ServiceType_SERVICE_TYPE_TCP ServiceType = 2
|
||||
ServiceType_SERVICE_TYPE_UDP ServiceType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for ServiceType.
|
||||
var (
|
||||
ServiceType_name = map[int32]string{
|
||||
0: "SERVICE_TYPE_UNSPECIFIED",
|
||||
1: "SERVICE_TYPE_HTTP",
|
||||
2: "SERVICE_TYPE_TCP",
|
||||
3: "SERVICE_TYPE_UDP",
|
||||
}
|
||||
ServiceType_value = map[string]int32{
|
||||
"SERVICE_TYPE_UNSPECIFIED": 0,
|
||||
"SERVICE_TYPE_HTTP": 1,
|
||||
"SERVICE_TYPE_TCP": 2,
|
||||
"SERVICE_TYPE_UDP": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ServiceType) Enum() *ServiceType {
|
||||
p := new(ServiceType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ServiceType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ServiceType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_mantrae_v1_service_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ServiceType) Type() protoreflect.EnumType {
|
||||
return &file_mantrae_v1_service_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ServiceType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServiceType.Descriptor instead.
|
||||
func (ServiceType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
@@ -84,7 +32,7 @@ type Service struct {
|
||||
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,6,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Type ServiceType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,7,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -163,11 +111,11 @@ func (x *Service) GetConfig() *structpb.Struct {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Service) GetType() ServiceType {
|
||||
func (x *Service) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Service) GetCreatedAt() *timestamppb.Timestamp {
|
||||
@@ -185,9 +133,14 @@ func (x *Service) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
}
|
||||
|
||||
type GetServiceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type ServiceType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"`
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
// Types that are valid to be assigned to Identifier:
|
||||
//
|
||||
// *GetServiceRequest_Id
|
||||
// *GetServiceRequest_Name
|
||||
Identifier isGetServiceRequest_Identifier `protobuf_oneof:"identifier"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -222,20 +175,61 @@ func (*GetServiceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetId() int64 {
|
||||
func (x *GetServiceRequest) GetProfileId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
return x.ProfileId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetType() ServiceType {
|
||||
func (x *GetServiceRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetIdentifier() isGetServiceRequest_Identifier {
|
||||
if x != nil {
|
||||
return x.Identifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
if x, ok := x.Identifier.(*GetServiceRequest_Id); ok {
|
||||
return x.Id
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetName() string {
|
||||
if x != nil {
|
||||
if x, ok := x.Identifier.(*GetServiceRequest_Name); ok {
|
||||
return x.Name
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isGetServiceRequest_Identifier interface {
|
||||
isGetServiceRequest_Identifier()
|
||||
}
|
||||
|
||||
type GetServiceRequest_Id struct {
|
||||
Id int64 `protobuf:"varint,3,opt,name=id,proto3,oneof"`
|
||||
}
|
||||
|
||||
type GetServiceRequest_Name struct {
|
||||
Name string `protobuf:"bytes,4,opt,name=name,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*GetServiceRequest_Id) isGetServiceRequest_Identifier() {}
|
||||
|
||||
func (*GetServiceRequest_Name) isGetServiceRequest_Identifier() {}
|
||||
|
||||
type GetServiceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
|
||||
@@ -287,7 +281,7 @@ type CreateServiceRequest struct {
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Type ServiceType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,6,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -357,11 +351,11 @@ func (x *CreateServiceRequest) GetEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *CreateServiceRequest) GetType() ServiceType {
|
||||
func (x *CreateServiceRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type CreateServiceResponse struct {
|
||||
@@ -414,7 +408,7 @@ type UpdateServiceRequest struct {
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
Config *structpb.Struct `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"`
|
||||
Type ProtocolType `protobuf:"varint,5,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -477,11 +471,11 @@ func (x *UpdateServiceRequest) GetConfig() *structpb.Struct {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UpdateServiceRequest) GetType() ServiceType {
|
||||
func (x *UpdateServiceRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type UpdateServiceResponse struct {
|
||||
@@ -531,7 +525,7 @@ func (x *UpdateServiceResponse) GetService() *Service {
|
||||
type DeleteServiceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type ServiceType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"`
|
||||
Type ProtocolType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ProtocolType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -573,11 +567,11 @@ func (x *DeleteServiceRequest) GetId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DeleteServiceRequest) GetType() ServiceType {
|
||||
func (x *DeleteServiceRequest) GetType() ProtocolType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type DeleteServiceResponse struct {
|
||||
@@ -620,7 +614,7 @@ type ListServicesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ProfileId int64 `protobuf:"varint,1,opt,name=profile_id,json=profileId,proto3" json:"profile_id,omitempty"`
|
||||
AgentId *string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3,oneof" json:"agent_id,omitempty"`
|
||||
Type *ServiceType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ServiceType,oneof" json:"type,omitempty"`
|
||||
Type *ProtocolType `protobuf:"varint,3,opt,name=type,proto3,enum=mantrae.v1.ProtocolType,oneof" json:"type,omitempty"`
|
||||
Limit *int64 `protobuf:"varint,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
|
||||
Offset *int64 `protobuf:"varint,5,opt,name=offset,proto3,oneof" json:"offset,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -671,11 +665,11 @@ func (x *ListServicesRequest) GetAgentId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) GetType() ServiceType {
|
||||
func (x *ListServicesRequest) GetType() ProtocolType {
|
||||
if x != nil && x.Type != nil {
|
||||
return *x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
return ProtocolType_PROTOCOL_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) GetLimit() int64 {
|
||||
@@ -744,108 +738,12 @@ func (x *ListServicesResponse) GetTotalCount() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetServiceByRouterRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Type ServiceType `protobuf:"varint,2,opt,name=type,proto3,enum=mantrae.v1.ServiceType" json:"type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterRequest) Reset() {
|
||||
*x = GetServiceByRouterRequest{}
|
||||
mi := &file_mantrae_v1_service_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetServiceByRouterRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetServiceByRouterRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_service_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 GetServiceByRouterRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetServiceByRouterRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_service_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterRequest) GetType() ServiceType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ServiceType_SERVICE_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type GetServiceByRouterResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterResponse) Reset() {
|
||||
*x = GetServiceByRouterResponse{}
|
||||
mi := &file_mantrae_v1_service_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetServiceByRouterResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetServiceByRouterResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_service_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 GetServiceByRouterResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetServiceByRouterResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_service_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *GetServiceByRouterResponse) GetService() *Service {
|
||||
if x != nil {
|
||||
return x.Service
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
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\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd5\x02\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19mantrae/v1/protocol.proto\"\xd6\x02\n" +
|
||||
"\aService\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
|
||||
"\n" +
|
||||
@@ -853,45 +751,50 @@ const file_mantrae_v1_service_proto_rawDesc = "" +
|
||||
"\bagent_id\x18\x03 \x01(\tR\aagentId\x12\x12\n" +
|
||||
"\x04name\x18\x04 \x01(\tR\x04name\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x12/\n" +
|
||||
"\x06config\x18\x06 \x01(\v2\x17.google.protobuf.StructR\x06config\x12+\n" +
|
||||
"\x04type\x18\a \x01(\x0e2\x17.mantrae.v1.ServiceTypeR\x04type\x129\n" +
|
||||
"\x06config\x18\x06 \x01(\v2\x17.google.protobuf.StructR\x06config\x12,\n" +
|
||||
"\x04type\x18\a \x01(\x0e2\x18.mantrae.v1.ProtocolTypeR\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\"c\n" +
|
||||
"\x11GetServiceRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x125\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x17.mantrae.v1.ServiceTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"C\n" +
|
||||
"updated_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xc2\x01\n" +
|
||||
"\x11GetServiceRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x19\n" +
|
||||
"\x02id\x18\x03 \x01(\x03B\a\xbaH\x04\"\x02 \x00H\x00R\x02id\x12\x1d\n" +
|
||||
"\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\x04nameB\x13\n" +
|
||||
"\n" +
|
||||
"identifier\x12\x05\xbaH\x02\b\x01\"C\n" +
|
||||
"\x12GetServiceResponse\x12-\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\x8a\x02\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\x8b\x02\n" +
|
||||
"\x14CreateServiceRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12\x1e\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tH\x00R\aagentId\x88\x01\x01\x12\x1b\n" +
|
||||
"\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x12\x18\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x125\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2\x17.mantrae.v1.ServiceTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\aenabled\x18\x05 \x01(\bR\aenabled\x126\n" +
|
||||
"\x04type\x18\x06 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04typeB\v\n" +
|
||||
"\t_agent_id\"F\n" +
|
||||
"\x15CreateServiceResponse\x12-\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\xce\x01\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"\xcf\x01\n" +
|
||||
"\x14UpdateServiceRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x12\x1b\n" +
|
||||
"\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x18\n" +
|
||||
"\aenabled\x18\x03 \x01(\bR\aenabled\x12/\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x125\n" +
|
||||
"\x04type\x18\x05 \x01(\x0e2\x17.mantrae.v1.ServiceTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"F\n" +
|
||||
"\x06config\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06config\x126\n" +
|
||||
"\x04type\x18\x05 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"F\n" +
|
||||
"\x15UpdateServiceResponse\x12-\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"f\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice\"g\n" +
|
||||
"\x14DeleteServiceRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x125\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x17.mantrae.v1.ServiceTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x17\n" +
|
||||
"\x15DeleteServiceResponse\"\xdc\x02\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\x126\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"\x17\n" +
|
||||
"\x15DeleteServiceResponse\"\xdd\x02\n" +
|
||||
"\x13ListServicesRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12'\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x120\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x17.mantrae.v1.ServiceTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\bagent_id\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01H\x00R\aagentId\x88\x01\x01\x121\n" +
|
||||
"\x04type\x18\x03 \x01(\x0e2\x18.mantrae.v1.ProtocolTypeH\x01R\x04type\x88\x01\x01\x12q\n" +
|
||||
"\x05limit\x18\x04 \x01(\x03BV\xbaHS\xba\x01P\n" +
|
||||
"\vlimit.valid\x12)limit must be either -1 or greater than 0\x1a\x16this == -1 || this > 0H\x02R\x05limit\x88\x01\x01\x12$\n" +
|
||||
"\x06offset\x18\x05 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x03R\x06offset\x88\x01\x01B\v\n" +
|
||||
@@ -902,25 +805,14 @@ const file_mantrae_v1_service_proto_rawDesc = "" +
|
||||
"\x14ListServicesResponse\x12/\n" +
|
||||
"\bservices\x18\x01 \x03(\v2\x13.mantrae.v1.ServiceR\bservices\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x03R\n" +
|
||||
"totalCount\"o\n" +
|
||||
"\x19GetServiceByRouterRequest\x12\x1b\n" +
|
||||
"\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x125\n" +
|
||||
"\x04type\x18\x02 \x01(\x0e2\x17.mantrae.v1.ServiceTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\"K\n" +
|
||||
"\x1aGetServiceByRouterResponse\x12-\n" +
|
||||
"\aservice\x18\x01 \x01(\v2\x13.mantrae.v1.ServiceR\aservice*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\xa6\x04\n" +
|
||||
"totalCount2\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\x01\x12h\n" +
|
||||
"\x12GetServiceByRouter\x12%.mantrae.v1.GetServiceByRouterRequest\x1a&.mantrae.v1.GetServiceByRouterResponse\"\x03\x90\x02\x01B\xa6\x01\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"
|
||||
@@ -937,61 +829,54 @@ func file_mantrae_v1_service_proto_rawDescGZIP() []byte {
|
||||
return file_mantrae_v1_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_mantrae_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||
var file_mantrae_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_mantrae_v1_service_proto_goTypes = []any{
|
||||
(ServiceType)(0), // 0: mantrae.v1.ServiceType
|
||||
(*Service)(nil), // 1: mantrae.v1.Service
|
||||
(*GetServiceRequest)(nil), // 2: mantrae.v1.GetServiceRequest
|
||||
(*GetServiceResponse)(nil), // 3: mantrae.v1.GetServiceResponse
|
||||
(*CreateServiceRequest)(nil), // 4: mantrae.v1.CreateServiceRequest
|
||||
(*CreateServiceResponse)(nil), // 5: mantrae.v1.CreateServiceResponse
|
||||
(*UpdateServiceRequest)(nil), // 6: mantrae.v1.UpdateServiceRequest
|
||||
(*UpdateServiceResponse)(nil), // 7: mantrae.v1.UpdateServiceResponse
|
||||
(*DeleteServiceRequest)(nil), // 8: mantrae.v1.DeleteServiceRequest
|
||||
(*DeleteServiceResponse)(nil), // 9: mantrae.v1.DeleteServiceResponse
|
||||
(*ListServicesRequest)(nil), // 10: mantrae.v1.ListServicesRequest
|
||||
(*ListServicesResponse)(nil), // 11: mantrae.v1.ListServicesResponse
|
||||
(*GetServiceByRouterRequest)(nil), // 12: mantrae.v1.GetServiceByRouterRequest
|
||||
(*GetServiceByRouterResponse)(nil), // 13: mantrae.v1.GetServiceByRouterResponse
|
||||
(*structpb.Struct)(nil), // 14: google.protobuf.Struct
|
||||
(*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp
|
||||
(*Service)(nil), // 0: mantrae.v1.Service
|
||||
(*GetServiceRequest)(nil), // 1: mantrae.v1.GetServiceRequest
|
||||
(*GetServiceResponse)(nil), // 2: mantrae.v1.GetServiceResponse
|
||||
(*CreateServiceRequest)(nil), // 3: mantrae.v1.CreateServiceRequest
|
||||
(*CreateServiceResponse)(nil), // 4: mantrae.v1.CreateServiceResponse
|
||||
(*UpdateServiceRequest)(nil), // 5: mantrae.v1.UpdateServiceRequest
|
||||
(*UpdateServiceResponse)(nil), // 6: mantrae.v1.UpdateServiceResponse
|
||||
(*DeleteServiceRequest)(nil), // 7: mantrae.v1.DeleteServiceRequest
|
||||
(*DeleteServiceResponse)(nil), // 8: mantrae.v1.DeleteServiceResponse
|
||||
(*ListServicesRequest)(nil), // 9: mantrae.v1.ListServicesRequest
|
||||
(*ListServicesResponse)(nil), // 10: mantrae.v1.ListServicesResponse
|
||||
(*structpb.Struct)(nil), // 11: google.protobuf.Struct
|
||||
(ProtocolType)(0), // 12: mantrae.v1.ProtocolType
|
||||
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
|
||||
}
|
||||
var file_mantrae_v1_service_proto_depIdxs = []int32{
|
||||
14, // 0: mantrae.v1.Service.config:type_name -> google.protobuf.Struct
|
||||
0, // 1: mantrae.v1.Service.type:type_name -> mantrae.v1.ServiceType
|
||||
15, // 2: mantrae.v1.Service.created_at:type_name -> google.protobuf.Timestamp
|
||||
15, // 3: mantrae.v1.Service.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 4: mantrae.v1.GetServiceRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
1, // 5: mantrae.v1.GetServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
14, // 6: mantrae.v1.CreateServiceRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 7: mantrae.v1.CreateServiceRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
1, // 8: mantrae.v1.CreateServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
14, // 9: mantrae.v1.UpdateServiceRequest.config:type_name -> google.protobuf.Struct
|
||||
0, // 10: mantrae.v1.UpdateServiceRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
1, // 11: mantrae.v1.UpdateServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
0, // 12: mantrae.v1.DeleteServiceRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
0, // 13: mantrae.v1.ListServicesRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
1, // 14: mantrae.v1.ListServicesResponse.services:type_name -> mantrae.v1.Service
|
||||
0, // 15: mantrae.v1.GetServiceByRouterRequest.type:type_name -> mantrae.v1.ServiceType
|
||||
1, // 16: mantrae.v1.GetServiceByRouterResponse.service:type_name -> mantrae.v1.Service
|
||||
2, // 17: mantrae.v1.ServiceService.GetService:input_type -> mantrae.v1.GetServiceRequest
|
||||
4, // 18: mantrae.v1.ServiceService.CreateService:input_type -> mantrae.v1.CreateServiceRequest
|
||||
6, // 19: mantrae.v1.ServiceService.UpdateService:input_type -> mantrae.v1.UpdateServiceRequest
|
||||
8, // 20: mantrae.v1.ServiceService.DeleteService:input_type -> mantrae.v1.DeleteServiceRequest
|
||||
10, // 21: mantrae.v1.ServiceService.ListServices:input_type -> mantrae.v1.ListServicesRequest
|
||||
12, // 22: mantrae.v1.ServiceService.GetServiceByRouter:input_type -> mantrae.v1.GetServiceByRouterRequest
|
||||
3, // 23: mantrae.v1.ServiceService.GetService:output_type -> mantrae.v1.GetServiceResponse
|
||||
5, // 24: mantrae.v1.ServiceService.CreateService:output_type -> mantrae.v1.CreateServiceResponse
|
||||
7, // 25: mantrae.v1.ServiceService.UpdateService:output_type -> mantrae.v1.UpdateServiceResponse
|
||||
9, // 26: mantrae.v1.ServiceService.DeleteService:output_type -> mantrae.v1.DeleteServiceResponse
|
||||
11, // 27: mantrae.v1.ServiceService.ListServices:output_type -> mantrae.v1.ListServicesResponse
|
||||
13, // 28: mantrae.v1.ServiceService.GetServiceByRouter:output_type -> mantrae.v1.GetServiceByRouterResponse
|
||||
23, // [23:29] is the sub-list for method output_type
|
||||
17, // [17:23] is the sub-list for method input_type
|
||||
17, // [17:17] is the sub-list for extension type_name
|
||||
17, // [17:17] is the sub-list for extension extendee
|
||||
0, // [0:17] is the sub-list for field type_name
|
||||
11, // 0: mantrae.v1.Service.config:type_name -> google.protobuf.Struct
|
||||
12, // 1: mantrae.v1.Service.type:type_name -> mantrae.v1.ProtocolType
|
||||
13, // 2: mantrae.v1.Service.created_at:type_name -> google.protobuf.Timestamp
|
||||
13, // 3: mantrae.v1.Service.updated_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 4: mantrae.v1.GetServiceRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 5: mantrae.v1.GetServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
11, // 6: mantrae.v1.CreateServiceRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 7: mantrae.v1.CreateServiceRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 8: mantrae.v1.CreateServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
11, // 9: mantrae.v1.UpdateServiceRequest.config:type_name -> google.protobuf.Struct
|
||||
12, // 10: mantrae.v1.UpdateServiceRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 11: mantrae.v1.UpdateServiceResponse.service:type_name -> mantrae.v1.Service
|
||||
12, // 12: mantrae.v1.DeleteServiceRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
12, // 13: mantrae.v1.ListServicesRequest.type:type_name -> mantrae.v1.ProtocolType
|
||||
0, // 14: mantrae.v1.ListServicesResponse.services:type_name -> mantrae.v1.Service
|
||||
1, // 15: mantrae.v1.ServiceService.GetService:input_type -> mantrae.v1.GetServiceRequest
|
||||
3, // 16: mantrae.v1.ServiceService.CreateService:input_type -> mantrae.v1.CreateServiceRequest
|
||||
5, // 17: mantrae.v1.ServiceService.UpdateService:input_type -> mantrae.v1.UpdateServiceRequest
|
||||
7, // 18: mantrae.v1.ServiceService.DeleteService:input_type -> mantrae.v1.DeleteServiceRequest
|
||||
9, // 19: mantrae.v1.ServiceService.ListServices:input_type -> mantrae.v1.ListServicesRequest
|
||||
2, // 20: mantrae.v1.ServiceService.GetService:output_type -> mantrae.v1.GetServiceResponse
|
||||
4, // 21: mantrae.v1.ServiceService.CreateService:output_type -> mantrae.v1.CreateServiceResponse
|
||||
6, // 22: mantrae.v1.ServiceService.UpdateService:output_type -> mantrae.v1.UpdateServiceResponse
|
||||
8, // 23: mantrae.v1.ServiceService.DeleteService:output_type -> mantrae.v1.DeleteServiceResponse
|
||||
10, // 24: mantrae.v1.ServiceService.ListServices:output_type -> mantrae.v1.ListServicesResponse
|
||||
20, // [20:25] is the sub-list for method output_type
|
||||
15, // [15:20] is the sub-list for method input_type
|
||||
15, // [15:15] is the sub-list for extension type_name
|
||||
15, // [15:15] is the sub-list for extension extendee
|
||||
0, // [0:15] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_mantrae_v1_service_proto_init() }
|
||||
@@ -999,6 +884,11 @@ func file_mantrae_v1_service_proto_init() {
|
||||
if File_mantrae_v1_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_mantrae_v1_protocol_proto_init()
|
||||
file_mantrae_v1_service_proto_msgTypes[1].OneofWrappers = []any{
|
||||
(*GetServiceRequest_Id)(nil),
|
||||
(*GetServiceRequest_Name)(nil),
|
||||
}
|
||||
file_mantrae_v1_service_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
file_mantrae_v1_service_proto_msgTypes[9].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
@@ -1006,14 +896,13 @@ func file_mantrae_v1_service_proto_init() {
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_service_proto_rawDesc), len(file_mantrae_v1_service_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 13,
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_service_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_service_proto_depIdxs,
|
||||
EnumInfos: file_mantrae_v1_service_proto_enumTypes,
|
||||
MessageInfos: file_mantrae_v1_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_service_proto = out.File
|
||||
|
||||
557
proto/gen/mantrae/v1/traefik_instance.pb.go
Normal file
557
proto/gen/mantrae/v1/traefik_instance.pb.go
Normal file
@@ -0,0 +1,557 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc (unknown)
|
||||
// source: mantrae/v1/traefik_instance.proto
|
||||
|
||||
package mantraev1
|
||||
|
||||
import (
|
||||
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
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 TraefikInstance struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
|
||||
Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
|
||||
Tls bool `protobuf:"varint,6,opt,name=tls,proto3" json:"tls,omitempty"`
|
||||
EntryPoints *structpb.Struct `protobuf:"bytes,7,opt,name=entry_points,json=entryPoints,proto3" json:"entry_points,omitempty"`
|
||||
Overview *structpb.Struct `protobuf:"bytes,8,opt,name=overview,proto3" json:"overview,omitempty"`
|
||||
Config *structpb.Struct `protobuf:"bytes,9,opt,name=config,proto3" json:"config,omitempty"`
|
||||
Version *structpb.Struct `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) Reset() {
|
||||
*x = TraefikInstance{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TraefikInstance) ProtoMessage() {}
|
||||
|
||||
func (x *TraefikInstance) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 TraefikInstance.ProtoReflect.Descriptor instead.
|
||||
func (*TraefikInstance) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetUrl() string {
|
||||
if x != nil {
|
||||
return x.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetTls() bool {
|
||||
if x != nil {
|
||||
return x.Tls
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetEntryPoints() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.EntryPoints
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetOverview() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.Overview
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetConfig() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.Config
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetVersion() *structpb.Struct {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TraefikInstance) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetTraefikInstanceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceRequest) Reset() {
|
||||
*x = GetTraefikInstanceRequest{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetTraefikInstanceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetTraefikInstanceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 GetTraefikInstanceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetTraefikInstanceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetTraefikInstanceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TraefikInstance *TraefikInstance `protobuf:"bytes,1,opt,name=traefik_instance,json=traefikInstance,proto3" json:"traefik_instance,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceResponse) Reset() {
|
||||
*x = GetTraefikInstanceResponse{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetTraefikInstanceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetTraefikInstanceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 GetTraefikInstanceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetTraefikInstanceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetTraefikInstanceResponse) GetTraefikInstance() *TraefikInstance {
|
||||
if x != nil {
|
||||
return x.TraefikInstance
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeleteTraefikInstanceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteTraefikInstanceRequest) Reset() {
|
||||
*x = DeleteTraefikInstanceRequest{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteTraefikInstanceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteTraefikInstanceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteTraefikInstanceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 DeleteTraefikInstanceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteTraefikInstanceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *DeleteTraefikInstanceRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DeleteTraefikInstanceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteTraefikInstanceResponse) Reset() {
|
||||
*x = DeleteTraefikInstanceResponse{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteTraefikInstanceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteTraefikInstanceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteTraefikInstanceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 DeleteTraefikInstanceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteTraefikInstanceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type ListTraefikInstancesRequest 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 *ListTraefikInstancesRequest) Reset() {
|
||||
*x = ListTraefikInstancesRequest{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListTraefikInstancesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListTraefikInstancesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 ListTraefikInstancesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListTraefikInstancesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesRequest) GetProfileId() int64 {
|
||||
if x != nil {
|
||||
return x.ProfileId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesRequest) GetLimit() int64 {
|
||||
if x != nil && x.Limit != nil {
|
||||
return *x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesRequest) GetOffset() int64 {
|
||||
if x != nil && x.Offset != nil {
|
||||
return *x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListTraefikInstancesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TraefikInstances []*TraefikInstance `protobuf:"bytes,1,rep,name=traefik_instances,json=traefikInstances,proto3" json:"traefik_instances,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 *ListTraefikInstancesResponse) Reset() {
|
||||
*x = ListTraefikInstancesResponse{}
|
||||
mi := &file_mantrae_v1_traefik_instance_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListTraefikInstancesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListTraefikInstancesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mantrae_v1_traefik_instance_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 ListTraefikInstancesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListTraefikInstancesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesResponse) GetTraefikInstances() []*TraefikInstance {
|
||||
if x != nil {
|
||||
return x.TraefikInstances
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListTraefikInstancesResponse) GetTotalCount() int64 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_mantrae_v1_traefik_instance_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_mantrae_v1_traefik_instance_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"!mantrae/v1/traefik_instance.proto\x12\n" +
|
||||
"mantrae.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x03\n" +
|
||||
"\x0fTraefikInstance\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12\x10\n" +
|
||||
"\x03url\x18\x03 \x01(\tR\x03url\x12\x1a\n" +
|
||||
"\busername\x18\x04 \x01(\tR\busername\x12\x1a\n" +
|
||||
"\bpassword\x18\x05 \x01(\tR\bpassword\x12\x10\n" +
|
||||
"\x03tls\x18\x06 \x01(\bR\x03tls\x12:\n" +
|
||||
"\fentry_points\x18\a \x01(\v2\x17.google.protobuf.StructR\ventryPoints\x123\n" +
|
||||
"\boverview\x18\b \x01(\v2\x17.google.protobuf.StructR\boverview\x12/\n" +
|
||||
"\x06config\x18\t \x01(\v2\x17.google.protobuf.StructR\x06config\x121\n" +
|
||||
"\aversion\x18\n" +
|
||||
" \x01(\v2\x17.google.protobuf.StructR\aversion\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"4\n" +
|
||||
"\x19GetTraefikInstanceRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\"d\n" +
|
||||
"\x1aGetTraefikInstanceResponse\x12F\n" +
|
||||
"\x10traefik_instance\x18\x01 \x01(\v2\x1b.mantrae.v1.TraefikInstanceR\x0ftraefikInstance\"7\n" +
|
||||
"\x1cDeleteTraefikInstanceRequest\x12\x17\n" +
|
||||
"\x02id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\x02id\"\x1f\n" +
|
||||
"\x1dDeleteTraefikInstanceResponse\"\xf3\x01\n" +
|
||||
"\x1bListTraefikInstancesRequest\x12&\n" +
|
||||
"\n" +
|
||||
"profile_id\x18\x01 \x01(\x03B\a\xbaH\x04\"\x02 \x00R\tprofileId\x12q\n" +
|
||||
"\x05limit\x18\x02 \x01(\x03BV\xbaHS\xba\x01P\n" +
|
||||
"\vlimit.valid\x12)limit must be either -1 or greater than 0\x1a\x16this == -1 || this > 0H\x00R\x05limit\x88\x01\x01\x12$\n" +
|
||||
"\x06offset\x18\x03 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x01R\x06offset\x88\x01\x01B\b\n" +
|
||||
"\x06_limitB\t\n" +
|
||||
"\a_offset\"\x89\x01\n" +
|
||||
"\x1cListTraefikInstancesResponse\x12H\n" +
|
||||
"\x11traefik_instances\x18\x01 \x03(\v2\x1b.mantrae.v1.TraefikInstanceR\x10traefikInstances\x12\x1f\n" +
|
||||
"\vtotal_count\x18\x02 \x01(\x03R\n" +
|
||||
"totalCount2\xe0\x02\n" +
|
||||
"\x16TraefikInstanceService\x12h\n" +
|
||||
"\x12GetTraefikInstance\x12%.mantrae.v1.GetTraefikInstanceRequest\x1a&.mantrae.v1.GetTraefikInstanceResponse\"\x03\x90\x02\x01\x12l\n" +
|
||||
"\x15DeleteTraefikInstance\x12(.mantrae.v1.DeleteTraefikInstanceRequest\x1a).mantrae.v1.DeleteTraefikInstanceResponse\x12n\n" +
|
||||
"\x14ListTraefikInstances\x12'.mantrae.v1.ListTraefikInstancesRequest\x1a(.mantrae.v1.ListTraefikInstancesResponse\"\x03\x90\x02\x01B\xae\x01\n" +
|
||||
"\x0ecom.mantrae.v1B\x14TraefikInstanceProtoP\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_traefik_instance_proto_rawDescOnce sync.Once
|
||||
file_mantrae_v1_traefik_instance_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_mantrae_v1_traefik_instance_proto_rawDescGZIP() []byte {
|
||||
file_mantrae_v1_traefik_instance_proto_rawDescOnce.Do(func() {
|
||||
file_mantrae_v1_traefik_instance_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mantrae_v1_traefik_instance_proto_rawDesc), len(file_mantrae_v1_traefik_instance_proto_rawDesc)))
|
||||
})
|
||||
return file_mantrae_v1_traefik_instance_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mantrae_v1_traefik_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_mantrae_v1_traefik_instance_proto_goTypes = []any{
|
||||
(*TraefikInstance)(nil), // 0: mantrae.v1.TraefikInstance
|
||||
(*GetTraefikInstanceRequest)(nil), // 1: mantrae.v1.GetTraefikInstanceRequest
|
||||
(*GetTraefikInstanceResponse)(nil), // 2: mantrae.v1.GetTraefikInstanceResponse
|
||||
(*DeleteTraefikInstanceRequest)(nil), // 3: mantrae.v1.DeleteTraefikInstanceRequest
|
||||
(*DeleteTraefikInstanceResponse)(nil), // 4: mantrae.v1.DeleteTraefikInstanceResponse
|
||||
(*ListTraefikInstancesRequest)(nil), // 5: mantrae.v1.ListTraefikInstancesRequest
|
||||
(*ListTraefikInstancesResponse)(nil), // 6: mantrae.v1.ListTraefikInstancesResponse
|
||||
(*structpb.Struct)(nil), // 7: google.protobuf.Struct
|
||||
(*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
|
||||
}
|
||||
var file_mantrae_v1_traefik_instance_proto_depIdxs = []int32{
|
||||
7, // 0: mantrae.v1.TraefikInstance.entry_points:type_name -> google.protobuf.Struct
|
||||
7, // 1: mantrae.v1.TraefikInstance.overview:type_name -> google.protobuf.Struct
|
||||
7, // 2: mantrae.v1.TraefikInstance.config:type_name -> google.protobuf.Struct
|
||||
7, // 3: mantrae.v1.TraefikInstance.version:type_name -> google.protobuf.Struct
|
||||
8, // 4: mantrae.v1.TraefikInstance.created_at:type_name -> google.protobuf.Timestamp
|
||||
8, // 5: mantrae.v1.TraefikInstance.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 6: mantrae.v1.GetTraefikInstanceResponse.traefik_instance:type_name -> mantrae.v1.TraefikInstance
|
||||
0, // 7: mantrae.v1.ListTraefikInstancesResponse.traefik_instances:type_name -> mantrae.v1.TraefikInstance
|
||||
1, // 8: mantrae.v1.TraefikInstanceService.GetTraefikInstance:input_type -> mantrae.v1.GetTraefikInstanceRequest
|
||||
3, // 9: mantrae.v1.TraefikInstanceService.DeleteTraefikInstance:input_type -> mantrae.v1.DeleteTraefikInstanceRequest
|
||||
5, // 10: mantrae.v1.TraefikInstanceService.ListTraefikInstances:input_type -> mantrae.v1.ListTraefikInstancesRequest
|
||||
2, // 11: mantrae.v1.TraefikInstanceService.GetTraefikInstance:output_type -> mantrae.v1.GetTraefikInstanceResponse
|
||||
4, // 12: mantrae.v1.TraefikInstanceService.DeleteTraefikInstance:output_type -> mantrae.v1.DeleteTraefikInstanceResponse
|
||||
6, // 13: mantrae.v1.TraefikInstanceService.ListTraefikInstances:output_type -> mantrae.v1.ListTraefikInstancesResponse
|
||||
11, // [11:14] is the sub-list for method output_type
|
||||
8, // [8:11] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_mantrae_v1_traefik_instance_proto_init() }
|
||||
func file_mantrae_v1_traefik_instance_proto_init() {
|
||||
if File_mantrae_v1_traefik_instance_proto != nil {
|
||||
return
|
||||
}
|
||||
file_mantrae_v1_traefik_instance_proto_msgTypes[5].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mantrae_v1_traefik_instance_proto_rawDesc), len(file_mantrae_v1_traefik_instance_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mantrae_v1_traefik_instance_proto_goTypes,
|
||||
DependencyIndexes: file_mantrae_v1_traefik_instance_proto_depIdxs,
|
||||
MessageInfos: file_mantrae_v1_traefik_instance_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mantrae_v1_traefik_instance_proto = out.File
|
||||
file_mantrae_v1_traefik_instance_proto_goTypes = nil
|
||||
file_mantrae_v1_traefik_instance_proto_depIdxs = nil
|
||||
}
|
||||
@@ -1020,6 +1020,14 @@ components:
|
||||
$ref: '#/components/schemas/mantrae.v1.EntryPoint'
|
||||
title: UpdateEntryPointResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.ProtocolType:
|
||||
type: string
|
||||
title: ProtocolType
|
||||
enum:
|
||||
- PROTOCOL_TYPE_UNSPECIFIED
|
||||
- PROTOCOL_TYPE_HTTP
|
||||
- PROTOCOL_TYPE_TCP
|
||||
- PROTOCOL_TYPE_UDP
|
||||
google.protobuf.NullValue:
|
||||
type: string
|
||||
title: NullValue
|
||||
@@ -1030,13 +1038,6 @@ components:
|
||||
`Value` type union.
|
||||
|
||||
The JSON representation for `NullValue` is JSON `null`.
|
||||
mantrae.v1.MiddlewareType:
|
||||
type: string
|
||||
title: MiddlewareType
|
||||
enum:
|
||||
- MIDDLEWARE_TYPE_UNSPECIFIED
|
||||
- MIDDLEWARE_TYPE_HTTP
|
||||
- MIDDLEWARE_TYPE_TCP
|
||||
google.protobuf.ListValue:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1112,7 +1113,7 @@ components:
|
||||
minLength: 1
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
isDefault:
|
||||
type: boolean
|
||||
title: is_default
|
||||
@@ -1141,7 +1142,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: DeleteMiddlewareRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteMiddlewareResponse:
|
||||
@@ -1174,7 +1175,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: GetMiddlewareRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetMiddlewareResponse:
|
||||
@@ -1203,7 +1204,7 @@ components:
|
||||
type:
|
||||
title: type
|
||||
nullable: true
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
limit:
|
||||
type:
|
||||
- integer
|
||||
@@ -1274,7 +1275,7 @@ components:
|
||||
title: is_default
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
createdAt:
|
||||
title: created_at
|
||||
$ref: '#/components/schemas/google.protobuf.Timestamp'
|
||||
@@ -1368,7 +1369,7 @@ components:
|
||||
minLength: 1
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.MiddlewareType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
config:
|
||||
title: config
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
@@ -1544,14 +1545,6 @@ components:
|
||||
$ref: '#/components/schemas/mantrae.v1.Profile'
|
||||
title: UpdateProfileResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.RouterType:
|
||||
type: string
|
||||
title: RouterType
|
||||
enum:
|
||||
- ROUTER_TYPE_UNSPECIFIED
|
||||
- ROUTER_TYPE_HTTP
|
||||
- ROUTER_TYPE_TCP
|
||||
- ROUTER_TYPE_UDP
|
||||
mantrae.v1.CreateRouterRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1578,7 +1571,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: CreateRouterRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.CreateRouterResponse:
|
||||
@@ -1601,7 +1594,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: DeleteRouterRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteRouterResponse:
|
||||
@@ -1620,7 +1613,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: GetRouterRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetRouterResponse:
|
||||
@@ -1649,7 +1642,7 @@ components:
|
||||
type:
|
||||
title: type
|
||||
nullable: true
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
limit:
|
||||
type:
|
||||
- integer
|
||||
@@ -1717,7 +1710,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
dnsProviders:
|
||||
type: array
|
||||
items:
|
||||
@@ -1747,7 +1740,7 @@ components:
|
||||
minLength: 1
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.RouterType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
config:
|
||||
title: config
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
@@ -1769,13 +1762,6 @@ components:
|
||||
$ref: '#/components/schemas/mantrae.v1.Router'
|
||||
title: UpdateRouterResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.ServersTransportType:
|
||||
type: string
|
||||
title: ServersTransportType
|
||||
enum:
|
||||
- SERVERS_TRANSPORT_TYPE_UNSPECIFIED
|
||||
- SERVERS_TRANSPORT_TYPE_HTTP
|
||||
- SERVERS_TRANSPORT_TYPE_TCP
|
||||
mantrae.v1.CreateServersTransportRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1802,7 +1788,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: CreateServersTransportRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.CreateServersTransportResponse:
|
||||
@@ -1825,7 +1811,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: DeleteServersTransportRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteServersTransportResponse:
|
||||
@@ -1844,7 +1830,7 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: GetServersTransportRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetServersTransportResponse:
|
||||
@@ -1873,7 +1859,7 @@ components:
|
||||
type:
|
||||
title: type
|
||||
nullable: true
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
limit:
|
||||
type:
|
||||
- integer
|
||||
@@ -1941,7 +1927,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
createdAt:
|
||||
title: created_at
|
||||
$ref: '#/components/schemas/google.protobuf.Timestamp'
|
||||
@@ -1972,7 +1958,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransportType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: UpdateServersTransportRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.UpdateServersTransportResponse:
|
||||
@@ -1983,14 +1969,6 @@ components:
|
||||
$ref: '#/components/schemas/mantrae.v1.ServersTransport'
|
||||
title: UpdateServersTransportResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.ServiceType:
|
||||
type: string
|
||||
title: ServiceType
|
||||
enum:
|
||||
- SERVICE_TYPE_UNSPECIFIED
|
||||
- SERVICE_TYPE_HTTP
|
||||
- SERVICE_TYPE_TCP
|
||||
- SERVICE_TYPE_UDP
|
||||
mantrae.v1.CreateServiceRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -2017,7 +1995,7 @@ components:
|
||||
title: enabled
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: CreateServiceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.CreateServiceResponse:
|
||||
@@ -2040,46 +2018,46 @@ components:
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: DeleteServiceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteServiceResponse:
|
||||
type: object
|
||||
title: DeleteServiceResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetServiceByRouterRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
title: name
|
||||
minLength: 1
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
title: GetServiceByRouterRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetServiceByRouterResponse:
|
||||
type: object
|
||||
properties:
|
||||
service:
|
||||
title: service
|
||||
$ref: '#/components/schemas/mantrae.v1.Service'
|
||||
title: GetServiceByRouterResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetServiceRequest:
|
||||
type: object
|
||||
oneOf:
|
||||
- properties:
|
||||
id:
|
||||
exclusiveMinimum: 0
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: id
|
||||
format: int64
|
||||
title: id
|
||||
required:
|
||||
- id
|
||||
- properties:
|
||||
name:
|
||||
type: string
|
||||
title: name
|
||||
minLength: 1
|
||||
title: name
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
profileId:
|
||||
exclusiveMinimum: 0
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: id
|
||||
title: profile_id
|
||||
format: int64
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: GetServiceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetServiceResponse:
|
||||
@@ -2108,7 +2086,7 @@ components:
|
||||
type:
|
||||
title: type
|
||||
nullable: true
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
limit:
|
||||
type:
|
||||
- integer
|
||||
@@ -2176,7 +2154,7 @@ components:
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
createdAt:
|
||||
title: created_at
|
||||
$ref: '#/components/schemas/google.protobuf.Timestamp'
|
||||
@@ -2207,7 +2185,7 @@ components:
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
type:
|
||||
title: type
|
||||
$ref: '#/components/schemas/mantrae.v1.ServiceType'
|
||||
$ref: '#/components/schemas/mantrae.v1.ProtocolType'
|
||||
title: UpdateServiceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.UpdateServiceResponse:
|
||||
@@ -2283,6 +2261,134 @@ components:
|
||||
$ref: '#/components/schemas/mantrae.v1.Setting'
|
||||
title: UpdateSettingResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteTraefikInstanceRequest:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
exclusiveMinimum: 0
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: id
|
||||
format: int64
|
||||
title: DeleteTraefikInstanceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.DeleteTraefikInstanceResponse:
|
||||
type: object
|
||||
title: DeleteTraefikInstanceResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetTraefikInstanceRequest:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
exclusiveMinimum: 0
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: id
|
||||
format: int64
|
||||
title: GetTraefikInstanceRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.GetTraefikInstanceResponse:
|
||||
type: object
|
||||
properties:
|
||||
traefikInstance:
|
||||
title: traefik_instance
|
||||
$ref: '#/components/schemas/mantrae.v1.TraefikInstance'
|
||||
title: GetTraefikInstanceResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.ListTraefikInstancesRequest:
|
||||
type: object
|
||||
properties:
|
||||
profileId:
|
||||
exclusiveMinimum: 0
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: profile_id
|
||||
format: int64
|
||||
limit:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: limit
|
||||
format: int64
|
||||
description: |+
|
||||
limit must be either -1 or greater than 0:
|
||||
```
|
||||
this == -1 || this > 0
|
||||
```
|
||||
|
||||
nullable: true
|
||||
offset:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: offset
|
||||
format: int64
|
||||
nullable: true
|
||||
title: ListTraefikInstancesRequest
|
||||
additionalProperties: false
|
||||
mantrae.v1.ListTraefikInstancesResponse:
|
||||
type: object
|
||||
properties:
|
||||
traefikInstances:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/mantrae.v1.TraefikInstance'
|
||||
title: traefik_instances
|
||||
totalCount:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: total_count
|
||||
format: int64
|
||||
title: ListTraefikInstancesResponse
|
||||
additionalProperties: false
|
||||
mantrae.v1.TraefikInstance:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
title: id
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
title: name
|
||||
url:
|
||||
type: string
|
||||
title: url
|
||||
username:
|
||||
type: string
|
||||
title: username
|
||||
password:
|
||||
type: string
|
||||
title: password
|
||||
tls:
|
||||
type: boolean
|
||||
title: tls
|
||||
entryPoints:
|
||||
title: entry_points
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
overview:
|
||||
title: overview
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
config:
|
||||
title: config
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
version:
|
||||
title: version
|
||||
$ref: '#/components/schemas/google.protobuf.Struct'
|
||||
createdAt:
|
||||
title: created_at
|
||||
$ref: '#/components/schemas/google.protobuf.Timestamp'
|
||||
updatedAt:
|
||||
title: updated_at
|
||||
$ref: '#/components/schemas/google.protobuf.Timestamp'
|
||||
title: TraefikInstance
|
||||
additionalProperties: false
|
||||
mantrae.v1.CreateUserRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -5365,92 +5471,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/mantrae.v1.ListServicesResponse'
|
||||
/mantrae.v1.ServiceService/GetServiceByRouter:
|
||||
get:
|
||||
tags:
|
||||
- mantrae.v1.ServiceService
|
||||
summary: GetServiceByRouter
|
||||
operationId: mantrae.v1.ServiceService.GetServiceByRouter.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.GetServiceByRouterRequest'
|
||||
- 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.GetServiceByRouterResponse'
|
||||
post:
|
||||
tags:
|
||||
- mantrae.v1.ServiceService
|
||||
summary: GetServiceByRouter
|
||||
operationId: mantrae.v1.ServiceService.GetServiceByRouter
|
||||
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.GetServiceByRouterRequest'
|
||||
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.GetServiceByRouterResponse'
|
||||
/mantrae.v1.SettingService/GetSetting:
|
||||
get:
|
||||
tags:
|
||||
@@ -5658,6 +5678,213 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/mantrae.v1.ListSettingsResponse'
|
||||
/mantrae.v1.TraefikInstanceService/GetTraefikInstance:
|
||||
get:
|
||||
tags:
|
||||
- mantrae.v1.TraefikInstanceService
|
||||
summary: GetTraefikInstance
|
||||
operationId: mantrae.v1.TraefikInstanceService.GetTraefikInstance.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.GetTraefikInstanceRequest'
|
||||
- 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.GetTraefikInstanceResponse'
|
||||
post:
|
||||
tags:
|
||||
- mantrae.v1.TraefikInstanceService
|
||||
summary: GetTraefikInstance
|
||||
operationId: mantrae.v1.TraefikInstanceService.GetTraefikInstance
|
||||
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.GetTraefikInstanceRequest'
|
||||
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.GetTraefikInstanceResponse'
|
||||
/mantrae.v1.TraefikInstanceService/DeleteTraefikInstance:
|
||||
post:
|
||||
tags:
|
||||
- mantrae.v1.TraefikInstanceService
|
||||
summary: DeleteTraefikInstance
|
||||
operationId: mantrae.v1.TraefikInstanceService.DeleteTraefikInstance
|
||||
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.DeleteTraefikInstanceRequest'
|
||||
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.DeleteTraefikInstanceResponse'
|
||||
/mantrae.v1.TraefikInstanceService/ListTraefikInstances:
|
||||
get:
|
||||
tags:
|
||||
- mantrae.v1.TraefikInstanceService
|
||||
summary: ListTraefikInstances
|
||||
operationId: mantrae.v1.TraefikInstanceService.ListTraefikInstances.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.ListTraefikInstancesRequest'
|
||||
- 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.ListTraefikInstancesResponse'
|
||||
post:
|
||||
tags:
|
||||
- mantrae.v1.TraefikInstanceService
|
||||
summary: ListTraefikInstances
|
||||
operationId: mantrae.v1.TraefikInstanceService.ListTraefikInstances
|
||||
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.ListTraefikInstancesRequest'
|
||||
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.ListTraefikInstancesResponse'
|
||||
/mantrae.v1.UserService/LoginUser:
|
||||
post:
|
||||
tags:
|
||||
@@ -6192,5 +6419,6 @@ tags:
|
||||
- name: mantrae.v1.ServersTransportService
|
||||
- name: mantrae.v1.ServiceService
|
||||
- name: mantrae.v1.SettingService
|
||||
- name: mantrae.v1.TraefikInstanceService
|
||||
- name: mantrae.v1.UserService
|
||||
- name: mantrae.v1.UtilService
|
||||
|
||||
@@ -5,6 +5,7 @@ package mantrae.v1;
|
||||
import "buf/validate/validate.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "mantrae/v1/protocol.proto";
|
||||
|
||||
service MiddlewareService {
|
||||
rpc GetMiddleware(GetMiddlewareRequest) returns (GetMiddlewareResponse) {
|
||||
@@ -21,12 +22,6 @@ service MiddlewareService {
|
||||
}
|
||||
}
|
||||
|
||||
enum MiddlewareType {
|
||||
MIDDLEWARE_TYPE_UNSPECIFIED = 0;
|
||||
MIDDLEWARE_TYPE_HTTP = 1;
|
||||
MIDDLEWARE_TYPE_TCP = 2;
|
||||
}
|
||||
|
||||
message Middleware {
|
||||
int64 id = 1;
|
||||
int64 profile_id = 2;
|
||||
@@ -35,7 +30,7 @@ message Middleware {
|
||||
google.protobuf.Struct config = 5;
|
||||
bool enabled = 6;
|
||||
bool is_default = 7;
|
||||
MiddlewareType type = 8;
|
||||
ProtocolType type = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
@@ -66,7 +61,7 @@ message PluginSnippet {
|
||||
|
||||
message GetMiddlewareRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
MiddlewareType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message GetMiddlewareResponse {
|
||||
Middleware middleware = 1;
|
||||
@@ -76,7 +71,7 @@ message CreateMiddlewareRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional string agent_id = 2;
|
||||
string name = 3 [(buf.validate.field).string.min_len = 1];
|
||||
MiddlewareType type = 4 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 4 [(buf.validate.field).enum.defined_only = true];
|
||||
bool is_default = 5;
|
||||
google.protobuf.Struct config = 6;
|
||||
}
|
||||
@@ -87,7 +82,7 @@ message CreateMiddlewareResponse {
|
||||
message UpdateMiddlewareRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
string name = 2 [(buf.validate.field).string.min_len = 1];
|
||||
MiddlewareType type = 3 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 3 [(buf.validate.field).enum.defined_only = true];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
bool is_default = 6;
|
||||
@@ -97,15 +92,15 @@ message UpdateMiddlewareResponse {
|
||||
}
|
||||
|
||||
message DeleteMiddlewareRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
MiddlewareType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
int64 id = 2 [(buf.validate.field).int64.gt = 0];
|
||||
ProtocolType type = 3 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message DeleteMiddlewareResponse {}
|
||||
|
||||
message ListMiddlewaresRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional string agent_id = 2 [(buf.validate.field).string.min_len = 1];
|
||||
optional MiddlewareType type = 3;
|
||||
optional ProtocolType type = 3;
|
||||
optional int64 limit = 4 [(buf.validate.field).cel = {
|
||||
id: "limit.valid"
|
||||
message: "limit must be either -1 or greater than 0"
|
||||
|
||||
10
proto/mantrae/v1/protocol.proto
Normal file
10
proto/mantrae/v1/protocol.proto
Normal file
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package mantrae.v1;
|
||||
|
||||
enum ProtocolType {
|
||||
PROTOCOL_TYPE_UNSPECIFIED = 0;
|
||||
PROTOCOL_TYPE_HTTP = 1;
|
||||
PROTOCOL_TYPE_TCP = 2;
|
||||
PROTOCOL_TYPE_UDP = 3;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import "buf/validate/validate.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "mantrae/v1/dns_provider.proto";
|
||||
import "mantrae/v1/protocol.proto";
|
||||
|
||||
service RouterService {
|
||||
rpc GetRouter(GetRouterRequest) returns (GetRouterResponse) {
|
||||
@@ -19,13 +20,6 @@ service RouterService {
|
||||
}
|
||||
}
|
||||
|
||||
enum RouterType {
|
||||
ROUTER_TYPE_UNSPECIFIED = 0;
|
||||
ROUTER_TYPE_HTTP = 1;
|
||||
ROUTER_TYPE_TCP = 2;
|
||||
ROUTER_TYPE_UDP = 3;
|
||||
}
|
||||
|
||||
message Router {
|
||||
int64 id = 1;
|
||||
int64 profile_id = 2;
|
||||
@@ -33,7 +27,7 @@ message Router {
|
||||
string name = 4;
|
||||
google.protobuf.Struct config = 5;
|
||||
bool enabled = 6;
|
||||
RouterType type = 7;
|
||||
ProtocolType type = 7;
|
||||
repeated DnsProvider dns_providers = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
@@ -41,7 +35,7 @@ message Router {
|
||||
|
||||
message GetRouterRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
RouterType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message GetRouterResponse {
|
||||
Router router = 1;
|
||||
@@ -53,7 +47,7 @@ message CreateRouterRequest {
|
||||
string name = 3 [(buf.validate.field).string.min_len = 1];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
RouterType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message CreateRouterResponse {
|
||||
Router router = 1;
|
||||
@@ -62,7 +56,7 @@ message CreateRouterResponse {
|
||||
message UpdateRouterRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
string name = 2 [(buf.validate.field).string.min_len = 1];
|
||||
RouterType type = 3 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 3 [(buf.validate.field).enum.defined_only = true];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
repeated DnsProvider dns_providers = 6;
|
||||
@@ -73,14 +67,14 @@ message UpdateRouterResponse {
|
||||
|
||||
message DeleteRouterRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
RouterType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message DeleteRouterResponse {}
|
||||
|
||||
message ListRoutersRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional string agent_id = 2 [(buf.validate.field).string.min_len = 1];
|
||||
optional RouterType type = 3;
|
||||
optional ProtocolType type = 3;
|
||||
optional int64 limit = 4 [(buf.validate.field).cel = {
|
||||
id: "limit.valid"
|
||||
message: "limit must be either -1 or greater than 0"
|
||||
|
||||
@@ -5,6 +5,7 @@ package mantrae.v1;
|
||||
import "buf/validate/validate.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "mantrae/v1/protocol.proto";
|
||||
|
||||
service ServersTransportService {
|
||||
rpc GetServersTransport(GetServersTransportRequest) returns (GetServersTransportResponse) {
|
||||
@@ -18,12 +19,6 @@ service ServersTransportService {
|
||||
}
|
||||
}
|
||||
|
||||
enum ServersTransportType {
|
||||
SERVERS_TRANSPORT_TYPE_UNSPECIFIED = 0;
|
||||
SERVERS_TRANSPORT_TYPE_HTTP = 1;
|
||||
SERVERS_TRANSPORT_TYPE_TCP = 2;
|
||||
}
|
||||
|
||||
message ServersTransport {
|
||||
int64 id = 1;
|
||||
int64 profile_id = 2;
|
||||
@@ -31,14 +26,14 @@ message ServersTransport {
|
||||
string name = 4;
|
||||
google.protobuf.Struct config = 5;
|
||||
bool enabled = 6;
|
||||
ServersTransportType type = 7;
|
||||
ProtocolType type = 7;
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
google.protobuf.Timestamp updated_at = 9;
|
||||
}
|
||||
|
||||
message GetServersTransportRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
ServersTransportType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message GetServersTransportResponse {
|
||||
ServersTransport servers_transport = 1;
|
||||
@@ -50,7 +45,7 @@ message CreateServersTransportRequest {
|
||||
string name = 3 [(buf.validate.field).string.min_len = 1];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
ServersTransportType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message CreateServersTransportResponse {
|
||||
ServersTransport servers_transport = 1;
|
||||
@@ -59,9 +54,9 @@ message CreateServersTransportResponse {
|
||||
message UpdateServersTransportRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
string name = 2 [(buf.validate.field).string.min_len = 1];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
ServersTransportType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
google.protobuf.Struct config = 3;
|
||||
bool enabled = 4;
|
||||
ProtocolType type = 5 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message UpdateServersTransportResponse {
|
||||
ServersTransport servers_transport = 1;
|
||||
@@ -69,14 +64,14 @@ message UpdateServersTransportResponse {
|
||||
|
||||
message DeleteServersTransportRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
ServersTransportType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message DeleteServersTransportResponse {}
|
||||
|
||||
message ListServersTransportsRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional string agent_id = 2 [(buf.validate.field).string.min_len = 1];
|
||||
optional ServersTransportType type = 3;
|
||||
optional ProtocolType type = 3;
|
||||
optional int64 limit = 4 [(buf.validate.field).cel = {
|
||||
id: "limit.valid"
|
||||
message: "limit must be either -1 or greater than 0"
|
||||
|
||||
@@ -5,6 +5,7 @@ package mantrae.v1;
|
||||
import "buf/validate/validate.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "mantrae/v1/protocol.proto";
|
||||
|
||||
service ServiceService {
|
||||
rpc GetService(GetServiceRequest) returns (GetServiceResponse) {
|
||||
@@ -16,16 +17,6 @@ service ServiceService {
|
||||
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
|
||||
option idempotency_level = NO_SIDE_EFFECTS;
|
||||
}
|
||||
rpc GetServiceByRouter(GetServiceByRouterRequest) returns (GetServiceByRouterResponse) {
|
||||
option idempotency_level = NO_SIDE_EFFECTS;
|
||||
}
|
||||
}
|
||||
|
||||
enum ServiceType {
|
||||
SERVICE_TYPE_UNSPECIFIED = 0;
|
||||
SERVICE_TYPE_HTTP = 1;
|
||||
SERVICE_TYPE_TCP = 2;
|
||||
SERVICE_TYPE_UDP = 3;
|
||||
}
|
||||
|
||||
message Service {
|
||||
@@ -35,14 +26,19 @@ message Service {
|
||||
string name = 4;
|
||||
bool enabled = 5;
|
||||
google.protobuf.Struct config = 6;
|
||||
ServiceType type = 7;
|
||||
ProtocolType type = 7;
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
google.protobuf.Timestamp updated_at = 9;
|
||||
}
|
||||
|
||||
message GetServiceRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
ServiceType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
oneof identifier {
|
||||
option (buf.validate.oneof).required = true;
|
||||
int64 id = 3 [(buf.validate.field).int64.gt = 0];
|
||||
string name = 4 [(buf.validate.field).string.min_len = 1];
|
||||
}
|
||||
}
|
||||
message GetServiceResponse {
|
||||
Service service = 1;
|
||||
@@ -54,7 +50,7 @@ message CreateServiceRequest {
|
||||
string name = 3 [(buf.validate.field).string.min_len = 1];
|
||||
google.protobuf.Struct config = 4;
|
||||
bool enabled = 5;
|
||||
ServiceType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 6 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message CreateServiceResponse {
|
||||
Service service = 1;
|
||||
@@ -65,7 +61,7 @@ message UpdateServiceRequest {
|
||||
string name = 2 [(buf.validate.field).string.min_len = 1];
|
||||
bool enabled = 3;
|
||||
google.protobuf.Struct config = 4;
|
||||
ServiceType type = 5 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 5 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message UpdateServiceResponse {
|
||||
Service service = 1;
|
||||
@@ -73,14 +69,14 @@ message UpdateServiceResponse {
|
||||
|
||||
message DeleteServiceRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
ServiceType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
ProtocolType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message DeleteServiceResponse {}
|
||||
|
||||
message ListServicesRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional string agent_id = 2 [(buf.validate.field).string.min_len = 1];
|
||||
optional ServiceType type = 3;
|
||||
optional ProtocolType type = 3;
|
||||
optional int64 limit = 4 [(buf.validate.field).cel = {
|
||||
id: "limit.valid"
|
||||
message: "limit must be either -1 or greater than 0"
|
||||
@@ -92,11 +88,3 @@ message ListServicesResponse {
|
||||
repeated Service services = 1;
|
||||
int64 total_count = 2;
|
||||
}
|
||||
|
||||
message GetServiceByRouterRequest {
|
||||
string name = 1 [(buf.validate.field).string.min_len = 1];
|
||||
ServiceType type = 2 [(buf.validate.field).enum.defined_only = true];
|
||||
}
|
||||
message GetServiceByRouterResponse {
|
||||
Service service = 1;
|
||||
}
|
||||
|
||||
58
proto/mantrae/v1/traefik_instance.proto
Normal file
58
proto/mantrae/v1/traefik_instance.proto
Normal file
@@ -0,0 +1,58 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package mantrae.v1;
|
||||
|
||||
import "buf/validate/validate.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service TraefikInstanceService {
|
||||
rpc GetTraefikInstance(GetTraefikInstanceRequest) returns (GetTraefikInstanceResponse) {
|
||||
option idempotency_level = NO_SIDE_EFFECTS;
|
||||
}
|
||||
rpc DeleteTraefikInstance(DeleteTraefikInstanceRequest) returns (DeleteTraefikInstanceResponse);
|
||||
rpc ListTraefikInstances(ListTraefikInstancesRequest) returns (ListTraefikInstancesResponse) {
|
||||
option idempotency_level = NO_SIDE_EFFECTS;
|
||||
}
|
||||
}
|
||||
|
||||
message TraefikInstance {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
string url = 3;
|
||||
string username = 4;
|
||||
string password = 5;
|
||||
bool tls = 6;
|
||||
google.protobuf.Struct entry_points = 7;
|
||||
google.protobuf.Struct overview = 8;
|
||||
google.protobuf.Struct config = 9;
|
||||
google.protobuf.Struct version = 10;
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
|
||||
message GetTraefikInstanceRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
}
|
||||
message GetTraefikInstanceResponse {
|
||||
TraefikInstance traefik_instance = 1;
|
||||
}
|
||||
|
||||
message DeleteTraefikInstanceRequest {
|
||||
int64 id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
}
|
||||
message DeleteTraefikInstanceResponse {}
|
||||
|
||||
message ListTraefikInstancesRequest {
|
||||
int64 profile_id = 1 [(buf.validate.field).int64.gt = 0];
|
||||
optional int64 limit = 2 [(buf.validate.field).cel = {
|
||||
id: "limit.valid"
|
||||
message: "limit must be either -1 or greater than 0"
|
||||
expression: "this == -1 || this > 0"
|
||||
}];
|
||||
optional int64 offset = 3 [(buf.validate.field).int64.gte = 0];
|
||||
}
|
||||
message ListTraefikInstancesResponse {
|
||||
repeated TraefikInstance traefik_instances = 1;
|
||||
int64 total_count = 2;
|
||||
}
|
||||
@@ -40,6 +40,14 @@ tasks:
|
||||
- go get -u ./...
|
||||
- cd web && pnpm update --latest
|
||||
|
||||
# Generate code
|
||||
gen:
|
||||
desc: Generate sqlc and buf
|
||||
cmds:
|
||||
- buf generate --clean
|
||||
- sqlc generate
|
||||
- go run -tags dev main.go -zod
|
||||
|
||||
# Build binary
|
||||
build:
|
||||
desc: Build Go binary
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@import "tailwindcss";
|
||||
@import "tw-animate-css";
|
||||
@import 'tailwindcss';
|
||||
@import 'tw-animate-css';
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
@@ -42,15 +42,11 @@
|
||||
--radius: 0.5rem;
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
--spacing: 0.25rem;
|
||||
@@ -95,15 +91,11 @@
|
||||
--radius: 0.5rem;
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl:
|
||||
0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
}
|
||||
|
||||
@@ -194,32 +186,32 @@
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Geist";
|
||||
src: url("/fonts/geist/Geist[wght].ttf") format("truetype");
|
||||
font-family: 'Geist';
|
||||
src: url('/fonts/geist/Geist[wght].ttf') format('truetype');
|
||||
font-weight: 100 900;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Geist";
|
||||
src: url("/fonts/geist/Geist-Italic[wght].ttf") format("truetype");
|
||||
font-family: 'Geist';
|
||||
src: url('/fonts/geist/Geist-Italic[wght].ttf') format('truetype');
|
||||
font-weight: 100 900;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Geist Mono";
|
||||
src: url("/fonts/geist/GeistMono[wght].ttf") format("truetype");
|
||||
font-family: 'Geist Mono';
|
||||
src: url('/fonts/geist/GeistMono[wght].ttf') format('truetype');
|
||||
font-weight: 100 900;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Geist Mono";
|
||||
src: url("/fonts/geist/GeistMono-Italic[wght].ttf") format("truetype");
|
||||
font-family: 'Geist Mono';
|
||||
src: url('/fonts/geist/GeistMono-Italic[wght].ttf') format('truetype');
|
||||
font-weight: 100 900;
|
||||
font-style: italic;
|
||||
font-display: swap;
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import type { Handle } from "@sveltejs/kit";
|
||||
import { dev } from "$app/environment";
|
||||
import type { Handle } from '@sveltejs/kit';
|
||||
import { dev } from '$app/environment';
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
if (
|
||||
dev &&
|
||||
event.url.pathname === "/.well-known/appspecific/com.chrome.devtools.json"
|
||||
) {
|
||||
if (dev && event.url.pathname === '/.well-known/appspecific/com.chrome.devtools.json') {
|
||||
return new Response(undefined, { status: 404 });
|
||||
}
|
||||
|
||||
// await resolve(event, {
|
||||
// filterSerializedResponseHeaders: (name) => name === 'content-type'
|
||||
// });
|
||||
return resolve(event);
|
||||
return await resolve(event, {
|
||||
filterSerializedResponseHeaders: (name) => name === 'content-type'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,11 +12,12 @@ import { EntryPointService } from "./gen/mantrae/v1/entry_point_pb";
|
||||
import { DnsProviderService } from "./gen/mantrae/v1/dns_provider_pb";
|
||||
import { UtilService } from "./gen/mantrae/v1/util_pb";
|
||||
import { AgentService } from "./gen/mantrae/v1/agent_pb";
|
||||
import { toast } from "svelte-sonner";
|
||||
import { AuditLogService } from "./gen/mantrae/v1/auditlog_pb";
|
||||
import { ServersTransportService } from "./gen/mantrae/v1/servers_transport_pb";
|
||||
import { TraefikInstanceService } from "./gen/mantrae/v1/traefik_instance_pb";
|
||||
import { toast } from "svelte-sonner";
|
||||
import { profile } from "./stores/profile";
|
||||
import { baseURL } from "./stores/common";
|
||||
import { ServersTransportService } from "./gen/mantrae/v1/servers_transport_pb";
|
||||
|
||||
export function useClient<T extends DescService>(
|
||||
service: T,
|
||||
@@ -123,7 +124,7 @@ export const routerClient = useClient(RouterService);
|
||||
export const serviceClient = useClient(ServiceService);
|
||||
export const middlewareClient = useClient(MiddlewareService);
|
||||
export const serversTransportClient = useClient(ServersTransportService);
|
||||
// export const instanceClient = useClient(TraefikInstanceService);
|
||||
export const traefikClient = useClient(TraefikInstanceService);
|
||||
export const settingClient = useClient(SettingService);
|
||||
export const backupClient = useClient(BackupService);
|
||||
export const auditLogClient = useClient(AuditLogService);
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { RouterType, type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import type { Router as HTTPRouter, RouterTLSConfig } from '$lib/gen/zen/traefik-schemas';
|
||||
import { AlertCircle, ExternalLink, Plus, Star } from '@lucide/svelte';
|
||||
import { entryPointClient, middlewareClient, routerClient } from '$lib/api';
|
||||
import { MiddlewareType } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { unmarshalConfig, marshalConfig } from '$lib/types';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { formatArrayDisplay } from '$lib/utils';
|
||||
import { onMount } from 'svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let { router = $bindable() }: { router: Router } = $props();
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if (defaultEntryPoint) config.entryPoints = [defaultEntryPoint.name];
|
||||
});
|
||||
middlewareClient
|
||||
.listMiddlewares({ profileId: profile.id, type: MiddlewareType.HTTP, limit: -1n, offset: 0n })
|
||||
.listMiddlewares({ profileId: profile.id, type: ProtocolType.HTTP, limit: -1n, offset: 0n })
|
||||
.then((data) => {
|
||||
let defaultMiddleware = data.middlewares.find((m) => m.isDefault);
|
||||
if (defaultMiddleware) config.middlewares = [defaultMiddleware.name];
|
||||
@@ -112,7 +112,7 @@
|
||||
{/await}
|
||||
|
||||
<!-- Middlewares -->
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id, type: MiddlewareType.HTTP, limit: -1n, offset: 0n } ) then value}
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id, type: ProtocolType.HTTP, limit: -1n, offset: 0n } ) then value}
|
||||
{#if !value.middlewares.length}
|
||||
<Alert.Root class="border-dashed">
|
||||
<AlertCircle class="h-4 w-4" />
|
||||
@@ -206,7 +206,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Rule -->
|
||||
{#if router.type === RouterType.HTTP}
|
||||
{#if router.type === ProtocolType.HTTP}
|
||||
<RuleEditor bind:rule={config.rule} bind:type={router.type} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import { ServiceType, type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import type { Service as HTTPService } from '$lib/gen/zen/traefik-schemas';
|
||||
import { Plus, Trash } from '@lucide/svelte';
|
||||
import { marshalConfig } from '$lib/types';
|
||||
@@ -56,9 +56,7 @@
|
||||
server.url = input.value;
|
||||
service.config = marshalConfig(config);
|
||||
}}
|
||||
placeholder={service.type === ServiceType.HTTP
|
||||
? 'http://127.0.0.1:8080'
|
||||
: '127.0.0.1:8080'}
|
||||
placeholder="http://127.0.0.1:8080"
|
||||
/>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
import { Badge } from '$lib/components/ui/badge/index.js';
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { RouterType, type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import type { RouterTCPTLSConfig, TCPRouter } from '$lib/gen/zen/traefik-schemas';
|
||||
import { Star } from '@lucide/svelte';
|
||||
import { entryPointClient, middlewareClient, routerClient } from '$lib/api';
|
||||
import { MiddlewareType } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { unmarshalConfig, marshalConfig } from '$lib/types';
|
||||
import { onMount } from 'svelte';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let { router = $bindable() }: { router: Router } = $props();
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
if (defaultEntryPoint) config.entryPoints = [defaultEntryPoint.name];
|
||||
});
|
||||
middlewareClient
|
||||
.listMiddlewares({ profileId: profile.id, type: MiddlewareType.TCP, limit: -1n, offset: 0n })
|
||||
.listMiddlewares({ profileId: profile.id, type: ProtocolType.TCP, limit: -1n, offset: 0n })
|
||||
.then((data) => {
|
||||
let defaultMiddleware = data.middlewares.find((m) => m.isDefault);
|
||||
if (defaultMiddleware) config.middlewares = [defaultMiddleware.name];
|
||||
@@ -93,7 +93,7 @@
|
||||
{config.middlewares?.join(', ') || 'Select middlewares'}
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id, type: MiddlewareType.TCP, limit: -1n, offset: 0n } ) then value}
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id, type: ProtocolType.TCP, limit: -1n, offset: 0n } ) then value}
|
||||
{#each value.middlewares as middleware (middleware.name)}
|
||||
<Select.Item value={middleware.name}>
|
||||
{middleware.name}
|
||||
@@ -158,7 +158,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Rule -->
|
||||
{#if router.type === RouterType.TCP}
|
||||
{#if router.type === ProtocolType.TCP}
|
||||
<RuleEditor bind:rule={config.rule} bind:type={router.type} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import { ServiceType, type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { Plus, Trash } from '@lucide/svelte';
|
||||
import { marshalConfig } from '$lib/types';
|
||||
import type { TCPService } from '$lib/gen/zen/traefik-schemas';
|
||||
@@ -39,9 +39,7 @@
|
||||
server.address = input.value;
|
||||
service.config = marshalConfig(config);
|
||||
}}
|
||||
placeholder={service.type === ServiceType.HTTP
|
||||
? 'http://127.0.0.1:8080'
|
||||
: '127.0.0.1:8080'}
|
||||
placeholder="127.0.0.1:8080"
|
||||
/>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Input } from '$lib/components/ui/input/index.js';
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import { ServiceType, type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { Plus, Trash } from '@lucide/svelte';
|
||||
import { marshalConfig } from '$lib/types';
|
||||
import type { UDPService } from '$lib/gen/zen/traefik-schemas';
|
||||
@@ -39,9 +39,7 @@
|
||||
server.address = input.value;
|
||||
service.config = marshalConfig(config);
|
||||
}}
|
||||
placeholder={service.type === ServiceType.HTTP
|
||||
? 'http://127.0.0.1:8080'
|
||||
: '127.0.0.1:8080'}
|
||||
placeholder="127.0.0.1:8080"
|
||||
/>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { Label } from '$lib/components/ui/label/index.js';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import Separator from '../ui/separator/separator.svelte';
|
||||
import CopyButton from '../ui/copy-button/copy-button.svelte';
|
||||
import { DateFormat, pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { RotateCcw } from '@lucide/svelte';
|
||||
import { agentClient } from '$lib/api';
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import Separator from '../ui/separator/separator.svelte';
|
||||
import { MiddlewareType, type Middleware } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { type Middleware } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { middlewareClient } from '$lib/api';
|
||||
import { middlewareTypes } from '$lib/types';
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import HTTPMiddlewareForm from '../forms/HTTPMiddlewareForm.svelte';
|
||||
import TCPMiddlewareForm from '../forms/TCPMiddlewareForm.svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
import { protocolTypes } from '$lib/types';
|
||||
|
||||
interface Props {
|
||||
data: Middleware[];
|
||||
@@ -102,15 +103,18 @@
|
||||
onValueChange={(value) => (item.type = parseInt(value, 10))}
|
||||
>
|
||||
<Select.Trigger class="w-full">
|
||||
{middlewareTypes.find((t) => t.value === item.type)?.label ?? 'Select type'}
|
||||
{protocolTypes.find((t) => t.value === item.type)?.label ?? 'Select type'}
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
<Select.Group>
|
||||
<Select.Label>Middleware Type</Select.Label>
|
||||
{#each middlewareTypes as t (t.value)}
|
||||
<Select.Item value={t.value.toString()} label={t.label}>
|
||||
{t.label}
|
||||
</Select.Item>
|
||||
{#each protocolTypes as t (t.value)}
|
||||
<!-- Skip UDP -->
|
||||
{#if t.value !== ProtocolType.UDP}
|
||||
<Select.Item value={t.value.toString()} label={t.label}>
|
||||
{t.label}
|
||||
</Select.Item>
|
||||
{/if}
|
||||
{/each}
|
||||
</Select.Group>
|
||||
</Select.Content>
|
||||
@@ -118,10 +122,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if item.type === MiddlewareType.HTTP}
|
||||
{#if item.type === ProtocolType.HTTP}
|
||||
<HTTPMiddlewareForm bind:middleware={item} />
|
||||
{/if}
|
||||
{#if item.type === MiddlewareType.TCP}
|
||||
{#if item.type === ProtocolType.TCP}
|
||||
<TCPMiddlewareForm bind:middleware={item} />
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
import * as Tabs from '$lib/components/ui/tabs/index.js';
|
||||
import { Input } from '$lib/components/ui/input';
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { RouterType, type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { ServiceType, type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { type Service } from '$lib/gen/mantrae/v1/service_pb';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { routerTypes, unmarshalConfig } from '$lib/types';
|
||||
import { protocolTypes, unmarshalConfig } from '$lib/types';
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import { Bot, Server } from '@lucide/svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
@@ -32,6 +32,7 @@
|
||||
import TCPServiceForm from '../forms/TCPServiceForm.svelte';
|
||||
import UDPServiceForm from '../forms/UDPServiceForm.svelte';
|
||||
import DnsProviderSelect from '../forms/DNSProviderSelect.svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
interface Props {
|
||||
data: Router[];
|
||||
@@ -56,9 +57,13 @@
|
||||
if (item.id && open && !hasLoadedService) {
|
||||
hasLoadedService = true;
|
||||
serviceClient
|
||||
.getServiceByRouter({
|
||||
name: item.name,
|
||||
type: item.type
|
||||
.getService({
|
||||
profileId: profile.id,
|
||||
type: item.type,
|
||||
identifier: {
|
||||
value: item.name,
|
||||
case: 'name'
|
||||
}
|
||||
})
|
||||
.then((data) => {
|
||||
service = data.service ?? ({} as Service);
|
||||
@@ -79,17 +84,7 @@
|
||||
service.enabled = item.enabled;
|
||||
}
|
||||
if (item.type) {
|
||||
switch (item.type) {
|
||||
case RouterType.HTTP:
|
||||
service.type = ServiceType.HTTP;
|
||||
break;
|
||||
case RouterType.TCP:
|
||||
service.type = ServiceType.TCP;
|
||||
break;
|
||||
case RouterType.UDP:
|
||||
service.type = ServiceType.UDP;
|
||||
break;
|
||||
}
|
||||
service.type = item.type;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -170,15 +165,15 @@
|
||||
const getServicePreview = () => {
|
||||
if (!service?.config) return 'No service configured';
|
||||
|
||||
if (service.type === ServiceType.HTTP) {
|
||||
if (service.type === ProtocolType.HTTP) {
|
||||
const config = unmarshalConfig(service.config) as HTTPService;
|
||||
const servers = config.loadBalancer?.servers || [];
|
||||
return servers.length > 0 ? servers[0].url : 'No servers';
|
||||
} else if (service.type === ServiceType.TCP) {
|
||||
} else if (service.type === ProtocolType.TCP) {
|
||||
const config = unmarshalConfig(service.config) as TCPService;
|
||||
const servers = config.loadBalancer?.servers || [];
|
||||
return servers.length > 0 ? servers[0].address : 'No servers';
|
||||
} else if (service.type === ServiceType.UDP) {
|
||||
} else if (service.type === ProtocolType.UDP) {
|
||||
const config = unmarshalConfig(service.config) as UDPService;
|
||||
const servers = config.loadBalancer?.servers || [];
|
||||
return servers.length > 0 ? servers[0].address : 'No servers';
|
||||
@@ -218,7 +213,7 @@
|
||||
<DnsProviderSelect
|
||||
bind:data
|
||||
bind:item
|
||||
disabled={item.type === RouterType.UDP || !item.id}
|
||||
disabled={item.type === ProtocolType.UDP || !item.id}
|
||||
/>
|
||||
</div>
|
||||
</Card.Header>
|
||||
@@ -255,7 +250,7 @@
|
||||
<div class="space-y-1">
|
||||
<Label class="text-muted-foreground">Protocol</Label>
|
||||
<Badge variant="outline">
|
||||
{routerTypes.find((t) => t.value === item.type)?.label || 'Unknown'}
|
||||
{protocolTypes.find((t) => t.value === item.type)?.label || 'Unknown'}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
@@ -296,7 +291,7 @@
|
||||
<DnsProviderSelect
|
||||
bind:data
|
||||
bind:item
|
||||
disabled={item.type === RouterType.UDP || !item.id}
|
||||
disabled={item.type === ProtocolType.UDP || !item.id}
|
||||
/>
|
||||
</Card.Header>
|
||||
<Card.Content class="space-y-4">
|
||||
@@ -323,13 +318,13 @@
|
||||
// Reset config
|
||||
item.type = parseInt(value, 10);
|
||||
switch (item.type) {
|
||||
case RouterType.HTTP:
|
||||
case ProtocolType.HTTP:
|
||||
item.config = {} as HTTPRouter;
|
||||
break;
|
||||
case RouterType.TCP:
|
||||
case ProtocolType.TCP:
|
||||
item.config = {} as TCPRouter;
|
||||
break;
|
||||
case RouterType.UDP:
|
||||
case ProtocolType.UDP:
|
||||
item.config = {} as UDPRouter;
|
||||
break;
|
||||
}
|
||||
@@ -337,12 +332,12 @@
|
||||
>
|
||||
<Select.Trigger class="w-full">
|
||||
<span class="truncate">
|
||||
{routerTypes.find((t) => t.value === item.type)?.label ??
|
||||
{protocolTypes.find((t) => t.value === item.type)?.label ??
|
||||
'Select protocol'}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
{#each routerTypes as t (t.value)}
|
||||
{#each protocolTypes as t (t.value)}
|
||||
<Select.Item value={t.value.toString()}>
|
||||
{t.label}
|
||||
</Select.Item>
|
||||
@@ -353,13 +348,13 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if item.type === RouterType.HTTP}
|
||||
{#if item.type === ProtocolType.HTTP}
|
||||
<HTTPRouterForm bind:router={item} />
|
||||
{/if}
|
||||
{#if item.type === RouterType.TCP}
|
||||
{#if item.type === ProtocolType.TCP}
|
||||
<TCPRouterForm bind:router={item} />
|
||||
{/if}
|
||||
{#if item.type === RouterType.UDP}
|
||||
{#if item.type === ProtocolType.UDP}
|
||||
<UDPRouterForm bind:router={item} />
|
||||
{/if}
|
||||
</Card.Content>
|
||||
@@ -372,13 +367,13 @@
|
||||
<Card.Description>Configure backend servers and load balancing</Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content class="flex flex-col gap-3">
|
||||
{#if item.type === RouterType.HTTP}
|
||||
{#if item.type === ProtocolType.HTTP}
|
||||
<HTTPServiceForm bind:service />
|
||||
{/if}
|
||||
{#if item.type === RouterType.TCP}
|
||||
{#if item.type === ProtocolType.TCP}
|
||||
<TCPServiceForm bind:service />
|
||||
{/if}
|
||||
{#if item.type === RouterType.UDP}
|
||||
{#if item.type === ProtocolType.UDP}
|
||||
<UDPServiceForm bind:service />
|
||||
{/if}
|
||||
</Card.Content>
|
||||
|
||||
@@ -10,17 +10,15 @@
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import {
|
||||
ServersTransportType,
|
||||
type ServersTransport
|
||||
} from '$lib/gen/mantrae/v1/servers_transport_pb';
|
||||
import { type ServersTransport } from '$lib/gen/mantrae/v1/servers_transport_pb';
|
||||
import {
|
||||
type TCPServersTransport,
|
||||
type ServersTransport as HTTPServersTransport
|
||||
} from '$lib/gen/zen/traefik-schemas';
|
||||
import { serversTransportTypes } from '$lib/types';
|
||||
import HTTPServerTransportForm from '$lib/components/forms/HTTPServerTransportForm.svelte';
|
||||
import TCPServerTransportForm from '$lib/components/forms/TCPServerTransportForm.svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
import { protocolTypes } from '$lib/types';
|
||||
|
||||
interface Props {
|
||||
data: ServersTransport[];
|
||||
@@ -110,10 +108,10 @@
|
||||
// Reset config
|
||||
item.type = parseInt(value, 10);
|
||||
switch (item.type) {
|
||||
case ServersTransportType.HTTP:
|
||||
case ProtocolType.HTTP:
|
||||
item.config = {} as HTTPServersTransport;
|
||||
break;
|
||||
case ServersTransportType.TCP:
|
||||
case ProtocolType.TCP:
|
||||
item.config = {} as TCPServersTransport;
|
||||
break;
|
||||
}
|
||||
@@ -121,14 +119,17 @@
|
||||
>
|
||||
<Select.Trigger class="w-full">
|
||||
<span class="truncate">
|
||||
{serversTransportTypes.find((t) => t.value === item.type)?.label ?? 'Select'}
|
||||
{protocolTypes.find((t) => t.value === item.type)?.label ?? 'Select'}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
{#each serversTransportTypes as t (t.value)}
|
||||
<Select.Item value={t.value.toString()}>
|
||||
{t.label}
|
||||
</Select.Item>
|
||||
{#each protocolTypes as t (t.value)}
|
||||
<!-- Skip UDP -->
|
||||
{#if t.value !== ProtocolType.UDP}
|
||||
<Select.Item value={t.value.toString()} label={t.label}>
|
||||
{t.label}
|
||||
</Select.Item>
|
||||
{/if}
|
||||
{/each}
|
||||
</Select.Content>
|
||||
</Select.Root>
|
||||
@@ -136,10 +137,10 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if item.type === ServersTransportType.HTTP}
|
||||
{#if item.type === ProtocolType.HTTP}
|
||||
<HTTPServerTransportForm bind:transport={item} />
|
||||
{/if}
|
||||
{#if item.type === ServersTransportType.TCP}
|
||||
{#if item.type === ProtocolType.TCP}
|
||||
<TCPServerTransportForm bind:transport={item} />
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { create } from '@bufbuild/protobuf';
|
||||
import CustomSwitch from '../ui/custom-switch/custom-switch.svelte';
|
||||
|
||||
interface Props {
|
||||
data?: User[];
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
<script lang="ts">
|
||||
import * as Command from '$lib/components/ui/command/index.js';
|
||||
import RouterModal from '../modals/router.svelte';
|
||||
import MiddlewareModal from '../modals/middleware.svelte';
|
||||
import { Layers, Route } from '@lucide/svelte';
|
||||
import type { Router, Service } from '$lib/types/router';
|
||||
import type { Middleware } from '$lib/types/middlewares';
|
||||
import { source } from '$lib/stores/source';
|
||||
import { TraefikSource } from '$lib/types';
|
||||
|
||||
let open = $state(false);
|
||||
let searchQuery = $state('');
|
||||
|
||||
interface ModalState {
|
||||
isOpenRouter: boolean;
|
||||
isOpenMiddleware: boolean;
|
||||
mode: 'create' | 'edit';
|
||||
router: Router;
|
||||
service: Service;
|
||||
middleware: Middleware;
|
||||
}
|
||||
|
||||
const defaultRouter: Router = {
|
||||
name: '',
|
||||
protocol: 'http',
|
||||
tls: {},
|
||||
entryPoints: [],
|
||||
middlewares: [],
|
||||
rule: '',
|
||||
service: ''
|
||||
};
|
||||
const defaultService: Service = {
|
||||
name: defaultRouter.name,
|
||||
protocol: defaultRouter.protocol,
|
||||
loadBalancer: {
|
||||
servers: [],
|
||||
passHostHeader: true
|
||||
}
|
||||
};
|
||||
const defaultMiddleware: Middleware = {
|
||||
name: '',
|
||||
protocol: 'http',
|
||||
type: undefined
|
||||
};
|
||||
const initialModalState: ModalState = {
|
||||
isOpenRouter: false,
|
||||
isOpenMiddleware: false,
|
||||
mode: 'create',
|
||||
router: defaultRouter,
|
||||
service: defaultService,
|
||||
middleware: defaultMiddleware
|
||||
};
|
||||
let modalState = $state(initialModalState);
|
||||
|
||||
const baseModal = () => {
|
||||
return (modalState = {
|
||||
isOpenRouter: false,
|
||||
isOpenMiddleware: false,
|
||||
mode: 'create',
|
||||
router: defaultRouter,
|
||||
service: defaultService,
|
||||
middleware: defaultMiddleware
|
||||
});
|
||||
};
|
||||
const createRouter = () => {
|
||||
source.value = TraefikSource.LOCAL;
|
||||
modalState = baseModal();
|
||||
modalState.mode = 'create';
|
||||
modalState.isOpenRouter = true;
|
||||
open = false;
|
||||
};
|
||||
const createMiddleware = () => {
|
||||
source.value = TraefikSource.LOCAL;
|
||||
modalState = baseModal();
|
||||
modalState.mode = 'create';
|
||||
modalState.isOpenMiddleware = true;
|
||||
open = false;
|
||||
};
|
||||
const updateRouter = (router: Router, service: Service) => {
|
||||
modalState = baseModal();
|
||||
modalState.mode = 'edit';
|
||||
modalState.isOpenRouter = true;
|
||||
modalState.router = router;
|
||||
modalState.service = service;
|
||||
open = false;
|
||||
};
|
||||
const updateMiddleware = (middleware: Middleware) => {
|
||||
source.value = TraefikSource.LOCAL;
|
||||
modalState = baseModal();
|
||||
modalState.mode = 'edit';
|
||||
modalState.isOpenMiddleware = true;
|
||||
modalState.middleware = middleware;
|
||||
open = false;
|
||||
};
|
||||
|
||||
// Keyboard shortcuts
|
||||
const handleKeydown = (e: KeyboardEvent) => {
|
||||
const isEditableElement =
|
||||
document.activeElement?.tagName === 'INPUT' || document.activeElement?.tagName === 'TEXTAREA';
|
||||
|
||||
if (isEditableElement) return;
|
||||
|
||||
// Command palette toggle
|
||||
if (e.key === '/' || ((e.ctrlKey || e.metaKey) && e.key === 'k')) {
|
||||
e.preventDefault();
|
||||
open = !open;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
$effect(() => {
|
||||
document.addEventListener('keydown', handleKeydown);
|
||||
return () => document.removeEventListener('keydown', handleKeydown);
|
||||
});
|
||||
</script>
|
||||
|
||||
<RouterModal
|
||||
mode={modalState.mode}
|
||||
bind:router={modalState.router}
|
||||
bind:service={modalState.service}
|
||||
bind:open={modalState.isOpenRouter}
|
||||
/>
|
||||
<MiddlewareModal
|
||||
mode={modalState.mode}
|
||||
bind:middleware={modalState.middleware}
|
||||
bind:open={modalState.isOpenMiddleware}
|
||||
/>
|
||||
|
||||
<Command.Dialog bind:open>
|
||||
<Command.Root loop>
|
||||
<Command.Input placeholder="Search..." bind:value={searchQuery} />
|
||||
<Command.List class="max-h-[800px] overflow-x-hidden overflow-y-auto">
|
||||
{#if searchQuery !== ''}
|
||||
<Command.Group heading="Routers">
|
||||
<Command.Empty>No results found.</Command.Empty>
|
||||
{#each $routerServiceMerge || [] as m (m.router.name)}
|
||||
<Command.Item onSelect={() => updateRouter(m.router, m.service)} value={m.router.name}>
|
||||
<Route class="mr-2 h-4 w-4" />
|
||||
<span>{m.router.name}</span>
|
||||
</Command.Item>
|
||||
{/each}
|
||||
</Command.Group>
|
||||
<Command.Separator />
|
||||
<Command.Group heading="Middlewares">
|
||||
<Command.Empty>No results found.</Command.Empty>
|
||||
{#each $middlewares || [] as m (m.name)}
|
||||
<Command.Item onSelect={() => updateMiddleware(m)} value={m.name}>
|
||||
<Layers class="mr-2 h-4 w-4" />
|
||||
<span>{m.name}</span>
|
||||
</Command.Item>
|
||||
{/each}
|
||||
</Command.Group>
|
||||
{/if}
|
||||
<Command.Separator />
|
||||
<Command.Group heading="Create">
|
||||
<Command.Item onSelect={createRouter}>
|
||||
<Route class="mr-2 h-4 w-4" />
|
||||
<span>Create Router</span>
|
||||
</Command.Item>
|
||||
<Command.Item onSelect={createMiddleware}>
|
||||
<Layers class="mr-2 h-4 w-4" />
|
||||
<span>Create Middleware</span>
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
</Command.List>
|
||||
</Command.Root>
|
||||
</Command.Dialog>
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Component } from "svelte";
|
||||
import type { Component } from 'svelte';
|
||||
import {
|
||||
Bot,
|
||||
EthernetPort,
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
Settings,
|
||||
Truck,
|
||||
Users,
|
||||
type IconProps,
|
||||
} from "@lucide/svelte";
|
||||
type IconProps
|
||||
} from '@lucide/svelte';
|
||||
|
||||
type IconComponent = Component<IconProps, Record<string, never>, "">;
|
||||
type IconComponent = Component<IconProps, Record<string, never>, ''>;
|
||||
|
||||
type Routes = {
|
||||
title: string;
|
||||
@@ -23,16 +23,16 @@ type Routes = {
|
||||
};
|
||||
|
||||
export const mainRoutes: Routes[] = [
|
||||
{ title: "Dashboard", url: "/", icon: Gauge },
|
||||
{ title: "Router", url: "/router/", icon: Route },
|
||||
{ title: "Middlewares", url: "/middlewares/", icon: Layers },
|
||||
{ title: "Entry Points", url: "/entrypoints/", icon: EthernetPort },
|
||||
{ title: "Server Transports", url: "/transport/", icon: Truck },
|
||||
{ title: 'Dashboard', url: '/', icon: Gauge },
|
||||
{ title: 'Router', url: '/router/', icon: Route },
|
||||
{ title: 'Middlewares', url: '/middlewares/', icon: Layers },
|
||||
{ title: 'Entry Points', url: '/entrypoints/', icon: EthernetPort },
|
||||
{ title: 'Server Transports', url: '/transport/', icon: Truck }
|
||||
];
|
||||
export const adminRoutes: Routes[] = [
|
||||
{ title: "Users", url: "/users/", icon: Users },
|
||||
{ title: "Agents", url: "/agents/", icon: Bot },
|
||||
{ title: "DNS", url: "/dns/", icon: Globe },
|
||||
{ title: "Settings", url: "/settings/", icon: Settings },
|
||||
{ title: 'Users', url: '/users/', icon: Users },
|
||||
{ title: 'Agents', url: '/agents/', icon: Bot },
|
||||
{ title: 'DNS', url: '/dns/', icon: Globe },
|
||||
{ title: 'Settings', url: '/settings/', icon: Settings }
|
||||
];
|
||||
export const SiteRoutes = [...mainRoutes, ...adminRoutes];
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
import * as HoverCard from '$lib/components/ui/hover-card';
|
||||
import * as Tooltip from '$lib/components/ui/tooltip';
|
||||
import { Badge, type BadgeVariant } from '$lib/components/ui/badge/index.js';
|
||||
import { RouterType } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { List, Globe, Route, Shield, Eye } from '@lucide/svelte';
|
||||
import { truncateText } from '$lib/utils';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
interface Props {
|
||||
rule: string;
|
||||
routerType: RouterType.HTTP | RouterType.TCP;
|
||||
protocol: ProtocolType.HTTP | ProtocolType.TCP;
|
||||
maxDisplayLength?: number;
|
||||
showIcons?: boolean;
|
||||
}
|
||||
|
||||
let { rule, routerType, maxDisplayLength = 40, showIcons = true }: Props = $props();
|
||||
let { rule, protocol, maxDisplayLength = 40, showIcons = true }: Props = $props();
|
||||
|
||||
interface ParsedRule {
|
||||
type: 'Host' | 'Path' | 'PathPrefix' | 'HostSNI' | 'Method' | 'Headers' | 'Query' | 'Complex';
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
function getUrl(domain: string): string {
|
||||
// For HTTP routers, try HTTPS first, fallback to HTTP
|
||||
if (routerType === RouterType.HTTP) {
|
||||
if (protocol === ProtocolType.HTTP) {
|
||||
return `https://${domain}`;
|
||||
}
|
||||
// For TCP/SNI, just show the domain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { HTMLAttributes } from "svelte/elements";
|
||||
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import { cn, type WithElementRef } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
@@ -14,7 +14,7 @@
|
||||
bind:this={ref}
|
||||
data-slot="alert-description"
|
||||
class={cn(
|
||||
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
||||
'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
|
||||
className
|
||||
)}
|
||||
{...restProps}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { HTMLAttributes } from "svelte/elements";
|
||||
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import { cn, type WithElementRef } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
@@ -13,7 +13,7 @@
|
||||
<div
|
||||
bind:this={ref}
|
||||
data-slot="alert-title"
|
||||
class={cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)}
|
||||
class={cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className)}
|
||||
{...restProps}
|
||||
>
|
||||
{@render children?.()}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<script lang="ts" module>
|
||||
import { type VariantProps, tv } from "tailwind-variants";
|
||||
import { type VariantProps, tv } from 'tailwind-variants';
|
||||
|
||||
export const alertVariants = tv({
|
||||
base: "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
||||
base: 'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-card text-card-foreground",
|
||||
default: 'bg-card text-card-foreground',
|
||||
destructive:
|
||||
"text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
|
||||
},
|
||||
'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current'
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
},
|
||||
variant: 'default'
|
||||
}
|
||||
});
|
||||
|
||||
export type AlertVariant = VariantProps<typeof alertVariants>["variant"];
|
||||
export type AlertVariant = VariantProps<typeof alertVariants>['variant'];
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import type { HTMLAttributes } from "svelte/elements";
|
||||
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import { cn, type WithElementRef } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
class: className,
|
||||
variant = "default",
|
||||
variant = 'default',
|
||||
children,
|
||||
...restProps
|
||||
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Root from "./alert.svelte";
|
||||
import Description from "./alert-description.svelte";
|
||||
import Title from "./alert-title.svelte";
|
||||
export { alertVariants, type AlertVariant } from "./alert.svelte";
|
||||
import Root from './alert.svelte';
|
||||
import Description from './alert-description.svelte';
|
||||
import Title from './alert-title.svelte';
|
||||
export { alertVariants, type AlertVariant } from './alert.svelte';
|
||||
|
||||
export {
|
||||
Root,
|
||||
@@ -10,5 +10,5 @@ export {
|
||||
//
|
||||
Root as Alert,
|
||||
Description as AlertDescription,
|
||||
Title as AlertTitle,
|
||||
Title as AlertTitle
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import CustomSwitch from "./custom-switch.svelte";
|
||||
import CustomSwitch from './custom-switch.svelte';
|
||||
|
||||
export { CustomSwitch };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Root from "./tabs.svelte";
|
||||
import Content from "./tabs-content.svelte";
|
||||
import List from "./tabs-list.svelte";
|
||||
import Trigger from "./tabs-trigger.svelte";
|
||||
import Root from './tabs.svelte';
|
||||
import Content from './tabs-content.svelte';
|
||||
import List from './tabs-list.svelte';
|
||||
import Trigger from './tabs-trigger.svelte';
|
||||
|
||||
export {
|
||||
Root,
|
||||
@@ -12,5 +12,5 @@ export {
|
||||
Root as Tabs,
|
||||
Content as TabsContent,
|
||||
List as TabsList,
|
||||
Trigger as TabsTrigger,
|
||||
Trigger as TabsTrigger
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Tabs as TabsPrimitive } from "bits-ui";
|
||||
import { cn } from "$lib/utils.js";
|
||||
import { Tabs as TabsPrimitive } from 'bits-ui';
|
||||
import { cn } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
@@ -12,6 +12,6 @@
|
||||
<TabsPrimitive.Content
|
||||
bind:ref
|
||||
data-slot="tabs-content"
|
||||
class={cn("flex-1 outline-none", className)}
|
||||
class={cn('flex-1 outline-none', className)}
|
||||
{...restProps}
|
||||
/>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { Tabs as TabsPrimitive } from "bits-ui";
|
||||
import { cn } from "$lib/utils.js";
|
||||
import { Tabs as TabsPrimitive } from 'bits-ui';
|
||||
import { cn } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
class: className,
|
||||
...restProps
|
||||
}: TabsPrimitive.ListProps = $props();
|
||||
let { ref = $bindable(null), class: className, ...restProps }: TabsPrimitive.ListProps = $props();
|
||||
</script>
|
||||
|
||||
<TabsPrimitive.List
|
||||
bind:ref
|
||||
data-slot="tabs-list"
|
||||
class={cn(
|
||||
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
||||
'bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]',
|
||||
className
|
||||
)}
|
||||
{...restProps}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { Tabs as TabsPrimitive } from "bits-ui";
|
||||
import { cn } from "$lib/utils.js";
|
||||
import { Tabs as TabsPrimitive } from 'bits-ui';
|
||||
import { cn } from '$lib/utils.js';
|
||||
|
||||
let {
|
||||
ref = $bindable(null),
|
||||
value = $bindable(""),
|
||||
value = $bindable(''),
|
||||
class: className,
|
||||
...restProps
|
||||
}: TabsPrimitive.RootProps = $props();
|
||||
@@ -14,6 +14,6 @@
|
||||
bind:ref
|
||||
bind:value
|
||||
data-slot="tabs"
|
||||
class={cn("flex flex-col gap-2", className)}
|
||||
class={cn('flex flex-col gap-2', className)}
|
||||
{...restProps}
|
||||
/>
|
||||
|
||||
@@ -6,20 +6,23 @@
|
||||
import { ValidateRule } from './ruleString';
|
||||
import { CircleCheck, CircleX } from '@lucide/svelte';
|
||||
import { ruleTab } from '$lib/stores/common';
|
||||
import { RouterType } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import CustomSwitch from '../ui/custom-switch/custom-switch.svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
interface Props {
|
||||
rule?: string;
|
||||
type: RouterType.HTTP | RouterType.TCP;
|
||||
type: ProtocolType.HTTP | ProtocolType.TCP;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
let { rule = $bindable(), type = $bindable(RouterType.HTTP), disabled = false }: Props = $props();
|
||||
let {
|
||||
rule = $bindable(),
|
||||
type = $bindable(ProtocolType.HTTP),
|
||||
disabled = false
|
||||
}: Props = $props();
|
||||
|
||||
// Simplified rule templates
|
||||
const ruleTemplates = {
|
||||
[RouterType.HTTP]: [
|
||||
[ProtocolType.HTTP]: [
|
||||
'Header(`key`, `value`)',
|
||||
'HeaderRegexp(`key`, `regexp`)',
|
||||
'Host(`domain`)',
|
||||
@@ -32,7 +35,7 @@
|
||||
'QueryRegexp(`key`, `regexp`)',
|
||||
'ClientIP(`ip`)'
|
||||
],
|
||||
[RouterType.TCP]: [
|
||||
[ProtocolType.TCP]: [
|
||||
'HostSNI(`domain`)',
|
||||
'HostSNIRegexp(`regexp`)',
|
||||
'ClientIP(`ip`)',
|
||||
@@ -58,11 +61,11 @@
|
||||
$effect(() => {
|
||||
if (!rule) return;
|
||||
|
||||
const hostPattern = type === RouterType.HTTP ? /Host\(`(.*?)`\)/ : /HostSNI\(`(.*?)`\)/;
|
||||
const hostPattern = type === ProtocolType.HTTP ? /Host\(`(.*?)`\)/ : /HostSNI\(`(.*?)`\)/;
|
||||
const pathPattern = /Path\(`(.*?)`\)/;
|
||||
|
||||
host = rule.match(hostPattern)?.[1] ?? '';
|
||||
path = type === RouterType.HTTP ? (rule.match(pathPattern)?.[1] ?? '') : '';
|
||||
path = type === ProtocolType.HTTP ? (rule.match(pathPattern)?.[1] ?? '') : '';
|
||||
|
||||
checkSimpleMode();
|
||||
});
|
||||
@@ -94,7 +97,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (type === RouterType.HTTP) {
|
||||
if (type === ProtocolType.HTTP) {
|
||||
rule = [host ? `Host(\`${host}\`)` : null, path ? `Path(\`${path}\`)` : null]
|
||||
.filter(Boolean)
|
||||
.join(' && ');
|
||||
@@ -238,10 +241,10 @@
|
||||
bind:value={host}
|
||||
oninput={handleSimpleInput}
|
||||
placeholder="example.com"
|
||||
class={type === RouterType.HTTP ? 'col-span-6' : 'col-span-8'}
|
||||
class={type === ProtocolType.HTTP ? 'col-span-6' : 'col-span-8'}
|
||||
{disabled}
|
||||
/>
|
||||
{#if type === RouterType.HTTP}
|
||||
{#if type === ProtocolType.HTTP}
|
||||
<Input
|
||||
id="path"
|
||||
bind:value={path}
|
||||
|
||||
@@ -1,341 +0,0 @@
|
||||
// @generated by protoc-gen-es v2.6.2 with parameter "target=ts"
|
||||
// @generated from file mantrae/v1/event.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 { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { Agent } from "./agent_pb";
|
||||
import { file_mantrae_v1_agent } from "./agent_pb";
|
||||
import type { AuditLog } from "./auditlog_pb";
|
||||
import { file_mantrae_v1_auditlog } from "./auditlog_pb";
|
||||
import type { DnsProvider } from "./dns_provider_pb";
|
||||
import { file_mantrae_v1_dns_provider } from "./dns_provider_pb";
|
||||
import type { EntryPoint } from "./entry_point_pb";
|
||||
import { file_mantrae_v1_entry_point } from "./entry_point_pb";
|
||||
import type { Middleware } from "./middleware_pb";
|
||||
import { file_mantrae_v1_middleware } from "./middleware_pb";
|
||||
import type { Router } from "./router_pb";
|
||||
import { file_mantrae_v1_router } from "./router_pb";
|
||||
import type { Service } from "./service_pb";
|
||||
import { file_mantrae_v1_service } from "./service_pb";
|
||||
import type { User } from "./user_pb";
|
||||
import { file_mantrae_v1_user } from "./user_pb";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/event.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_event: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChZtYW50cmFlL3YxL2V2ZW50LnByb3RvEgptYW50cmFlLnYxIrMDCgxQcm9maWxlRXZlbnQSKQoKZXZlbnRfdHlwZRgBIAEoDjIVLm1hbnRyYWUudjEuRXZlbnRUeXBlEi8KDXJlc291cmNlX3R5cGUYAiABKA4yGC5tYW50cmFlLnYxLlJlc291cmNlVHlwZRISCgpwcm9maWxlX2lkGAMgASgDEi0KCXRpbWVzdGFtcBgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASJAoGcm91dGVyGAogASgLMhIubWFudHJhZS52MS5Sb3V0ZXJIABImCgdzZXJ2aWNlGAsgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlSAASLAoKbWlkZGxld2FyZRgMIAEoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZUgAEi0KC2VudHJ5X3BvaW50GA0gASgLMhYubWFudHJhZS52MS5FbnRyeVBvaW50SAASIgoFYWdlbnQYDiABKAsyES5tYW50cmFlLnYxLkFnZW50SAASKQoJYXVkaXRfbG9nGA8gASgLMhQubWFudHJhZS52MS5BdWRpdExvZ0gAQgoKCHJlc291cmNlIvcBCgtHbG9iYWxFdmVudBIpCgpldmVudF90eXBlGAEgASgOMhUubWFudHJhZS52MS5FdmVudFR5cGUSLwoNcmVzb3VyY2VfdHlwZRgCIAEoDjIYLm1hbnRyYWUudjEuUmVzb3VyY2VUeXBlEi0KCXRpbWVzdGFtcBgDIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASIAoEdXNlchgKIAEoCzIQLm1hbnRyYWUudjEuVXNlckgAEi8KDGRuc19wcm92aWRlchgLIAEoCzIXLm1hbnRyYWUudjEuRG5zUHJvdmlkZXJIAEIKCghyZXNvdXJjZSJlChRQcm9maWxlRXZlbnRzUmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEjAKDnJlc291cmNlX3R5cGVzGAIgAygOMhgubWFudHJhZS52MS5SZXNvdXJjZVR5cGUiQAoVUHJvZmlsZUV2ZW50c1Jlc3BvbnNlEicKBWV2ZW50GAEgASgLMhgubWFudHJhZS52MS5Qcm9maWxlRXZlbnQiRwoTR2xvYmFsRXZlbnRzUmVxdWVzdBIwCg5yZXNvdXJjZV90eXBlcxgBIAMoDjIYLm1hbnRyYWUudjEuUmVzb3VyY2VUeXBlIj4KFEdsb2JhbEV2ZW50c1Jlc3BvbnNlEiYKBWV2ZW50GAEgASgLMhcubWFudHJhZS52MS5HbG9iYWxFdmVudCpvCglFdmVudFR5cGUSGgoWRVZFTlRfVFlQRV9VTlNQRUNJRklFRBAAEhYKEkVWRU5UX1RZUEVfQ1JFQVRFRBABEhYKEkVWRU5UX1RZUEVfVVBEQVRFRBACEhYKEkVWRU5UX1RZUEVfREVMRVRFRBADKo0CCgxSZXNvdXJjZVR5cGUSHQoZUkVTT1VSQ0VfVFlQRV9VTlNQRUNJRklFRBAAEhgKFFJFU09VUkNFX1RZUEVfUk9VVEVSEAESGQoVUkVTT1VSQ0VfVFlQRV9TRVJWSUNFEAISHAoYUkVTT1VSQ0VfVFlQRV9NSURETEVXQVJFEAMSHQoZUkVTT1VSQ0VfVFlQRV9FTlRSWV9QT0lOVBAEEhsKF1JFU09VUkNFX1RZUEVfQVVESVRfTE9HEAUSFwoTUkVTT1VSQ0VfVFlQRV9BR0VOVBAGEhYKElJFU09VUkNFX1RZUEVfVVNFUhAHEh4KGlJFU09VUkNFX1RZUEVfRE5TX1BST1ZJREVSEAgyuwEKDEV2ZW50U2VydmljZRJWCg1Qcm9maWxlRXZlbnRzEiAubWFudHJhZS52MS5Qcm9maWxlRXZlbnRzUmVxdWVzdBohLm1hbnRyYWUudjEuUHJvZmlsZUV2ZW50c1Jlc3BvbnNlMAESUwoMR2xvYmFsRXZlbnRzEh8ubWFudHJhZS52MS5HbG9iYWxFdmVudHNSZXF1ZXN0GiAubWFudHJhZS52MS5HbG9iYWxFdmVudHNSZXNwb25zZTABQqQBCg5jb20ubWFudHJhZS52MUIKRXZlbnRQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_protobuf_timestamp, file_mantrae_v1_agent, file_mantrae_v1_auditlog, file_mantrae_v1_dns_provider, file_mantrae_v1_entry_point, file_mantrae_v1_middleware, file_mantrae_v1_router, file_mantrae_v1_service, file_mantrae_v1_user]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ProfileEvent
|
||||
*/
|
||||
export type ProfileEvent = Message<"mantrae.v1.ProfileEvent"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.EventType event_type = 1;
|
||||
*/
|
||||
eventType: EventType;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ResourceType resource_type = 2;
|
||||
*/
|
||||
resourceType: ResourceType;
|
||||
|
||||
/**
|
||||
* @generated from field: int64 profile_id = 3;
|
||||
*/
|
||||
profileId: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp timestamp = 4;
|
||||
*/
|
||||
timestamp?: Timestamp;
|
||||
|
||||
/**
|
||||
* @generated from oneof mantrae.v1.ProfileEvent.resource
|
||||
*/
|
||||
resource: {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.Router router = 10;
|
||||
*/
|
||||
value: Router;
|
||||
case: "router";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.Service service = 11;
|
||||
*/
|
||||
value: Service;
|
||||
case: "service";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.Middleware middleware = 12;
|
||||
*/
|
||||
value: Middleware;
|
||||
case: "middleware";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.EntryPoint entry_point = 13;
|
||||
*/
|
||||
value: EntryPoint;
|
||||
case: "entryPoint";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.Agent agent = 14;
|
||||
*/
|
||||
value: Agent;
|
||||
case: "agent";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.AuditLog audit_log = 15;
|
||||
*/
|
||||
value: AuditLog;
|
||||
case: "auditLog";
|
||||
} | { case: undefined; value?: undefined };
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.ProfileEvent.
|
||||
* Use `create(ProfileEventSchema)` to create a new message.
|
||||
*/
|
||||
export const ProfileEventSchema: GenMessage<ProfileEvent> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 0);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GlobalEvent
|
||||
*/
|
||||
export type GlobalEvent = Message<"mantrae.v1.GlobalEvent"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.EventType event_type = 1;
|
||||
*/
|
||||
eventType: EventType;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ResourceType resource_type = 2;
|
||||
*/
|
||||
resourceType: ResourceType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp timestamp = 3;
|
||||
*/
|
||||
timestamp?: Timestamp;
|
||||
|
||||
/**
|
||||
* @generated from oneof mantrae.v1.GlobalEvent.resource
|
||||
*/
|
||||
resource: {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.User user = 10;
|
||||
*/
|
||||
value: User;
|
||||
case: "user";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.DnsProvider dns_provider = 11;
|
||||
*/
|
||||
value: DnsProvider;
|
||||
case: "dnsProvider";
|
||||
} | { case: undefined; value?: undefined };
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GlobalEvent.
|
||||
* Use `create(GlobalEventSchema)` to create a new message.
|
||||
*/
|
||||
export const GlobalEventSchema: GenMessage<GlobalEvent> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 1);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ProfileEventsRequest
|
||||
*/
|
||||
export type ProfileEventsRequest = Message<"mantrae.v1.ProfileEventsRequest"> & {
|
||||
/**
|
||||
* @generated from field: int64 profile_id = 1;
|
||||
*/
|
||||
profileId: bigint;
|
||||
|
||||
/**
|
||||
* Filter by specific resource types
|
||||
*
|
||||
* @generated from field: repeated mantrae.v1.ResourceType resource_types = 2;
|
||||
*/
|
||||
resourceTypes: ResourceType[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.ProfileEventsRequest.
|
||||
* Use `create(ProfileEventsRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const ProfileEventsRequestSchema: GenMessage<ProfileEventsRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 2);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ProfileEventsResponse
|
||||
*/
|
||||
export type ProfileEventsResponse = Message<"mantrae.v1.ProfileEventsResponse"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ProfileEvent event = 1;
|
||||
*/
|
||||
event?: ProfileEvent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.ProfileEventsResponse.
|
||||
* Use `create(ProfileEventsResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const ProfileEventsResponseSchema: GenMessage<ProfileEventsResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 3);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GlobalEventsRequest
|
||||
*/
|
||||
export type GlobalEventsRequest = Message<"mantrae.v1.GlobalEventsRequest"> & {
|
||||
/**
|
||||
* Filter by specific resource types
|
||||
*
|
||||
* @generated from field: repeated mantrae.v1.ResourceType resource_types = 1;
|
||||
*/
|
||||
resourceTypes: ResourceType[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GlobalEventsRequest.
|
||||
* Use `create(GlobalEventsRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const GlobalEventsRequestSchema: GenMessage<GlobalEventsRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 4);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GlobalEventsResponse
|
||||
*/
|
||||
export type GlobalEventsResponse = Message<"mantrae.v1.GlobalEventsResponse"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.GlobalEvent event = 1;
|
||||
*/
|
||||
event?: GlobalEvent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GlobalEventsResponse.
|
||||
* Use `create(GlobalEventsResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const GlobalEventsResponseSchema: GenMessage<GlobalEventsResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_event, 5);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.EventType
|
||||
*/
|
||||
export enum EventType {
|
||||
/**
|
||||
* @generated from enum value: EVENT_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: EVENT_TYPE_CREATED = 1;
|
||||
*/
|
||||
CREATED = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: EVENT_TYPE_UPDATED = 2;
|
||||
*/
|
||||
UPDATED = 2,
|
||||
|
||||
/**
|
||||
* @generated from enum value: EVENT_TYPE_DELETED = 3;
|
||||
*/
|
||||
DELETED = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.EventType.
|
||||
*/
|
||||
export const EventTypeSchema: GenEnum<EventType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_event, 0);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.ResourceType
|
||||
*/
|
||||
export enum ResourceType {
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_ROUTER = 1;
|
||||
*/
|
||||
ROUTER = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_SERVICE = 2;
|
||||
*/
|
||||
SERVICE = 2,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_MIDDLEWARE = 3;
|
||||
*/
|
||||
MIDDLEWARE = 3,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_ENTRY_POINT = 4;
|
||||
*/
|
||||
ENTRY_POINT = 4,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_AUDIT_LOG = 5;
|
||||
*/
|
||||
AUDIT_LOG = 5,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_AGENT = 6;
|
||||
*/
|
||||
AGENT = 6,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_USER = 7;
|
||||
*/
|
||||
USER = 7,
|
||||
|
||||
/**
|
||||
* @generated from enum value: RESOURCE_TYPE_DNS_PROVIDER = 8;
|
||||
*/
|
||||
DNS_PROVIDER = 8,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.ResourceType.
|
||||
*/
|
||||
export const ResourceTypeSchema: GenEnum<ResourceType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_event, 1);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.EventService
|
||||
*/
|
||||
export const EventService: GenService<{
|
||||
/**
|
||||
* Profile-scoped events (routers, services, middlewares, entrypoints)
|
||||
*
|
||||
* @generated from rpc mantrae.v1.EventService.ProfileEvents
|
||||
*/
|
||||
profileEvents: {
|
||||
methodKind: "server_streaming";
|
||||
input: typeof ProfileEventsRequestSchema;
|
||||
output: typeof ProfileEventsResponseSchema;
|
||||
},
|
||||
/**
|
||||
* Global events (users, dns)
|
||||
*
|
||||
* @generated from rpc mantrae.v1.EventService.GlobalEvents
|
||||
*/
|
||||
globalEvents: {
|
||||
methodKind: "server_streaming";
|
||||
input: typeof GlobalEventsRequestSchema;
|
||||
output: typeof GlobalEventsResponseSchema;
|
||||
},
|
||||
}> = /*@__PURE__*/
|
||||
serviceDesc(file_mantrae_v1_event, 0);
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
// @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 { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { ProtocolType } from "./protocol_pb";
|
||||
import { file_mantrae_v1_protocol } from "./protocol_pb";
|
||||
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/middleware.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_middleware: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChttYW50cmFlL3YxL21pZGRsZXdhcmUucHJvdG8SCm1hbnRyYWUudjEipAIKCk1pZGRsZXdhcmUSCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEicKBmNvbmZpZxgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgGIAEoCBISCgppc19kZWZhdWx0GAcgASgIEigKBHR5cGUYCCABKA4yGi5tYW50cmFlLnYxLk1pZGRsZXdhcmVUeXBlEi4KCmNyZWF0ZWRfYXQYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYCiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIqYCCgZQbHVnaW4SCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxkaXNwbGF5X25hbWUYAyABKAkSDgoGYXV0aG9yGAQgASgJEgwKBHR5cGUYBSABKAkSDgoGaW1wb3J0GAYgASgJEg8KB3N1bW1hcnkYByABKAkSEAoIaWNvbl91cmwYCCABKAkSEgoKYmFubmVyX3VybBgJIAEoCRIOCgZyZWFkbWUYCiABKAkSFgoObGF0ZXN0X3ZlcnNpb24YCyABKAkSEAoIdmVyc2lvbnMYDCADKAkSDQoFc3RhcnMYDSABKAMSKgoHc25pcHBldBgOIAEoCzIZLm1hbnRyYWUudjEuUGx1Z2luU25pcHBldBISCgpjcmVhdGVkX2F0GA8gASgJIjgKDVBsdWdpblNuaXBwZXQSCwoDazhzGAEgASgJEgwKBHlhbWwYAiABKAkSDAoEdG9tbBgDIAEoCSJfChRHZXRNaWRkbGV3YXJlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIyCgR0eXBlGAIgASgOMhoubWFudHJhZS52MS5NaWRkbGV3YXJlVHlwZUIIukgFggECEAEiQwoVR2V0TWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUi4gEKF0NyZWF0ZU1pZGRsZXdhcmVSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASFQoIYWdlbnRfaWQYAiABKAlIAIgBARIVCgRuYW1lGAMgASgJQge6SARyAhABEjIKBHR5cGUYBCABKA4yGi5tYW50cmFlLnYxLk1pZGRsZXdhcmVUeXBlQgi6SAWCAQIQARISCgppc19kZWZhdWx0GAUgASgIEicKBmNvbmZpZxgGIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RCCwoJX2FnZW50X2lkIkYKGENyZWF0ZU1pZGRsZXdhcmVSZXNwb25zZRIqCgptaWRkbGV3YXJlGAEgASgLMhYubWFudHJhZS52MS5NaWRkbGV3YXJlIscBChdVcGRhdGVNaWRkbGV3YXJlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEjIKBHR5cGUYAyABKA4yGi5tYW50cmFlLnYxLk1pZGRsZXdhcmVUeXBlQgi6SAWCAQIQARInCgZjb25maWcYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBSABKAgSEgoKaXNfZGVmYXVsdBgGIAEoCCJGChhVcGRhdGVNaWRkbGV3YXJlUmVzcG9uc2USKgoKbWlkZGxld2FyZRgBIAEoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZSJiChdEZWxldGVNaWRkbGV3YXJlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIyCgR0eXBlGAIgASgOMhoubWFudHJhZS52MS5NaWRkbGV3YXJlVHlwZUIIukgFggECEAEiGgoYRGVsZXRlTWlkZGxld2FyZVJlc3BvbnNlIrkCChZMaXN0TWlkZGxld2FyZXNSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASHgoIYWdlbnRfaWQYAiABKAlCB7pIBHICEAFIAIgBARItCgR0eXBlGAMgASgOMhoubWFudHJhZS52MS5NaWRkbGV3YXJlVHlwZUgBiAEBEmoKBWxpbWl0GAQgASgDQla6SFO6AVAKC2xpbWl0LnZhbGlkEilsaW1pdCBtdXN0IGJlIGVpdGhlciAtMSBvciBncmVhdGVyIHRoYW4gMBoWdGhpcyA9PSAtMSB8fCB0aGlzID4gMEgCiAEBEhwKBm9mZnNldBgFIAEoA0IHukgEIgIoAEgDiAEBQgsKCV9hZ2VudF9pZEIHCgVfdHlwZUIICgZfbGltaXRCCQoHX29mZnNldCJbChdMaXN0TWlkZGxld2FyZXNSZXNwb25zZRIrCgttaWRkbGV3YXJlcxgBIAMoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZRITCgt0b3RhbF9jb3VudBgCIAEoAyIdChtHZXRNaWRkbGV3YXJlUGx1Z2luc1JlcXVlc3QiQwocR2V0TWlkZGxld2FyZVBsdWdpbnNSZXNwb25zZRIjCgdwbHVnaW5zGAEgAygLMhIubWFudHJhZS52MS5QbHVnaW4qZAoOTWlkZGxld2FyZVR5cGUSHwobTUlERExFV0FSRV9UWVBFX1VOU1BFQ0lGSUVEEAASGAoUTUlERExFV0FSRV9UWVBFX0hUVFAQARIXChNNSURETEVXQVJFX1RZUEVfVENQEAIy3AQKEU1pZGRsZXdhcmVTZXJ2aWNlElkKDUdldE1pZGRsZXdhcmUSIC5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVSZXF1ZXN0GiEubWFudHJhZS52MS5HZXRNaWRkbGV3YXJlUmVzcG9uc2UiA5ACARJdChBDcmVhdGVNaWRkbGV3YXJlEiMubWFudHJhZS52MS5DcmVhdGVNaWRkbGV3YXJlUmVxdWVzdBokLm1hbnRyYWUudjEuQ3JlYXRlTWlkZGxld2FyZVJlc3BvbnNlEl0KEFVwZGF0ZU1pZGRsZXdhcmUSIy5tYW50cmFlLnYxLlVwZGF0ZU1pZGRsZXdhcmVSZXF1ZXN0GiQubWFudHJhZS52MS5VcGRhdGVNaWRkbGV3YXJlUmVzcG9uc2USXQoQRGVsZXRlTWlkZGxld2FyZRIjLm1hbnRyYWUudjEuRGVsZXRlTWlkZGxld2FyZVJlcXVlc3QaJC5tYW50cmFlLnYxLkRlbGV0ZU1pZGRsZXdhcmVSZXNwb25zZRJfCg9MaXN0TWlkZGxld2FyZXMSIi5tYW50cmFlLnYxLkxpc3RNaWRkbGV3YXJlc1JlcXVlc3QaIy5tYW50cmFlLnYxLkxpc3RNaWRkbGV3YXJlc1Jlc3BvbnNlIgOQAgESbgoUR2V0TWlkZGxld2FyZVBsdWdpbnMSJy5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVQbHVnaW5zUmVxdWVzdBooLm1hbnRyYWUudjEuR2V0TWlkZGxld2FyZVBsdWdpbnNSZXNwb25zZSIDkAIBQqkBCg5jb20ubWFudHJhZS52MUIPTWlkZGxld2FyZVByb3RvUAFaPWdpdGh1Yi5jb20vbWl6dWNoaWxhYnMvbWFudHJhZS9wcm90by9nZW4vbWFudHJhZS92MTttYW50cmFldjGiAgNNWFiqAgpNYW50cmFlLlYxygIKTWFudHJhZVxWMeICFk1hbnRyYWVcVjFcR1BCTWV0YWRhdGHqAgtNYW50cmFlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp]);
|
||||
fileDesc("ChttYW50cmFlL3YxL21pZGRsZXdhcmUucHJvdG8SCm1hbnRyYWUudjEiogIKCk1pZGRsZXdhcmUSCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEicKBmNvbmZpZxgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgGIAEoCBISCgppc19kZWZhdWx0GAcgASgIEiYKBHR5cGUYCCABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZRIuCgpjcmVhdGVkX2F0GAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAogASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCKmAgoGUGx1Z2luEgoKAmlkGAEgASgJEgwKBG5hbWUYAiABKAkSFAoMZGlzcGxheV9uYW1lGAMgASgJEg4KBmF1dGhvchgEIAEoCRIMCgR0eXBlGAUgASgJEg4KBmltcG9ydBgGIAEoCRIPCgdzdW1tYXJ5GAcgASgJEhAKCGljb25fdXJsGAggASgJEhIKCmJhbm5lcl91cmwYCSABKAkSDgoGcmVhZG1lGAogASgJEhYKDmxhdGVzdF92ZXJzaW9uGAsgASgJEhAKCHZlcnNpb25zGAwgAygJEg0KBXN0YXJzGA0gASgDEioKB3NuaXBwZXQYDiABKAsyGS5tYW50cmFlLnYxLlBsdWdpblNuaXBwZXQSEgoKY3JlYXRlZF9hdBgPIAEoCSI4Cg1QbHVnaW5TbmlwcGV0EgsKA2s4cxgBIAEoCRIMCgR5YW1sGAIgASgJEgwKBHRvbWwYAyABKAkiXQoUR2V0TWlkZGxld2FyZVJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASMAoEdHlwZRgCIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQASJDChVHZXRNaWRkbGV3YXJlUmVzcG9uc2USKgoKbWlkZGxld2FyZRgBIAEoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZSLgAQoXQ3JlYXRlTWlkZGxld2FyZVJlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABIVCghhZ2VudF9pZBgCIAEoCUgAiAEBEhUKBG5hbWUYAyABKAlCB7pIBHICEAESMAoEdHlwZRgEIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQARISCgppc19kZWZhdWx0GAUgASgIEicKBmNvbmZpZxgGIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RCCwoJX2FnZW50X2lkIkYKGENyZWF0ZU1pZGRsZXdhcmVSZXNwb25zZRIqCgptaWRkbGV3YXJlGAEgASgLMhYubWFudHJhZS52MS5NaWRkbGV3YXJlIsUBChdVcGRhdGVNaWRkbGV3YXJlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEjAKBHR5cGUYAyABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUIIukgFggECEAESJwoGY29uZmlnGAQgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIPCgdlbmFibGVkGAUgASgIEhIKCmlzX2RlZmF1bHQYBiABKAgiRgoYVXBkYXRlTWlkZGxld2FyZVJlc3BvbnNlEioKCm1pZGRsZXdhcmUYASABKAsyFi5tYW50cmFlLnYxLk1pZGRsZXdhcmUiYAoXRGVsZXRlTWlkZGxld2FyZVJlcXVlc3QSEwoCaWQYAiABKANCB7pIBCICIAASMAoEdHlwZRgDIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQASIaChhEZWxldGVNaWRkbGV3YXJlUmVzcG9uc2UitwIKFkxpc3RNaWRkbGV3YXJlc1JlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABIeCghhZ2VudF9pZBgCIAEoCUIHukgEcgIQAUgAiAEBEisKBHR5cGUYAyABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUgBiAEBEmoKBWxpbWl0GAQgASgDQla6SFO6AVAKC2xpbWl0LnZhbGlkEilsaW1pdCBtdXN0IGJlIGVpdGhlciAtMSBvciBncmVhdGVyIHRoYW4gMBoWdGhpcyA9PSAtMSB8fCB0aGlzID4gMEgCiAEBEhwKBm9mZnNldBgFIAEoA0IHukgEIgIoAEgDiAEBQgsKCV9hZ2VudF9pZEIHCgVfdHlwZUIICgZfbGltaXRCCQoHX29mZnNldCJbChdMaXN0TWlkZGxld2FyZXNSZXNwb25zZRIrCgttaWRkbGV3YXJlcxgBIAMoCzIWLm1hbnRyYWUudjEuTWlkZGxld2FyZRITCgt0b3RhbF9jb3VudBgCIAEoAyIdChtHZXRNaWRkbGV3YXJlUGx1Z2luc1JlcXVlc3QiQwocR2V0TWlkZGxld2FyZVBsdWdpbnNSZXNwb25zZRIjCgdwbHVnaW5zGAEgAygLMhIubWFudHJhZS52MS5QbHVnaW4y3AQKEU1pZGRsZXdhcmVTZXJ2aWNlElkKDUdldE1pZGRsZXdhcmUSIC5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVSZXF1ZXN0GiEubWFudHJhZS52MS5HZXRNaWRkbGV3YXJlUmVzcG9uc2UiA5ACARJdChBDcmVhdGVNaWRkbGV3YXJlEiMubWFudHJhZS52MS5DcmVhdGVNaWRkbGV3YXJlUmVxdWVzdBokLm1hbnRyYWUudjEuQ3JlYXRlTWlkZGxld2FyZVJlc3BvbnNlEl0KEFVwZGF0ZU1pZGRsZXdhcmUSIy5tYW50cmFlLnYxLlVwZGF0ZU1pZGRsZXdhcmVSZXF1ZXN0GiQubWFudHJhZS52MS5VcGRhdGVNaWRkbGV3YXJlUmVzcG9uc2USXQoQRGVsZXRlTWlkZGxld2FyZRIjLm1hbnRyYWUudjEuRGVsZXRlTWlkZGxld2FyZVJlcXVlc3QaJC5tYW50cmFlLnYxLkRlbGV0ZU1pZGRsZXdhcmVSZXNwb25zZRJfCg9MaXN0TWlkZGxld2FyZXMSIi5tYW50cmFlLnYxLkxpc3RNaWRkbGV3YXJlc1JlcXVlc3QaIy5tYW50cmFlLnYxLkxpc3RNaWRkbGV3YXJlc1Jlc3BvbnNlIgOQAgESbgoUR2V0TWlkZGxld2FyZVBsdWdpbnMSJy5tYW50cmFlLnYxLkdldE1pZGRsZXdhcmVQbHVnaW5zUmVxdWVzdBooLm1hbnRyYWUudjEuR2V0TWlkZGxld2FyZVBsdWdpbnNSZXNwb25zZSIDkAIBQqkBCg5jb20ubWFudHJhZS52MUIPTWlkZGxld2FyZVByb3RvUAFaPWdpdGh1Yi5jb20vbWl6dWNoaWxhYnMvbWFudHJhZS9wcm90by9nZW4vbWFudHJhZS92MTttYW50cmFldjGiAgNNWFiqAgpNYW50cmFlLlYxygIKTWFudHJhZVxWMeICFk1hbnRyYWVcVjFcR1BCTWV0YWRhdGHqAgtNYW50cmFlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp, file_mantrae_v1_protocol]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.Middleware
|
||||
@@ -55,9 +57,9 @@ export type Middleware = Message<"mantrae.v1.Middleware"> & {
|
||||
isDefault: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.MiddlewareType type = 8;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 8;
|
||||
*/
|
||||
type: MiddlewareType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp created_at = 9;
|
||||
@@ -201,9 +203,9 @@ export type GetMiddlewareRequest = Message<"mantrae.v1.GetMiddlewareRequest"> &
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.MiddlewareType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: MiddlewareType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -250,9 +252,9 @@ export type CreateMiddlewareRequest = Message<"mantrae.v1.CreateMiddlewareReques
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.MiddlewareType type = 4;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 4;
|
||||
*/
|
||||
type: MiddlewareType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: bool is_default = 5;
|
||||
@@ -304,9 +306,9 @@ export type UpdateMiddlewareRequest = Message<"mantrae.v1.UpdateMiddlewareReques
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.MiddlewareType type = 3;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type: MiddlewareType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct config = 4;
|
||||
@@ -353,14 +355,14 @@ export const UpdateMiddlewareResponseSchema: GenMessage<UpdateMiddlewareResponse
|
||||
*/
|
||||
export type DeleteMiddlewareRequest = Message<"mantrae.v1.DeleteMiddlewareRequest"> & {
|
||||
/**
|
||||
* @generated from field: int64 id = 1;
|
||||
* @generated from field: int64 id = 2;
|
||||
*/
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.MiddlewareType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type: MiddlewareType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -398,9 +400,9 @@ export type ListMiddlewaresRequest = Message<"mantrae.v1.ListMiddlewaresRequest"
|
||||
agentId?: string;
|
||||
|
||||
/**
|
||||
* @generated from field: optional mantrae.v1.MiddlewareType type = 3;
|
||||
* @generated from field: optional mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type?: MiddlewareType;
|
||||
type?: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: optional int64 limit = 4;
|
||||
@@ -472,32 +474,6 @@ export type GetMiddlewarePluginsResponse = Message<"mantrae.v1.GetMiddlewarePlug
|
||||
export const GetMiddlewarePluginsResponseSchema: GenMessage<GetMiddlewarePluginsResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_middleware, 14);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.MiddlewareType
|
||||
*/
|
||||
export enum MiddlewareType {
|
||||
/**
|
||||
* @generated from enum value: MIDDLEWARE_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: MIDDLEWARE_TYPE_HTTP = 1;
|
||||
*/
|
||||
HTTP = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: MIDDLEWARE_TYPE_TCP = 2;
|
||||
*/
|
||||
TCP = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.MiddlewareType.
|
||||
*/
|
||||
export const MiddlewareTypeSchema: GenEnum<MiddlewareType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_middleware, 0);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.MiddlewareService
|
||||
*/
|
||||
|
||||
44
web/src/lib/gen/mantrae/v1/protocol_pb.ts
Normal file
44
web/src/lib/gen/mantrae/v1/protocol_pb.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// @generated by protoc-gen-es v2.6.2 with parameter "target=ts"
|
||||
// @generated from file mantrae/v1/protocol.proto (package mantrae.v1, syntax proto3)
|
||||
/* eslint-disable */
|
||||
|
||||
import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2";
|
||||
import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/protocol.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_protocol: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChltYW50cmFlL3YxL3Byb3RvY29sLnByb3RvEgptYW50cmFlLnYxKnMKDFByb3RvY29sVHlwZRIdChlQUk9UT0NPTF9UWVBFX1VOU1BFQ0lGSUVEEAASFgoSUFJPVE9DT0xfVFlQRV9IVFRQEAESFQoRUFJPVE9DT0xfVFlQRV9UQ1AQAhIVChFQUk9UT0NPTF9UWVBFX1VEUBADQqcBCg5jb20ubWFudHJhZS52MUINUHJvdG9jb2xQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw");
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.ProtocolType
|
||||
*/
|
||||
export enum ProtocolType {
|
||||
/**
|
||||
* @generated from enum value: PROTOCOL_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: PROTOCOL_TYPE_HTTP = 1;
|
||||
*/
|
||||
HTTP = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: PROTOCOL_TYPE_TCP = 2;
|
||||
*/
|
||||
TCP = 2,
|
||||
|
||||
/**
|
||||
* @generated from enum value: PROTOCOL_TYPE_UDP = 3;
|
||||
*/
|
||||
UDP = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.ProtocolType.
|
||||
*/
|
||||
export const ProtocolTypeSchema: GenEnum<ProtocolType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_protocol, 0);
|
||||
|
||||
@@ -2,20 +2,22 @@
|
||||
// @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 { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { DnsProvider } from "./dns_provider_pb";
|
||||
import { file_mantrae_v1_dns_provider } from "./dns_provider_pb";
|
||||
import type { ProtocolType } from "./protocol_pb";
|
||||
import { file_mantrae_v1_protocol } from "./protocol_pb";
|
||||
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/router.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_router: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChdtYW50cmFlL3YxL3JvdXRlci5wcm90bxIKbWFudHJhZS52MSK4AgoGUm91dGVyEgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIYWdlbnRfaWQYAyABKAkSDAoEbmFtZRgEIAEoCRInCgZjb25maWcYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBiABKAgSJAoEdHlwZRgHIAEoDjIWLm1hbnRyYWUudjEuUm91dGVyVHlwZRIuCg1kbnNfcHJvdmlkZXJzGAggAygLMhcubWFudHJhZS52MS5EbnNQcm92aWRlchIuCgpjcmVhdGVkX2F0GAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAogASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCJXChBHZXRSb3V0ZXJSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAEi4KBHR5cGUYAiABKA4yFi5tYW50cmFlLnYxLlJvdXRlclR5cGVCCLpIBYIBAhABIjcKEUdldFJvdXRlclJlc3BvbnNlEiIKBnJvdXRlchgBIAEoCzISLm1hbnRyYWUudjEuUm91dGVyItcBChNDcmVhdGVSb3V0ZXJSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASFQoIYWdlbnRfaWQYAiABKAlIAIgBARIVCgRuYW1lGAMgASgJQge6SARyAhABEicKBmNvbmZpZxgEIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgFIAEoCBIuCgR0eXBlGAYgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlQgi6SAWCAQIQAUILCglfYWdlbnRfaWQiOgoUQ3JlYXRlUm91dGVyUmVzcG9uc2USIgoGcm91dGVyGAEgASgLMhIubWFudHJhZS52MS5Sb3V0ZXIi2wEKE1VwZGF0ZVJvdXRlclJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASFQoEbmFtZRgCIAEoCUIHukgEcgIQARIuCgR0eXBlGAMgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlQgi6SAWCAQIQARInCgZjb25maWcYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBSABKAgSLgoNZG5zX3Byb3ZpZGVycxgGIAMoCzIXLm1hbnRyYWUudjEuRG5zUHJvdmlkZXIiOgoUVXBkYXRlUm91dGVyUmVzcG9uc2USIgoGcm91dGVyGAEgASgLMhIubWFudHJhZS52MS5Sb3V0ZXIiWgoTRGVsZXRlUm91dGVyUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIuCgR0eXBlGAIgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlQgi6SAWCAQIQASIWChREZWxldGVSb3V0ZXJSZXNwb25zZSKxAgoSTGlzdFJvdXRlcnNSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASHgoIYWdlbnRfaWQYAiABKAlCB7pIBHICEAFIAIgBARIpCgR0eXBlGAMgASgOMhYubWFudHJhZS52MS5Sb3V0ZXJUeXBlSAGIAQESagoFbGltaXQYBCABKANCVrpIU7oBUAoLbGltaXQudmFsaWQSKWxpbWl0IG11c3QgYmUgZWl0aGVyIC0xIG9yIGdyZWF0ZXIgdGhhbiAwGhZ0aGlzID09IC0xIHx8IHRoaXMgPiAwSAKIAQESHAoGb2Zmc2V0GAUgASgDQge6SAQiAigASAOIAQFCCwoJX2FnZW50X2lkQgcKBV90eXBlQggKBl9saW1pdEIJCgdfb2Zmc2V0Ik8KE0xpc3RSb3V0ZXJzUmVzcG9uc2USIwoHcm91dGVycxgBIAMoCzISLm1hbnRyYWUudjEuUm91dGVyEhMKC3RvdGFsX2NvdW50GAIgASgDKmkKClJvdXRlclR5cGUSGwoXUk9VVEVSX1RZUEVfVU5TUEVDSUZJRUQQABIUChBST1VURVJfVFlQRV9IVFRQEAESEwoPUk9VVEVSX1RZUEVfVENQEAISEwoPUk9VVEVSX1RZUEVfVURQEAMyrAMKDVJvdXRlclNlcnZpY2USTQoJR2V0Um91dGVyEhwubWFudHJhZS52MS5HZXRSb3V0ZXJSZXF1ZXN0Gh0ubWFudHJhZS52MS5HZXRSb3V0ZXJSZXNwb25zZSIDkAIBElEKDENyZWF0ZVJvdXRlchIfLm1hbnRyYWUudjEuQ3JlYXRlUm91dGVyUmVxdWVzdBogLm1hbnRyYWUudjEuQ3JlYXRlUm91dGVyUmVzcG9uc2USUQoMVXBkYXRlUm91dGVyEh8ubWFudHJhZS52MS5VcGRhdGVSb3V0ZXJSZXF1ZXN0GiAubWFudHJhZS52MS5VcGRhdGVSb3V0ZXJSZXNwb25zZRJRCgxEZWxldGVSb3V0ZXISHy5tYW50cmFlLnYxLkRlbGV0ZVJvdXRlclJlcXVlc3QaIC5tYW50cmFlLnYxLkRlbGV0ZVJvdXRlclJlc3BvbnNlElMKC0xpc3RSb3V0ZXJzEh4ubWFudHJhZS52MS5MaXN0Um91dGVyc1JlcXVlc3QaHy5tYW50cmFlLnYxLkxpc3RSb3V0ZXJzUmVzcG9uc2UiA5ACAUKlAQoOY29tLm1hbnRyYWUudjFCC1JvdXRlclByb3RvUAFaPWdpdGh1Yi5jb20vbWl6dWNoaWxhYnMvbWFudHJhZS9wcm90by9nZW4vbWFudHJhZS92MTttYW50cmFldjGiAgNNWFiqAgpNYW50cmFlLlYxygIKTWFudHJhZVxWMeICFk1hbnRyYWVcVjFcR1BCTWV0YWRhdGHqAgtNYW50cmFlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp, file_mantrae_v1_dns_provider]);
|
||||
fileDesc("ChdtYW50cmFlL3YxL3JvdXRlci5wcm90bxIKbWFudHJhZS52MSK6AgoGUm91dGVyEgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIYWdlbnRfaWQYAyABKAkSDAoEbmFtZRgEIAEoCRInCgZjb25maWcYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBiABKAgSJgoEdHlwZRgHIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlEi4KDWRuc19wcm92aWRlcnMYCCADKAsyFy5tYW50cmFlLnYxLkRuc1Byb3ZpZGVyEi4KCmNyZWF0ZWRfYXQYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYCiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIlkKEEdldFJvdXRlclJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASMAoEdHlwZRgCIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQASI3ChFHZXRSb3V0ZXJSZXNwb25zZRIiCgZyb3V0ZXIYASABKAsyEi5tYW50cmFlLnYxLlJvdXRlciLZAQoTQ3JlYXRlUm91dGVyUmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEhUKCGFnZW50X2lkGAIgASgJSACIAQESFQoEbmFtZRgDIAEoCUIHukgEcgIQARInCgZjb25maWcYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBSABKAgSMAoEdHlwZRgGIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQAUILCglfYWdlbnRfaWQiOgoUQ3JlYXRlUm91dGVyUmVzcG9uc2USIgoGcm91dGVyGAEgASgLMhIubWFudHJhZS52MS5Sb3V0ZXIi3QEKE1VwZGF0ZVJvdXRlclJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASFQoEbmFtZRgCIAEoCUIHukgEcgIQARIwCgR0eXBlGAMgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGVCCLpIBYIBAhABEicKBmNvbmZpZxgEIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgFIAEoCBIuCg1kbnNfcHJvdmlkZXJzGAYgAygLMhcubWFudHJhZS52MS5EbnNQcm92aWRlciI6ChRVcGRhdGVSb3V0ZXJSZXNwb25zZRIiCgZyb3V0ZXIYASABKAsyEi5tYW50cmFlLnYxLlJvdXRlciJcChNEZWxldGVSb3V0ZXJSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAEjAKBHR5cGUYAiABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUIIukgFggECEAEiFgoURGVsZXRlUm91dGVyUmVzcG9uc2UiswIKEkxpc3RSb3V0ZXJzUmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEh4KCGFnZW50X2lkGAIgASgJQge6SARyAhABSACIAQESKwoEdHlwZRgDIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlSAGIAQESagoFbGltaXQYBCABKANCVrpIU7oBUAoLbGltaXQudmFsaWQSKWxpbWl0IG11c3QgYmUgZWl0aGVyIC0xIG9yIGdyZWF0ZXIgdGhhbiAwGhZ0aGlzID09IC0xIHx8IHRoaXMgPiAwSAKIAQESHAoGb2Zmc2V0GAUgASgDQge6SAQiAigASAOIAQFCCwoJX2FnZW50X2lkQgcKBV90eXBlQggKBl9saW1pdEIJCgdfb2Zmc2V0Ik8KE0xpc3RSb3V0ZXJzUmVzcG9uc2USIwoHcm91dGVycxgBIAMoCzISLm1hbnRyYWUudjEuUm91dGVyEhMKC3RvdGFsX2NvdW50GAIgASgDMqwDCg1Sb3V0ZXJTZXJ2aWNlEk0KCUdldFJvdXRlchIcLm1hbnRyYWUudjEuR2V0Um91dGVyUmVxdWVzdBodLm1hbnRyYWUudjEuR2V0Um91dGVyUmVzcG9uc2UiA5ACARJRCgxDcmVhdGVSb3V0ZXISHy5tYW50cmFlLnYxLkNyZWF0ZVJvdXRlclJlcXVlc3QaIC5tYW50cmFlLnYxLkNyZWF0ZVJvdXRlclJlc3BvbnNlElEKDFVwZGF0ZVJvdXRlchIfLm1hbnRyYWUudjEuVXBkYXRlUm91dGVyUmVxdWVzdBogLm1hbnRyYWUudjEuVXBkYXRlUm91dGVyUmVzcG9uc2USUQoMRGVsZXRlUm91dGVyEh8ubWFudHJhZS52MS5EZWxldGVSb3V0ZXJSZXF1ZXN0GiAubWFudHJhZS52MS5EZWxldGVSb3V0ZXJSZXNwb25zZRJTCgtMaXN0Um91dGVycxIeLm1hbnRyYWUudjEuTGlzdFJvdXRlcnNSZXF1ZXN0Gh8ubWFudHJhZS52MS5MaXN0Um91dGVyc1Jlc3BvbnNlIgOQAgFCpQEKDmNvbS5tYW50cmFlLnYxQgtSb3V0ZXJQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp, file_mantrae_v1_dns_provider, file_mantrae_v1_protocol]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.Router
|
||||
@@ -52,9 +54,9 @@ export type Router = Message<"mantrae.v1.Router"> & {
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.RouterType type = 7;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 7;
|
||||
*/
|
||||
type: RouterType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: repeated mantrae.v1.DnsProvider dns_providers = 8;
|
||||
@@ -89,9 +91,9 @@ export type GetRouterRequest = Message<"mantrae.v1.GetRouterRequest"> & {
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.RouterType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: RouterType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -148,9 +150,9 @@ export type CreateRouterRequest = Message<"mantrae.v1.CreateRouterRequest"> & {
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.RouterType type = 6;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 6;
|
||||
*/
|
||||
type: RouterType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -192,9 +194,9 @@ export type UpdateRouterRequest = Message<"mantrae.v1.UpdateRouterRequest"> & {
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.RouterType type = 3;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type: RouterType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct config = 4;
|
||||
@@ -246,9 +248,9 @@ export type DeleteRouterRequest = Message<"mantrae.v1.DeleteRouterRequest"> & {
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.RouterType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: RouterType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -286,9 +288,9 @@ export type ListRoutersRequest = Message<"mantrae.v1.ListRoutersRequest"> & {
|
||||
agentId?: string;
|
||||
|
||||
/**
|
||||
* @generated from field: optional mantrae.v1.RouterType type = 3;
|
||||
* @generated from field: optional mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type?: RouterType;
|
||||
type?: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: optional int64 limit = 4;
|
||||
@@ -330,37 +332,6 @@ export type ListRoutersResponse = Message<"mantrae.v1.ListRoutersResponse"> & {
|
||||
export const ListRoutersResponseSchema: GenMessage<ListRoutersResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_router, 10);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.RouterType
|
||||
*/
|
||||
export enum RouterType {
|
||||
/**
|
||||
* @generated from enum value: ROUTER_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: ROUTER_TYPE_HTTP = 1;
|
||||
*/
|
||||
HTTP = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: ROUTER_TYPE_TCP = 2;
|
||||
*/
|
||||
TCP = 2,
|
||||
|
||||
/**
|
||||
* @generated from enum value: ROUTER_TYPE_UDP = 3;
|
||||
*/
|
||||
UDP = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.RouterType.
|
||||
*/
|
||||
export const RouterTypeSchema: GenEnum<RouterType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_router, 0);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.RouterService
|
||||
*/
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
// @generated from file mantrae/v1/servers_transport.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 { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { ProtocolType } from "./protocol_pb";
|
||||
import { file_mantrae_v1_protocol } from "./protocol_pb";
|
||||
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/servers_transport.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_servers_transport: GenFile = /*@__PURE__*/
|
||||
fileDesc("CiJtYW50cmFlL3YxL3NlcnZlcnNfdHJhbnNwb3J0LnByb3RvEgptYW50cmFlLnYxIpwCChBTZXJ2ZXJzVHJhbnNwb3J0EgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIYWdlbnRfaWQYAyABKAkSDAoEbmFtZRgEIAEoCRInCgZjb25maWcYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBiABKAgSLgoEdHlwZRgHIAEoDjIgLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydFR5cGUSLgoKY3JlYXRlZF9hdBgIIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgJIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiawoaR2V0U2VydmVyc1RyYW5zcG9ydFJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASOAoEdHlwZRgCIAEoDjIgLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydFR5cGVCCLpIBYIBAhABIlYKG0dldFNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZRI3ChFzZXJ2ZXJzX3RyYW5zcG9ydBgBIAEoCzIcLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydCLrAQodQ3JlYXRlU2VydmVyc1RyYW5zcG9ydFJlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABIVCghhZ2VudF9pZBgCIAEoCUgAiAEBEhUKBG5hbWUYAyABKAlCB7pIBHICEAESJwoGY29uZmlnGAQgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIPCgdlbmFibGVkGAUgASgIEjgKBHR5cGUYBiABKA4yIC5tYW50cmFlLnYxLlNlcnZlcnNUcmFuc3BvcnRUeXBlQgi6SAWCAQIQAUILCglfYWdlbnRfaWQiWQoeQ3JlYXRlU2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEjcKEXNlcnZlcnNfdHJhbnNwb3J0GAEgASgLMhwubWFudHJhZS52MS5TZXJ2ZXJzVHJhbnNwb3J0Ir8BCh1VcGRhdGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEicKBmNvbmZpZxgEIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgFIAEoCBI4CgR0eXBlGAYgASgOMiAubWFudHJhZS52MS5TZXJ2ZXJzVHJhbnNwb3J0VHlwZUIIukgFggECEAEiWQoeVXBkYXRlU2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEjcKEXNlcnZlcnNfdHJhbnNwb3J0GAEgASgLMhwubWFudHJhZS52MS5TZXJ2ZXJzVHJhbnNwb3J0Im4KHURlbGV0ZVNlcnZlcnNUcmFuc3BvcnRSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAEjgKBHR5cGUYAiABKA4yIC5tYW50cmFlLnYxLlNlcnZlcnNUcmFuc3BvcnRUeXBlQgi6SAWCAQIQASIgCh5EZWxldGVTZXJ2ZXJzVHJhbnNwb3J0UmVzcG9uc2UixQIKHExpc3RTZXJ2ZXJzVHJhbnNwb3J0c1JlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABIeCghhZ2VudF9pZBgCIAEoCUIHukgEcgIQAUgAiAEBEjMKBHR5cGUYAyABKA4yIC5tYW50cmFlLnYxLlNlcnZlcnNUcmFuc3BvcnRUeXBlSAGIAQESagoFbGltaXQYBCABKANCVrpIU7oBUAoLbGltaXQudmFsaWQSKWxpbWl0IG11c3QgYmUgZWl0aGVyIC0xIG9yIGdyZWF0ZXIgdGhhbiAwGhZ0aGlzID09IC0xIHx8IHRoaXMgPiAwSAKIAQESHAoGb2Zmc2V0GAUgASgDQge6SAQiAigASAOIAQFCCwoJX2FnZW50X2lkQgcKBV90eXBlQggKBl9saW1pdEIJCgdfb2Zmc2V0Im4KHUxpc3RTZXJ2ZXJzVHJhbnNwb3J0c1Jlc3BvbnNlEjgKEnNlcnZlcnNfdHJhbnNwb3J0cxgBIAMoCzIcLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydBITCgt0b3RhbF9jb3VudBgCIAEoAyp/ChRTZXJ2ZXJzVHJhbnNwb3J0VHlwZRImCiJTRVJWRVJTX1RSQU5TUE9SVF9UWVBFX1VOU1BFQ0lGSUVEEAASHwobU0VSVkVSU19UUkFOU1BPUlRfVFlQRV9IVFRQEAESHgoaU0VSVkVSU19UUkFOU1BPUlRfVFlQRV9UQ1AQAjLMBAoXU2VydmVyc1RyYW5zcG9ydFNlcnZpY2USawoTR2V0U2VydmVyc1RyYW5zcG9ydBImLm1hbnRyYWUudjEuR2V0U2VydmVyc1RyYW5zcG9ydFJlcXVlc3QaJy5tYW50cmFlLnYxLkdldFNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZSIDkAIBEm8KFkNyZWF0ZVNlcnZlcnNUcmFuc3BvcnQSKS5tYW50cmFlLnYxLkNyZWF0ZVNlcnZlcnNUcmFuc3BvcnRSZXF1ZXN0GioubWFudHJhZS52MS5DcmVhdGVTZXJ2ZXJzVHJhbnNwb3J0UmVzcG9uc2USbwoWVXBkYXRlU2VydmVyc1RyYW5zcG9ydBIpLm1hbnRyYWUudjEuVXBkYXRlU2VydmVyc1RyYW5zcG9ydFJlcXVlc3QaKi5tYW50cmFlLnYxLlVwZGF0ZVNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZRJvChZEZWxldGVTZXJ2ZXJzVHJhbnNwb3J0EikubWFudHJhZS52MS5EZWxldGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBoqLm1hbnRyYWUudjEuRGVsZXRlU2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEnEKFUxpc3RTZXJ2ZXJzVHJhbnNwb3J0cxIoLm1hbnRyYWUudjEuTGlzdFNlcnZlcnNUcmFuc3BvcnRzUmVxdWVzdBopLm1hbnRyYWUudjEuTGlzdFNlcnZlcnNUcmFuc3BvcnRzUmVzcG9uc2UiA5ACAUKvAQoOY29tLm1hbnRyYWUudjFCFVNlcnZlcnNUcmFuc3BvcnRQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp]);
|
||||
fileDesc("CiJtYW50cmFlL3YxL3NlcnZlcnNfdHJhbnNwb3J0LnByb3RvEgptYW50cmFlLnYxIpQCChBTZXJ2ZXJzVHJhbnNwb3J0EgoKAmlkGAEgASgDEhIKCnByb2ZpbGVfaWQYAiABKAMSEAoIYWdlbnRfaWQYAyABKAkSDAoEbmFtZRgEIAEoCRInCgZjb25maWcYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBiABKAgSJgoEdHlwZRgHIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlEi4KCmNyZWF0ZWRfYXQYCCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wImMKGkdldFNlcnZlcnNUcmFuc3BvcnRSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAEjAKBHR5cGUYAiABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUIIukgFggECEAEiVgobR2V0U2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEjcKEXNlcnZlcnNfdHJhbnNwb3J0GAEgASgLMhwubWFudHJhZS52MS5TZXJ2ZXJzVHJhbnNwb3J0IuMBCh1DcmVhdGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEhUKCGFnZW50X2lkGAIgASgJSACIAQESFQoEbmFtZRgDIAEoCUIHukgEcgIQARInCgZjb25maWcYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Eg8KB2VuYWJsZWQYBSABKAgSMAoEdHlwZRgGIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQAUILCglfYWdlbnRfaWQiWQoeQ3JlYXRlU2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEjcKEXNlcnZlcnNfdHJhbnNwb3J0GAEgASgLMhwubWFudHJhZS52MS5TZXJ2ZXJzVHJhbnNwb3J0IrcBCh1VcGRhdGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEicKBmNvbmZpZxgDIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgEIAEoCBIwCgR0eXBlGAUgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGVCCLpIBYIBAhABIlkKHlVwZGF0ZVNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZRI3ChFzZXJ2ZXJzX3RyYW5zcG9ydBgBIAEoCzIcLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydCJmCh1EZWxldGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIwCgR0eXBlGAIgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGVCCLpIBYIBAhABIiAKHkRlbGV0ZVNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZSK9AgocTGlzdFNlcnZlcnNUcmFuc3BvcnRzUmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEh4KCGFnZW50X2lkGAIgASgJQge6SARyAhABSACIAQESKwoEdHlwZRgDIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlSAGIAQESagoFbGltaXQYBCABKANCVrpIU7oBUAoLbGltaXQudmFsaWQSKWxpbWl0IG11c3QgYmUgZWl0aGVyIC0xIG9yIGdyZWF0ZXIgdGhhbiAwGhZ0aGlzID09IC0xIHx8IHRoaXMgPiAwSAKIAQESHAoGb2Zmc2V0GAUgASgDQge6SAQiAigASAOIAQFCCwoJX2FnZW50X2lkQgcKBV90eXBlQggKBl9saW1pdEIJCgdfb2Zmc2V0Im4KHUxpc3RTZXJ2ZXJzVHJhbnNwb3J0c1Jlc3BvbnNlEjgKEnNlcnZlcnNfdHJhbnNwb3J0cxgBIAMoCzIcLm1hbnRyYWUudjEuU2VydmVyc1RyYW5zcG9ydBITCgt0b3RhbF9jb3VudBgCIAEoAzLMBAoXU2VydmVyc1RyYW5zcG9ydFNlcnZpY2USawoTR2V0U2VydmVyc1RyYW5zcG9ydBImLm1hbnRyYWUudjEuR2V0U2VydmVyc1RyYW5zcG9ydFJlcXVlc3QaJy5tYW50cmFlLnYxLkdldFNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZSIDkAIBEm8KFkNyZWF0ZVNlcnZlcnNUcmFuc3BvcnQSKS5tYW50cmFlLnYxLkNyZWF0ZVNlcnZlcnNUcmFuc3BvcnRSZXF1ZXN0GioubWFudHJhZS52MS5DcmVhdGVTZXJ2ZXJzVHJhbnNwb3J0UmVzcG9uc2USbwoWVXBkYXRlU2VydmVyc1RyYW5zcG9ydBIpLm1hbnRyYWUudjEuVXBkYXRlU2VydmVyc1RyYW5zcG9ydFJlcXVlc3QaKi5tYW50cmFlLnYxLlVwZGF0ZVNlcnZlcnNUcmFuc3BvcnRSZXNwb25zZRJvChZEZWxldGVTZXJ2ZXJzVHJhbnNwb3J0EikubWFudHJhZS52MS5EZWxldGVTZXJ2ZXJzVHJhbnNwb3J0UmVxdWVzdBoqLm1hbnRyYWUudjEuRGVsZXRlU2VydmVyc1RyYW5zcG9ydFJlc3BvbnNlEnEKFUxpc3RTZXJ2ZXJzVHJhbnNwb3J0cxIoLm1hbnRyYWUudjEuTGlzdFNlcnZlcnNUcmFuc3BvcnRzUmVxdWVzdBopLm1hbnRyYWUudjEuTGlzdFNlcnZlcnNUcmFuc3BvcnRzUmVzcG9uc2UiA5ACAUKvAQoOY29tLm1hbnRyYWUudjFCFVNlcnZlcnNUcmFuc3BvcnRQcm90b1ABWj1naXRodWIuY29tL21penVjaGlsYWJzL21hbnRyYWUvcHJvdG8vZ2VuL21hbnRyYWUvdjE7bWFudHJhZXYxogIDTVhYqgIKTWFudHJhZS5WMcoCCk1hbnRyYWVcVjHiAhZNYW50cmFlXFYxXEdQQk1ldGFkYXRh6gILTWFudHJhZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp, file_mantrae_v1_protocol]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ServersTransport
|
||||
@@ -50,9 +52,9 @@ export type ServersTransport = Message<"mantrae.v1.ServersTransport"> & {
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServersTransportType type = 7;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 7;
|
||||
*/
|
||||
type: ServersTransportType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp created_at = 8;
|
||||
@@ -82,9 +84,9 @@ export type GetServersTransportRequest = Message<"mantrae.v1.GetServersTransport
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServersTransportType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: ServersTransportType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -141,9 +143,9 @@ export type CreateServersTransportRequest = Message<"mantrae.v1.CreateServersTra
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServersTransportType type = 6;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 6;
|
||||
*/
|
||||
type: ServersTransportType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -185,19 +187,19 @@ export type UpdateServersTransportRequest = Message<"mantrae.v1.UpdateServersTra
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct config = 4;
|
||||
* @generated from field: google.protobuf.Struct config = 3;
|
||||
*/
|
||||
config?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: bool enabled = 5;
|
||||
* @generated from field: bool enabled = 4;
|
||||
*/
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServersTransportType type = 6;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 5;
|
||||
*/
|
||||
type: ServersTransportType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -234,9 +236,9 @@ export type DeleteServersTransportRequest = Message<"mantrae.v1.DeleteServersTra
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServersTransportType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: ServersTransportType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -274,9 +276,9 @@ export type ListServersTransportsRequest = Message<"mantrae.v1.ListServersTransp
|
||||
agentId?: string;
|
||||
|
||||
/**
|
||||
* @generated from field: optional mantrae.v1.ServersTransportType type = 3;
|
||||
* @generated from field: optional mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type?: ServersTransportType;
|
||||
type?: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: optional int64 limit = 4;
|
||||
@@ -318,32 +320,6 @@ export type ListServersTransportsResponse = Message<"mantrae.v1.ListServersTrans
|
||||
export const ListServersTransportsResponseSchema: GenMessage<ListServersTransportsResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_servers_transport, 10);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.ServersTransportType
|
||||
*/
|
||||
export enum ServersTransportType {
|
||||
/**
|
||||
* @generated from enum value: SERVERS_TRANSPORT_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: SERVERS_TRANSPORT_TYPE_HTTP = 1;
|
||||
*/
|
||||
HTTP = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: SERVERS_TRANSPORT_TYPE_TCP = 2;
|
||||
*/
|
||||
TCP = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.ServersTransportType.
|
||||
*/
|
||||
export const ServersTransportTypeSchema: GenEnum<ServersTransportType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_servers_transport, 0);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.ServersTransportService
|
||||
*/
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
// @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 { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
||||
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
||||
import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { ProtocolType } from "./protocol_pb";
|
||||
import { file_mantrae_v1_protocol } from "./protocol_pb";
|
||||
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/service.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_service: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChhtYW50cmFlL3YxL3NlcnZpY2UucHJvdG8SCm1hbnRyYWUudjEiigIKB1NlcnZpY2USCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEg8KB2VuYWJsZWQYBSABKAgSJwoGY29uZmlnGAYgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIlCgR0eXBlGAcgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZRIuCgpjcmVhdGVkX2F0GAggASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCJZChFHZXRTZXJ2aWNlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIvCgR0eXBlGAIgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZUIIukgFggECEAEiOgoSR2V0U2VydmljZVJlc3BvbnNlEiQKB3NlcnZpY2UYASABKAsyEy5tYW50cmFlLnYxLlNlcnZpY2Ui2QEKFENyZWF0ZVNlcnZpY2VSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASFQoIYWdlbnRfaWQYAiABKAlIAIgBARIVCgRuYW1lGAMgASgJQge6SARyAhABEicKBmNvbmZpZxgEIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSDwoHZW5hYmxlZBgFIAEoCBIvCgR0eXBlGAYgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZUIIukgFggECEAFCCwoJX2FnZW50X2lkIj0KFUNyZWF0ZVNlcnZpY2VSZXNwb25zZRIkCgdzZXJ2aWNlGAEgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlIq0BChRVcGRhdGVTZXJ2aWNlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEg8KB2VuYWJsZWQYAyABKAgSJwoGY29uZmlnGAQgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIvCgR0eXBlGAUgASgOMhcubWFudHJhZS52MS5TZXJ2aWNlVHlwZUIIukgFggECEAEiPQoVVXBkYXRlU2VydmljZVJlc3BvbnNlEiQKB3NlcnZpY2UYASABKAsyEy5tYW50cmFlLnYxLlNlcnZpY2UiXAoURGVsZXRlU2VydmljZVJlcXVlc3QSEwoCaWQYASABKANCB7pIBCICIAASLwoEdHlwZRgCIAEoDjIXLm1hbnRyYWUudjEuU2VydmljZVR5cGVCCLpIBYIBAhABIhcKFURlbGV0ZVNlcnZpY2VSZXNwb25zZSKzAgoTTGlzdFNlcnZpY2VzUmVxdWVzdBIbCgpwcm9maWxlX2lkGAEgASgDQge6SAQiAiAAEh4KCGFnZW50X2lkGAIgASgJQge6SARyAhABSACIAQESKgoEdHlwZRgDIAEoDjIXLm1hbnRyYWUudjEuU2VydmljZVR5cGVIAYgBARJqCgVsaW1pdBgEIAEoA0JWukhTugFQCgtsaW1pdC52YWxpZBIpbGltaXQgbXVzdCBiZSBlaXRoZXIgLTEgb3IgZ3JlYXRlciB0aGFuIDAaFnRoaXMgPT0gLTEgfHwgdGhpcyA+IDBIAogBARIcCgZvZmZzZXQYBSABKANCB7pIBCICKABIA4gBAUILCglfYWdlbnRfaWRCBwoFX3R5cGVCCAoGX2xpbWl0QgkKB19vZmZzZXQiUgoUTGlzdFNlcnZpY2VzUmVzcG9uc2USJQoIc2VydmljZXMYASADKAsyEy5tYW50cmFlLnYxLlNlcnZpY2USEwoLdG90YWxfY291bnQYAiABKAMiYwoZR2V0U2VydmljZUJ5Um91dGVyUmVxdWVzdBIVCgRuYW1lGAEgASgJQge6SARyAhABEi8KBHR5cGUYAiABKA4yFy5tYW50cmFlLnYxLlNlcnZpY2VUeXBlQgi6SAWCAQIQASJCChpHZXRTZXJ2aWNlQnlSb3V0ZXJSZXNwb25zZRIkCgdzZXJ2aWNlGAEgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlKm4KC1NlcnZpY2VUeXBlEhwKGFNFUlZJQ0VfVFlQRV9VTlNQRUNJRklFRBAAEhUKEVNFUlZJQ0VfVFlQRV9IVFRQEAESFAoQU0VSVklDRV9UWVBFX1RDUBACEhQKEFNFUlZJQ0VfVFlQRV9VRFAQAzKmBAoOU2VydmljZVNlcnZpY2USUAoKR2V0U2VydmljZRIdLm1hbnRyYWUudjEuR2V0U2VydmljZVJlcXVlc3QaHi5tYW50cmFlLnYxLkdldFNlcnZpY2VSZXNwb25zZSIDkAIBElQKDUNyZWF0ZVNlcnZpY2USIC5tYW50cmFlLnYxLkNyZWF0ZVNlcnZpY2VSZXF1ZXN0GiEubWFudHJhZS52MS5DcmVhdGVTZXJ2aWNlUmVzcG9uc2USVAoNVXBkYXRlU2VydmljZRIgLm1hbnRyYWUudjEuVXBkYXRlU2VydmljZVJlcXVlc3QaIS5tYW50cmFlLnYxLlVwZGF0ZVNlcnZpY2VSZXNwb25zZRJUCg1EZWxldGVTZXJ2aWNlEiAubWFudHJhZS52MS5EZWxldGVTZXJ2aWNlUmVxdWVzdBohLm1hbnRyYWUudjEuRGVsZXRlU2VydmljZVJlc3BvbnNlElYKDExpc3RTZXJ2aWNlcxIfLm1hbnRyYWUudjEuTGlzdFNlcnZpY2VzUmVxdWVzdBogLm1hbnRyYWUudjEuTGlzdFNlcnZpY2VzUmVzcG9uc2UiA5ACARJoChJHZXRTZXJ2aWNlQnlSb3V0ZXISJS5tYW50cmFlLnYxLkdldFNlcnZpY2VCeVJvdXRlclJlcXVlc3QaJi5tYW50cmFlLnYxLkdldFNlcnZpY2VCeVJvdXRlclJlc3BvbnNlIgOQAgFCpgEKDmNvbS5tYW50cmFlLnYxQgxTZXJ2aWNlUHJvdG9QAVo9Z2l0aHViLmNvbS9taXp1Y2hpbGFicy9tYW50cmFlL3Byb3RvL2dlbi9tYW50cmFlL3YxO21hbnRyYWV2MaICA01YWKoCCk1hbnRyYWUuVjHKAgpNYW50cmFlXFYx4gIWTWFudHJhZVxWMVxHUEJNZXRhZGF0YeoCC01hbnRyYWU6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp]);
|
||||
fileDesc("ChhtYW50cmFlL3YxL3NlcnZpY2UucHJvdG8SCm1hbnRyYWUudjEiiwIKB1NlcnZpY2USCgoCaWQYASABKAMSEgoKcHJvZmlsZV9pZBgCIAEoAxIQCghhZ2VudF9pZBgDIAEoCRIMCgRuYW1lGAQgASgJEg8KB2VuYWJsZWQYBSABKAgSJwoGY29uZmlnGAYgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBImCgR0eXBlGAcgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGUSLgoKY3JlYXRlZF9hdBgIIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgJIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAipwEKEUdldFNlcnZpY2VSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASMAoEdHlwZRgCIAEoDjIYLm1hbnRyYWUudjEuUHJvdG9jb2xUeXBlQgi6SAWCAQIQARIVCgJpZBgDIAEoA0IHukgEIgIgAEgAEhcKBG5hbWUYBCABKAlCB7pIBHICEAFIAEITCgppZGVudGlmaWVyEgW6SAIIASI6ChJHZXRTZXJ2aWNlUmVzcG9uc2USJAoHc2VydmljZRgBIAEoCzITLm1hbnRyYWUudjEuU2VydmljZSLaAQoUQ3JlYXRlU2VydmljZVJlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABIVCghhZ2VudF9pZBgCIAEoCUgAiAEBEhUKBG5hbWUYAyABKAlCB7pIBHICEAESJwoGY29uZmlnGAQgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIPCgdlbmFibGVkGAUgASgIEjAKBHR5cGUYBiABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUIIukgFggECEAFCCwoJX2FnZW50X2lkIj0KFUNyZWF0ZVNlcnZpY2VSZXNwb25zZRIkCgdzZXJ2aWNlGAEgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlIq4BChRVcGRhdGVTZXJ2aWNlUmVxdWVzdBITCgJpZBgBIAEoA0IHukgEIgIgABIVCgRuYW1lGAIgASgJQge6SARyAhABEg8KB2VuYWJsZWQYAyABKAgSJwoGY29uZmlnGAQgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIwCgR0eXBlGAUgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGVCCLpIBYIBAhABIj0KFVVwZGF0ZVNlcnZpY2VSZXNwb25zZRIkCgdzZXJ2aWNlGAEgASgLMhMubWFudHJhZS52MS5TZXJ2aWNlIl0KFERlbGV0ZVNlcnZpY2VSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAEjAKBHR5cGUYAiABKA4yGC5tYW50cmFlLnYxLlByb3RvY29sVHlwZUIIukgFggECEAEiFwoVRGVsZXRlU2VydmljZVJlc3BvbnNlIrQCChNMaXN0U2VydmljZXNSZXF1ZXN0EhsKCnByb2ZpbGVfaWQYASABKANCB7pIBCICIAASHgoIYWdlbnRfaWQYAiABKAlCB7pIBHICEAFIAIgBARIrCgR0eXBlGAMgASgOMhgubWFudHJhZS52MS5Qcm90b2NvbFR5cGVIAYgBARJqCgVsaW1pdBgEIAEoA0JWukhTugFQCgtsaW1pdC52YWxpZBIpbGltaXQgbXVzdCBiZSBlaXRoZXIgLTEgb3IgZ3JlYXRlciB0aGFuIDAaFnRoaXMgPT0gLTEgfHwgdGhpcyA+IDBIAogBARIcCgZvZmZzZXQYBSABKANCB7pIBCICKABIA4gBAUILCglfYWdlbnRfaWRCBwoFX3R5cGVCCAoGX2xpbWl0QgkKB19vZmZzZXQiUgoUTGlzdFNlcnZpY2VzUmVzcG9uc2USJQoIc2VydmljZXMYASADKAsyEy5tYW50cmFlLnYxLlNlcnZpY2USEwoLdG90YWxfY291bnQYAiABKAMyvAMKDlNlcnZpY2VTZXJ2aWNlElAKCkdldFNlcnZpY2USHS5tYW50cmFlLnYxLkdldFNlcnZpY2VSZXF1ZXN0Gh4ubWFudHJhZS52MS5HZXRTZXJ2aWNlUmVzcG9uc2UiA5ACARJUCg1DcmVhdGVTZXJ2aWNlEiAubWFudHJhZS52MS5DcmVhdGVTZXJ2aWNlUmVxdWVzdBohLm1hbnRyYWUudjEuQ3JlYXRlU2VydmljZVJlc3BvbnNlElQKDVVwZGF0ZVNlcnZpY2USIC5tYW50cmFlLnYxLlVwZGF0ZVNlcnZpY2VSZXF1ZXN0GiEubWFudHJhZS52MS5VcGRhdGVTZXJ2aWNlUmVzcG9uc2USVAoNRGVsZXRlU2VydmljZRIgLm1hbnRyYWUudjEuRGVsZXRlU2VydmljZVJlcXVlc3QaIS5tYW50cmFlLnYxLkRlbGV0ZVNlcnZpY2VSZXNwb25zZRJWCgxMaXN0U2VydmljZXMSHy5tYW50cmFlLnYxLkxpc3RTZXJ2aWNlc1JlcXVlc3QaIC5tYW50cmFlLnYxLkxpc3RTZXJ2aWNlc1Jlc3BvbnNlIgOQAgFCpgEKDmNvbS5tYW50cmFlLnYxQgxTZXJ2aWNlUHJvdG9QAVo9Z2l0aHViLmNvbS9taXp1Y2hpbGFicy9tYW50cmFlL3Byb3RvL2dlbi9tYW50cmFlL3YxO21hbnRyYWV2MaICA01YWKoCCk1hbnRyYWUuVjHKAgpNYW50cmFlXFYx4gIWTWFudHJhZVxWMVxHUEJNZXRhZGF0YeoCC01hbnRyYWU6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp, file_mantrae_v1_protocol]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.Service
|
||||
@@ -50,9 +52,9 @@ export type Service = Message<"mantrae.v1.Service"> & {
|
||||
config?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 7;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 7;
|
||||
*/
|
||||
type: ServiceType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp created_at = 8;
|
||||
@@ -77,14 +79,31 @@ export const ServiceSchema: GenMessage<Service> = /*@__PURE__*/
|
||||
*/
|
||||
export type GetServiceRequest = Message<"mantrae.v1.GetServiceRequest"> & {
|
||||
/**
|
||||
* @generated from field: int64 id = 1;
|
||||
* @generated from field: int64 profile_id = 1;
|
||||
*/
|
||||
id: bigint;
|
||||
profileId: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: ServiceType;
|
||||
type: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from oneof mantrae.v1.GetServiceRequest.identifier
|
||||
*/
|
||||
identifier: {
|
||||
/**
|
||||
* @generated from field: int64 id = 3;
|
||||
*/
|
||||
value: bigint;
|
||||
case: "id";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: string name = 4;
|
||||
*/
|
||||
value: string;
|
||||
case: "name";
|
||||
} | { case: undefined; value?: undefined };
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -141,9 +160,9 @@ export type CreateServiceRequest = Message<"mantrae.v1.CreateServiceRequest"> &
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 6;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 6;
|
||||
*/
|
||||
type: ServiceType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -195,9 +214,9 @@ export type UpdateServiceRequest = Message<"mantrae.v1.UpdateServiceRequest"> &
|
||||
config?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 5;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 5;
|
||||
*/
|
||||
type: ServiceType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -234,9 +253,9 @@ export type DeleteServiceRequest = Message<"mantrae.v1.DeleteServiceRequest"> &
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 2;
|
||||
* @generated from field: mantrae.v1.ProtocolType type = 2;
|
||||
*/
|
||||
type: ServiceType;
|
||||
type: ProtocolType;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -274,9 +293,9 @@ export type ListServicesRequest = Message<"mantrae.v1.ListServicesRequest"> & {
|
||||
agentId?: string;
|
||||
|
||||
/**
|
||||
* @generated from field: optional mantrae.v1.ServiceType type = 3;
|
||||
* @generated from field: optional mantrae.v1.ProtocolType type = 3;
|
||||
*/
|
||||
type?: ServiceType;
|
||||
type?: ProtocolType;
|
||||
|
||||
/**
|
||||
* @generated from field: optional int64 limit = 4;
|
||||
@@ -318,76 +337,6 @@ export type ListServicesResponse = Message<"mantrae.v1.ListServicesResponse"> &
|
||||
export const ListServicesResponseSchema: GenMessage<ListServicesResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_service, 10);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GetServiceByRouterRequest
|
||||
*/
|
||||
export type GetServiceByRouterRequest = Message<"mantrae.v1.GetServiceByRouterRequest"> & {
|
||||
/**
|
||||
* @generated from field: string name = 1;
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: mantrae.v1.ServiceType type = 2;
|
||||
*/
|
||||
type: ServiceType;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GetServiceByRouterRequest.
|
||||
* Use `create(GetServiceByRouterRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const GetServiceByRouterRequestSchema: GenMessage<GetServiceByRouterRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_service, 11);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GetServiceByRouterResponse
|
||||
*/
|
||||
export type GetServiceByRouterResponse = Message<"mantrae.v1.GetServiceByRouterResponse"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.Service service = 1;
|
||||
*/
|
||||
service?: Service;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GetServiceByRouterResponse.
|
||||
* Use `create(GetServiceByRouterResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const GetServiceByRouterResponseSchema: GenMessage<GetServiceByRouterResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_service, 12);
|
||||
|
||||
/**
|
||||
* @generated from enum mantrae.v1.ServiceType
|
||||
*/
|
||||
export enum ServiceType {
|
||||
/**
|
||||
* @generated from enum value: SERVICE_TYPE_UNSPECIFIED = 0;
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
|
||||
/**
|
||||
* @generated from enum value: SERVICE_TYPE_HTTP = 1;
|
||||
*/
|
||||
HTTP = 1,
|
||||
|
||||
/**
|
||||
* @generated from enum value: SERVICE_TYPE_TCP = 2;
|
||||
*/
|
||||
TCP = 2,
|
||||
|
||||
/**
|
||||
* @generated from enum value: SERVICE_TYPE_UDP = 3;
|
||||
*/
|
||||
UDP = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the enum mantrae.v1.ServiceType.
|
||||
*/
|
||||
export const ServiceTypeSchema: GenEnum<ServiceType> = /*@__PURE__*/
|
||||
enumDesc(file_mantrae_v1_service, 0);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.ServiceService
|
||||
*/
|
||||
@@ -432,14 +381,6 @@ export const ServiceService: GenService<{
|
||||
input: typeof ListServicesRequestSchema;
|
||||
output: typeof ListServicesResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc mantrae.v1.ServiceService.GetServiceByRouter
|
||||
*/
|
||||
getServiceByRouter: {
|
||||
methodKind: "unary";
|
||||
input: typeof GetServiceByRouterRequestSchema;
|
||||
output: typeof GetServiceByRouterResponseSchema;
|
||||
},
|
||||
}> = /*@__PURE__*/
|
||||
serviceDesc(file_mantrae_v1_service, 0);
|
||||
|
||||
|
||||
233
web/src/lib/gen/mantrae/v1/traefik_instance_pb.ts
Normal file
233
web/src/lib/gen/mantrae/v1/traefik_instance_pb.ts
Normal file
@@ -0,0 +1,233 @@
|
||||
// @generated by protoc-gen-es v2.6.2 with parameter "target=ts"
|
||||
// @generated from file mantrae/v1/traefik_instance.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 { file_buf_validate_validate } from "../../buf/validate/validate_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file mantrae/v1/traefik_instance.proto.
|
||||
*/
|
||||
export const file_mantrae_v1_traefik_instance: GenFile = /*@__PURE__*/
|
||||
fileDesc("CiFtYW50cmFlL3YxL3RyYWVmaWtfaW5zdGFuY2UucHJvdG8SCm1hbnRyYWUudjEi9gIKD1RyYWVmaWtJbnN0YW5jZRIKCgJpZBgBIAEoAxIMCgRuYW1lGAIgASgJEgsKA3VybBgDIAEoCRIQCgh1c2VybmFtZRgEIAEoCRIQCghwYXNzd29yZBgFIAEoCRILCgN0bHMYBiABKAgSLQoMZW50cnlfcG9pbnRzGAcgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIpCghvdmVydmlldxgIIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QSJwoGY29uZmlnGAkgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIoCgd2ZXJzaW9uGAogASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIuCgpjcmVhdGVkX2F0GAsgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIuCgp1cGRhdGVkX2F0GAwgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCIwChlHZXRUcmFlZmlrSW5zdGFuY2VSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAIlMKGkdldFRyYWVmaWtJbnN0YW5jZVJlc3BvbnNlEjUKEHRyYWVmaWtfaW5zdGFuY2UYASABKAsyGy5tYW50cmFlLnYxLlRyYWVmaWtJbnN0YW5jZSIzChxEZWxldGVUcmFlZmlrSW5zdGFuY2VSZXF1ZXN0EhMKAmlkGAEgASgDQge6SAQiAiAAIh8KHURlbGV0ZVRyYWVmaWtJbnN0YW5jZVJlc3BvbnNlItkBChtMaXN0VHJhZWZpa0luc3RhbmNlc1JlcXVlc3QSGwoKcHJvZmlsZV9pZBgBIAEoA0IHukgEIgIgABJqCgVsaW1pdBgCIAEoA0JWukhTugFQCgtsaW1pdC52YWxpZBIpbGltaXQgbXVzdCBiZSBlaXRoZXIgLTEgb3IgZ3JlYXRlciB0aGFuIDAaFnRoaXMgPT0gLTEgfHwgdGhpcyA+IDBIAIgBARIcCgZvZmZzZXQYAyABKANCB7pIBCICKABIAYgBAUIICgZfbGltaXRCCQoHX29mZnNldCJrChxMaXN0VHJhZWZpa0luc3RhbmNlc1Jlc3BvbnNlEjYKEXRyYWVmaWtfaW5zdGFuY2VzGAEgAygLMhsubWFudHJhZS52MS5UcmFlZmlrSW5zdGFuY2USEwoLdG90YWxfY291bnQYAiABKAMy4AIKFlRyYWVmaWtJbnN0YW5jZVNlcnZpY2USaAoSR2V0VHJhZWZpa0luc3RhbmNlEiUubWFudHJhZS52MS5HZXRUcmFlZmlrSW5zdGFuY2VSZXF1ZXN0GiYubWFudHJhZS52MS5HZXRUcmFlZmlrSW5zdGFuY2VSZXNwb25zZSIDkAIBEmwKFURlbGV0ZVRyYWVmaWtJbnN0YW5jZRIoLm1hbnRyYWUudjEuRGVsZXRlVHJhZWZpa0luc3RhbmNlUmVxdWVzdBopLm1hbnRyYWUudjEuRGVsZXRlVHJhZWZpa0luc3RhbmNlUmVzcG9uc2USbgoUTGlzdFRyYWVmaWtJbnN0YW5jZXMSJy5tYW50cmFlLnYxLkxpc3RUcmFlZmlrSW5zdGFuY2VzUmVxdWVzdBooLm1hbnRyYWUudjEuTGlzdFRyYWVmaWtJbnN0YW5jZXNSZXNwb25zZSIDkAIBQq4BCg5jb20ubWFudHJhZS52MUIUVHJhZWZpa0luc3RhbmNlUHJvdG9QAVo9Z2l0aHViLmNvbS9taXp1Y2hpbGFicy9tYW50cmFlL3Byb3RvL2dlbi9tYW50cmFlL3YxO21hbnRyYWV2MaICA01YWKoCCk1hbnRyYWUuVjHKAgpNYW50cmFlXFYx4gIWTWFudHJhZVxWMVxHUEJNZXRhZGF0YeoCC01hbnRyYWU6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp]);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.TraefikInstance
|
||||
*/
|
||||
export type TraefikInstance = Message<"mantrae.v1.TraefikInstance"> & {
|
||||
/**
|
||||
* @generated from field: int64 id = 1;
|
||||
*/
|
||||
id: bigint;
|
||||
|
||||
/**
|
||||
* @generated from field: string name = 2;
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string url = 3;
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string username = 4;
|
||||
*/
|
||||
username: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string password = 5;
|
||||
*/
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* @generated from field: bool tls = 6;
|
||||
*/
|
||||
tls: boolean;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct entry_points = 7;
|
||||
*/
|
||||
entryPoints?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct overview = 8;
|
||||
*/
|
||||
overview?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct config = 9;
|
||||
*/
|
||||
config?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Struct version = 10;
|
||||
*/
|
||||
version?: JsonObject;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp created_at = 11;
|
||||
*/
|
||||
createdAt?: Timestamp;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp updated_at = 12;
|
||||
*/
|
||||
updatedAt?: Timestamp;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.TraefikInstance.
|
||||
* Use `create(TraefikInstanceSchema)` to create a new message.
|
||||
*/
|
||||
export const TraefikInstanceSchema: GenMessage<TraefikInstance> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 0);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GetTraefikInstanceRequest
|
||||
*/
|
||||
export type GetTraefikInstanceRequest = Message<"mantrae.v1.GetTraefikInstanceRequest"> & {
|
||||
/**
|
||||
* @generated from field: int64 id = 1;
|
||||
*/
|
||||
id: bigint;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GetTraefikInstanceRequest.
|
||||
* Use `create(GetTraefikInstanceRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const GetTraefikInstanceRequestSchema: GenMessage<GetTraefikInstanceRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 1);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.GetTraefikInstanceResponse
|
||||
*/
|
||||
export type GetTraefikInstanceResponse = Message<"mantrae.v1.GetTraefikInstanceResponse"> & {
|
||||
/**
|
||||
* @generated from field: mantrae.v1.TraefikInstance traefik_instance = 1;
|
||||
*/
|
||||
traefikInstance?: TraefikInstance;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.GetTraefikInstanceResponse.
|
||||
* Use `create(GetTraefikInstanceResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const GetTraefikInstanceResponseSchema: GenMessage<GetTraefikInstanceResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 2);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.DeleteTraefikInstanceRequest
|
||||
*/
|
||||
export type DeleteTraefikInstanceRequest = Message<"mantrae.v1.DeleteTraefikInstanceRequest"> & {
|
||||
/**
|
||||
* @generated from field: int64 id = 1;
|
||||
*/
|
||||
id: bigint;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.DeleteTraefikInstanceRequest.
|
||||
* Use `create(DeleteTraefikInstanceRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const DeleteTraefikInstanceRequestSchema: GenMessage<DeleteTraefikInstanceRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 3);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.DeleteTraefikInstanceResponse
|
||||
*/
|
||||
export type DeleteTraefikInstanceResponse = Message<"mantrae.v1.DeleteTraefikInstanceResponse"> & {
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.DeleteTraefikInstanceResponse.
|
||||
* Use `create(DeleteTraefikInstanceResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const DeleteTraefikInstanceResponseSchema: GenMessage<DeleteTraefikInstanceResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 4);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ListTraefikInstancesRequest
|
||||
*/
|
||||
export type ListTraefikInstancesRequest = Message<"mantrae.v1.ListTraefikInstancesRequest"> & {
|
||||
/**
|
||||
* @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.ListTraefikInstancesRequest.
|
||||
* Use `create(ListTraefikInstancesRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const ListTraefikInstancesRequestSchema: GenMessage<ListTraefikInstancesRequest> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 5);
|
||||
|
||||
/**
|
||||
* @generated from message mantrae.v1.ListTraefikInstancesResponse
|
||||
*/
|
||||
export type ListTraefikInstancesResponse = Message<"mantrae.v1.ListTraefikInstancesResponse"> & {
|
||||
/**
|
||||
* @generated from field: repeated mantrae.v1.TraefikInstance traefik_instances = 1;
|
||||
*/
|
||||
traefikInstances: TraefikInstance[];
|
||||
|
||||
/**
|
||||
* @generated from field: int64 total_count = 2;
|
||||
*/
|
||||
totalCount: bigint;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message mantrae.v1.ListTraefikInstancesResponse.
|
||||
* Use `create(ListTraefikInstancesResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const ListTraefikInstancesResponseSchema: GenMessage<ListTraefikInstancesResponse> = /*@__PURE__*/
|
||||
messageDesc(file_mantrae_v1_traefik_instance, 6);
|
||||
|
||||
/**
|
||||
* @generated from service mantrae.v1.TraefikInstanceService
|
||||
*/
|
||||
export const TraefikInstanceService: GenService<{
|
||||
/**
|
||||
* @generated from rpc mantrae.v1.TraefikInstanceService.GetTraefikInstance
|
||||
*/
|
||||
getTraefikInstance: {
|
||||
methodKind: "unary";
|
||||
input: typeof GetTraefikInstanceRequestSchema;
|
||||
output: typeof GetTraefikInstanceResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc mantrae.v1.TraefikInstanceService.DeleteTraefikInstance
|
||||
*/
|
||||
deleteTraefikInstance: {
|
||||
methodKind: "unary";
|
||||
input: typeof DeleteTraefikInstanceRequestSchema;
|
||||
output: typeof DeleteTraefikInstanceResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc mantrae.v1.TraefikInstanceService.ListTraefikInstances
|
||||
*/
|
||||
listTraefikInstances: {
|
||||
methodKind: "unary";
|
||||
input: typeof ListTraefikInstancesRequestSchema;
|
||||
output: typeof ListTraefikInstancesResponseSchema;
|
||||
},
|
||||
}> = /*@__PURE__*/
|
||||
serviceDesc(file_mantrae_v1_traefik_instance, 0);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,21 @@
|
||||
import { createLocalStorage } from "$lib/storage.svelte";
|
||||
import { createLocalStorage } from '$lib/storage.svelte';
|
||||
|
||||
export const DEFAULT_URL = import.meta.env.PROD
|
||||
? window?.location?.origin || "/"
|
||||
? window?.location?.origin || '/'
|
||||
: `http://127.0.0.1:3000`;
|
||||
|
||||
export const baseURL = createLocalStorage("base_url", DEFAULT_URL);
|
||||
export const pageIndex = createLocalStorage("page_index", 0);
|
||||
export const pageSize = createLocalStorage("page_size", 10);
|
||||
export const routerColumns = createLocalStorage("router_columns", []);
|
||||
export const middlewareColumns = createLocalStorage("middleware_columns", []);
|
||||
export const ruleTab = createLocalStorage("rule_tab", "simple");
|
||||
export const baseURL = createLocalStorage('base_url', DEFAULT_URL);
|
||||
export const pageIndex = createLocalStorage('page_index', 0);
|
||||
export const pageSize = createLocalStorage('page_size', 10);
|
||||
export const routerColumns = createLocalStorage('router_columns', []);
|
||||
export const middlewareColumns = createLocalStorage('middleware_columns', []);
|
||||
export const ruleTab = createLocalStorage('rule_tab', 'simple');
|
||||
|
||||
export const DateFormat = new Intl.DateTimeFormat("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
second: "numeric",
|
||||
export const DateFormat = new Intl.DateTimeFormat('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric'
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Profile } from "$lib/gen/mantrae/v1/profile_pb";
|
||||
import { createLocalStorage } from "$lib/storage.svelte";
|
||||
import type { Profile } from '$lib/gen/mantrae/v1/profile_pb';
|
||||
import { createLocalStorage } from '$lib/storage.svelte';
|
||||
|
||||
class ProfileStore {
|
||||
private store = createLocalStorage<Profile | null>("selected_profile", null);
|
||||
private store = createLocalStorage<Profile | null>('selected_profile', null);
|
||||
|
||||
get value(): Profile | null {
|
||||
return this.store.value ?? null;
|
||||
@@ -31,11 +31,11 @@ class ProfileStore {
|
||||
|
||||
// Validation methods
|
||||
hasValidId(): boolean {
|
||||
return typeof this.id === "bigint" && this.id > 0n;
|
||||
return typeof this.id === 'bigint' && this.id > 0n;
|
||||
}
|
||||
|
||||
hasValidName(): boolean {
|
||||
return typeof this.name === "string" && this.name.length > 0;
|
||||
return typeof this.name === 'string' && this.name.length > 0;
|
||||
}
|
||||
|
||||
isValid(): boolean {
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
import { writable } from "svelte/store";
|
||||
import {
|
||||
ResourceType,
|
||||
EventType,
|
||||
type ProfileEvent,
|
||||
type ProfileEventsResponse,
|
||||
EventService,
|
||||
} from "$lib/gen/mantrae/v1/event_pb";
|
||||
import { profile } from "./profile";
|
||||
import { ConnectError, createClient } from "@connectrpc/connect";
|
||||
import type { Router } from "$lib/gen/mantrae/v1/router_pb";
|
||||
import type { Service } from "$lib/gen/mantrae/v1/service_pb";
|
||||
import type { Middleware } from "$lib/gen/mantrae/v1/middleware_pb";
|
||||
import { createConnectTransport } from "@connectrpc/connect-web";
|
||||
import { baseURL } from "./common";
|
||||
|
||||
type ResourceUnion = Router | Service | Middleware;
|
||||
|
||||
interface RealtimeState<T extends ResourceUnion> {
|
||||
data: T[];
|
||||
rowCount: number;
|
||||
loading: boolean;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
interface FetchResult<T> {
|
||||
data: T[];
|
||||
rowCount: number;
|
||||
}
|
||||
|
||||
const eventClient = createClient(
|
||||
EventService,
|
||||
createConnectTransport({
|
||||
baseUrl: baseURL,
|
||||
useBinaryFormat: true,
|
||||
interceptors: [
|
||||
(next) => async (req) => {
|
||||
// Debug the request
|
||||
console.log("Request headers:", req.header);
|
||||
console.log("Request method:", req.method);
|
||||
return await next(req);
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
export function createRealtimeStore<T extends ResourceUnion & { id: bigint }>(
|
||||
resourceType: ResourceType,
|
||||
fetchFn: (pageSize: number, pageIndex: number) => Promise<FetchResult<T>>,
|
||||
) {
|
||||
const { subscribe, set, update } = writable<RealtimeState<T>>({
|
||||
data: [],
|
||||
rowCount: 0,
|
||||
loading: false,
|
||||
error: null,
|
||||
});
|
||||
|
||||
let eventStream: AsyncIterable<ProfileEventsResponse> | null = null;
|
||||
let isStreaming = false;
|
||||
|
||||
function getResourceFromEvent(event: ProfileEvent): T | null {
|
||||
if (!event.resource) return null;
|
||||
|
||||
switch (resourceType) {
|
||||
case ResourceType.ROUTER:
|
||||
return event.resource.case === "router"
|
||||
? (event.resource.value as T)
|
||||
: null;
|
||||
case ResourceType.SERVICE:
|
||||
return event.resource.case === "service"
|
||||
? (event.resource.value as T)
|
||||
: null;
|
||||
case ResourceType.MIDDLEWARE:
|
||||
return event.resource.case === "middleware"
|
||||
? (event.resource.value as T)
|
||||
: null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function isRelevantEvent(event: ProfileEvent): boolean {
|
||||
if (!event.resource || event.resourceType !== resourceType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (resourceType) {
|
||||
case ResourceType.ROUTER:
|
||||
return event.resource.case === "router";
|
||||
case ResourceType.SERVICE:
|
||||
return event.resource.case === "service";
|
||||
case ResourceType.MIDDLEWARE:
|
||||
return event.resource.case === "middleware";
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function startEventStream() {
|
||||
if (isStreaming || !profile?.id) return;
|
||||
|
||||
isStreaming = true;
|
||||
try {
|
||||
eventStream = eventClient.profileEvents({
|
||||
profileId: profile.id,
|
||||
resourceTypes: [resourceType],
|
||||
});
|
||||
if (!eventStream) return;
|
||||
|
||||
for await (const response of eventStream) {
|
||||
const event = response.event;
|
||||
if (!event || !isRelevantEvent(event)) continue;
|
||||
|
||||
const resource = getResourceFromEvent(event);
|
||||
if (!resource) continue;
|
||||
|
||||
update((state) => {
|
||||
const newData = [...state.data];
|
||||
|
||||
switch (event.eventType) {
|
||||
case EventType.CREATED: {
|
||||
// Add to beginning of list, avoid duplicates
|
||||
const exists = newData.some((item) => item.id === resource.id);
|
||||
if (!exists) {
|
||||
newData.unshift(resource);
|
||||
return {
|
||||
...state,
|
||||
data: newData,
|
||||
rowCount: state.rowCount + 1,
|
||||
};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
case EventType.UPDATED: {
|
||||
const updateIndex = newData.findIndex(
|
||||
(item) => item.id === resource.id,
|
||||
);
|
||||
if (updateIndex !== -1) {
|
||||
newData[updateIndex] = resource;
|
||||
return { ...state, data: newData };
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
case EventType.DELETED: {
|
||||
const filteredData = newData.filter(
|
||||
(item) => item.id !== resource.id,
|
||||
);
|
||||
const rowCountDelta = newData.length - filteredData.length;
|
||||
return {
|
||||
...state,
|
||||
data: filteredData,
|
||||
rowCount: Math.max(0, state.rowCount - rowCountDelta),
|
||||
};
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
const e = ConnectError.from(error);
|
||||
console.error("Event stream error:", e.message);
|
||||
update((state) => ({ ...state, error: e.message }));
|
||||
} finally {
|
||||
isStreaming = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadData(pageSize: number, pageIndex: number) {
|
||||
update((state) => ({ ...state, loading: true, error: null }));
|
||||
|
||||
try {
|
||||
const result = await fetchFn(pageSize, pageIndex);
|
||||
set({
|
||||
data: result.data,
|
||||
rowCount: result.rowCount,
|
||||
loading: false,
|
||||
error: null,
|
||||
});
|
||||
} catch (error) {
|
||||
const e = ConnectError.from(error);
|
||||
update((state) => ({
|
||||
...state,
|
||||
loading: false,
|
||||
error: e.message,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
function stopEventStream() {
|
||||
isStreaming = false;
|
||||
eventStream = null;
|
||||
}
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
loadData,
|
||||
startEventStream,
|
||||
stopEventStream,
|
||||
// Optimistic updates for better UX
|
||||
optimisticUpdate: (id: bigint, updates: Partial<T>) => {
|
||||
update((state) => ({
|
||||
...state,
|
||||
data: state.data.map((item) =>
|
||||
item.id === id ? { ...item, ...updates } : item,
|
||||
),
|
||||
}));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Type-safe factory functions for each resource type
|
||||
export function createRouterStore(
|
||||
fetchFn: (
|
||||
pageSize: number,
|
||||
pageIndex: number,
|
||||
) => Promise<FetchResult<Router>>,
|
||||
) {
|
||||
return createRealtimeStore<Router>(ResourceType.ROUTER, fetchFn);
|
||||
}
|
||||
|
||||
export function createServiceStore(
|
||||
fetchFn: (
|
||||
pageSize: number,
|
||||
pageIndex: number,
|
||||
) => Promise<FetchResult<Service>>,
|
||||
) {
|
||||
return createRealtimeStore<Service>(ResourceType.SERVICE, fetchFn);
|
||||
}
|
||||
|
||||
export function createMiddlewareStore(
|
||||
fetchFn: (
|
||||
pageSize: number,
|
||||
pageIndex: number,
|
||||
) => Promise<FetchResult<Middleware>>,
|
||||
) {
|
||||
return createRealtimeStore<Middleware>(ResourceType.MIDDLEWARE, fetchFn);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { User } from "$lib/gen/mantrae/v1/user_pb";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { createLocalStorage } from "$lib/storage.svelte";
|
||||
import type { User } from '$lib/gen/mantrae/v1/user_pb';
|
||||
import type { Timestamp } from '@bufbuild/protobuf/wkt';
|
||||
import { createLocalStorage } from '$lib/storage.svelte';
|
||||
|
||||
class UserStore {
|
||||
private store = createLocalStorage<User | null>("current_user", null);
|
||||
private store = createLocalStorage<User | null>('current_user', null);
|
||||
|
||||
get value(): User | null {
|
||||
return this.store.value ?? null;
|
||||
@@ -39,11 +39,11 @@ class UserStore {
|
||||
|
||||
// Validation methods
|
||||
hasValidId(): boolean {
|
||||
return typeof this.id === "string" && this.id.length > 0;
|
||||
return typeof this.id === 'string' && this.id.length > 0;
|
||||
}
|
||||
|
||||
hasValidUsername(): boolean {
|
||||
return typeof this.username === "string" && this.username.length > 0;
|
||||
return typeof this.username === 'string' && this.username.length > 0;
|
||||
}
|
||||
|
||||
isLoggedIn(): boolean {
|
||||
@@ -51,7 +51,7 @@ class UserStore {
|
||||
}
|
||||
|
||||
hasEmail(): boolean {
|
||||
return typeof this.email === "string" && this.email.length > 0;
|
||||
return typeof this.email === 'string' && this.email.length > 0;
|
||||
}
|
||||
|
||||
// Clear user data (logout)
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { DnsProviderType } from "./gen/mantrae/v1/dns_provider_pb";
|
||||
import { MiddlewareType } from "./gen/mantrae/v1/middleware_pb";
|
||||
import { RouterType } from "./gen/mantrae/v1/router_pb";
|
||||
import { ServiceType } from "./gen/mantrae/v1/service_pb";
|
||||
import type { JsonObject } from "@bufbuild/protobuf";
|
||||
import type { Component } from "svelte";
|
||||
import type { IconProps } from "@lucide/svelte";
|
||||
import { ServersTransportType } from "./gen/mantrae/v1/servers_transport_pb";
|
||||
import { DnsProviderType } from './gen/mantrae/v1/dns_provider_pb';
|
||||
import type { JsonObject } from '@bufbuild/protobuf';
|
||||
import type { Component } from 'svelte';
|
||||
import type { IconProps } from '@lucide/svelte';
|
||||
import { ProtocolType } from './gen/mantrae/v1/protocol_pb';
|
||||
|
||||
export type IconComponent = Component<IconProps, Record<string, never>, "">;
|
||||
export type IconComponent = Component<IconProps, Record<string, never>, ''>;
|
||||
|
||||
// Parse protobuf config
|
||||
export function unmarshalConfig<T>(json: JsonObject | undefined): T {
|
||||
@@ -21,40 +18,19 @@ export function marshalConfig<T>(config: T): JsonObject {
|
||||
}
|
||||
|
||||
// Convert enum to select options
|
||||
export const routerTypes = Object.keys(RouterType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== "UNSPECIFIED")
|
||||
export const protocolTypes = Object.keys(ProtocolType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== 'UNSPECIFIED')
|
||||
.map((key) => ({
|
||||
label: key.toUpperCase(),
|
||||
value: RouterType[key as keyof typeof RouterType],
|
||||
}));
|
||||
|
||||
export const serviceTypes = Object.keys(ServiceType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== "UNSPECIFIED")
|
||||
.map((key) => ({
|
||||
label: key.toUpperCase(),
|
||||
value: ServiceType[key as keyof typeof ServiceType],
|
||||
}));
|
||||
|
||||
export const middlewareTypes = Object.keys(MiddlewareType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== "UNSPECIFIED")
|
||||
.map((key) => ({
|
||||
label: key.toUpperCase(),
|
||||
value: MiddlewareType[key as keyof typeof MiddlewareType],
|
||||
}));
|
||||
|
||||
export const serversTransportTypes = Object.keys(ServersTransportType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== "UNSPECIFIED")
|
||||
.map((key) => ({
|
||||
label: key.toUpperCase(),
|
||||
value: ServersTransportType[key as keyof typeof ServersTransportType],
|
||||
value: ProtocolType[key as keyof typeof ProtocolType]
|
||||
}));
|
||||
|
||||
export const dnsProviderTypes = Object.keys(DnsProviderType)
|
||||
.filter((key) => isNaN(Number(key)) && key !== "UNSPECIFIED")
|
||||
.filter((key) => isNaN(Number(key)) && key !== 'UNSPECIFIED')
|
||||
.map((key) => ({
|
||||
label: key
|
||||
.replace("DNS_PROVIDER_TYPE_", "")
|
||||
.replace('DNS_PROVIDER_TYPE_', '')
|
||||
.toLowerCase()
|
||||
.replace(/^\w/, (c) => c.toUpperCase()),
|
||||
value: DnsProviderType[key as keyof typeof DnsProviderType],
|
||||
value: DnsProviderType[key as keyof typeof DnsProviderType]
|
||||
}));
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import { type ClassValue, clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
|
||||
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, 'child'> : T;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type WithoutChildren<T> = T extends { children?: any }
|
||||
? Omit<T, "children">
|
||||
: T;
|
||||
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, 'children'> : T;
|
||||
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
|
||||
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
|
||||
ref?: U | null;
|
||||
@@ -18,26 +16,23 @@ export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
|
||||
|
||||
// Helper function to truncate text with ellipsis
|
||||
export function truncateText(text: string, maxLength: number = 30): string {
|
||||
return text.length > maxLength ? text.substring(0, maxLength) + "..." : text;
|
||||
return text.length > maxLength ? text.substring(0, maxLength) + '...' : text;
|
||||
}
|
||||
|
||||
// Helper function to format array display with ellipsis
|
||||
export function formatArrayDisplay(
|
||||
arr: string[] | undefined,
|
||||
maxItems: number = 2,
|
||||
): string {
|
||||
if (!arr || arr.length === 0) return "";
|
||||
if (arr.length <= maxItems) return arr.join(", ");
|
||||
return `${arr.slice(0, maxItems).join(", ")} (+${arr.length - maxItems})`;
|
||||
export function formatArrayDisplay(arr: string[] | undefined, maxItems: number = 2): string {
|
||||
if (!arr || arr.length === 0) return '';
|
||||
if (arr.length <= maxItems) return arr.join(', ');
|
||||
return `${arr.slice(0, maxItems).join(', ')} (+${arr.length - maxItems})`;
|
||||
}
|
||||
|
||||
export function parseGoDuration(input: string) {
|
||||
const normalized = input
|
||||
.toLowerCase()
|
||||
.replace(/minutes?|mins?/g, "m")
|
||||
.replace(/seconds?|secs?/g, "s")
|
||||
.replace(/hours?|hrs?/g, "h")
|
||||
.replace(/\s+/g, "");
|
||||
.replace(/minutes?|mins?/g, 'm')
|
||||
.replace(/seconds?|secs?/g, 's')
|
||||
.replace(/hours?|hrs?/g, 'h')
|
||||
.replace(/\s+/g, '');
|
||||
|
||||
const regex = /(?<value>[-+]?\d+)(?<unit>ns|us|µs|ms|s|m|h)/g;
|
||||
const parts: string[] = [];
|
||||
@@ -52,5 +47,5 @@ export function parseGoDuration(input: string) {
|
||||
}
|
||||
|
||||
if (parts.length === 0) return null;
|
||||
return parts.join("");
|
||||
return parts.join('');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import AppFooter from '$lib/components/nav/AppFooter.svelte';
|
||||
import AppHeader from '$lib/components/nav/AppHeader.svelte';
|
||||
import AppSidebar from '$lib/components/nav/AppSidebar.svelte';
|
||||
// import AppCenter from '$lib/components/nav/AppCenter.svelte';
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
|
||||
import { Toaster } from '$lib/components/ui/sonner';
|
||||
import { ModeWatcher } from 'mode-watcher';
|
||||
@@ -19,7 +18,6 @@
|
||||
|
||||
<ModeWatcher />
|
||||
<Toaster />
|
||||
<!-- <AppCenter /> -->
|
||||
|
||||
{#if user.isLoggedIn()}
|
||||
<Sidebar.Provider>
|
||||
|
||||
@@ -1,40 +1,39 @@
|
||||
import type { LayoutLoad } from "./$types";
|
||||
import { goto } from "$app/navigation";
|
||||
import { checkHealth, useClient } from "$lib/api";
|
||||
import { profile } from "$lib/stores/profile";
|
||||
import { user } from "$lib/stores/user";
|
||||
import { UserService } from "$lib/gen/mantrae/v1/user_pb";
|
||||
import { ProfileService } from "$lib/gen/mantrae/v1/profile_pb";
|
||||
import type { LayoutLoad } from './$types';
|
||||
import { goto } from '$app/navigation';
|
||||
import { checkHealth, useClient } from '$lib/api';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { UserService } from '$lib/gen/mantrae/v1/user_pb';
|
||||
import { ProfileService } from '$lib/gen/mantrae/v1/profile_pb';
|
||||
|
||||
export const ssr = false;
|
||||
export const prerender = true;
|
||||
export const trailingSlash = "always";
|
||||
export const trailingSlash = 'always';
|
||||
|
||||
export const load: LayoutLoad = async ({ url, fetch }) => {
|
||||
const currentPath = url.pathname;
|
||||
const isPublic =
|
||||
currentPath.startsWith("/login") || currentPath.startsWith("/welcome");
|
||||
const isPublic = currentPath.startsWith('/login') || currentPath.startsWith('/welcome');
|
||||
|
||||
const healthy = await checkHealth(fetch);
|
||||
if (!healthy) {
|
||||
// No backend, force redirect to welcome screen to enter backend URL
|
||||
if (currentPath !== "/welcome") {
|
||||
await goto("/welcome");
|
||||
if (currentPath !== '/welcome') {
|
||||
await goto('/welcome');
|
||||
user.clear();
|
||||
return {};
|
||||
}
|
||||
} else {
|
||||
// Backend reachable
|
||||
if (currentPath === "/welcome") {
|
||||
if (currentPath === '/welcome') {
|
||||
// Backend is back, redirect from welcome to login
|
||||
await goto("/login");
|
||||
await goto('/login');
|
||||
return {};
|
||||
}
|
||||
|
||||
try {
|
||||
const userClient = useClient(UserService, fetch);
|
||||
const resUser = await userClient.getUser({});
|
||||
if (!resUser.user) throw new Error("Authentication failed");
|
||||
if (!resUser.user) throw new Error('Authentication failed');
|
||||
user.value = resUser.user;
|
||||
|
||||
const profileClient = useClient(ProfileService, fetch);
|
||||
@@ -43,14 +42,15 @@ export const load: LayoutLoad = async ({ url, fetch }) => {
|
||||
profile.value = response.profiles[0];
|
||||
} else {
|
||||
const response = await profileClient.getProfile({ id: profile.id });
|
||||
if (!response.profile) throw new Error('Profile not found');
|
||||
profile.value = response.profile;
|
||||
}
|
||||
|
||||
if (isPublic) await goto("/");
|
||||
if (isPublic) await goto('/');
|
||||
} catch (_) {
|
||||
user.clear();
|
||||
profile.clear();
|
||||
if (!isPublic) await goto("/login");
|
||||
if (!isPublic) await goto('/login');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,10 +33,9 @@
|
||||
profileClient,
|
||||
routerClient,
|
||||
serviceClient,
|
||||
traefikClient,
|
||||
userClient
|
||||
} from '$lib/api';
|
||||
import { RouterType } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { MiddlewareType } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { DateFormat } from '$lib/stores/common';
|
||||
import { timestampDate, type Timestamp } from '@bufbuild/protobuf/wkt';
|
||||
import ProfileModal from '$lib/components/modals/ProfileModal.svelte';
|
||||
@@ -44,22 +43,10 @@
|
||||
import type { Profile } from '$lib/gen/mantrae/v1/profile_pb';
|
||||
import AuditLogModal from '$lib/components/modals/AuditLogModal.svelte';
|
||||
import TraefikConnection from '$lib/components/utils/TraefikConnection.svelte';
|
||||
|
||||
let totalAgents = $derived.by(async () => {
|
||||
const response = await agentClient.listAgents({
|
||||
profileId: profile.id,
|
||||
limit: -1n,
|
||||
offset: 0n
|
||||
});
|
||||
return response.totalCount;
|
||||
});
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let onlineAgents = $derived.by(async () => {
|
||||
const response = await agentClient.listAgents({
|
||||
profileId: profile.id,
|
||||
limit: -1n,
|
||||
offset: 0n
|
||||
});
|
||||
const response = await agentClient.listAgents({ profileId: profile.id });
|
||||
const now = Date.now();
|
||||
|
||||
let activeAgents = response.agents.reduce((count, agent) => {
|
||||
@@ -72,11 +59,6 @@
|
||||
return BigInt(activeAgents);
|
||||
});
|
||||
|
||||
// Helper function to calculate percentage
|
||||
function getPercentage(value: number, total: number) {
|
||||
return total > 0 ? Math.round((value / total) * 100) : 0;
|
||||
}
|
||||
|
||||
function timeAgo(date: Timestamp) {
|
||||
const dateTime = new Date(timestampDate(date));
|
||||
const seconds = Math.floor((new Date().getTime() - dateTime.getTime()) / 1000);
|
||||
@@ -133,7 +115,7 @@
|
||||
<Layers2 class="text-muted-foreground h-4 w-4" />
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
{#await profileClient.listProfiles({ limit: -1n, offset: 0n }) then result}
|
||||
{#await profileClient.listProfiles({}) then result}
|
||||
<div class="text-3xl font-bold">{result.totalCount}</div>
|
||||
<div class="mt-2 flex items-center text-sm">
|
||||
<TrendingUp class="mr-1 h-3 w-3 text-green-500" />
|
||||
@@ -176,7 +158,7 @@
|
||||
<Globe class="text-muted-foreground h-4 w-4" />
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
{#await dnsClient.listDnsProviders({ limit: -1n, offset: 0n }) then result}
|
||||
{#await dnsClient.listDnsProviders({}) then result}
|
||||
<div class="text-3xl font-bold">
|
||||
{result.totalCount}
|
||||
</div>
|
||||
@@ -230,7 +212,7 @@
|
||||
</Card.Title>
|
||||
</Card.Header>
|
||||
<Card.Content class="space-y-4">
|
||||
{#await routerClient.listRouters( { profileId: profile.id, limit: -1n, offset: 0n } ) then result}
|
||||
{#await routerClient.listRouters({ profileId: profile.id }) then result}
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -238,7 +220,7 @@
|
||||
<span class="text-sm">HTTP Routers</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{result.routers.filter((r) => r.type === RouterType.HTTP).length}
|
||||
{result.routers.filter((r) => r.type === ProtocolType.HTTP).length}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -247,7 +229,7 @@
|
||||
<span class="text-sm">TCP Routers</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{result.routers.filter((r) => r.type === RouterType.TCP).length}
|
||||
{result.routers.filter((r) => r.type === ProtocolType.TCP).length}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -256,7 +238,7 @@
|
||||
<span class="text-sm">UDP Routers</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{result.routers.filter((r) => r.type === RouterType.UDP).length}
|
||||
{result.routers.filter((r) => r.type === ProtocolType.UDP).length}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -264,37 +246,6 @@
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
|
||||
<!-- Services Overview -->
|
||||
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title class="flex items-center gap-2">
|
||||
<Server class="h-5 w-5" />
|
||||
Services Overview
|
||||
</Card.Title>
|
||||
</Card.Header>
|
||||
<Card.Content class="space-y-4">
|
||||
{#await serviceClient.listServices({ profileId: profile.id }) then result}
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="h-3 w-3 rounded-full bg-orange-500"></div>
|
||||
<span class="text-sm">HTTP Services</span>
|
||||
</div>
|
||||
<Badge variant="secondary">{result.totalCount}</Badge>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="mb-1 flex items-center justify-between text-sm">
|
||||
<span class="text-muted-foreground">Health Status</span>
|
||||
<span>100%</span>
|
||||
</div>
|
||||
<Progress value={100} class="h-2" />
|
||||
</div>
|
||||
</div>
|
||||
{/await}
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
|
||||
<!-- Middlewares Overview -->
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
@@ -312,7 +263,7 @@
|
||||
<span class="text-sm">HTTP Middlewares</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{result.middlewares.filter((m) => m.type === MiddlewareType.HTTP).length}
|
||||
{result.middlewares.filter((m) => m.type === ProtocolType.HTTP).length}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -321,13 +272,41 @@
|
||||
<span class="text-sm">TCP Middlewares</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{result.middlewares.filter((m) => m.type === MiddlewareType.TCP).length}
|
||||
{result.middlewares.filter((m) => m.type === ProtocolType.TCP).length}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
{/await}
|
||||
</Card.Content>
|
||||
</Card.Root>
|
||||
|
||||
<!-- Instances Overview -->
|
||||
<Card.Root>
|
||||
{#await traefikClient.listTraefikInstances({ profileId: profile.id }) then result}
|
||||
<Card.Header class="flex items-center justify-between">
|
||||
<Card.Title class="flex items-center gap-2">
|
||||
<Server class="h-5 w-5" />
|
||||
Traefik Instances
|
||||
</Card.Title>
|
||||
<Badge variant="secondary">{result.totalCount}</Badge>
|
||||
</Card.Header>
|
||||
<Card.Content class="space-y-4">
|
||||
<div class="max-h-64 space-y-2 overflow-y-auto pr-2">
|
||||
{#each result.traefikInstances || [] as instance (instance.id)}
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="h-3 w-3 rounded-full bg-green-500"></div>
|
||||
<span class="text-sm">{instance.name}</span>
|
||||
</div>
|
||||
<Badge variant="secondary">
|
||||
{instance.url}
|
||||
</Badge>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</Card.Content>
|
||||
{/await}
|
||||
</Card.Root>
|
||||
</div>
|
||||
|
||||
<!-- Profile Details and Activity -->
|
||||
@@ -348,7 +327,7 @@
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<div class="space-y-4">
|
||||
{#await profileClient.listProfiles({ limit: -1n, offset: 0n }) then result}
|
||||
{#await profileClient.listProfiles({}) then result}
|
||||
{#each result.profiles || [] as profile (profile.id)}
|
||||
<div class="space-y-4 rounded-lg border p-4">
|
||||
<div class="flex items-start justify-between">
|
||||
@@ -371,14 +350,14 @@
|
||||
<Separator />
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 md:grid-cols-4">
|
||||
{#await agentClient.listAgents( { profileId: profile.id, limit: -1n, offset: 0n } ) then agentResult}
|
||||
{#await agentClient.listAgents({ profileId: profile.id }) then agentResult}
|
||||
<div class="text-center">
|
||||
<div class="text-2xl font-bold text-blue-600">{agentResult.totalCount}</div>
|
||||
<div class="text-muted-foreground text-xs">Agents</div>
|
||||
</div>
|
||||
{/await}
|
||||
|
||||
{#await routerClient.listRouters( { profileId: profile.id, limit: -1n, offset: 0n } ) then routerResult}
|
||||
{#await routerClient.listRouters({ profileId: profile.id }) then routerResult}
|
||||
<div class="text-center">
|
||||
<div class="text-2xl font-bold text-green-600">
|
||||
{routerResult.totalCount}
|
||||
@@ -387,7 +366,7 @@
|
||||
</div>
|
||||
{/await}
|
||||
|
||||
{#await serviceClient.listServices( { profileId: profile.id, limit: -1n, offset: 0n } ) then serviceResult}
|
||||
{#await serviceClient.listServices( { profileId: profile.id } ) then serviceResult}
|
||||
<div class="text-center">
|
||||
<div class="text-2xl font-bold text-orange-600">
|
||||
{serviceResult.totalCount}
|
||||
@@ -396,7 +375,7 @@
|
||||
</div>
|
||||
{/await}
|
||||
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id, limit: -1n, offset: 0n } ) then middlewareResult}
|
||||
{#await middlewareClient.listMiddlewares( { profileId: profile.id } ) then middlewareResult}
|
||||
<div class="text-center">
|
||||
<div class="text-2xl font-bold text-purple-600">
|
||||
{middlewareResult.totalCount}
|
||||
@@ -494,7 +473,7 @@
|
||||
</Card.Header>
|
||||
<Card.Content class="space-y-3">
|
||||
<div class="space-y-3 text-sm">
|
||||
{#await auditLogClient.listAuditLogs({ limit: 8n, offset: 0n }) then result}
|
||||
{#await auditLogClient.listAuditLogs({ limit: 8n }) then result}
|
||||
{#each result.auditLogs || [] as log (log.id)}
|
||||
<div class="flex items-start gap-3">
|
||||
{#if log.agentId}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import { CircleCheck, CircleSlash, EthernetPort, Pencil, Trash } from '@lucide/svelte';
|
||||
import type { ColumnDef, PaginationState } from '@tanstack/table-core';
|
||||
import { onMount } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
let item = $state({} as EntryPoint);
|
||||
@@ -166,8 +165,8 @@
|
||||
rowCount = Number(response.totalCount);
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
$effect(() => {
|
||||
if (profile) refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -19,21 +19,20 @@
|
||||
const isEmail = username.includes('@');
|
||||
|
||||
try {
|
||||
await userClient.verifyOTP({
|
||||
let response = await userClient.verifyOTP({
|
||||
identifier: {
|
||||
case: isEmail ? 'email' : 'username',
|
||||
value: username
|
||||
},
|
||||
otp
|
||||
});
|
||||
const verified = await userClient.verifyJWT({});
|
||||
if (verified.user) {
|
||||
user.value = verified.user;
|
||||
await goto('/');
|
||||
}
|
||||
if (!response.user) throw new Error('Failed to verify token');
|
||||
|
||||
user.value = response.user;
|
||||
toast.success('Token verified successfully!', {
|
||||
description: 'Please reset your password!'
|
||||
});
|
||||
await goto('/');
|
||||
} catch (err) {
|
||||
let e = ConnectError.from(err);
|
||||
toast.error('Failed to verify Token', { description: e.message });
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import type { BulkAction } from '$lib/components/tables/types';
|
||||
import { MiddlewareType, type Middleware } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { onMount } from 'svelte';
|
||||
import { type Middleware } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { middlewareClient } from '$lib/api';
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import ColumnText from '$lib/components/tables/ColumnText.svelte';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let item = $state({} as Middleware);
|
||||
let open = $state(false);
|
||||
@@ -55,7 +55,7 @@
|
||||
enableSorting: true,
|
||||
enableGlobalFilter: false,
|
||||
filterFn: (row, columnId, filterValue) => {
|
||||
const protocol = row.getValue(columnId) as MiddlewareType;
|
||||
const protocol = row.getValue(columnId) as ProtocolType;
|
||||
|
||||
// Handle both enum value and display label filtering
|
||||
if (typeof filterValue === 'string') {
|
||||
@@ -70,14 +70,14 @@
|
||||
return protocol === filterValue;
|
||||
},
|
||||
cell: ({ row, column }) => {
|
||||
let protocol = row.getValue('type') as MiddlewareType.HTTP | MiddlewareType.TCP;
|
||||
let protocol = row.getValue('type') as ProtocolType.HTTP | ProtocolType.TCP;
|
||||
|
||||
let label = 'Unspecified';
|
||||
let icon = undefined;
|
||||
if (protocol === MiddlewareType.HTTP) {
|
||||
if (protocol === ProtocolType.HTTP) {
|
||||
label = 'HTTP';
|
||||
icon = Globe;
|
||||
} else if (protocol === MiddlewareType.TCP) {
|
||||
} else if (protocol === ProtocolType.TCP) {
|
||||
label = 'TCP';
|
||||
icon = Network;
|
||||
}
|
||||
@@ -179,9 +179,9 @@
|
||||
}
|
||||
}
|
||||
];
|
||||
function getProtocolLabel(protocol: MiddlewareType): string {
|
||||
if (protocol === MiddlewareType.HTTP) return 'HTTP';
|
||||
if (protocol === MiddlewareType.TCP) return 'TCP';
|
||||
function getProtocolLabel(protocol: ProtocolType): string {
|
||||
if (protocol === ProtocolType.HTTP) return 'HTTP';
|
||||
if (protocol === ProtocolType.TCP) return 'TCP';
|
||||
return 'Unspecified';
|
||||
}
|
||||
const bulkActions: BulkAction<Middleware>[] = [
|
||||
@@ -198,7 +198,7 @@
|
||||
await refreshData(p.pageSize, p.pageIndex);
|
||||
}
|
||||
|
||||
const deleteItem = async (id: bigint, type: MiddlewareType) => {
|
||||
const deleteItem = async (id: bigint, type: ProtocolType) => {
|
||||
try {
|
||||
await middlewareClient.deleteMiddleware({ id: id, type: type });
|
||||
await refreshData(pageSize.value ?? 10, 0);
|
||||
@@ -255,8 +255,8 @@
|
||||
rowCount = Number(response.totalCount);
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
$effect(() => {
|
||||
if (profile) refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
createButton={{
|
||||
label: 'Create Middleware',
|
||||
onClick: () => {
|
||||
item = { type: MiddlewareType.HTTP } as Middleware;
|
||||
item = { type: ProtocolType.HTTP } as Middleware;
|
||||
open = true;
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
import YAML from 'yaml';
|
||||
import { slide } from 'svelte/transition';
|
||||
import CopyButton from '$lib/components/ui/copy-button/copy-button.svelte';
|
||||
import { MiddlewareType, type Plugin } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { type Plugin } from '$lib/gen/mantrae/v1/middleware_pb';
|
||||
import { middlewareClient } from '$lib/api';
|
||||
import { ConnectError } from '@connectrpc/connect';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import { marshalConfig } from '$lib/types';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
// State
|
||||
let open = $state(false);
|
||||
@@ -62,7 +63,7 @@
|
||||
try {
|
||||
await middlewareClient.createMiddleware({
|
||||
profileId: profile.value?.id,
|
||||
type: MiddlewareType.HTTP,
|
||||
type: ProtocolType.HTTP,
|
||||
name: name,
|
||||
config: marshalConfig(pluginContent)
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import TableActions from '$lib/components/tables/TableActions.svelte';
|
||||
import type { BulkAction } from '$lib/components/tables/types';
|
||||
import { renderComponent } from '$lib/components/ui/data-table';
|
||||
import { RouterType, type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import { type Router } from '$lib/gen/mantrae/v1/router_pb';
|
||||
import type { RouterTCPTLSConfig, RouterTLSConfig } from '$lib/gen/zen/traefik-schemas';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
@@ -29,9 +29,9 @@
|
||||
Waves
|
||||
} from '@lucide/svelte';
|
||||
import type { ColumnDef, PaginationState } from '@tanstack/table-core';
|
||||
import { onMount } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { type IconComponent } from '$lib/types';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let item = $state({} as Router);
|
||||
let open = $state(false);
|
||||
@@ -39,7 +39,6 @@
|
||||
// Data state
|
||||
let data = $state<Router[]>([]);
|
||||
let rowCount = $state<number>(0);
|
||||
// let viewMode = $state<'table' | 'grid'>('table');
|
||||
|
||||
const columns: ColumnDef<Router>[] = [
|
||||
{
|
||||
@@ -62,7 +61,7 @@
|
||||
enableSorting: true,
|
||||
enableGlobalFilter: false,
|
||||
filterFn: (row, columnId, filterValue) => {
|
||||
const protocol = row.getValue(columnId) as RouterType;
|
||||
const protocol = row.getValue(columnId) as ProtocolType;
|
||||
|
||||
// Handle both enum value and display label filtering
|
||||
if (typeof filterValue === 'string') {
|
||||
@@ -77,13 +76,13 @@
|
||||
return protocol === filterValue;
|
||||
},
|
||||
cell: ({ row, column }) => {
|
||||
const protocol = row.getValue('type') as RouterType;
|
||||
const protocol = row.getValue('type') as ProtocolType;
|
||||
const label = getProtocolLabel(protocol);
|
||||
const iconMap: Record<RouterType, IconComponent> = {
|
||||
[RouterType.HTTP]: Globe,
|
||||
[RouterType.TCP]: Network,
|
||||
[RouterType.UDP]: Waves,
|
||||
[RouterType.UNSPECIFIED]: TriangleAlert
|
||||
const iconMap: Record<ProtocolType, IconComponent> = {
|
||||
[ProtocolType.HTTP]: Globe,
|
||||
[ProtocolType.TCP]: Network,
|
||||
[ProtocolType.UDP]: Waves,
|
||||
[ProtocolType.UNSPECIFIED]: TriangleAlert
|
||||
};
|
||||
return renderComponent(ColumnBadge<Router>, {
|
||||
label,
|
||||
@@ -133,7 +132,7 @@
|
||||
cell: ({ row }) => {
|
||||
return renderComponent(ColumnRule, {
|
||||
rule: (row.original.config?.rule as string) ?? '',
|
||||
routerType: row.original.type as RouterType.HTTP | RouterType.TCP
|
||||
protocol: row.original.type as ProtocolType.HTTP | ProtocolType.TCP
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -200,10 +199,10 @@
|
||||
];
|
||||
|
||||
// Helper functions to avoid repetition
|
||||
function getProtocolLabel(protocol: RouterType): string {
|
||||
if (protocol === RouterType.HTTP) return 'HTTP';
|
||||
if (protocol === RouterType.TCP) return 'TCP';
|
||||
if (protocol === RouterType.UDP) return 'UDP';
|
||||
function getProtocolLabel(protocol: ProtocolType): string {
|
||||
if (protocol === ProtocolType.HTTP) return 'HTTP';
|
||||
if (protocol === ProtocolType.TCP) return 'TCP';
|
||||
if (protocol === ProtocolType.UDP) return 'UDP';
|
||||
return 'Unspecified';
|
||||
}
|
||||
|
||||
@@ -256,9 +255,13 @@
|
||||
enabled: item.enabled,
|
||||
dnsProviders: item.dnsProviders
|
||||
});
|
||||
const service = await serviceClient.getServiceByRouter({
|
||||
name: item.name,
|
||||
type: item.type
|
||||
const service = await serviceClient.getService({
|
||||
profileId: profile.id,
|
||||
type: item.type,
|
||||
identifier: {
|
||||
value: item.name,
|
||||
case: 'name'
|
||||
}
|
||||
});
|
||||
if (service.service) {
|
||||
service.service.enabled = item.enabled;
|
||||
@@ -332,18 +335,8 @@
|
||||
rowCount = Number(response.totalCount);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
|
||||
// Set up resize handler
|
||||
// const handleResize = () => {
|
||||
// const isMobile = window.matchMedia('(max-width: 768px)').matches;
|
||||
// if (isMobile) viewMode = 'grid';
|
||||
// };
|
||||
|
||||
// handleResize(); // Check initial state
|
||||
// window.addEventListener('resize', handleResize);
|
||||
// return () => window.removeEventListener('resize', handleResize);
|
||||
$effect(() => {
|
||||
if (profile) refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -362,51 +355,8 @@
|
||||
</h1>
|
||||
<p class="text-muted-foreground text-sm sm:text-base">Manage your routers and services</p>
|
||||
</div>
|
||||
|
||||
<!-- View Toggle (Don't show on mobile) -->
|
||||
<!-- <div class="hidden items-center gap-2 self-start sm:self-auto md:flex"> -->
|
||||
<!-- <Button -->
|
||||
<!-- variant={viewMode === 'table' ? 'default' : 'outline'} -->
|
||||
<!-- size="sm" -->
|
||||
<!-- onclick={() => (viewMode = 'table')} -->
|
||||
<!-- class="flex-1 sm:flex-none" -->
|
||||
<!-- > -->
|
||||
<!-- <Table class="h-4 w-4 sm:mr-2" /> -->
|
||||
<!-- <span class="hidden sm:block">Table</span> -->
|
||||
<!-- </Button> -->
|
||||
<!-- <Button -->
|
||||
<!-- variant={viewMode === 'grid' ? 'default' : 'outline'} -->
|
||||
<!-- size="sm" -->
|
||||
<!-- onclick={() => (viewMode = 'grid')} -->
|
||||
<!-- class="flex-1 sm:flex-none" -->
|
||||
<!-- > -->
|
||||
<!-- <LayoutGrid class="h-4 w-4 sm:mr-2" /> -->
|
||||
<!-- <span class="hidden sm:block">Grid</span> -->
|
||||
<!-- </Button> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<!-- <DataTable -->
|
||||
<!-- {data} -->
|
||||
<!-- {columns} -->
|
||||
<!-- {rowCount} -->
|
||||
<!-- {viewMode} -->
|
||||
<!-- {onPaginationChange} -->
|
||||
<!-- {bulkActions} -->
|
||||
<!-- rowClassModifiers={{}} -->
|
||||
<!-- cardConfig={{ -->
|
||||
<!-- titleKey: 'name', -->
|
||||
<!-- subtitleKey: 'type', -->
|
||||
<!-- excludeColumns: [] -->
|
||||
<!-- }} -->
|
||||
<!-- createButton={{ -->
|
||||
<!-- label: 'Create Router', -->
|
||||
<!-- onClick: () => { -->
|
||||
<!-- item = { type: RouterType.HTTP } as Router; -->
|
||||
<!-- open = true; -->
|
||||
<!-- } -->
|
||||
<!-- }} -->
|
||||
<!-- /> -->
|
||||
<DataTable
|
||||
{data}
|
||||
{columns}
|
||||
@@ -416,7 +366,7 @@
|
||||
createButton={{
|
||||
label: 'Create Router',
|
||||
onClick: () => {
|
||||
item = { type: RouterType.HTTP } as Router;
|
||||
item = { type: ProtocolType.HTTP } as Router;
|
||||
open = true;
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -1,214 +1,206 @@
|
||||
export const settingGroups = {
|
||||
general: {
|
||||
title: "General Settings",
|
||||
description: "Core configuration for connecting to backend services.",
|
||||
title: 'General Settings',
|
||||
description: 'Core configuration for connecting to backend services.',
|
||||
keys: [
|
||||
{
|
||||
key: "server_url",
|
||||
label: "Server URL",
|
||||
type: "text",
|
||||
key: 'server_url',
|
||||
label: 'Server URL',
|
||||
type: 'text',
|
||||
description:
|
||||
"The base URL of your backend server, including protocol (e.g., https://example.com).",
|
||||
'The base URL of your backend server, including protocol (e.g., https://example.com).'
|
||||
},
|
||||
{
|
||||
key: "storage_select",
|
||||
label: "Storage Type",
|
||||
type: "select",
|
||||
description:
|
||||
"Select the storage backend for backups (e.g., local, S3).",
|
||||
},
|
||||
],
|
||||
key: 'storage_select',
|
||||
label: 'Storage Type',
|
||||
type: 'select',
|
||||
description: 'Select the storage backend for backups (e.g., local, S3).'
|
||||
}
|
||||
]
|
||||
},
|
||||
backup: {
|
||||
title: "Backup Settings",
|
||||
description: "Control how and where the system creates database backups.",
|
||||
title: 'Backup Settings',
|
||||
description: 'Control how and where the system creates database backups.',
|
||||
keys: [
|
||||
{
|
||||
key: "backup_enabled",
|
||||
label: "Enable Backups",
|
||||
type: "boolean",
|
||||
description: "Toggle automatic backups of the database.",
|
||||
key: 'backup_enabled',
|
||||
label: 'Enable Backups',
|
||||
type: 'boolean',
|
||||
description: 'Toggle automatic backups of the database.'
|
||||
},
|
||||
{
|
||||
key: "backup_interval",
|
||||
label: "Backup Interval",
|
||||
type: "duration",
|
||||
description: "How often backups should run (e.g., 24h, 1h30m).",
|
||||
key: 'backup_interval',
|
||||
label: 'Backup Interval',
|
||||
type: 'duration',
|
||||
description: 'How often backups should run (e.g., 24h, 1h30m).'
|
||||
},
|
||||
{
|
||||
key: "backup_keep",
|
||||
label: "Backups to Keep",
|
||||
type: "number",
|
||||
description: "The number of recent backups to retain.",
|
||||
},
|
||||
],
|
||||
key: 'backup_keep',
|
||||
label: 'Backups to Keep',
|
||||
type: 'number',
|
||||
description: 'The number of recent backups to retain.'
|
||||
}
|
||||
]
|
||||
},
|
||||
s3: {
|
||||
title: "S3 Storage Settings",
|
||||
description:
|
||||
"Configure connection to Amazon S3 or any compatible object storage.",
|
||||
title: 'S3 Storage Settings',
|
||||
description: 'Configure connection to Amazon S3 or any compatible object storage.',
|
||||
keys: [
|
||||
{
|
||||
key: "s3_endpoint",
|
||||
label: "S3 Endpoint",
|
||||
type: "text",
|
||||
key: 's3_endpoint',
|
||||
label: 'S3 Endpoint',
|
||||
type: 'text',
|
||||
description:
|
||||
"Custom endpoint for your S3-compatible storage (e.g., https://s3.amazonaws.com).",
|
||||
'Custom endpoint for your S3-compatible storage (e.g., https://s3.amazonaws.com).'
|
||||
},
|
||||
{
|
||||
key: "s3_bucket",
|
||||
label: "Bucket Name",
|
||||
type: "text",
|
||||
description: "The name of the S3 bucket used for storing backups.",
|
||||
key: 's3_bucket',
|
||||
label: 'Bucket Name',
|
||||
type: 'text',
|
||||
description: 'The name of the S3 bucket used for storing backups.'
|
||||
},
|
||||
{
|
||||
key: "s3_region",
|
||||
label: "Region",
|
||||
type: "text",
|
||||
description: "AWS region of your bucket (e.g., us-east-1).",
|
||||
key: 's3_region',
|
||||
label: 'Region',
|
||||
type: 'text',
|
||||
description: 'AWS region of your bucket (e.g., us-east-1).'
|
||||
},
|
||||
{
|
||||
key: "s3_access_key",
|
||||
label: "Access Key",
|
||||
type: "text",
|
||||
description: "Access key ID for your S3 storage credentials.",
|
||||
key: 's3_access_key',
|
||||
label: 'Access Key',
|
||||
type: 'text',
|
||||
description: 'Access key ID for your S3 storage credentials.'
|
||||
},
|
||||
{
|
||||
key: "s3_secret_key",
|
||||
label: "Secret Key",
|
||||
type: "text",
|
||||
description: "Secret access key for S3 storage. Keep it safe.",
|
||||
key: 's3_secret_key',
|
||||
label: 'Secret Key',
|
||||
type: 'text',
|
||||
description: 'Secret access key for S3 storage. Keep it safe.'
|
||||
},
|
||||
{
|
||||
key: "s3_use_path_style",
|
||||
label: "Use Path Style",
|
||||
type: "boolean",
|
||||
key: 's3_use_path_style',
|
||||
label: 'Use Path Style',
|
||||
type: 'boolean',
|
||||
description:
|
||||
"Enable if your S3 provider requires path-style URLs (instead of virtual-host style).",
|
||||
},
|
||||
],
|
||||
'Enable if your S3 provider requires path-style URLs (instead of virtual-host style).'
|
||||
}
|
||||
]
|
||||
},
|
||||
email: {
|
||||
title: "Email Settings",
|
||||
description: "Set up SMTP for sending system and user notification emails.",
|
||||
title: 'Email Settings',
|
||||
description: 'Set up SMTP for sending system and user notification emails.',
|
||||
keys: [
|
||||
{
|
||||
key: "email_host",
|
||||
label: "SMTP Host",
|
||||
type: "text",
|
||||
description: "Hostname of the SMTP server (e.g., smtp.mailgun.org).",
|
||||
key: 'email_host',
|
||||
label: 'SMTP Host',
|
||||
type: 'text',
|
||||
description: 'Hostname of the SMTP server (e.g., smtp.mailgun.org).'
|
||||
},
|
||||
{
|
||||
key: "email_port",
|
||||
label: "SMTP Port",
|
||||
type: "number",
|
||||
description:
|
||||
"Port used to connect to the SMTP server (e.g., 587 or 465).",
|
||||
key: 'email_port',
|
||||
label: 'SMTP Port',
|
||||
type: 'number',
|
||||
description: 'Port used to connect to the SMTP server (e.g., 587 or 465).'
|
||||
},
|
||||
{
|
||||
key: "email_user",
|
||||
label: "Username",
|
||||
type: "text",
|
||||
description: "Login username for the SMTP server.",
|
||||
key: 'email_user',
|
||||
label: 'Username',
|
||||
type: 'text',
|
||||
description: 'Login username for the SMTP server.'
|
||||
},
|
||||
{
|
||||
key: "email_password",
|
||||
label: "Password",
|
||||
type: "password",
|
||||
description: "SMTP password or app-specific token.",
|
||||
key: 'email_password',
|
||||
label: 'Password',
|
||||
type: 'password',
|
||||
description: 'SMTP password or app-specific token.'
|
||||
},
|
||||
{
|
||||
key: "email_from",
|
||||
label: "From Address",
|
||||
type: "text",
|
||||
description: "Email address to use as the sender in outgoing emails.",
|
||||
},
|
||||
],
|
||||
key: 'email_from',
|
||||
label: 'From Address',
|
||||
type: 'text',
|
||||
description: 'Email address to use as the sender in outgoing emails.'
|
||||
}
|
||||
]
|
||||
},
|
||||
oauth: {
|
||||
title: "OIDC Authentication",
|
||||
title: 'OIDC Authentication',
|
||||
description:
|
||||
"Configure OpenID Connect for secure single sign-on (SSO) and identity management.",
|
||||
'Configure OpenID Connect for secure single sign-on (SSO) and identity management.',
|
||||
keys: [
|
||||
{
|
||||
key: "oidc_enabled",
|
||||
label: "Enable OIDC",
|
||||
type: "boolean",
|
||||
key: 'oidc_enabled',
|
||||
label: 'Enable OIDC',
|
||||
type: 'boolean',
|
||||
description:
|
||||
"Turn on OpenID Connect authentication. Use /oidc/callback as the callback URL in your identity provider configuration.",
|
||||
'Turn on OpenID Connect authentication. Use /oidc/callback as the callback URL in your identity provider configuration.'
|
||||
},
|
||||
{
|
||||
key: "password_login_enabled",
|
||||
label: "Password Login",
|
||||
type: "boolean",
|
||||
key: 'password_login_enabled',
|
||||
label: 'Password Login',
|
||||
type: 'boolean',
|
||||
description: 'Force users to log in only via OIDC when disabled (no local passwords).'
|
||||
},
|
||||
{
|
||||
key: 'oidc_client_id',
|
||||
label: 'Client ID',
|
||||
type: 'text',
|
||||
description: 'OIDC client ID issued by your identity provider.'
|
||||
},
|
||||
{
|
||||
key: 'oidc_client_secret',
|
||||
label: 'Client Secret',
|
||||
type: 'password',
|
||||
description: 'OIDC client secret issued by your identity provider.'
|
||||
},
|
||||
{
|
||||
key: 'oidc_issuer_url',
|
||||
label: 'Issuer URL',
|
||||
type: 'text',
|
||||
description: 'URL of the OIDC provider (e.g., https://auth.example.com).'
|
||||
},
|
||||
{
|
||||
key: 'oidc_provider_name',
|
||||
label: 'Provider Name',
|
||||
type: 'text',
|
||||
description: 'Friendly name shown in the login UI for the OIDC provider.'
|
||||
},
|
||||
{
|
||||
key: 'oidc_scopes',
|
||||
label: 'OIDC Scopes',
|
||||
type: 'text',
|
||||
description:
|
||||
"Force users to log in only via OIDC when disabled (no local passwords).",
|
||||
'Requested scopes (space-separated) for the OIDC flow (e.g., openid email profile).'
|
||||
},
|
||||
{
|
||||
key: "oidc_client_id",
|
||||
label: "Client ID",
|
||||
type: "text",
|
||||
description: "OIDC client ID issued by your identity provider.",
|
||||
},
|
||||
{
|
||||
key: "oidc_client_secret",
|
||||
label: "Client Secret",
|
||||
type: "password",
|
||||
description: "OIDC client secret issued by your identity provider.",
|
||||
},
|
||||
{
|
||||
key: "oidc_issuer_url",
|
||||
label: "Issuer URL",
|
||||
type: "text",
|
||||
description:
|
||||
"URL of the OIDC provider (e.g., https://auth.example.com).",
|
||||
},
|
||||
{
|
||||
key: "oidc_provider_name",
|
||||
label: "Provider Name",
|
||||
type: "text",
|
||||
description:
|
||||
"Friendly name shown in the login UI for the OIDC provider.",
|
||||
},
|
||||
{
|
||||
key: "oidc_scopes",
|
||||
label: "OIDC Scopes",
|
||||
type: "text",
|
||||
description:
|
||||
"Requested scopes (space-separated) for the OIDC flow (e.g., openid email profile).",
|
||||
},
|
||||
{
|
||||
key: "oidc_pkce",
|
||||
label: "Use PKCE",
|
||||
type: "boolean",
|
||||
description:
|
||||
"Enable PKCE (Proof Key for Code Exchange) for better security.",
|
||||
},
|
||||
],
|
||||
key: 'oidc_pkce',
|
||||
label: 'Use PKCE',
|
||||
type: 'boolean',
|
||||
description: 'Enable PKCE (Proof Key for Code Exchange) for better security.'
|
||||
}
|
||||
]
|
||||
},
|
||||
agents: {
|
||||
title: "Agent Configuration",
|
||||
description: "Manage automated cleanup tasks for connected agents.",
|
||||
title: 'Agent Configuration',
|
||||
description: 'Manage automated cleanup tasks for connected agents.',
|
||||
keys: [
|
||||
{
|
||||
key: "agent_cleanup_enabled",
|
||||
label: "Enable Cleanup",
|
||||
type: "boolean",
|
||||
description:
|
||||
"Automatically remove stale or offline agents on a schedule.",
|
||||
key: 'agent_cleanup_enabled',
|
||||
label: 'Enable Cleanup',
|
||||
type: 'boolean',
|
||||
description: 'Automatically remove stale or offline agents on a schedule.'
|
||||
},
|
||||
{
|
||||
key: "agent_cleanup_interval",
|
||||
label: "Cleanup Interval",
|
||||
type: "duration",
|
||||
description: "Frequency of cleanup jobs (e.g., 1h, 24h).",
|
||||
},
|
||||
],
|
||||
},
|
||||
key: 'agent_cleanup_interval',
|
||||
label: 'Cleanup Interval',
|
||||
type: 'duration',
|
||||
description: 'Frequency of cleanup jobs (e.g., 1h, 24h).'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// Storage types for the select dropdown
|
||||
export const storageTypes = [
|
||||
{ value: "local", label: "Local Storage" },
|
||||
{ value: "s3", label: "S3 Storage" },
|
||||
{ value: 'local', label: 'Local Storage' },
|
||||
{ value: 's3', label: 'S3 Storage' }
|
||||
];
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
import TableActions from '$lib/components/tables/TableActions.svelte';
|
||||
import type { BulkAction } from '$lib/components/tables/types';
|
||||
import { renderComponent } from '$lib/components/ui/data-table';
|
||||
import {
|
||||
ServersTransportType,
|
||||
type ServersTransport
|
||||
} from '$lib/gen/mantrae/v1/servers_transport_pb';
|
||||
import { type ServersTransport } from '$lib/gen/mantrae/v1/servers_transport_pb';
|
||||
import { pageIndex, pageSize } from '$lib/stores/common';
|
||||
import { profile } from '$lib/stores/profile';
|
||||
import type { IconComponent } from '$lib/types';
|
||||
@@ -25,8 +22,8 @@
|
||||
Truck
|
||||
} from '@lucide/svelte';
|
||||
import type { ColumnDef, PaginationState } from '@tanstack/table-core';
|
||||
import { onMount } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { ProtocolType } from '$lib/gen/mantrae/v1/protocol_pb';
|
||||
|
||||
let item = $state({} as ServersTransport);
|
||||
let open = $state(false);
|
||||
@@ -48,7 +45,7 @@
|
||||
enableSorting: true,
|
||||
enableGlobalFilter: false,
|
||||
filterFn: (row, columnId, filterValue) => {
|
||||
const protocol = row.getValue(columnId) as ServersTransportType;
|
||||
const protocol = row.getValue(columnId) as ProtocolType;
|
||||
|
||||
// Handle both enum value and display label filtering
|
||||
if (typeof filterValue === 'string') {
|
||||
@@ -63,12 +60,12 @@
|
||||
return protocol === filterValue;
|
||||
},
|
||||
cell: ({ row, column }) => {
|
||||
const protocol = row.getValue('type') as ServersTransportType;
|
||||
const protocol = row.getValue('type') as ProtocolType;
|
||||
const label = getProtocolLabel(protocol);
|
||||
const iconMap: Record<ServersTransportType, IconComponent> = {
|
||||
[ServersTransportType.HTTP]: Globe,
|
||||
[ServersTransportType.TCP]: Network,
|
||||
[ServersTransportType.UNSPECIFIED]: TriangleAlert
|
||||
const iconMap: Partial<Record<ProtocolType, IconComponent>> = {
|
||||
[ProtocolType.HTTP]: Globe,
|
||||
[ProtocolType.TCP]: Network,
|
||||
[ProtocolType.UNSPECIFIED]: TriangleAlert
|
||||
};
|
||||
return renderComponent(ColumnBadge<ServersTransport>, {
|
||||
label,
|
||||
@@ -126,9 +123,9 @@
|
||||
];
|
||||
|
||||
// Helper functions to avoid repetition
|
||||
function getProtocolLabel(protocol: ServersTransportType): string {
|
||||
if (protocol === ServersTransportType.HTTP) return 'HTTP';
|
||||
if (protocol === ServersTransportType.TCP) return 'TCP';
|
||||
function getProtocolLabel(protocol: ProtocolType): string {
|
||||
if (protocol === ProtocolType.HTTP) return 'HTTP';
|
||||
if (protocol === ProtocolType.TCP) return 'TCP';
|
||||
return 'Unspecified';
|
||||
}
|
||||
|
||||
@@ -200,8 +197,8 @@
|
||||
rowCount = Number(response.totalCount);
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
$effect(() => {
|
||||
if (profile) refreshData(pageSize.value ?? 10, pageIndex.value ?? 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user