mirror of
https://github.com/MizuchiLabs/mantrae.git
synced 2025-12-21 06:10:04 -06:00
cleanup
This commit is contained in:
@@ -50,7 +50,8 @@ func GetContainers() ([]ContainerInfo, error) {
|
||||
|
||||
var result []ContainerInfo
|
||||
for _, c := range containers {
|
||||
if strings.Contains(c.Image, "traefik") {
|
||||
name := strings.TrimPrefix(c.Names[0], "/")
|
||||
if strings.Contains(c.Image, "traefik") && name != "whoami" {
|
||||
slog.Debug("Skipping Traefik container", "name", c.Names[0])
|
||||
continue
|
||||
}
|
||||
@@ -67,7 +68,7 @@ func GetContainers() ([]ContainerInfo, error) {
|
||||
|
||||
result = append(result, ContainerInfo{
|
||||
ID: c.ID,
|
||||
Name: c.Names[0],
|
||||
Name: name,
|
||||
Labels: c.Labels,
|
||||
})
|
||||
}
|
||||
|
||||
12
docs/pnpm-lock.yaml
generated
12
docs/pnpm-lock.yaml
generated
@@ -1892,8 +1892,8 @@ packages:
|
||||
caniuse-api@3.0.0:
|
||||
resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
|
||||
|
||||
caniuse-lite@1.0.30001757:
|
||||
resolution: {integrity: sha512-r0nnL/I28Zi/yjk1el6ilj27tKcdjLsNqAOZr0yVjWPrSQyHgKI2INaEWw21bAQSv2LXRt1XuCS/GomNpWOxsQ==}
|
||||
caniuse-lite@1.0.30001759:
|
||||
resolution: {integrity: sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==}
|
||||
|
||||
ccount@2.0.1:
|
||||
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
|
||||
@@ -7594,7 +7594,7 @@ snapshots:
|
||||
autoprefixer@10.4.22(postcss@8.5.6):
|
||||
dependencies:
|
||||
browserslist: 4.28.0
|
||||
caniuse-lite: 1.0.30001757
|
||||
caniuse-lite: 1.0.30001759
|
||||
fraction.js: 5.3.4
|
||||
normalize-range: 0.1.2
|
||||
picocolors: 1.1.1
|
||||
@@ -7706,7 +7706,7 @@ snapshots:
|
||||
browserslist@4.28.0:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.8.32
|
||||
caniuse-lite: 1.0.30001757
|
||||
caniuse-lite: 1.0.30001759
|
||||
electron-to-chromium: 1.5.263
|
||||
node-releases: 2.0.27
|
||||
update-browserslist-db: 1.1.4(browserslist@4.28.0)
|
||||
@@ -7764,11 +7764,11 @@ snapshots:
|
||||
caniuse-api@3.0.0:
|
||||
dependencies:
|
||||
browserslist: 4.28.0
|
||||
caniuse-lite: 1.0.30001757
|
||||
caniuse-lite: 1.0.30001759
|
||||
lodash.memoize: 4.1.2
|
||||
lodash.uniq: 4.5.0
|
||||
|
||||
caniuse-lite@1.0.30001757: {}
|
||||
caniuse-lite@1.0.30001759: {}
|
||||
|
||||
ccount@2.0.1: {}
|
||||
|
||||
|
||||
4
go.mod
4
go.mod
@@ -152,8 +152,8 @@ require (
|
||||
golang.org/x/text v0.31.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
golang.org/x/tools v0.39.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||
google.golang.org/grpc v1.77.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
|
||||
4
go.sum
4
go.sum
@@ -419,8 +419,12 @@ gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846 h1:ZdyUkS9po3H7G0tuh955QVyyotWvOD4W0aEapeGeUYk=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846/go.mod h1:Fk4kyraUvqD7i5H6S43sj2W98fbZa75lpZz/eUyhfO0=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 h1:Wgl1rcDNThT+Zn47YyCXOXyX/COgMTIdhJ717F0l4xk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=
|
||||
google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=
|
||||
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
|
||||
|
||||
@@ -347,7 +347,7 @@ func findOrCreateOIDCUser(
|
||||
}
|
||||
|
||||
// Ensure username is unique
|
||||
params := db.CreateUserParams{
|
||||
params := &db.CreateUserParams{
|
||||
ID: id.String(),
|
||||
Username: generateUniqueUsername(ctx, q, userInfo),
|
||||
Email: &userInfo.Email,
|
||||
@@ -365,7 +365,7 @@ func findOrCreateOIDCUser(
|
||||
} else {
|
||||
// Update existing user's email if verified
|
||||
if userInfo.Email != "" && userInfo.EmailVerified {
|
||||
if _, err := q.UpdateUser(ctx, db.UpdateUserParams{
|
||||
if _, err := q.UpdateUser(ctx, &db.UpdateUserParams{
|
||||
ID: user.ID,
|
||||
Username: user.Username,
|
||||
Email: &userInfo.Email,
|
||||
|
||||
@@ -79,7 +79,7 @@ func PublishTraefikConfig(a *config.App) http.HandlerFunc {
|
||||
// Create or update traefik instance
|
||||
scheduleUpdate(r, a, profile.ID)
|
||||
|
||||
cfg, err := traefik.BuildDynamicConfig(r.Context(), a.Conn.GetQuery(), profile)
|
||||
cfg, err := traefik.BuildDynamicConfig(r.Context(), a.Conn.GetQuery(), *profile)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
@@ -30,7 +30,7 @@ func NewAuditInterceptor(app *config.App) connect.UnaryInterceptorFunc {
|
||||
|
||||
// Only audit on successful operations
|
||||
if err == nil {
|
||||
var params db.CreateAuditLogParams
|
||||
params := &db.CreateAuditLogParams{}
|
||||
params.UserID = GetUserIDFromContext(ctx)
|
||||
params.AgentID = GetAgentIDFromContext(ctx)
|
||||
if auditEvent := extractAuditEvent(req, resp); auditEvent != nil {
|
||||
|
||||
@@ -41,7 +41,7 @@ func (s *AgentService) CreateAgent(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.CreateAgentRequest],
|
||||
) (*connect.Response[mantraev1.CreateAgentResponse], error) {
|
||||
params := db.CreateAgentParams{
|
||||
params := &db.CreateAgentParams{
|
||||
ID: uuid.NewString(),
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (s *AgentService) UpdateAgent(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateAgentRequest],
|
||||
) (*connect.Response[mantraev1.UpdateAgentResponse], error) {
|
||||
params := db.UpdateAgentParams{
|
||||
params := &db.UpdateAgentParams{
|
||||
ID: req.Msg.Id,
|
||||
ActiveIp: req.Msg.Ip,
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func (s *AgentService) ListAgents(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListAgentsRequest],
|
||||
) (*connect.Response[mantraev1.ListAgentsResponse], error) {
|
||||
params := db.ListAgentsParams{
|
||||
params := &db.ListAgentsParams{
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
@@ -168,7 +168,7 @@ func (s *AgentService) HealthCheck(
|
||||
}
|
||||
|
||||
// Update Agent
|
||||
params := db.UpdateAgentParams{
|
||||
params := &db.UpdateAgentParams{
|
||||
ID: agent.ID,
|
||||
Hostname: &req.Msg.Hostname,
|
||||
PublicIp: &req.Msg.PublicIp,
|
||||
|
||||
@@ -22,7 +22,7 @@ func (s *AuditLogService) ListAuditLogs(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListAuditLogsRequest],
|
||||
) (*connect.Response[mantraev1.ListAuditLogsResponse], error) {
|
||||
params := db.ListAuditLogsParams{
|
||||
params := &db.ListAuditLogsParams{
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func (s *DnsProviderService) CreateDnsProvider(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.CreateDnsProviderRequest],
|
||||
) (*connect.Response[mantraev1.CreateDnsProviderResponse], error) {
|
||||
params := db.CreateDnsProviderParams{
|
||||
params := &db.CreateDnsProviderParams{
|
||||
ID: uuid.New().String(),
|
||||
Name: req.Msg.Name,
|
||||
Type: int64(req.Msg.Type),
|
||||
@@ -89,7 +89,7 @@ func (s *DnsProviderService) UpdateDnsProvider(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateDnsProviderRequest],
|
||||
) (*connect.Response[mantraev1.UpdateDnsProviderResponse], error) {
|
||||
params := db.UpdateDnsProviderParams{
|
||||
params := &db.UpdateDnsProviderParams{
|
||||
ID: req.Msg.Id,
|
||||
Name: req.Msg.Name,
|
||||
Type: int64(req.Msg.Type),
|
||||
@@ -156,7 +156,7 @@ func (s *DnsProviderService) ListDnsProviders(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListDnsProvidersRequest],
|
||||
) (*connect.Response[mantraev1.ListDnsProvidersResponse], error) {
|
||||
params := db.ListDnsProvidersParams{
|
||||
params := &db.ListDnsProvidersParams{
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func (s *EntryPointService) CreateEntryPoint(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.CreateEntryPointRequest],
|
||||
) (*connect.Response[mantraev1.CreateEntryPointResponse], error) {
|
||||
params := db.CreateEntryPointParams{
|
||||
params := &db.CreateEntryPointParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
Name: req.Msg.Name,
|
||||
@@ -70,7 +70,7 @@ func (s *EntryPointService) UpdateEntryPoint(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateEntryPointRequest],
|
||||
) (*connect.Response[mantraev1.UpdateEntryPointResponse], error) {
|
||||
params := db.UpdateEntryPointParams{
|
||||
params := &db.UpdateEntryPointParams{
|
||||
ID: req.Msg.Id,
|
||||
Name: req.Msg.Name,
|
||||
Address: req.Msg.Address,
|
||||
@@ -130,7 +130,7 @@ func (s *EntryPointService) ListEntryPoints(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListEntryPointsRequest],
|
||||
) (*connect.Response[mantraev1.ListEntryPointsResponse], error) {
|
||||
params := db.ListEntryPointsParams{
|
||||
params := &db.ListEntryPointsParams{
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
@@ -166,7 +166,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
return err
|
||||
}
|
||||
httpRouters, err := s.app.Conn.GetQuery().
|
||||
GetHttpRoutersUsingEntryPoint(ctx, db.GetHttpRoutersUsingEntryPointParams{
|
||||
GetHttpRoutersUsingEntryPoint(ctx, &db.GetHttpRoutersUsingEntryPointParams{
|
||||
ProfileID: entrypoint.ProfileID,
|
||||
ID: entrypoint.ID,
|
||||
})
|
||||
@@ -180,7 +180,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
if newEntrypoint != "" {
|
||||
r.Config.EntryPoints = append(r.Config.EntryPoints, newEntrypoint)
|
||||
}
|
||||
if _, err = s.app.Conn.GetQuery().UpdateHttpRouter(ctx, db.UpdateHttpRouterParams{
|
||||
if _, err = s.app.Conn.GetQuery().UpdateHttpRouter(ctx, &db.UpdateHttpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -190,7 +190,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
}
|
||||
}
|
||||
tcpRouters, err := s.app.Conn.GetQuery().
|
||||
GetTcpRoutersUsingEntryPoint(ctx, db.GetTcpRoutersUsingEntryPointParams{
|
||||
GetTcpRoutersUsingEntryPoint(ctx, &db.GetTcpRoutersUsingEntryPointParams{
|
||||
ProfileID: entrypoint.ProfileID,
|
||||
ID: entrypoint.ID,
|
||||
})
|
||||
@@ -204,7 +204,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
if newEntrypoint != "" {
|
||||
r.Config.EntryPoints = append(r.Config.EntryPoints, newEntrypoint)
|
||||
}
|
||||
if _, err = s.app.Conn.GetQuery().UpdateTcpRouter(ctx, db.UpdateTcpRouterParams{
|
||||
if _, err = s.app.Conn.GetQuery().UpdateTcpRouter(ctx, &db.UpdateTcpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -214,7 +214,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
}
|
||||
}
|
||||
udpRouters, err := s.app.Conn.GetQuery().
|
||||
GetUdpRoutersUsingEntryPoint(ctx, db.GetUdpRoutersUsingEntryPointParams{
|
||||
GetUdpRoutersUsingEntryPoint(ctx, &db.GetUdpRoutersUsingEntryPointParams{
|
||||
ProfileID: entrypoint.ProfileID,
|
||||
ID: entrypoint.ID,
|
||||
})
|
||||
@@ -228,7 +228,7 @@ func (s *EntryPointService) updateRouterEntrypoints(
|
||||
if newEntrypoint != "" {
|
||||
r.Config.EntryPoints = append(r.Config.EntryPoints, newEntrypoint)
|
||||
}
|
||||
if _, err = s.app.Conn.GetQuery().UpdateUdpRouter(ctx, db.UpdateUdpRouterParams{
|
||||
if _, err = s.app.Conn.GetQuery().UpdateUdpRouter(ctx, &db.UpdateUdpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
|
||||
@@ -69,7 +69,7 @@ func (s *HTTPMiddlewareOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateMiddlewareRequest,
|
||||
) (*mantraev1.CreateMiddlewareResponse, error) {
|
||||
params := db.CreateHttpMiddlewareParams{
|
||||
params := &db.CreateHttpMiddlewareParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
@@ -112,7 +112,7 @@ func (s *HTTPMiddlewareOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateMiddlewareRequest,
|
||||
) (*mantraev1.UpdateMiddlewareResponse, error) {
|
||||
params := db.UpdateHttpMiddlewareParams{
|
||||
params := &db.UpdateHttpMiddlewareParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -142,7 +142,7 @@ func (s *HTTPMiddlewareOps) Update(
|
||||
|
||||
// Make sure routers using this middleware use the new name
|
||||
routers, err := s.app.Conn.GetQuery().
|
||||
GetHttpRoutersUsingMiddleware(ctx, db.GetHttpRoutersUsingMiddlewareParams{
|
||||
GetHttpRoutersUsingMiddleware(ctx, &db.GetHttpRoutersUsingMiddlewareParams{
|
||||
ProfileID: middleware.ProfileID,
|
||||
ID: middleware.ID,
|
||||
})
|
||||
@@ -154,7 +154,7 @@ func (s *HTTPMiddlewareOps) Update(
|
||||
r.Config.Middlewares = slices.Delete(r.Config.Middlewares, idx, idx+1)
|
||||
}
|
||||
r.Config.Middlewares = append(r.Config.Middlewares, req.Name)
|
||||
if _, err = s.app.Conn.GetQuery().UpdateHttpRouter(ctx, db.UpdateHttpRouterParams{
|
||||
if _, err = s.app.Conn.GetQuery().UpdateHttpRouter(ctx, &db.UpdateHttpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -191,7 +191,7 @@ func (s *HTTPMiddlewareOps) Delete(
|
||||
|
||||
// Make sure to delete the middleware from related routers
|
||||
routers, err := s.app.Conn.GetQuery().
|
||||
GetHttpRoutersUsingMiddleware(ctx, db.GetHttpRoutersUsingMiddlewareParams{
|
||||
GetHttpRoutersUsingMiddleware(ctx, &db.GetHttpRoutersUsingMiddlewareParams{
|
||||
ProfileID: middleware.ProfileID,
|
||||
ID: middleware.ID,
|
||||
})
|
||||
@@ -202,7 +202,7 @@ func (s *HTTPMiddlewareOps) Delete(
|
||||
if idx := slices.Index(r.Config.Middlewares, middleware.Name); idx != -1 {
|
||||
r.Config.Middlewares = slices.Delete(r.Config.Middlewares, idx, idx+1)
|
||||
}
|
||||
if _, err := s.app.Conn.GetQuery().UpdateHttpRouter(ctx, db.UpdateHttpRouterParams{
|
||||
if _, err := s.app.Conn.GetQuery().UpdateHttpRouter(ctx, &db.UpdateHttpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -230,7 +230,7 @@ func (s *HTTPMiddlewareOps) List(
|
||||
req *mantraev1.ListMiddlewaresRequest,
|
||||
) (*mantraev1.ListMiddlewaresResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListHttpMiddlewares(ctx, db.ListHttpMiddlewaresParams{
|
||||
ListHttpMiddlewares(ctx, &db.ListHttpMiddlewaresParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -240,7 +240,7 @@ func (s *HTTPMiddlewareOps) List(
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().
|
||||
CountHttpMiddlewares(ctx, db.CountHttpMiddlewaresParams{
|
||||
CountHttpMiddlewares(ctx, &db.CountHttpMiddlewaresParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -277,7 +277,7 @@ func (s *TCPMiddlewareOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateMiddlewareRequest,
|
||||
) (*mantraev1.CreateMiddlewareResponse, error) {
|
||||
params := db.CreateTcpMiddlewareParams{
|
||||
params := &db.CreateTcpMiddlewareParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
@@ -317,7 +317,7 @@ func (s *TCPMiddlewareOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateMiddlewareRequest,
|
||||
) (*mantraev1.UpdateMiddlewareResponse, error) {
|
||||
params := db.UpdateTcpMiddlewareParams{
|
||||
params := &db.UpdateTcpMiddlewareParams{
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
IsDefault: req.IsDefault,
|
||||
@@ -344,7 +344,7 @@ func (s *TCPMiddlewareOps) Update(
|
||||
|
||||
// Make sure routers using this middleware use the new name
|
||||
routers, err := s.app.Conn.GetQuery().
|
||||
GetTcpRoutersUsingMiddleware(ctx, db.GetTcpRoutersUsingMiddlewareParams{
|
||||
GetTcpRoutersUsingMiddleware(ctx, &db.GetTcpRoutersUsingMiddlewareParams{
|
||||
ProfileID: middleware.ProfileID,
|
||||
ID: middleware.ID,
|
||||
})
|
||||
@@ -356,7 +356,7 @@ func (s *TCPMiddlewareOps) Update(
|
||||
r.Config.Middlewares = slices.Delete(r.Config.Middlewares, idx, idx+1)
|
||||
}
|
||||
r.Config.Middlewares = append(r.Config.Middlewares, req.Name)
|
||||
if _, err = s.app.Conn.GetQuery().UpdateTcpRouter(ctx, db.UpdateTcpRouterParams{
|
||||
if _, err = s.app.Conn.GetQuery().UpdateTcpRouter(ctx, &db.UpdateTcpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -393,7 +393,7 @@ func (s *TCPMiddlewareOps) Delete(
|
||||
|
||||
// Make sure to delete the middleware from related routers
|
||||
routers, err := s.app.Conn.GetQuery().
|
||||
GetTcpRoutersUsingMiddleware(ctx, db.GetTcpRoutersUsingMiddlewareParams{
|
||||
GetTcpRoutersUsingMiddleware(ctx, &db.GetTcpRoutersUsingMiddlewareParams{
|
||||
ProfileID: middleware.ProfileID,
|
||||
ID: middleware.ID,
|
||||
})
|
||||
@@ -404,7 +404,7 @@ func (s *TCPMiddlewareOps) Delete(
|
||||
if idx := slices.Index(r.Config.Middlewares, middleware.Name); idx != -1 {
|
||||
r.Config.Middlewares = slices.Delete(r.Config.Middlewares, idx, idx+1)
|
||||
}
|
||||
if _, err := s.app.Conn.GetQuery().UpdateTcpRouter(ctx, db.UpdateTcpRouterParams{
|
||||
if _, err := s.app.Conn.GetQuery().UpdateTcpRouter(ctx, &db.UpdateTcpRouterParams{
|
||||
ID: r.ID,
|
||||
Enabled: r.Enabled,
|
||||
Config: r.Config,
|
||||
@@ -432,7 +432,7 @@ func (s *TCPMiddlewareOps) List(
|
||||
req *mantraev1.ListMiddlewaresRequest,
|
||||
) (*mantraev1.ListMiddlewaresResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListTcpMiddlewares(ctx, db.ListTcpMiddlewaresParams{
|
||||
ListTcpMiddlewares(ctx, &db.ListTcpMiddlewaresParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -441,7 +441,7 @@ func (s *TCPMiddlewareOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpMiddlewares(ctx, db.CountTcpMiddlewaresParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpMiddlewares(ctx, &db.CountTcpMiddlewaresParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ func (s *ProfileService) CreateProfile(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.CreateProfileRequest],
|
||||
) (*connect.Response[mantraev1.CreateProfileResponse], error) {
|
||||
params := db.CreateProfileParams{
|
||||
params := &db.CreateProfileParams{
|
||||
Name: slug.Make(req.Msg.Name),
|
||||
Description: req.Msg.Description,
|
||||
Token: util.GenerateToken(6),
|
||||
@@ -63,7 +63,7 @@ func (s *ProfileService) UpdateProfile(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateProfileRequest],
|
||||
) (*connect.Response[mantraev1.UpdateProfileResponse], error) {
|
||||
params := db.UpdateProfileParams{
|
||||
params := &db.UpdateProfileParams{
|
||||
ID: req.Msg.Id,
|
||||
Name: slug.Make(req.Msg.Name),
|
||||
Description: req.Msg.Description,
|
||||
@@ -119,7 +119,7 @@ func (s *ProfileService) ListProfiles(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListProfilesRequest],
|
||||
) (*connect.Response[mantraev1.ListProfilesResponse], error) {
|
||||
params := db.ListProfilesParams{
|
||||
params := &db.ListProfilesParams{
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func (s *HTTPRouterOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateRouterRequest,
|
||||
) (*mantraev1.CreateRouterResponse, error) {
|
||||
params := db.CreateHttpRouterParams{
|
||||
params := &db.CreateHttpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -109,7 +109,7 @@ func (s *HTTPRouterOps) Create(
|
||||
|
||||
dnsProvider, err := s.app.Conn.GetQuery().GetDefaultDNSProvider(ctx)
|
||||
if err == nil {
|
||||
if err := s.app.Conn.GetQuery().CreateHttpRouterDNSProvider(ctx, db.CreateHttpRouterDNSProviderParams{
|
||||
if err := s.app.Conn.GetQuery().CreateHttpRouterDNSProvider(ctx, &db.CreateHttpRouterDNSProviderParams{
|
||||
HttpRouterID: router.Id,
|
||||
DnsProviderID: dnsProvider.ID,
|
||||
}); err != nil {
|
||||
@@ -139,7 +139,7 @@ func (s *HTTPRouterOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateRouterRequest,
|
||||
) (*mantraev1.UpdateRouterResponse, error) {
|
||||
params := db.UpdateHttpRouterParams{
|
||||
params := &db.UpdateHttpRouterParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -172,7 +172,7 @@ func (s *HTTPRouterOps) Update(
|
||||
for _, id := range desiredIDs {
|
||||
if !existingMap[id] {
|
||||
if err = s.app.Conn.GetQuery().
|
||||
CreateHttpRouterDNSProvider(ctx, db.CreateHttpRouterDNSProviderParams{
|
||||
CreateHttpRouterDNSProvider(ctx, &db.CreateHttpRouterDNSProviderParams{
|
||||
HttpRouterID: params.ID,
|
||||
DnsProviderID: id,
|
||||
}); err != nil {
|
||||
@@ -191,7 +191,7 @@ func (s *HTTPRouterOps) Update(
|
||||
}()
|
||||
|
||||
if err = s.app.Conn.GetQuery().
|
||||
DeleteHttpRouterDNSProvider(ctx, db.DeleteHttpRouterDNSProviderParams{
|
||||
DeleteHttpRouterDNSProvider(ctx, &db.DeleteHttpRouterDNSProviderParams{
|
||||
HttpRouterID: params.ID,
|
||||
DnsProviderID: id,
|
||||
}); err != nil {
|
||||
@@ -242,7 +242,7 @@ func (s *HTTPRouterOps) Delete(
|
||||
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().
|
||||
GetHttpServiceByName(ctx, db.GetHttpServiceByNameParams{
|
||||
GetHttpServiceByName(ctx, &db.GetHttpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
@@ -272,7 +272,7 @@ func (s *HTTPRouterOps) List(
|
||||
req *mantraev1.ListRoutersRequest,
|
||||
) (*mantraev1.ListRoutersResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListHttpRouters(ctx, db.ListHttpRoutersParams{
|
||||
ListHttpRouters(ctx, &db.ListHttpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -281,7 +281,7 @@ func (s *HTTPRouterOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountHttpRouters(ctx, db.CountHttpRoutersParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountHttpRouters(ctx, &db.CountHttpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -334,7 +334,7 @@ func (s *TCPRouterOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateRouterRequest,
|
||||
) (*mantraev1.CreateRouterResponse, error) {
|
||||
params := db.CreateTcpRouterParams{
|
||||
params := &db.CreateTcpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -368,7 +368,7 @@ func (s *TCPRouterOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateRouterRequest,
|
||||
) (*mantraev1.UpdateRouterResponse, error) {
|
||||
params := db.UpdateTcpRouterParams{
|
||||
params := &db.UpdateTcpRouterParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -406,7 +406,7 @@ func (s *TCPRouterOps) Update(
|
||||
}
|
||||
}()
|
||||
if err = s.app.Conn.GetQuery().
|
||||
CreateTcpRouterDNSProvider(ctx, db.CreateTcpRouterDNSProviderParams{
|
||||
CreateTcpRouterDNSProvider(ctx, &db.CreateTcpRouterDNSProviderParams{
|
||||
TcpRouterID: params.ID,
|
||||
DnsProviderID: id,
|
||||
}); err != nil {
|
||||
@@ -425,7 +425,7 @@ func (s *TCPRouterOps) Update(
|
||||
}()
|
||||
|
||||
if err = s.app.Conn.GetQuery().
|
||||
DeleteTcpRouterDNSProvider(ctx, db.DeleteTcpRouterDNSProviderParams{
|
||||
DeleteTcpRouterDNSProvider(ctx, &db.DeleteTcpRouterDNSProviderParams{
|
||||
TcpRouterID: params.ID,
|
||||
DnsProviderID: id,
|
||||
}); err != nil {
|
||||
@@ -465,7 +465,7 @@ func (s *TCPRouterOps) Delete(
|
||||
}()
|
||||
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().GetTcpServiceByName(ctx, db.GetTcpServiceByNameParams{
|
||||
service, err := s.app.Conn.GetQuery().GetTcpServiceByName(ctx, &db.GetTcpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
@@ -495,7 +495,7 @@ func (s *TCPRouterOps) List(
|
||||
req *mantraev1.ListRoutersRequest,
|
||||
) (*mantraev1.ListRoutersResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListTcpRouters(ctx, db.ListTcpRoutersParams{
|
||||
ListTcpRouters(ctx, &db.ListTcpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -504,7 +504,7 @@ func (s *TCPRouterOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpRouters(ctx, db.CountTcpRoutersParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpRouters(ctx, &db.CountTcpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -549,7 +549,7 @@ func (s *UDPRouterOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateRouterRequest,
|
||||
) (*mantraev1.CreateRouterResponse, error) {
|
||||
params := db.CreateUdpRouterParams{
|
||||
params := &db.CreateUdpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -583,7 +583,7 @@ func (s *UDPRouterOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateRouterRequest,
|
||||
) (*mantraev1.UpdateRouterResponse, error) {
|
||||
params := db.UpdateUdpRouterParams{
|
||||
params := &db.UpdateUdpRouterParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -621,7 +621,7 @@ func (s *UDPRouterOps) Delete(
|
||||
return nil, err
|
||||
}
|
||||
if router.Config.Service != "" {
|
||||
service, err := s.app.Conn.GetQuery().GetUdpServiceByName(ctx, db.GetUdpServiceByNameParams{
|
||||
service, err := s.app.Conn.GetQuery().GetUdpServiceByName(ctx, &db.GetUdpServiceByNameParams{
|
||||
ProfileID: router.ProfileID,
|
||||
Name: router.Config.Service,
|
||||
})
|
||||
@@ -651,7 +651,7 @@ func (s *UDPRouterOps) List(
|
||||
req *mantraev1.ListRoutersRequest,
|
||||
) (*mantraev1.ListRoutersResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListUdpRouters(ctx, db.ListUdpRoutersParams{
|
||||
ListUdpRouters(ctx, &db.ListUdpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -660,7 +660,7 @@ func (s *UDPRouterOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountUdpRouters(ctx, db.CountUdpRoutersParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountUdpRouters(ctx, &db.CountUdpRoutersParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
|
||||
@@ -68,7 +68,7 @@ func (s *HTTPServersTransportOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServersTransportRequest,
|
||||
) (*mantraev1.CreateServersTransportResponse, error) {
|
||||
params := db.CreateHttpServersTransportParams{
|
||||
params := &db.CreateHttpServersTransportParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
@@ -101,7 +101,7 @@ func (s *HTTPServersTransportOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateServersTransportRequest,
|
||||
) (*mantraev1.UpdateServersTransportResponse, error) {
|
||||
params := db.UpdateHttpServersTransportParams{
|
||||
params := &db.UpdateHttpServersTransportParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -155,7 +155,7 @@ func (s *HTTPServersTransportOps) List(
|
||||
req *mantraev1.ListServersTransportsRequest,
|
||||
) (*mantraev1.ListServersTransportsResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListHttpServersTransports(ctx, db.ListHttpServersTransportsParams{
|
||||
ListHttpServersTransports(ctx, &db.ListHttpServersTransportsParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -165,7 +165,7 @@ func (s *HTTPServersTransportOps) List(
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().
|
||||
CountHttpServersTransports(ctx, db.CountHttpServersTransportsParams{
|
||||
CountHttpServersTransports(ctx, &db.CountHttpServersTransportsParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -202,7 +202,7 @@ func (s *TCPServersTransportOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServersTransportRequest,
|
||||
) (*mantraev1.CreateServersTransportResponse, error) {
|
||||
params := db.CreateTcpServersTransportParams{
|
||||
params := &db.CreateTcpServersTransportParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
@@ -235,7 +235,7 @@ func (s *TCPServersTransportOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateServersTransportRequest,
|
||||
) (*mantraev1.UpdateServersTransportResponse, error) {
|
||||
params := db.UpdateTcpServersTransportParams{
|
||||
params := &db.UpdateTcpServersTransportParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -289,7 +289,7 @@ func (s *TCPServersTransportOps) List(
|
||||
req *mantraev1.ListServersTransportsRequest,
|
||||
) (*mantraev1.ListServersTransportsResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListTcpServersTransports(ctx, db.ListTcpServersTransportsParams{
|
||||
ListTcpServersTransports(ctx, &db.ListTcpServersTransportsParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -299,7 +299,7 @@ func (s *TCPServersTransportOps) List(
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().
|
||||
CountTcpServersTransports(ctx, db.CountTcpServersTransportsParams{
|
||||
CountTcpServersTransports(ctx, &db.CountTcpServersTransportsParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@ func (s *HTTPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
var result db.HttpService
|
||||
var result *db.HttpService
|
||||
var err error
|
||||
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
@@ -74,7 +74,7 @@ func (s *HTTPServiceOps) Get(
|
||||
return nil, err
|
||||
}
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetHttpServiceByName(ctx, db.GetHttpServiceByNameParams{
|
||||
result, err = s.app.Conn.GetQuery().GetHttpServiceByName(ctx, &db.GetHttpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
@@ -94,7 +94,7 @@ func (s *HTTPServiceOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServiceRequest,
|
||||
) (*mantraev1.CreateServiceResponse, error) {
|
||||
params := db.CreateHttpServiceParams{
|
||||
params := &db.CreateHttpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -127,7 +127,7 @@ func (s *HTTPServiceOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateServiceRequest,
|
||||
) (*mantraev1.UpdateServiceResponse, error) {
|
||||
params := db.UpdateHttpServiceParams{
|
||||
params := &db.UpdateHttpServiceParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -181,7 +181,7 @@ func (s *HTTPServiceOps) List(
|
||||
req *mantraev1.ListServicesRequest,
|
||||
) (*mantraev1.ListServicesResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListHttpServices(ctx, db.ListHttpServicesParams{
|
||||
ListHttpServices(ctx, &db.ListHttpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -190,7 +190,7 @@ func (s *HTTPServiceOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountHttpServices(ctx, db.CountHttpServicesParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountHttpServices(ctx, &db.CountHttpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -214,7 +214,7 @@ func (s *TCPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
var result db.TcpService
|
||||
var result *db.TcpService
|
||||
var err error
|
||||
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
@@ -224,7 +224,7 @@ func (s *TCPServiceOps) Get(
|
||||
return nil, err
|
||||
}
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetTcpServiceByName(ctx, db.GetTcpServiceByNameParams{
|
||||
result, err = s.app.Conn.GetQuery().GetTcpServiceByName(ctx, &db.GetTcpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
@@ -244,7 +244,7 @@ func (s *TCPServiceOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServiceRequest,
|
||||
) (*mantraev1.CreateServiceResponse, error) {
|
||||
params := db.CreateTcpServiceParams{
|
||||
params := &db.CreateTcpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -277,7 +277,7 @@ func (s *TCPServiceOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateServiceRequest,
|
||||
) (*mantraev1.UpdateServiceResponse, error) {
|
||||
params := db.UpdateTcpServiceParams{
|
||||
params := &db.UpdateTcpServiceParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -331,7 +331,7 @@ func (s *TCPServiceOps) List(
|
||||
req *mantraev1.ListServicesRequest,
|
||||
) (*mantraev1.ListServicesResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListTcpServices(ctx, db.ListTcpServicesParams{
|
||||
ListTcpServices(ctx, &db.ListTcpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -340,7 +340,7 @@ func (s *TCPServiceOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpServices(ctx, db.CountTcpServicesParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountTcpServices(ctx, &db.CountTcpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
@@ -364,7 +364,7 @@ func (s *UDPServiceOps) Get(
|
||||
ctx context.Context,
|
||||
req *mantraev1.GetServiceRequest,
|
||||
) (*mantraev1.GetServiceResponse, error) {
|
||||
var result db.UdpService
|
||||
var result *db.UdpService
|
||||
var err error
|
||||
|
||||
switch id := req.GetIdentifier().(type) {
|
||||
@@ -374,7 +374,7 @@ func (s *UDPServiceOps) Get(
|
||||
return nil, err
|
||||
}
|
||||
case *mantraev1.GetServiceRequest_Name:
|
||||
result, err = s.app.Conn.GetQuery().GetUdpServiceByName(ctx, db.GetUdpServiceByNameParams{
|
||||
result, err = s.app.Conn.GetQuery().GetUdpServiceByName(ctx, &db.GetUdpServiceByNameParams{
|
||||
ProfileID: req.ProfileId,
|
||||
Name: id.Name,
|
||||
})
|
||||
@@ -394,7 +394,7 @@ func (s *UDPServiceOps) Create(
|
||||
ctx context.Context,
|
||||
req *mantraev1.CreateServiceRequest,
|
||||
) (*mantraev1.CreateServiceResponse, error) {
|
||||
params := db.CreateUdpServiceParams{
|
||||
params := &db.CreateUdpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: req.ProfileId,
|
||||
Name: req.Name,
|
||||
@@ -427,7 +427,7 @@ func (s *UDPServiceOps) Update(
|
||||
ctx context.Context,
|
||||
req *mantraev1.UpdateServiceRequest,
|
||||
) (*mantraev1.UpdateServiceResponse, error) {
|
||||
params := db.UpdateUdpServiceParams{
|
||||
params := &db.UpdateUdpServiceParams{
|
||||
ID: req.Id,
|
||||
Name: req.Name,
|
||||
Enabled: req.Enabled,
|
||||
@@ -481,7 +481,7 @@ func (s *UDPServiceOps) List(
|
||||
req *mantraev1.ListServicesRequest,
|
||||
) (*mantraev1.ListServicesResponse, error) {
|
||||
result, err := s.app.Conn.GetQuery().
|
||||
ListUdpServices(ctx, db.ListUdpServicesParams{
|
||||
ListUdpServices(ctx, &db.ListUdpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
Limit: req.Limit,
|
||||
@@ -490,7 +490,7 @@ func (s *UDPServiceOps) List(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalCount, err := s.app.Conn.GetQuery().CountUdpServices(ctx, db.CountUdpServicesParams{
|
||||
totalCount, err := s.app.Conn.GetQuery().CountUdpServices(ctx, &db.CountUdpServicesParams{
|
||||
ProfileID: req.ProfileId,
|
||||
AgentID: req.AgentId,
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ func (s *SettingService) UpdateSetting(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateSettingRequest],
|
||||
) (*connect.Response[mantraev1.UpdateSettingResponse], error) {
|
||||
params := db.UpsertSettingParams{
|
||||
params := &db.UpsertSettingParams{
|
||||
Key: req.Msg.Key,
|
||||
Value: req.Msg.Value,
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func (s *TraefikInstanceService) ListTraefikInstances(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListTraefikInstancesRequest],
|
||||
) (*connect.Response[mantraev1.ListTraefikInstancesResponse], error) {
|
||||
params := db.ListTraefikInstancesParams{
|
||||
params := &db.ListTraefikInstancesParams{
|
||||
ProfileID: req.Msg.ProfileId,
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
|
||||
@@ -31,7 +31,7 @@ func (s *UserService) LoginUser(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.LoginUserRequest],
|
||||
) (*connect.Response[mantraev1.LoginUserResponse], error) {
|
||||
var user db.User
|
||||
var user *db.User
|
||||
var err error
|
||||
switch id := req.Msg.GetIdentifier().(type) {
|
||||
case *mantraev1.LoginUserRequest_Username:
|
||||
@@ -95,7 +95,7 @@ func (s *UserService) VerifyOTP(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.VerifyOTPRequest],
|
||||
) (*connect.Response[mantraev1.VerifyOTPResponse], error) {
|
||||
var user db.User
|
||||
var user *db.User
|
||||
var err error
|
||||
switch id := req.Msg.GetIdentifier().(type) {
|
||||
case *mantraev1.VerifyOTPRequest_Username:
|
||||
@@ -131,7 +131,7 @@ func (s *UserService) VerifyOTP(
|
||||
|
||||
// Delete OTP if it's set
|
||||
if user.Otp != nil && user.OtpExpiry != nil {
|
||||
if err := s.app.Conn.GetQuery().UpdateUserResetToken(ctx, db.UpdateUserResetTokenParams{
|
||||
if err := s.app.Conn.GetQuery().UpdateUserResetToken(ctx, &db.UpdateUserResetTokenParams{
|
||||
ID: user.ID,
|
||||
Otp: nil,
|
||||
OtpExpiry: nil,
|
||||
@@ -158,7 +158,7 @@ func (s *UserService) SendOTP(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.SendOTPRequest],
|
||||
) (*connect.Response[mantraev1.SendOTPResponse], error) {
|
||||
var user db.User
|
||||
var user *db.User
|
||||
var err error
|
||||
switch id := req.Msg.GetIdentifier().(type) {
|
||||
case *mantraev1.SendOTPRequest_Username:
|
||||
@@ -180,7 +180,7 @@ func (s *UserService) SendOTP(
|
||||
}
|
||||
hash := util.HashOTP(token)
|
||||
|
||||
if err := s.app.Conn.GetQuery().UpdateUserResetToken(ctx, db.UpdateUserResetTokenParams{
|
||||
if err := s.app.Conn.GetQuery().UpdateUserResetToken(ctx, &db.UpdateUserResetTokenParams{
|
||||
ID: user.ID,
|
||||
Otp: &hash,
|
||||
OtpExpiry: &expiresAt,
|
||||
@@ -203,7 +203,7 @@ func (s *UserService) GetUser(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.GetUserRequest],
|
||||
) (*connect.Response[mantraev1.GetUserResponse], error) {
|
||||
var user db.User
|
||||
var user *db.User
|
||||
var err error
|
||||
switch id := req.Msg.GetIdentifier().(type) {
|
||||
case *mantraev1.GetUserRequest_Id:
|
||||
@@ -232,7 +232,7 @@ func (s *UserService) CreateUser(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.CreateUserRequest],
|
||||
) (*connect.Response[mantraev1.CreateUserResponse], error) {
|
||||
params := db.CreateUserParams{
|
||||
params := &db.CreateUserParams{
|
||||
ID: uuid.NewString(),
|
||||
Username: req.Msg.Username,
|
||||
Email: req.Msg.Email,
|
||||
@@ -264,7 +264,7 @@ func (s *UserService) UpdateUser(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.UpdateUserRequest],
|
||||
) (*connect.Response[mantraev1.UpdateUserResponse], error) {
|
||||
params := db.UpdateUserParams{
|
||||
params := &db.UpdateUserParams{
|
||||
ID: req.Msg.Id,
|
||||
Username: req.Msg.Username,
|
||||
Email: req.Msg.Email,
|
||||
@@ -281,7 +281,7 @@ func (s *UserService) UpdateUser(
|
||||
return nil, connect.NewError(connect.CodeInternal, err)
|
||||
}
|
||||
|
||||
if err := s.app.Conn.GetQuery().UpdateUserPassword(ctx, db.UpdateUserPasswordParams{
|
||||
if err := s.app.Conn.GetQuery().UpdateUserPassword(ctx, &db.UpdateUserPasswordParams{
|
||||
ID: result.ID,
|
||||
Password: hash,
|
||||
}); err != nil {
|
||||
@@ -325,7 +325,7 @@ func (s *UserService) ListUsers(
|
||||
ctx context.Context,
|
||||
req *connect.Request[mantraev1.ListUsersRequest],
|
||||
) (*connect.Response[mantraev1.ListUsersResponse], error) {
|
||||
params := db.ListUsersParams{
|
||||
params := &db.ListUsersParams{
|
||||
Limit: req.Msg.Limit,
|
||||
Offset: req.Msg.Offset,
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ func (a *App) ResetPassword(ctx context.Context, cmd *cli.Command) {
|
||||
slog.Error("failed to hash password", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err = a.Conn.GetQuery().UpdateUserPassword(ctx, db.UpdateUserPasswordParams{
|
||||
if err = a.Conn.GetQuery().UpdateUserPassword(ctx, &db.UpdateUserPasswordParams{
|
||||
ID: user.ID,
|
||||
Password: hash,
|
||||
}); err != nil {
|
||||
|
||||
@@ -72,7 +72,7 @@ func (a *App) setupDefaultData(ctx context.Context) error {
|
||||
q := a.Conn.GetQuery()
|
||||
|
||||
// Ensure at least one user exists
|
||||
users, err := q.ListUsers(ctx, db.ListUsersParams{})
|
||||
users, err := q.ListUsers(ctx, &db.ListUsersParams{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to list admin users: %w", err)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (a *App) setupDefaultData(ctx context.Context) error {
|
||||
return fmt.Errorf("failed to generate UUID: %w", err)
|
||||
}
|
||||
|
||||
if _, err = q.CreateUser(ctx, db.CreateUserParams{
|
||||
if _, err = q.CreateUser(ctx, &db.CreateUserParams{
|
||||
ID: id.String(),
|
||||
Username: "admin",
|
||||
Password: hash,
|
||||
@@ -111,14 +111,14 @@ func (a *App) setupDefaultData(ctx context.Context) error {
|
||||
}
|
||||
|
||||
// Ensure default profile exists
|
||||
profiles, err := q.ListProfiles(ctx, db.ListProfilesParams{})
|
||||
profiles, err := q.ListProfiles(ctx, &db.ListProfilesParams{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to list profiles: %w", err)
|
||||
}
|
||||
|
||||
if len(profiles) == 0 {
|
||||
description := "Default profile"
|
||||
if _, err = q.CreateProfile(ctx, db.CreateProfileParams{
|
||||
if _, err = q.CreateProfile(ctx, &db.CreateProfileParams{
|
||||
Name: "default",
|
||||
Description: &description,
|
||||
Token: util.GenerateToken(6),
|
||||
|
||||
@@ -93,7 +93,7 @@ func (sm *SettingsManager) Start(ctx context.Context) {
|
||||
}
|
||||
|
||||
if _, exists := dbMap[key]; !exists {
|
||||
err = q.UpsertSetting(ctx, db.UpsertSettingParams{Key: key, Value: val})
|
||||
err = q.UpsertSetting(ctx, &db.UpsertSettingParams{Key: key, Value: val})
|
||||
if err != nil {
|
||||
log.Fatal(fmt.Errorf("failed to upsert setting %s: %w", key, err))
|
||||
}
|
||||
@@ -140,7 +140,7 @@ func (sm *SettingsManager) Set(ctx context.Context, key, val string) error {
|
||||
}
|
||||
|
||||
// Update database
|
||||
if err := sm.conn.GetQuery().UpsertSetting(ctx, *params); err != nil {
|
||||
if err := sm.conn.GetQuery().UpsertSetting(ctx, params); err != nil {
|
||||
return fmt.Errorf("failed to update setting in database: %w", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ func TestStart(t *testing.T) {
|
||||
}()
|
||||
|
||||
// Add a value to the database
|
||||
err := sm.conn.GetQuery().UpsertSetting(ctx, db.UpsertSettingParams{
|
||||
err := sm.conn.GetQuery().UpsertSetting(ctx, &db.UpsertSettingParams{
|
||||
Key: KeyStorage,
|
||||
Value: "db_value",
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@ func (sm *SettingsManager) validate(ctx context.Context, params *db.UpsertSettin
|
||||
return errors.New("failed to get password login setting")
|
||||
}
|
||||
if params.Value == "false" && !AsBool(pwLogin) {
|
||||
return q.UpsertSetting(ctx, db.UpsertSettingParams{
|
||||
return q.UpsertSetting(ctx, &db.UpsertSettingParams{
|
||||
Key: KeyPasswordLoginEnabled,
|
||||
Value: "true",
|
||||
})
|
||||
|
||||
@@ -27,9 +27,9 @@ func (q *Queries) CountAgents(ctx context.Context, profileID int64) (int64, erro
|
||||
|
||||
const createAgent = `-- name: CreateAgent :one
|
||||
INSERT INTO
|
||||
agents (id, profile_id, token, created_at)
|
||||
agents (id, profile_id, token)
|
||||
VALUES
|
||||
(?, ?, ?, CURRENT_TIMESTAMP) RETURNING id, profile_id, hostname, public_ip, containers, active_ip, private_ip, token, created_at, updated_at
|
||||
(?, ?, ?) RETURNING id, profile_id, hostname, public_ip, containers, active_ip, private_ip, token, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateAgentParams struct {
|
||||
@@ -38,7 +38,7 @@ type CreateAgentParams struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error) {
|
||||
func (q *Queries) CreateAgent(ctx context.Context, arg *CreateAgentParams) (*Agent, error) {
|
||||
row := q.queryRow(ctx, q.createAgentStmt, createAgent, arg.ID, arg.ProfileID, arg.Token)
|
||||
var i Agent
|
||||
err := row.Scan(
|
||||
@@ -53,7 +53,7 @@ func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteAgent = `-- name: DeleteAgent :exec
|
||||
@@ -76,7 +76,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetAgent(ctx context.Context, id string) (Agent, error) {
|
||||
func (q *Queries) GetAgent(ctx context.Context, id string) (*Agent, error) {
|
||||
row := q.queryRow(ctx, q.getAgentStmt, getAgent, id)
|
||||
var i Agent
|
||||
err := row.Scan(
|
||||
@@ -91,7 +91,7 @@ func (q *Queries) GetAgent(ctx context.Context, id string) (Agent, error) {
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listAgents = `-- name: ListAgents :many
|
||||
@@ -115,13 +115,13 @@ type ListAgentsParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListAgents(ctx context.Context, arg ListAgentsParams) ([]Agent, error) {
|
||||
func (q *Queries) ListAgents(ctx context.Context, arg *ListAgentsParams) ([]*Agent, error) {
|
||||
rows, err := q.query(ctx, q.listAgentsStmt, listAgents, arg.ProfileID, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Agent
|
||||
var items []*Agent
|
||||
for rows.Next() {
|
||||
var i Agent
|
||||
if err := rows.Scan(
|
||||
@@ -138,7 +138,7 @@ func (q *Queries) ListAgents(ctx context.Context, arg ListAgentsParams) ([]Agent
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -173,7 +173,7 @@ type UpdateAgentParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateAgent(ctx context.Context, arg UpdateAgentParams) (Agent, error) {
|
||||
func (q *Queries) UpdateAgent(ctx context.Context, arg *UpdateAgentParams) (*Agent, error) {
|
||||
row := q.queryRow(ctx, q.updateAgentStmt, updateAgent,
|
||||
arg.Hostname,
|
||||
arg.PublicIp,
|
||||
@@ -196,5 +196,5 @@ func (q *Queries) UpdateAgent(ctx context.Context, arg UpdateAgentParams) (Agent
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ type CreateAuditLogParams struct {
|
||||
Details *string `json:"details"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error {
|
||||
func (q *Queries) CreateAuditLog(ctx context.Context, arg *CreateAuditLogParams) error {
|
||||
_, err := q.exec(ctx, q.createAuditLogStmt, createAuditLog,
|
||||
arg.ProfileID,
|
||||
arg.UserID,
|
||||
@@ -111,13 +111,13 @@ type ListAuditLogsRow struct {
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error) {
|
||||
func (q *Queries) ListAuditLogs(ctx context.Context, arg *ListAuditLogsParams) ([]*ListAuditLogsRow, error) {
|
||||
rows, err := q.query(ctx, q.listAuditLogsStmt, listAuditLogs, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListAuditLogsRow
|
||||
var items []*ListAuditLogsRow
|
||||
for rows.Next() {
|
||||
var i ListAuditLogsRow
|
||||
if err := rows.Scan(
|
||||
@@ -134,7 +134,7 @@ func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -27,25 +27,9 @@ func (q *Queries) CountDnsProviders(ctx context.Context) (int64, error) {
|
||||
|
||||
const createDnsProvider = `-- name: CreateDnsProvider :one
|
||||
INSERT INTO
|
||||
dns_providers (
|
||||
id,
|
||||
name,
|
||||
type,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
dns_providers (id, name, type, config, is_default)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, name, type, config, is_default, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, name, type, config, is_default, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateDnsProviderParams struct {
|
||||
@@ -56,7 +40,7 @@ type CreateDnsProviderParams struct {
|
||||
IsDefault bool `json:"isDefault"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateDnsProvider(ctx context.Context, arg CreateDnsProviderParams) (DnsProvider, error) {
|
||||
func (q *Queries) CreateDnsProvider(ctx context.Context, arg *CreateDnsProviderParams) (*DnsProvider, error) {
|
||||
row := q.queryRow(ctx, q.createDnsProviderStmt, createDnsProvider,
|
||||
arg.ID,
|
||||
arg.Name,
|
||||
@@ -74,7 +58,7 @@ func (q *Queries) CreateDnsProvider(ctx context.Context, arg CreateDnsProviderPa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteDnsProvider = `-- name: DeleteDnsProvider :exec
|
||||
@@ -99,7 +83,7 @@ LIMIT
|
||||
1
|
||||
`
|
||||
|
||||
func (q *Queries) GetDefaultDNSProvider(ctx context.Context) (DnsProvider, error) {
|
||||
func (q *Queries) GetDefaultDNSProvider(ctx context.Context) (*DnsProvider, error) {
|
||||
row := q.queryRow(ctx, q.getDefaultDNSProviderStmt, getDefaultDNSProvider)
|
||||
var i DnsProvider
|
||||
err := row.Scan(
|
||||
@@ -111,7 +95,7 @@ func (q *Queries) GetDefaultDNSProvider(ctx context.Context) (DnsProvider, error
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getDnsProvider = `-- name: GetDnsProvider :one
|
||||
@@ -123,7 +107,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetDnsProvider(ctx context.Context, id string) (DnsProvider, error) {
|
||||
func (q *Queries) GetDnsProvider(ctx context.Context, id string) (*DnsProvider, error) {
|
||||
row := q.queryRow(ctx, q.getDnsProviderStmt, getDnsProvider, id)
|
||||
var i DnsProvider
|
||||
err := row.Scan(
|
||||
@@ -135,7 +119,7 @@ func (q *Queries) GetDnsProvider(ctx context.Context, id string) (DnsProvider, e
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getDnsProviderByName = `-- name: GetDnsProviderByName :one
|
||||
@@ -147,7 +131,7 @@ WHERE
|
||||
name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetDnsProviderByName(ctx context.Context, name string) (DnsProvider, error) {
|
||||
func (q *Queries) GetDnsProviderByName(ctx context.Context, name string) (*DnsProvider, error) {
|
||||
row := q.queryRow(ctx, q.getDnsProviderByNameStmt, getDnsProviderByName, name)
|
||||
var i DnsProvider
|
||||
err := row.Scan(
|
||||
@@ -159,7 +143,7 @@ func (q *Queries) GetDnsProviderByName(ctx context.Context, name string) (DnsPro
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listDnsProviders = `-- name: ListDnsProviders :many
|
||||
@@ -180,13 +164,13 @@ type ListDnsProvidersParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListDnsProviders(ctx context.Context, arg ListDnsProvidersParams) ([]DnsProvider, error) {
|
||||
func (q *Queries) ListDnsProviders(ctx context.Context, arg *ListDnsProvidersParams) ([]*DnsProvider, error) {
|
||||
rows, err := q.query(ctx, q.listDnsProvidersStmt, listDnsProviders, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []DnsProvider
|
||||
var items []*DnsProvider
|
||||
for rows.Next() {
|
||||
var i DnsProvider
|
||||
if err := rows.Scan(
|
||||
@@ -200,7 +184,7 @@ func (q *Queries) ListDnsProviders(ctx context.Context, arg ListDnsProvidersPara
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -244,7 +228,7 @@ type UpdateDnsProviderParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateDnsProvider(ctx context.Context, arg UpdateDnsProviderParams) (DnsProvider, error) {
|
||||
func (q *Queries) UpdateDnsProvider(ctx context.Context, arg *UpdateDnsProviderParams) (*DnsProvider, error) {
|
||||
row := q.queryRow(ctx, q.updateDnsProviderStmt, updateDnsProvider,
|
||||
arg.Name,
|
||||
arg.Type,
|
||||
@@ -262,5 +246,5 @@ func (q *Queries) UpdateDnsProvider(ctx context.Context, arg UpdateDnsProviderPa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -27,25 +27,9 @@ func (q *Queries) CountEntryPoints(ctx context.Context, profileID int64) (int64,
|
||||
|
||||
const createEntryPoint = `-- name: CreateEntryPoint :one
|
||||
INSERT INTO
|
||||
entry_points (
|
||||
id,
|
||||
profile_id,
|
||||
name,
|
||||
address,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
entry_points (id, profile_id, name, address, is_default)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, name, address, is_default, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, name, address, is_default, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateEntryPointParams struct {
|
||||
@@ -56,7 +40,7 @@ type CreateEntryPointParams struct {
|
||||
IsDefault bool `json:"isDefault"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateEntryPoint(ctx context.Context, arg CreateEntryPointParams) (EntryPoint, error) {
|
||||
func (q *Queries) CreateEntryPoint(ctx context.Context, arg *CreateEntryPointParams) (*EntryPoint, error) {
|
||||
row := q.queryRow(ctx, q.createEntryPointStmt, createEntryPoint,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -74,7 +58,7 @@ func (q *Queries) CreateEntryPoint(ctx context.Context, arg CreateEntryPointPara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteEntryPointByID = `-- name: DeleteEntryPointByID :exec
|
||||
@@ -99,7 +83,7 @@ LIMIT
|
||||
1
|
||||
`
|
||||
|
||||
func (q *Queries) GetDefaultEntryPoint(ctx context.Context) (EntryPoint, error) {
|
||||
func (q *Queries) GetDefaultEntryPoint(ctx context.Context) (*EntryPoint, error) {
|
||||
row := q.queryRow(ctx, q.getDefaultEntryPointStmt, getDefaultEntryPoint)
|
||||
var i EntryPoint
|
||||
err := row.Scan(
|
||||
@@ -111,7 +95,7 @@ func (q *Queries) GetDefaultEntryPoint(ctx context.Context) (EntryPoint, error)
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getEntryPoint = `-- name: GetEntryPoint :one
|
||||
@@ -123,7 +107,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetEntryPoint(ctx context.Context, id string) (EntryPoint, error) {
|
||||
func (q *Queries) GetEntryPoint(ctx context.Context, id string) (*EntryPoint, error) {
|
||||
row := q.queryRow(ctx, q.getEntryPointStmt, getEntryPoint, id)
|
||||
var i EntryPoint
|
||||
err := row.Scan(
|
||||
@@ -135,7 +119,7 @@ func (q *Queries) GetEntryPoint(ctx context.Context, id string) (EntryPoint, err
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listEntryPoints = `-- name: ListEntryPoints :many
|
||||
@@ -159,13 +143,13 @@ type ListEntryPointsParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListEntryPoints(ctx context.Context, arg ListEntryPointsParams) ([]EntryPoint, error) {
|
||||
func (q *Queries) ListEntryPoints(ctx context.Context, arg *ListEntryPointsParams) ([]*EntryPoint, error) {
|
||||
rows, err := q.query(ctx, q.listEntryPointsStmt, listEntryPoints, arg.ProfileID, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []EntryPoint
|
||||
var items []*EntryPoint
|
||||
for rows.Next() {
|
||||
var i EntryPoint
|
||||
if err := rows.Scan(
|
||||
@@ -179,7 +163,7 @@ func (q *Queries) ListEntryPoints(ctx context.Context, arg ListEntryPointsParams
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -222,7 +206,7 @@ type UpdateEntryPointParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateEntryPoint(ctx context.Context, arg UpdateEntryPointParams) (EntryPoint, error) {
|
||||
func (q *Queries) UpdateEntryPoint(ctx context.Context, arg *UpdateEntryPointParams) (*EntryPoint, error) {
|
||||
row := q.queryRow(ctx, q.updateEntryPointStmt, updateEntryPoint,
|
||||
arg.Name,
|
||||
arg.Address,
|
||||
@@ -239,5 +223,5 @@ func (q *Queries) UpdateEntryPoint(ctx context.Context, arg UpdateEntryPointPara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ type DeleteErrorsByProfileCategoryParams struct {
|
||||
Category string `json:"category"`
|
||||
}
|
||||
|
||||
func (q *Queries) DeleteErrorsByProfileCategory(ctx context.Context, arg DeleteErrorsByProfileCategoryParams) error {
|
||||
func (q *Queries) DeleteErrorsByProfileCategory(ctx context.Context, arg *DeleteErrorsByProfileCategoryParams) error {
|
||||
_, err := q.exec(ctx, q.deleteErrorsByProfileCategoryStmt, deleteErrorsByProfileCategory, arg.ProfileID, arg.Category)
|
||||
return err
|
||||
}
|
||||
@@ -59,13 +59,13 @@ ORDER BY
|
||||
created_at DESC
|
||||
`
|
||||
|
||||
func (q *Queries) GetErrorsByProfile(ctx context.Context, profileID int64) ([]Error, error) {
|
||||
func (q *Queries) GetErrorsByProfile(ctx context.Context, profileID int64) ([]*Error, error) {
|
||||
rows, err := q.query(ctx, q.getErrorsByProfileStmt, getErrorsByProfile, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Error
|
||||
var items []*Error
|
||||
for rows.Next() {
|
||||
var i Error
|
||||
if err := rows.Scan(
|
||||
@@ -78,7 +78,7 @@ func (q *Queries) GetErrorsByProfile(ctx context.Context, profileID int64) ([]Er
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -98,13 +98,13 @@ ORDER BY
|
||||
created_at DESC
|
||||
`
|
||||
|
||||
func (q *Queries) ListErrors(ctx context.Context) ([]Error, error) {
|
||||
func (q *Queries) ListErrors(ctx context.Context) ([]*Error, error) {
|
||||
rows, err := q.query(ctx, q.listErrorsStmt, listErrors)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Error
|
||||
var items []*Error
|
||||
for rows.Next() {
|
||||
var i Error
|
||||
if err := rows.Scan(
|
||||
@@ -117,7 +117,7 @@ func (q *Queries) ListErrors(ctx context.Context) ([]Error, error) {
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -132,10 +132,7 @@ const logError = `-- name: LogError :exec
|
||||
INSERT INTO
|
||||
errors (profile_id, category, message, details)
|
||||
VALUES
|
||||
(?, ?, ?, ?) ON CONFLICT (profile_id, category, details) DO
|
||||
UPDATE
|
||||
SET
|
||||
created_at = CURRENT_TIMESTAMP
|
||||
(?, ?, ?, ?)
|
||||
`
|
||||
|
||||
type LogErrorParams struct {
|
||||
@@ -145,7 +142,7 @@ type LogErrorParams struct {
|
||||
Details *string `json:"details"`
|
||||
}
|
||||
|
||||
func (q *Queries) LogError(ctx context.Context, arg LogErrorParams) error {
|
||||
func (q *Queries) LogError(ctx context.Context, arg *LogErrorParams) error {
|
||||
_, err := q.exec(ctx, q.logErrorStmt, logError,
|
||||
arg.ProfileID,
|
||||
arg.Category,
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountHttpMiddlewaresParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountHttpMiddlewares(ctx context.Context, arg CountHttpMiddlewaresParams) (int64, error) {
|
||||
func (q *Queries) CountHttpMiddlewares(ctx context.Context, arg *CountHttpMiddlewaresParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countHttpMiddlewaresStmt, countHttpMiddlewares, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -44,21 +44,10 @@ INSERT INTO
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
is_default
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, is_default, created_at, updated_at
|
||||
(?, ?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, is_default, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateHttpMiddlewareParams struct {
|
||||
@@ -70,7 +59,7 @@ type CreateHttpMiddlewareParams struct {
|
||||
IsDefault bool `json:"isDefault"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateHttpMiddleware(ctx context.Context, arg CreateHttpMiddlewareParams) (HttpMiddleware, error) {
|
||||
func (q *Queries) CreateHttpMiddleware(ctx context.Context, arg *CreateHttpMiddlewareParams) (*HttpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.createHttpMiddlewareStmt, createHttpMiddleware,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -91,7 +80,7 @@ func (q *Queries) CreateHttpMiddleware(ctx context.Context, arg CreateHttpMiddle
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteHttpMiddleware = `-- name: DeleteHttpMiddleware :exec
|
||||
@@ -114,7 +103,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpMiddleware(ctx context.Context, id string) (HttpMiddleware, error) {
|
||||
func (q *Queries) GetHttpMiddleware(ctx context.Context, id string) (*HttpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.getHttpMiddlewareStmt, getHttpMiddleware, id)
|
||||
var i HttpMiddleware
|
||||
err := row.Scan(
|
||||
@@ -128,7 +117,7 @@ func (q *Queries) GetHttpMiddleware(ctx context.Context, id string) (HttpMiddlew
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listHttpMiddlewares = `-- name: ListHttpMiddlewares :many
|
||||
@@ -157,7 +146,7 @@ type ListHttpMiddlewaresParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListHttpMiddlewares(ctx context.Context, arg ListHttpMiddlewaresParams) ([]HttpMiddleware, error) {
|
||||
func (q *Queries) ListHttpMiddlewares(ctx context.Context, arg *ListHttpMiddlewaresParams) ([]*HttpMiddleware, error) {
|
||||
rows, err := q.query(ctx, q.listHttpMiddlewaresStmt, listHttpMiddlewares,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -168,7 +157,7 @@ func (q *Queries) ListHttpMiddlewares(ctx context.Context, arg ListHttpMiddlewar
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpMiddleware
|
||||
var items []*HttpMiddleware
|
||||
for rows.Next() {
|
||||
var i HttpMiddleware
|
||||
if err := rows.Scan(
|
||||
@@ -184,7 +173,7 @@ func (q *Queries) ListHttpMiddlewares(ctx context.Context, arg ListHttpMiddlewar
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -205,13 +194,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListHttpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]HttpMiddleware, error) {
|
||||
func (q *Queries) ListHttpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]*HttpMiddleware, error) {
|
||||
rows, err := q.query(ctx, q.listHttpMiddlewaresEnabledStmt, listHttpMiddlewaresEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpMiddleware
|
||||
var items []*HttpMiddleware
|
||||
for rows.Next() {
|
||||
var i HttpMiddleware
|
||||
if err := rows.Scan(
|
||||
@@ -227,7 +216,7 @@ func (q *Queries) ListHttpMiddlewaresEnabled(ctx context.Context, profileID int6
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -272,7 +261,7 @@ type UpdateHttpMiddlewareParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateHttpMiddleware(ctx context.Context, arg UpdateHttpMiddlewareParams) (HttpMiddleware, error) {
|
||||
func (q *Queries) UpdateHttpMiddleware(ctx context.Context, arg *UpdateHttpMiddlewareParams) (*HttpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.updateHttpMiddlewareStmt, updateHttpMiddleware,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -292,5 +281,5 @@ func (q *Queries) UpdateHttpMiddleware(ctx context.Context, arg UpdateHttpMiddle
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ type CreateHttpRouterDNSProviderParams struct {
|
||||
DnsProviderID string `json:"dnsProviderId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateHttpRouterDNSProvider(ctx context.Context, arg CreateHttpRouterDNSProviderParams) error {
|
||||
func (q *Queries) CreateHttpRouterDNSProvider(ctx context.Context, arg *CreateHttpRouterDNSProviderParams) error {
|
||||
_, err := q.exec(ctx, q.createHttpRouterDNSProviderStmt, createHttpRouterDNSProvider, arg.HttpRouterID, arg.DnsProviderID)
|
||||
return err
|
||||
}
|
||||
@@ -40,7 +40,7 @@ type DeleteHttpRouterDNSProviderParams struct {
|
||||
DnsProviderID string `json:"dnsProviderId"`
|
||||
}
|
||||
|
||||
func (q *Queries) DeleteHttpRouterDNSProvider(ctx context.Context, arg DeleteHttpRouterDNSProviderParams) error {
|
||||
func (q *Queries) DeleteHttpRouterDNSProvider(ctx context.Context, arg *DeleteHttpRouterDNSProviderParams) error {
|
||||
_, err := q.exec(ctx, q.deleteHttpRouterDNSProviderStmt, deleteHttpRouterDNSProvider, arg.HttpRouterID, arg.DnsProviderID)
|
||||
return err
|
||||
}
|
||||
@@ -55,13 +55,13 @@ WHERE
|
||||
hrdp.http_router_id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetDnsProvidersByHttpRouter(ctx context.Context, httpRouterID string) ([]DnsProvider, error) {
|
||||
func (q *Queries) GetDnsProvidersByHttpRouter(ctx context.Context, httpRouterID string) ([]*DnsProvider, error) {
|
||||
rows, err := q.query(ctx, q.getDnsProvidersByHttpRouterStmt, getDnsProvidersByHttpRouter, httpRouterID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []DnsProvider
|
||||
var items []*DnsProvider
|
||||
for rows.Next() {
|
||||
var i DnsProvider
|
||||
if err := rows.Scan(
|
||||
@@ -75,7 +75,7 @@ func (q *Queries) GetDnsProvidersByHttpRouter(ctx context.Context, httpRouterID
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -110,13 +110,13 @@ type GetHttpRouterDomainsRow struct {
|
||||
DnsProviderName *string `json:"dnsProviderName"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpRouterDomains(ctx context.Context) ([]GetHttpRouterDomainsRow, error) {
|
||||
func (q *Queries) GetHttpRouterDomains(ctx context.Context) ([]*GetHttpRouterDomainsRow, error) {
|
||||
rows, err := q.query(ctx, q.getHttpRouterDomainsStmt, getHttpRouterDomains)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetHttpRouterDomainsRow
|
||||
var items []*GetHttpRouterDomainsRow
|
||||
for rows.Next() {
|
||||
var i GetHttpRouterDomainsRow
|
||||
if err := rows.Scan(
|
||||
@@ -129,7 +129,7 @@ func (q *Queries) GetHttpRouterDomains(ctx context.Context) ([]GetHttpRouterDoma
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountHttpRoutersParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountHttpRouters(ctx context.Context, arg CountHttpRoutersParams) (int64, error) {
|
||||
func (q *Queries) CountHttpRouters(ctx context.Context, arg *CountHttpRoutersParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countHttpRoutersStmt, countHttpRouters, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountHttpRouters(ctx context.Context, arg CountHttpRoutersPara
|
||||
|
||||
const createHttpRouter = `-- name: CreateHttpRouter :one
|
||||
INSERT INTO
|
||||
http_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateHttpRouterParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateHttpRouterParams struct {
|
||||
Config *schema.HTTPRouter `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateHttpRouter(ctx context.Context, arg CreateHttpRouterParams) (HttpRouter, error) {
|
||||
func (q *Queries) CreateHttpRouter(ctx context.Context, arg *CreateHttpRouterParams) (*HttpRouter, error) {
|
||||
row := q.queryRow(ctx, q.createHttpRouterStmt, createHttpRouter,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateHttpRouter(ctx context.Context, arg CreateHttpRouterPara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteHttpRouter = `-- name: DeleteHttpRouter :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpRouter(ctx context.Context, id string) (HttpRouter, error) {
|
||||
func (q *Queries) GetHttpRouter(ctx context.Context, id string) (*HttpRouter, error) {
|
||||
row := q.queryRow(ctx, q.getHttpRouterStmt, getHttpRouter, id)
|
||||
var i HttpRouter
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetHttpRouter(ctx context.Context, id string) (HttpRouter, err
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getHttpRoutersUsingEntryPoint = `-- name: GetHttpRoutersUsingEntryPoint :many
|
||||
@@ -159,13 +143,13 @@ type GetHttpRoutersUsingEntryPointRow struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpRoutersUsingEntryPoint(ctx context.Context, arg GetHttpRoutersUsingEntryPointParams) ([]GetHttpRoutersUsingEntryPointRow, error) {
|
||||
func (q *Queries) GetHttpRoutersUsingEntryPoint(ctx context.Context, arg *GetHttpRoutersUsingEntryPointParams) ([]*GetHttpRoutersUsingEntryPointRow, error) {
|
||||
rows, err := q.query(ctx, q.getHttpRoutersUsingEntryPointStmt, getHttpRoutersUsingEntryPoint, arg.ID, arg.ProfileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetHttpRoutersUsingEntryPointRow
|
||||
var items []*GetHttpRoutersUsingEntryPointRow
|
||||
for rows.Next() {
|
||||
var i GetHttpRoutersUsingEntryPointRow
|
||||
if err := rows.Scan(
|
||||
@@ -176,7 +160,7 @@ func (q *Queries) GetHttpRoutersUsingEntryPoint(ctx context.Context, arg GetHttp
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -221,13 +205,13 @@ type GetHttpRoutersUsingMiddlewareRow struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpRoutersUsingMiddleware(ctx context.Context, arg GetHttpRoutersUsingMiddlewareParams) ([]GetHttpRoutersUsingMiddlewareRow, error) {
|
||||
func (q *Queries) GetHttpRoutersUsingMiddleware(ctx context.Context, arg *GetHttpRoutersUsingMiddlewareParams) ([]*GetHttpRoutersUsingMiddlewareRow, error) {
|
||||
rows, err := q.query(ctx, q.getHttpRoutersUsingMiddlewareStmt, getHttpRoutersUsingMiddleware, arg.ID, arg.ProfileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetHttpRoutersUsingMiddlewareRow
|
||||
var items []*GetHttpRoutersUsingMiddlewareRow
|
||||
for rows.Next() {
|
||||
var i GetHttpRoutersUsingMiddlewareRow
|
||||
if err := rows.Scan(
|
||||
@@ -238,7 +222,7 @@ func (q *Queries) GetHttpRoutersUsingMiddleware(ctx context.Context, arg GetHttp
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -275,7 +259,7 @@ type ListHttpRoutersParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListHttpRouters(ctx context.Context, arg ListHttpRoutersParams) ([]HttpRouter, error) {
|
||||
func (q *Queries) ListHttpRouters(ctx context.Context, arg *ListHttpRoutersParams) ([]*HttpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listHttpRoutersStmt, listHttpRouters,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -286,7 +270,7 @@ func (q *Queries) ListHttpRouters(ctx context.Context, arg ListHttpRoutersParams
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpRouter
|
||||
var items []*HttpRouter
|
||||
for rows.Next() {
|
||||
var i HttpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -301,7 +285,7 @@ func (q *Queries) ListHttpRouters(ctx context.Context, arg ListHttpRoutersParams
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -322,13 +306,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListHttpRoutersEnabled(ctx context.Context, profileID int64) ([]HttpRouter, error) {
|
||||
func (q *Queries) ListHttpRoutersEnabled(ctx context.Context, profileID int64) ([]*HttpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listHttpRoutersEnabledStmt, listHttpRoutersEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpRouter
|
||||
var items []*HttpRouter
|
||||
for rows.Next() {
|
||||
var i HttpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -343,7 +327,7 @@ func (q *Queries) ListHttpRoutersEnabled(ctx context.Context, profileID int64) (
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -372,7 +356,7 @@ type UpdateHttpRouterParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateHttpRouter(ctx context.Context, arg UpdateHttpRouterParams) (HttpRouter, error) {
|
||||
func (q *Queries) UpdateHttpRouter(ctx context.Context, arg *UpdateHttpRouterParams) (*HttpRouter, error) {
|
||||
row := q.queryRow(ctx, q.updateHttpRouterStmt, updateHttpRouter,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -390,5 +374,5 @@ func (q *Queries) UpdateHttpRouter(ctx context.Context, arg UpdateHttpRouterPara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountHttpServersTransportsParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountHttpServersTransports(ctx context.Context, arg CountHttpServersTransportsParams) (int64, error) {
|
||||
func (q *Queries) CountHttpServersTransports(ctx context.Context, arg *CountHttpServersTransportsParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countHttpServersTransportsStmt, countHttpServersTransports, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountHttpServersTransports(ctx context.Context, arg CountHttpS
|
||||
|
||||
const createHttpServersTransport = `-- name: CreateHttpServersTransport :one
|
||||
INSERT INTO
|
||||
http_servers_transports (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_servers_transports (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateHttpServersTransportParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateHttpServersTransportParams struct {
|
||||
Config *schema.HTTPServersTransport `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateHttpServersTransport(ctx context.Context, arg CreateHttpServersTransportParams) (HttpServersTransport, error) {
|
||||
func (q *Queries) CreateHttpServersTransport(ctx context.Context, arg *CreateHttpServersTransportParams) (*HttpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.createHttpServersTransportStmt, createHttpServersTransport,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateHttpServersTransport(ctx context.Context, arg CreateHttp
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteHttpServersTransport = `-- name: DeleteHttpServersTransport :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpServersTransport(ctx context.Context, id string) (HttpServersTransport, error) {
|
||||
func (q *Queries) GetHttpServersTransport(ctx context.Context, id string) (*HttpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServersTransportStmt, getHttpServersTransport, id)
|
||||
var i HttpServersTransport
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetHttpServersTransport(ctx context.Context, id string) (HttpS
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listHttpServersTransports = `-- name: ListHttpServersTransports :many
|
||||
@@ -151,7 +135,7 @@ type ListHttpServersTransportsParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListHttpServersTransports(ctx context.Context, arg ListHttpServersTransportsParams) ([]HttpServersTransport, error) {
|
||||
func (q *Queries) ListHttpServersTransports(ctx context.Context, arg *ListHttpServersTransportsParams) ([]*HttpServersTransport, error) {
|
||||
rows, err := q.query(ctx, q.listHttpServersTransportsStmt, listHttpServersTransports,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -162,7 +146,7 @@ func (q *Queries) ListHttpServersTransports(ctx context.Context, arg ListHttpSer
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpServersTransport
|
||||
var items []*HttpServersTransport
|
||||
for rows.Next() {
|
||||
var i HttpServersTransport
|
||||
if err := rows.Scan(
|
||||
@@ -177,7 +161,7 @@ func (q *Queries) ListHttpServersTransports(ctx context.Context, arg ListHttpSer
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -198,13 +182,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListHttpServersTransportsEnabled(ctx context.Context, profileID int64) ([]HttpServersTransport, error) {
|
||||
func (q *Queries) ListHttpServersTransportsEnabled(ctx context.Context, profileID int64) ([]*HttpServersTransport, error) {
|
||||
rows, err := q.query(ctx, q.listHttpServersTransportsEnabledStmt, listHttpServersTransportsEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpServersTransport
|
||||
var items []*HttpServersTransport
|
||||
for rows.Next() {
|
||||
var i HttpServersTransport
|
||||
if err := rows.Scan(
|
||||
@@ -219,7 +203,7 @@ func (q *Queries) ListHttpServersTransportsEnabled(ctx context.Context, profileI
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -248,7 +232,7 @@ type UpdateHttpServersTransportParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateHttpServersTransport(ctx context.Context, arg UpdateHttpServersTransportParams) (HttpServersTransport, error) {
|
||||
func (q *Queries) UpdateHttpServersTransport(ctx context.Context, arg *UpdateHttpServersTransportParams) (*HttpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.updateHttpServersTransportStmt, updateHttpServersTransport,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -266,5 +250,5 @@ func (q *Queries) UpdateHttpServersTransport(ctx context.Context, arg UpdateHttp
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountHttpServicesParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountHttpServices(ctx context.Context, arg CountHttpServicesParams) (int64, error) {
|
||||
func (q *Queries) CountHttpServices(ctx context.Context, arg *CountHttpServicesParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countHttpServicesStmt, countHttpServices, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountHttpServices(ctx context.Context, arg CountHttpServicesPa
|
||||
|
||||
const createHttpService = `-- name: CreateHttpService :one
|
||||
INSERT INTO
|
||||
http_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateHttpServiceParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateHttpServiceParams struct {
|
||||
Config *schema.HTTPService `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateHttpService(ctx context.Context, arg CreateHttpServiceParams) (HttpService, error) {
|
||||
func (q *Queries) CreateHttpService(ctx context.Context, arg *CreateHttpServiceParams) (*HttpService, error) {
|
||||
row := q.queryRow(ctx, q.createHttpServiceStmt, createHttpService,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateHttpService(ctx context.Context, arg CreateHttpServicePa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteHttpService = `-- name: DeleteHttpService :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetHttpService(ctx context.Context, id string) (HttpService, error) {
|
||||
func (q *Queries) GetHttpService(ctx context.Context, id string) (*HttpService, error) {
|
||||
row := q.queryRow(ctx, q.getHttpServiceStmt, getHttpService, id)
|
||||
var i HttpService
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetHttpService(ctx context.Context, id string) (HttpService, e
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getHttpServiceByName = `-- name: GetHttpServiceByName :one
|
||||
@@ -140,7 +124,7 @@ type GetHttpServiceByNameParams struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetHttpServiceByName(ctx context.Context, arg GetHttpServiceByNameParams) (HttpService, error) {
|
||||
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(
|
||||
@@ -153,7 +137,7 @@ func (q *Queries) GetHttpServiceByName(ctx context.Context, arg GetHttpServiceBy
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listHttpServices = `-- name: ListHttpServices :many
|
||||
@@ -182,7 +166,7 @@ type ListHttpServicesParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListHttpServices(ctx context.Context, arg ListHttpServicesParams) ([]HttpService, error) {
|
||||
func (q *Queries) ListHttpServices(ctx context.Context, arg *ListHttpServicesParams) ([]*HttpService, error) {
|
||||
rows, err := q.query(ctx, q.listHttpServicesStmt, listHttpServices,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -193,7 +177,7 @@ func (q *Queries) ListHttpServices(ctx context.Context, arg ListHttpServicesPara
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpService
|
||||
var items []*HttpService
|
||||
for rows.Next() {
|
||||
var i HttpService
|
||||
if err := rows.Scan(
|
||||
@@ -208,7 +192,7 @@ func (q *Queries) ListHttpServices(ctx context.Context, arg ListHttpServicesPara
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -229,13 +213,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListHttpServicesEnabled(ctx context.Context, profileID int64) ([]HttpService, error) {
|
||||
func (q *Queries) ListHttpServicesEnabled(ctx context.Context, profileID int64) ([]*HttpService, error) {
|
||||
rows, err := q.query(ctx, q.listHttpServicesEnabledStmt, listHttpServicesEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []HttpService
|
||||
var items []*HttpService
|
||||
for rows.Next() {
|
||||
var i HttpService
|
||||
if err := rows.Scan(
|
||||
@@ -250,7 +234,7 @@ func (q *Queries) ListHttpServicesEnabled(ctx context.Context, profileID int64)
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -279,7 +263,7 @@ type UpdateHttpServiceParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateHttpService(ctx context.Context, arg UpdateHttpServiceParams) (HttpService, error) {
|
||||
func (q *Queries) UpdateHttpService(ctx context.Context, arg *UpdateHttpServiceParams) (*HttpService, error) {
|
||||
row := q.queryRow(ctx, q.updateHttpServiceStmt, updateHttpService,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -297,5 +281,5 @@ func (q *Queries) UpdateHttpService(ctx context.Context, arg UpdateHttpServicePa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ func (q *Queries) CountProfiles(ctx context.Context) (int64, error) {
|
||||
|
||||
const createProfile = `-- name: CreateProfile :one
|
||||
INSERT INTO
|
||||
profiles (name, description, token, created_at, updated_at)
|
||||
profiles (name, description, token)
|
||||
VALUES
|
||||
(?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, name, description, token, created_at, updated_at
|
||||
(?, ?, ?) RETURNING id, name, description, token, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateProfileParams struct {
|
||||
@@ -36,7 +36,7 @@ type CreateProfileParams struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error) {
|
||||
func (q *Queries) CreateProfile(ctx context.Context, arg *CreateProfileParams) (*Profile, error) {
|
||||
row := q.queryRow(ctx, q.createProfileStmt, createProfile, arg.Name, arg.Description, arg.Token)
|
||||
var i Profile
|
||||
err := row.Scan(
|
||||
@@ -47,7 +47,7 @@ func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (P
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteProfile = `-- name: DeleteProfile :exec
|
||||
@@ -70,7 +70,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetProfile(ctx context.Context, id int64) (Profile, error) {
|
||||
func (q *Queries) GetProfile(ctx context.Context, id int64) (*Profile, error) {
|
||||
row := q.queryRow(ctx, q.getProfileStmt, getProfile, id)
|
||||
var i Profile
|
||||
err := row.Scan(
|
||||
@@ -81,7 +81,7 @@ func (q *Queries) GetProfile(ctx context.Context, id int64) (Profile, error) {
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getProfileByName = `-- name: GetProfileByName :one
|
||||
@@ -93,7 +93,7 @@ WHERE
|
||||
name = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetProfileByName(ctx context.Context, name string) (Profile, error) {
|
||||
func (q *Queries) GetProfileByName(ctx context.Context, name string) (*Profile, error) {
|
||||
row := q.queryRow(ctx, q.getProfileByNameStmt, getProfileByName, name)
|
||||
var i Profile
|
||||
err := row.Scan(
|
||||
@@ -104,7 +104,7 @@ func (q *Queries) GetProfileByName(ctx context.Context, name string) (Profile, e
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listProfiles = `-- name: ListProfiles :many
|
||||
@@ -125,13 +125,13 @@ type ListProfilesParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListProfiles(ctx context.Context, arg ListProfilesParams) ([]Profile, error) {
|
||||
func (q *Queries) ListProfiles(ctx context.Context, arg *ListProfilesParams) ([]*Profile, error) {
|
||||
rows, err := q.query(ctx, q.listProfilesStmt, listProfiles, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Profile
|
||||
var items []*Profile
|
||||
for rows.Next() {
|
||||
var i Profile
|
||||
if err := rows.Scan(
|
||||
@@ -144,7 +144,7 @@ func (q *Queries) ListProfiles(ctx context.Context, arg ListProfilesParams) ([]P
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -173,7 +173,7 @@ type UpdateProfileParams struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error) {
|
||||
func (q *Queries) UpdateProfile(ctx context.Context, arg *UpdateProfileParams) (*Profile, error) {
|
||||
row := q.queryRow(ctx, q.updateProfileStmt, updateProfile,
|
||||
arg.Name,
|
||||
arg.Description,
|
||||
@@ -189,5 +189,5 @@ func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (P
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -13,46 +13,46 @@ type Querier interface {
|
||||
CountAuditLogs(ctx context.Context) (int64, error)
|
||||
CountDnsProviders(ctx context.Context) (int64, error)
|
||||
CountEntryPoints(ctx context.Context, profileID int64) (int64, error)
|
||||
CountHttpMiddlewares(ctx context.Context, arg CountHttpMiddlewaresParams) (int64, error)
|
||||
CountHttpRouters(ctx context.Context, arg CountHttpRoutersParams) (int64, error)
|
||||
CountHttpServersTransports(ctx context.Context, arg CountHttpServersTransportsParams) (int64, error)
|
||||
CountHttpServices(ctx context.Context, arg CountHttpServicesParams) (int64, error)
|
||||
CountHttpMiddlewares(ctx context.Context, arg *CountHttpMiddlewaresParams) (int64, error)
|
||||
CountHttpRouters(ctx context.Context, arg *CountHttpRoutersParams) (int64, error)
|
||||
CountHttpServersTransports(ctx context.Context, arg *CountHttpServersTransportsParams) (int64, error)
|
||||
CountHttpServices(ctx context.Context, arg *CountHttpServicesParams) (int64, error)
|
||||
CountProfiles(ctx context.Context) (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)
|
||||
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, profileID int64) (int64, error)
|
||||
CountUdpRouters(ctx context.Context, arg CountUdpRoutersParams) (int64, error)
|
||||
CountUdpServices(ctx context.Context, arg CountUdpServicesParams) (int64, error)
|
||||
CountUdpRouters(ctx context.Context, arg *CountUdpRoutersParams) (int64, error)
|
||||
CountUdpServices(ctx context.Context, arg *CountUdpServicesParams) (int64, error)
|
||||
CountUsers(ctx context.Context) (int64, error)
|
||||
CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error)
|
||||
CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error
|
||||
CreateDnsProvider(ctx context.Context, arg CreateDnsProviderParams) (DnsProvider, error)
|
||||
CreateEntryPoint(ctx context.Context, arg CreateEntryPointParams) (EntryPoint, error)
|
||||
CreateHttpMiddleware(ctx context.Context, arg CreateHttpMiddlewareParams) (HttpMiddleware, error)
|
||||
CreateHttpRouter(ctx context.Context, arg CreateHttpRouterParams) (HttpRouter, error)
|
||||
CreateHttpRouterDNSProvider(ctx context.Context, arg CreateHttpRouterDNSProviderParams) error
|
||||
CreateHttpServersTransport(ctx context.Context, arg CreateHttpServersTransportParams) (HttpServersTransport, error)
|
||||
CreateHttpService(ctx context.Context, arg CreateHttpServiceParams) (HttpService, error)
|
||||
CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error)
|
||||
CreateTcpMiddleware(ctx context.Context, arg CreateTcpMiddlewareParams) (TcpMiddleware, error)
|
||||
CreateTcpRouter(ctx context.Context, arg CreateTcpRouterParams) (TcpRouter, error)
|
||||
CreateTcpRouterDNSProvider(ctx context.Context, arg CreateTcpRouterDNSProviderParams) error
|
||||
CreateTcpServersTransport(ctx context.Context, arg CreateTcpServersTransportParams) (TcpServersTransport, error)
|
||||
CreateTcpService(ctx context.Context, arg CreateTcpServiceParams) (TcpService, error)
|
||||
CreateUdpRouter(ctx context.Context, arg CreateUdpRouterParams) (UdpRouter, error)
|
||||
CreateUdpService(ctx context.Context, arg CreateUdpServiceParams) (UdpService, error)
|
||||
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
|
||||
CreateAgent(ctx context.Context, arg *CreateAgentParams) (*Agent, error)
|
||||
CreateAuditLog(ctx context.Context, arg *CreateAuditLogParams) error
|
||||
CreateDnsProvider(ctx context.Context, arg *CreateDnsProviderParams) (*DnsProvider, error)
|
||||
CreateEntryPoint(ctx context.Context, arg *CreateEntryPointParams) (*EntryPoint, error)
|
||||
CreateHttpMiddleware(ctx context.Context, arg *CreateHttpMiddlewareParams) (*HttpMiddleware, error)
|
||||
CreateHttpRouter(ctx context.Context, arg *CreateHttpRouterParams) (*HttpRouter, error)
|
||||
CreateHttpRouterDNSProvider(ctx context.Context, arg *CreateHttpRouterDNSProviderParams) error
|
||||
CreateHttpServersTransport(ctx context.Context, arg *CreateHttpServersTransportParams) (*HttpServersTransport, error)
|
||||
CreateHttpService(ctx context.Context, arg *CreateHttpServiceParams) (*HttpService, error)
|
||||
CreateProfile(ctx context.Context, arg *CreateProfileParams) (*Profile, error)
|
||||
CreateTcpMiddleware(ctx context.Context, arg *CreateTcpMiddlewareParams) (*TcpMiddleware, error)
|
||||
CreateTcpRouter(ctx context.Context, arg *CreateTcpRouterParams) (*TcpRouter, error)
|
||||
CreateTcpRouterDNSProvider(ctx context.Context, arg *CreateTcpRouterDNSProviderParams) error
|
||||
CreateTcpServersTransport(ctx context.Context, arg *CreateTcpServersTransportParams) (*TcpServersTransport, error)
|
||||
CreateTcpService(ctx context.Context, arg *CreateTcpServiceParams) (*TcpService, error)
|
||||
CreateUdpRouter(ctx context.Context, arg *CreateUdpRouterParams) (*UdpRouter, error)
|
||||
CreateUdpService(ctx context.Context, arg *CreateUdpServiceParams) (*UdpService, error)
|
||||
CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error)
|
||||
DeleteAgent(ctx context.Context, id string) error
|
||||
DeleteDnsProvider(ctx context.Context, id string) error
|
||||
DeleteEntryPointByID(ctx context.Context, id string) error
|
||||
DeleteErrorById(ctx context.Context, id int64) error
|
||||
DeleteErrorsByProfile(ctx context.Context, profileID int64) error
|
||||
DeleteErrorsByProfileCategory(ctx context.Context, arg DeleteErrorsByProfileCategoryParams) error
|
||||
DeleteErrorsByProfileCategory(ctx context.Context, arg *DeleteErrorsByProfileCategoryParams) error
|
||||
DeleteHttpMiddleware(ctx context.Context, id string) error
|
||||
DeleteHttpRouter(ctx context.Context, id string) error
|
||||
DeleteHttpRouterDNSProvider(ctx context.Context, arg DeleteHttpRouterDNSProviderParams) error
|
||||
DeleteHttpRouterDNSProvider(ctx context.Context, arg *DeleteHttpRouterDNSProviderParams) error
|
||||
DeleteHttpServersTransport(ctx context.Context, id string) error
|
||||
DeleteHttpService(ctx context.Context, id string) error
|
||||
DeleteOldAuditLogs(ctx context.Context) error
|
||||
@@ -60,105 +60,105 @@ type Querier interface {
|
||||
DeleteSetting(ctx context.Context, key string) error
|
||||
DeleteTcpMiddleware(ctx context.Context, id string) error
|
||||
DeleteTcpRouter(ctx context.Context, id string) error
|
||||
DeleteTcpRouterDNSProvider(ctx context.Context, arg DeleteTcpRouterDNSProviderParams) error
|
||||
DeleteTcpRouterDNSProvider(ctx context.Context, arg *DeleteTcpRouterDNSProviderParams) error
|
||||
DeleteTcpServersTransport(ctx context.Context, id string) error
|
||||
DeleteTcpService(ctx context.Context, id string) error
|
||||
DeleteTraefikInstance(ctx context.Context, id string) error
|
||||
DeleteUdpRouter(ctx context.Context, id string) error
|
||||
DeleteUdpService(ctx context.Context, id string) error
|
||||
DeleteUser(ctx context.Context, id string) error
|
||||
GetAgent(ctx context.Context, id string) (Agent, error)
|
||||
GetDefaultDNSProvider(ctx context.Context) (DnsProvider, error)
|
||||
GetDefaultEntryPoint(ctx context.Context) (EntryPoint, error)
|
||||
GetDnsProvider(ctx context.Context, id string) (DnsProvider, error)
|
||||
GetDnsProviderByName(ctx context.Context, name string) (DnsProvider, error)
|
||||
GetDnsProvidersByHttpRouter(ctx context.Context, httpRouterID string) ([]DnsProvider, error)
|
||||
GetDnsProvidersByTcpRouter(ctx context.Context, tcpRouterID string) ([]DnsProvider, error)
|
||||
GetEntryPoint(ctx context.Context, id string) (EntryPoint, error)
|
||||
GetErrorsByProfile(ctx context.Context, profileID int64) ([]Error, error)
|
||||
GetHttpMiddleware(ctx context.Context, id string) (HttpMiddleware, error)
|
||||
GetHttpRouter(ctx context.Context, id string) (HttpRouter, error)
|
||||
GetHttpRouterDomains(ctx context.Context) ([]GetHttpRouterDomainsRow, error)
|
||||
GetHttpRoutersUsingEntryPoint(ctx context.Context, arg GetHttpRoutersUsingEntryPointParams) ([]GetHttpRoutersUsingEntryPointRow, error)
|
||||
GetHttpRoutersUsingMiddleware(ctx context.Context, arg GetHttpRoutersUsingMiddlewareParams) ([]GetHttpRoutersUsingMiddlewareRow, error)
|
||||
GetHttpServersTransport(ctx context.Context, id string) (HttpServersTransport, error)
|
||||
GetHttpService(ctx context.Context, id string) (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)
|
||||
GetTcpMiddleware(ctx context.Context, id string) (TcpMiddleware, error)
|
||||
GetTcpRouter(ctx context.Context, id string) (TcpRouter, error)
|
||||
GetTcpRouterDomains(ctx context.Context) ([]GetTcpRouterDomainsRow, error)
|
||||
GetTcpRoutersUsingEntryPoint(ctx context.Context, arg GetTcpRoutersUsingEntryPointParams) ([]GetTcpRoutersUsingEntryPointRow, error)
|
||||
GetTcpRoutersUsingMiddleware(ctx context.Context, arg GetTcpRoutersUsingMiddlewareParams) ([]GetTcpRoutersUsingMiddlewareRow, error)
|
||||
GetTcpServersTransport(ctx context.Context, id string) (TcpServersTransport, error)
|
||||
GetTcpService(ctx context.Context, id string) (TcpService, error)
|
||||
GetTcpServiceByName(ctx context.Context, arg GetTcpServiceByNameParams) (TcpService, error)
|
||||
GetTraefikInstanceByID(ctx context.Context, id string) (TraefikInstance, error)
|
||||
GetTraefikInstanceByName(ctx context.Context, arg GetTraefikInstanceByNameParams) (TraefikInstance, error)
|
||||
GetUdpRouter(ctx context.Context, id string) (UdpRouter, error)
|
||||
GetUdpRoutersUsingEntryPoint(ctx context.Context, arg GetUdpRoutersUsingEntryPointParams) ([]GetUdpRoutersUsingEntryPointRow, error)
|
||||
GetUdpService(ctx context.Context, id string) (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)
|
||||
ListAgents(ctx context.Context, arg ListAgentsParams) ([]Agent, error)
|
||||
ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
|
||||
ListDnsProviders(ctx context.Context, arg ListDnsProvidersParams) ([]DnsProvider, error)
|
||||
ListEntryPoints(ctx context.Context, arg ListEntryPointsParams) ([]EntryPoint, error)
|
||||
ListErrors(ctx context.Context) ([]Error, error)
|
||||
ListHttpMiddlewares(ctx context.Context, arg ListHttpMiddlewaresParams) ([]HttpMiddleware, error)
|
||||
ListHttpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]HttpMiddleware, error)
|
||||
ListHttpRouters(ctx context.Context, arg ListHttpRoutersParams) ([]HttpRouter, error)
|
||||
ListHttpRoutersEnabled(ctx context.Context, profileID int64) ([]HttpRouter, error)
|
||||
ListHttpServersTransports(ctx context.Context, arg ListHttpServersTransportsParams) ([]HttpServersTransport, error)
|
||||
ListHttpServersTransportsEnabled(ctx context.Context, profileID int64) ([]HttpServersTransport, error)
|
||||
ListHttpServices(ctx context.Context, arg ListHttpServicesParams) ([]HttpService, error)
|
||||
ListHttpServicesEnabled(ctx context.Context, profileID int64) ([]HttpService, error)
|
||||
ListProfiles(ctx context.Context, arg ListProfilesParams) ([]Profile, error)
|
||||
ListSettings(ctx context.Context) ([]Setting, error)
|
||||
ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewaresParams) ([]TcpMiddleware, error)
|
||||
ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]TcpMiddleware, error)
|
||||
ListTcpRouters(ctx context.Context, arg ListTcpRoutersParams) ([]TcpRouter, error)
|
||||
ListTcpRoutersEnabled(ctx context.Context, profileID int64) ([]TcpRouter, error)
|
||||
ListTcpServersTransports(ctx context.Context, arg ListTcpServersTransportsParams) ([]TcpServersTransport, error)
|
||||
ListTcpServersTransportsEnabled(ctx context.Context, profileID int64) ([]TcpServersTransport, error)
|
||||
ListTcpServices(ctx context.Context, arg ListTcpServicesParams) ([]TcpService, error)
|
||||
ListTcpServicesEnabled(ctx context.Context, profileID int64) ([]TcpService, error)
|
||||
ListTraefikInstances(ctx context.Context, arg ListTraefikInstancesParams) ([]TraefikInstance, error)
|
||||
ListUdpRouters(ctx context.Context, arg ListUdpRoutersParams) ([]UdpRouter, error)
|
||||
ListUdpRoutersEnabled(ctx context.Context, profileID int64) ([]UdpRouter, error)
|
||||
ListUdpServices(ctx context.Context, arg ListUdpServicesParams) ([]UdpService, error)
|
||||
ListUdpServicesEnabled(ctx context.Context, profileID int64) ([]UdpService, error)
|
||||
ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
|
||||
LogError(ctx context.Context, arg LogErrorParams) error
|
||||
GetAgent(ctx context.Context, id string) (*Agent, error)
|
||||
GetDefaultDNSProvider(ctx context.Context) (*DnsProvider, error)
|
||||
GetDefaultEntryPoint(ctx context.Context) (*EntryPoint, error)
|
||||
GetDnsProvider(ctx context.Context, id string) (*DnsProvider, error)
|
||||
GetDnsProviderByName(ctx context.Context, name string) (*DnsProvider, error)
|
||||
GetDnsProvidersByHttpRouter(ctx context.Context, httpRouterID string) ([]*DnsProvider, error)
|
||||
GetDnsProvidersByTcpRouter(ctx context.Context, tcpRouterID string) ([]*DnsProvider, error)
|
||||
GetEntryPoint(ctx context.Context, id string) (*EntryPoint, error)
|
||||
GetErrorsByProfile(ctx context.Context, profileID int64) ([]*Error, error)
|
||||
GetHttpMiddleware(ctx context.Context, id string) (*HttpMiddleware, error)
|
||||
GetHttpRouter(ctx context.Context, id string) (*HttpRouter, error)
|
||||
GetHttpRouterDomains(ctx context.Context) ([]*GetHttpRouterDomainsRow, error)
|
||||
GetHttpRoutersUsingEntryPoint(ctx context.Context, arg *GetHttpRoutersUsingEntryPointParams) ([]*GetHttpRoutersUsingEntryPointRow, error)
|
||||
GetHttpRoutersUsingMiddleware(ctx context.Context, arg *GetHttpRoutersUsingMiddlewareParams) ([]*GetHttpRoutersUsingMiddlewareRow, error)
|
||||
GetHttpServersTransport(ctx context.Context, id string) (*HttpServersTransport, error)
|
||||
GetHttpService(ctx context.Context, id string) (*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)
|
||||
GetTcpMiddleware(ctx context.Context, id string) (*TcpMiddleware, error)
|
||||
GetTcpRouter(ctx context.Context, id string) (*TcpRouter, error)
|
||||
GetTcpRouterDomains(ctx context.Context) ([]*GetTcpRouterDomainsRow, error)
|
||||
GetTcpRoutersUsingEntryPoint(ctx context.Context, arg *GetTcpRoutersUsingEntryPointParams) ([]*GetTcpRoutersUsingEntryPointRow, error)
|
||||
GetTcpRoutersUsingMiddleware(ctx context.Context, arg *GetTcpRoutersUsingMiddlewareParams) ([]*GetTcpRoutersUsingMiddlewareRow, error)
|
||||
GetTcpServersTransport(ctx context.Context, id string) (*TcpServersTransport, error)
|
||||
GetTcpService(ctx context.Context, id string) (*TcpService, error)
|
||||
GetTcpServiceByName(ctx context.Context, arg *GetTcpServiceByNameParams) (*TcpService, error)
|
||||
GetTraefikInstanceByID(ctx context.Context, id string) (*TraefikInstance, error)
|
||||
GetTraefikInstanceByName(ctx context.Context, arg *GetTraefikInstanceByNameParams) (*TraefikInstance, error)
|
||||
GetUdpRouter(ctx context.Context, id string) (*UdpRouter, error)
|
||||
GetUdpRoutersUsingEntryPoint(ctx context.Context, arg *GetUdpRoutersUsingEntryPointParams) ([]*GetUdpRoutersUsingEntryPointRow, error)
|
||||
GetUdpService(ctx context.Context, id string) (*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)
|
||||
ListAgents(ctx context.Context, arg *ListAgentsParams) ([]*Agent, error)
|
||||
ListAuditLogs(ctx context.Context, arg *ListAuditLogsParams) ([]*ListAuditLogsRow, error)
|
||||
ListDnsProviders(ctx context.Context, arg *ListDnsProvidersParams) ([]*DnsProvider, error)
|
||||
ListEntryPoints(ctx context.Context, arg *ListEntryPointsParams) ([]*EntryPoint, error)
|
||||
ListErrors(ctx context.Context) ([]*Error, error)
|
||||
ListHttpMiddlewares(ctx context.Context, arg *ListHttpMiddlewaresParams) ([]*HttpMiddleware, error)
|
||||
ListHttpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]*HttpMiddleware, error)
|
||||
ListHttpRouters(ctx context.Context, arg *ListHttpRoutersParams) ([]*HttpRouter, error)
|
||||
ListHttpRoutersEnabled(ctx context.Context, profileID int64) ([]*HttpRouter, error)
|
||||
ListHttpServersTransports(ctx context.Context, arg *ListHttpServersTransportsParams) ([]*HttpServersTransport, error)
|
||||
ListHttpServersTransportsEnabled(ctx context.Context, profileID int64) ([]*HttpServersTransport, error)
|
||||
ListHttpServices(ctx context.Context, arg *ListHttpServicesParams) ([]*HttpService, error)
|
||||
ListHttpServicesEnabled(ctx context.Context, profileID int64) ([]*HttpService, error)
|
||||
ListProfiles(ctx context.Context, arg *ListProfilesParams) ([]*Profile, error)
|
||||
ListSettings(ctx context.Context) ([]*Setting, error)
|
||||
ListTcpMiddlewares(ctx context.Context, arg *ListTcpMiddlewaresParams) ([]*TcpMiddleware, error)
|
||||
ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]*TcpMiddleware, error)
|
||||
ListTcpRouters(ctx context.Context, arg *ListTcpRoutersParams) ([]*TcpRouter, error)
|
||||
ListTcpRoutersEnabled(ctx context.Context, profileID int64) ([]*TcpRouter, error)
|
||||
ListTcpServersTransports(ctx context.Context, arg *ListTcpServersTransportsParams) ([]*TcpServersTransport, error)
|
||||
ListTcpServersTransportsEnabled(ctx context.Context, profileID int64) ([]*TcpServersTransport, error)
|
||||
ListTcpServices(ctx context.Context, arg *ListTcpServicesParams) ([]*TcpService, error)
|
||||
ListTcpServicesEnabled(ctx context.Context, profileID int64) ([]*TcpService, error)
|
||||
ListTraefikInstances(ctx context.Context, arg *ListTraefikInstancesParams) ([]*TraefikInstance, error)
|
||||
ListUdpRouters(ctx context.Context, arg *ListUdpRoutersParams) ([]*UdpRouter, error)
|
||||
ListUdpRoutersEnabled(ctx context.Context, profileID int64) ([]*UdpRouter, error)
|
||||
ListUdpServices(ctx context.Context, arg *ListUdpServicesParams) ([]*UdpService, error)
|
||||
ListUdpServicesEnabled(ctx context.Context, profileID int64) ([]*UdpService, error)
|
||||
ListUsers(ctx context.Context, arg *ListUsersParams) ([]*User, error)
|
||||
LogError(ctx context.Context, arg *LogErrorParams) error
|
||||
PurgeTraefikInstances(ctx context.Context) error
|
||||
UnsetDefaultDNSProvider(ctx context.Context) error
|
||||
UnsetDefaultEntryPoint(ctx context.Context, profileID int64) error
|
||||
UnsetDefaultHttpMiddleware(ctx context.Context, profileID int64) error
|
||||
UnsetDefaultTcpMiddleware(ctx context.Context, profileID int64) error
|
||||
UpdateAgent(ctx context.Context, arg UpdateAgentParams) (Agent, error)
|
||||
UpdateDnsProvider(ctx context.Context, arg UpdateDnsProviderParams) (DnsProvider, error)
|
||||
UpdateEntryPoint(ctx context.Context, arg UpdateEntryPointParams) (EntryPoint, error)
|
||||
UpdateHttpMiddleware(ctx context.Context, arg UpdateHttpMiddlewareParams) (HttpMiddleware, error)
|
||||
UpdateHttpRouter(ctx context.Context, arg UpdateHttpRouterParams) (HttpRouter, error)
|
||||
UpdateHttpServersTransport(ctx context.Context, arg UpdateHttpServersTransportParams) (HttpServersTransport, error)
|
||||
UpdateHttpService(ctx context.Context, arg UpdateHttpServiceParams) (HttpService, error)
|
||||
UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error)
|
||||
UpdateTcpMiddleware(ctx context.Context, arg UpdateTcpMiddlewareParams) (TcpMiddleware, error)
|
||||
UpdateTcpRouter(ctx context.Context, arg UpdateTcpRouterParams) (TcpRouter, error)
|
||||
UpdateTcpServersTransport(ctx context.Context, arg UpdateTcpServersTransportParams) (TcpServersTransport, error)
|
||||
UpdateTcpService(ctx context.Context, arg UpdateTcpServiceParams) (TcpService, error)
|
||||
UpdateUdpRouter(ctx context.Context, arg UpdateUdpRouterParams) (UdpRouter, error)
|
||||
UpdateUdpService(ctx context.Context, arg UpdateUdpServiceParams) (UdpService, error)
|
||||
UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
|
||||
UpdateAgent(ctx context.Context, arg *UpdateAgentParams) (*Agent, error)
|
||||
UpdateDnsProvider(ctx context.Context, arg *UpdateDnsProviderParams) (*DnsProvider, error)
|
||||
UpdateEntryPoint(ctx context.Context, arg *UpdateEntryPointParams) (*EntryPoint, error)
|
||||
UpdateHttpMiddleware(ctx context.Context, arg *UpdateHttpMiddlewareParams) (*HttpMiddleware, error)
|
||||
UpdateHttpRouter(ctx context.Context, arg *UpdateHttpRouterParams) (*HttpRouter, error)
|
||||
UpdateHttpServersTransport(ctx context.Context, arg *UpdateHttpServersTransportParams) (*HttpServersTransport, error)
|
||||
UpdateHttpService(ctx context.Context, arg *UpdateHttpServiceParams) (*HttpService, error)
|
||||
UpdateProfile(ctx context.Context, arg *UpdateProfileParams) (*Profile, error)
|
||||
UpdateTcpMiddleware(ctx context.Context, arg *UpdateTcpMiddlewareParams) (*TcpMiddleware, error)
|
||||
UpdateTcpRouter(ctx context.Context, arg *UpdateTcpRouterParams) (*TcpRouter, error)
|
||||
UpdateTcpServersTransport(ctx context.Context, arg *UpdateTcpServersTransportParams) (*TcpServersTransport, error)
|
||||
UpdateTcpService(ctx context.Context, arg *UpdateTcpServiceParams) (*TcpService, error)
|
||||
UpdateUdpRouter(ctx context.Context, arg *UpdateUdpRouterParams) (*UdpRouter, error)
|
||||
UpdateUdpService(ctx context.Context, arg *UpdateUdpServiceParams) (*UdpService, error)
|
||||
UpdateUser(ctx context.Context, arg *UpdateUserParams) (*User, error)
|
||||
UpdateUserLastLogin(ctx context.Context, id string) error
|
||||
UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
|
||||
UpdateUserResetToken(ctx context.Context, arg UpdateUserResetTokenParams) error
|
||||
UpsertSetting(ctx context.Context, arg UpsertSettingParams) error
|
||||
UpsertTraefikInstance(ctx context.Context, arg UpsertTraefikInstanceParams) (TraefikInstance, error)
|
||||
UpdateUserPassword(ctx context.Context, arg *UpdateUserPasswordParams) error
|
||||
UpdateUserResetToken(ctx context.Context, arg *UpdateUserResetTokenParams) error
|
||||
UpsertSetting(ctx context.Context, arg *UpsertSettingParams) error
|
||||
UpsertTraefikInstance(ctx context.Context, arg *UpsertTraefikInstanceParams) (*TraefikInstance, error)
|
||||
}
|
||||
|
||||
var _ Querier = (*Queries)(nil)
|
||||
|
||||
@@ -29,11 +29,11 @@ WHERE
|
||||
key = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetSetting(ctx context.Context, key string) (Setting, error) {
|
||||
func (q *Queries) GetSetting(ctx context.Context, key string) (*Setting, error) {
|
||||
row := q.queryRow(ctx, q.getSettingStmt, getSetting, key)
|
||||
var i Setting
|
||||
err := row.Scan(&i.Key, &i.Value, &i.UpdatedAt)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listSettings = `-- name: ListSettings :many
|
||||
@@ -43,19 +43,19 @@ FROM
|
||||
settings
|
||||
`
|
||||
|
||||
func (q *Queries) ListSettings(ctx context.Context) ([]Setting, error) {
|
||||
func (q *Queries) ListSettings(ctx context.Context) ([]*Setting, error) {
|
||||
rows, err := q.query(ctx, q.listSettingsStmt, listSettings)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Setting
|
||||
var items []*Setting
|
||||
for rows.Next() {
|
||||
var i Setting
|
||||
if err := rows.Scan(&i.Key, &i.Value, &i.UpdatedAt); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -82,7 +82,7 @@ type UpsertSettingParams struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpsertSetting(ctx context.Context, arg UpsertSettingParams) error {
|
||||
func (q *Queries) UpsertSetting(ctx context.Context, arg *UpsertSettingParams) error {
|
||||
_, err := q.exec(ctx, q.upsertSettingStmt, upsertSetting, arg.Key, arg.Value)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountTcpMiddlewaresParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountTcpMiddlewares(ctx context.Context, arg CountTcpMiddlewaresParams) (int64, error) {
|
||||
func (q *Queries) CountTcpMiddlewares(ctx context.Context, arg *CountTcpMiddlewaresParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTcpMiddlewaresStmt, countTcpMiddlewares, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -44,21 +44,10 @@ INSERT INTO
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
is_default
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, is_default, created_at, updated_at
|
||||
(?, ?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, is_default, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateTcpMiddlewareParams struct {
|
||||
@@ -70,7 +59,7 @@ type CreateTcpMiddlewareParams struct {
|
||||
IsDefault bool `json:"isDefault"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTcpMiddleware(ctx context.Context, arg CreateTcpMiddlewareParams) (TcpMiddleware, error) {
|
||||
func (q *Queries) CreateTcpMiddleware(ctx context.Context, arg *CreateTcpMiddlewareParams) (*TcpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.createTcpMiddlewareStmt, createTcpMiddleware,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -91,7 +80,7 @@ func (q *Queries) CreateTcpMiddleware(ctx context.Context, arg CreateTcpMiddlewa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteTcpMiddleware = `-- name: DeleteTcpMiddleware :exec
|
||||
@@ -114,7 +103,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpMiddleware(ctx context.Context, id string) (TcpMiddleware, error) {
|
||||
func (q *Queries) GetTcpMiddleware(ctx context.Context, id string) (*TcpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.getTcpMiddlewareStmt, getTcpMiddleware, id)
|
||||
var i TcpMiddleware
|
||||
err := row.Scan(
|
||||
@@ -128,7 +117,7 @@ func (q *Queries) GetTcpMiddleware(ctx context.Context, id string) (TcpMiddlewar
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listTcpMiddlewares = `-- name: ListTcpMiddlewares :many
|
||||
@@ -157,7 +146,7 @@ type ListTcpMiddlewaresParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewaresParams) ([]TcpMiddleware, error) {
|
||||
func (q *Queries) ListTcpMiddlewares(ctx context.Context, arg *ListTcpMiddlewaresParams) ([]*TcpMiddleware, error) {
|
||||
rows, err := q.query(ctx, q.listTcpMiddlewaresStmt, listTcpMiddlewares,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -168,7 +157,7 @@ func (q *Queries) ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewares
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpMiddleware
|
||||
var items []*TcpMiddleware
|
||||
for rows.Next() {
|
||||
var i TcpMiddleware
|
||||
if err := rows.Scan(
|
||||
@@ -184,7 +173,7 @@ func (q *Queries) ListTcpMiddlewares(ctx context.Context, arg ListTcpMiddlewares
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -205,13 +194,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]TcpMiddleware, error) {
|
||||
func (q *Queries) ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64) ([]*TcpMiddleware, error) {
|
||||
rows, err := q.query(ctx, q.listTcpMiddlewaresEnabledStmt, listTcpMiddlewaresEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpMiddleware
|
||||
var items []*TcpMiddleware
|
||||
for rows.Next() {
|
||||
var i TcpMiddleware
|
||||
if err := rows.Scan(
|
||||
@@ -227,7 +216,7 @@ func (q *Queries) ListTcpMiddlewaresEnabled(ctx context.Context, profileID int64
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -272,7 +261,7 @@ type UpdateTcpMiddlewareParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateTcpMiddleware(ctx context.Context, arg UpdateTcpMiddlewareParams) (TcpMiddleware, error) {
|
||||
func (q *Queries) UpdateTcpMiddleware(ctx context.Context, arg *UpdateTcpMiddlewareParams) (*TcpMiddleware, error) {
|
||||
row := q.queryRow(ctx, q.updateTcpMiddlewareStmt, updateTcpMiddleware,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -292,5 +281,5 @@ func (q *Queries) UpdateTcpMiddleware(ctx context.Context, arg UpdateTcpMiddlewa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ type CreateTcpRouterDNSProviderParams struct {
|
||||
DnsProviderID string `json:"dnsProviderId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTcpRouterDNSProvider(ctx context.Context, arg CreateTcpRouterDNSProviderParams) error {
|
||||
func (q *Queries) CreateTcpRouterDNSProvider(ctx context.Context, arg *CreateTcpRouterDNSProviderParams) error {
|
||||
_, err := q.exec(ctx, q.createTcpRouterDNSProviderStmt, createTcpRouterDNSProvider, arg.TcpRouterID, arg.DnsProviderID)
|
||||
return err
|
||||
}
|
||||
@@ -40,7 +40,7 @@ type DeleteTcpRouterDNSProviderParams struct {
|
||||
DnsProviderID string `json:"dnsProviderId"`
|
||||
}
|
||||
|
||||
func (q *Queries) DeleteTcpRouterDNSProvider(ctx context.Context, arg DeleteTcpRouterDNSProviderParams) error {
|
||||
func (q *Queries) DeleteTcpRouterDNSProvider(ctx context.Context, arg *DeleteTcpRouterDNSProviderParams) error {
|
||||
_, err := q.exec(ctx, q.deleteTcpRouterDNSProviderStmt, deleteTcpRouterDNSProvider, arg.TcpRouterID, arg.DnsProviderID)
|
||||
return err
|
||||
}
|
||||
@@ -55,13 +55,13 @@ WHERE
|
||||
trdp.tcp_router_id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetDnsProvidersByTcpRouter(ctx context.Context, tcpRouterID string) ([]DnsProvider, error) {
|
||||
func (q *Queries) GetDnsProvidersByTcpRouter(ctx context.Context, tcpRouterID string) ([]*DnsProvider, error) {
|
||||
rows, err := q.query(ctx, q.getDnsProvidersByTcpRouterStmt, getDnsProvidersByTcpRouter, tcpRouterID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []DnsProvider
|
||||
var items []*DnsProvider
|
||||
for rows.Next() {
|
||||
var i DnsProvider
|
||||
if err := rows.Scan(
|
||||
@@ -75,7 +75,7 @@ func (q *Queries) GetDnsProvidersByTcpRouter(ctx context.Context, tcpRouterID st
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -110,13 +110,13 @@ type GetTcpRouterDomainsRow struct {
|
||||
DnsProviderName *string `json:"dnsProviderName"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpRouterDomains(ctx context.Context) ([]GetTcpRouterDomainsRow, error) {
|
||||
func (q *Queries) GetTcpRouterDomains(ctx context.Context) ([]*GetTcpRouterDomainsRow, error) {
|
||||
rows, err := q.query(ctx, q.getTcpRouterDomainsStmt, getTcpRouterDomains)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetTcpRouterDomainsRow
|
||||
var items []*GetTcpRouterDomainsRow
|
||||
for rows.Next() {
|
||||
var i GetTcpRouterDomainsRow
|
||||
if err := rows.Scan(
|
||||
@@ -129,7 +129,7 @@ func (q *Queries) GetTcpRouterDomains(ctx context.Context) ([]GetTcpRouterDomain
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountTcpRoutersParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountTcpRouters(ctx context.Context, arg CountTcpRoutersParams) (int64, error) {
|
||||
func (q *Queries) CountTcpRouters(ctx context.Context, arg *CountTcpRoutersParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTcpRoutersStmt, countTcpRouters, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountTcpRouters(ctx context.Context, arg CountTcpRoutersParams
|
||||
|
||||
const createTcpRouter = `-- name: CreateTcpRouter :one
|
||||
INSERT INTO
|
||||
tcp_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateTcpRouterParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateTcpRouterParams struct {
|
||||
Config *schema.TCPRouter `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTcpRouter(ctx context.Context, arg CreateTcpRouterParams) (TcpRouter, error) {
|
||||
func (q *Queries) CreateTcpRouter(ctx context.Context, arg *CreateTcpRouterParams) (*TcpRouter, error) {
|
||||
row := q.queryRow(ctx, q.createTcpRouterStmt, createTcpRouter,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateTcpRouter(ctx context.Context, arg CreateTcpRouterParams
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteTcpRouter = `-- name: DeleteTcpRouter :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpRouter(ctx context.Context, id string) (TcpRouter, error) {
|
||||
func (q *Queries) GetTcpRouter(ctx context.Context, id string) (*TcpRouter, error) {
|
||||
row := q.queryRow(ctx, q.getTcpRouterStmt, getTcpRouter, id)
|
||||
var i TcpRouter
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetTcpRouter(ctx context.Context, id string) (TcpRouter, error
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getTcpRoutersUsingEntryPoint = `-- name: GetTcpRoutersUsingEntryPoint :many
|
||||
@@ -159,13 +143,13 @@ type GetTcpRoutersUsingEntryPointRow struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpRoutersUsingEntryPoint(ctx context.Context, arg GetTcpRoutersUsingEntryPointParams) ([]GetTcpRoutersUsingEntryPointRow, error) {
|
||||
func (q *Queries) GetTcpRoutersUsingEntryPoint(ctx context.Context, arg *GetTcpRoutersUsingEntryPointParams) ([]*GetTcpRoutersUsingEntryPointRow, error) {
|
||||
rows, err := q.query(ctx, q.getTcpRoutersUsingEntryPointStmt, getTcpRoutersUsingEntryPoint, arg.ID, arg.ProfileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetTcpRoutersUsingEntryPointRow
|
||||
var items []*GetTcpRoutersUsingEntryPointRow
|
||||
for rows.Next() {
|
||||
var i GetTcpRoutersUsingEntryPointRow
|
||||
if err := rows.Scan(
|
||||
@@ -176,7 +160,7 @@ func (q *Queries) GetTcpRoutersUsingEntryPoint(ctx context.Context, arg GetTcpRo
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -221,13 +205,13 @@ type GetTcpRoutersUsingMiddlewareRow struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpRoutersUsingMiddleware(ctx context.Context, arg GetTcpRoutersUsingMiddlewareParams) ([]GetTcpRoutersUsingMiddlewareRow, error) {
|
||||
func (q *Queries) GetTcpRoutersUsingMiddleware(ctx context.Context, arg *GetTcpRoutersUsingMiddlewareParams) ([]*GetTcpRoutersUsingMiddlewareRow, error) {
|
||||
rows, err := q.query(ctx, q.getTcpRoutersUsingMiddlewareStmt, getTcpRoutersUsingMiddleware, arg.ID, arg.ProfileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetTcpRoutersUsingMiddlewareRow
|
||||
var items []*GetTcpRoutersUsingMiddlewareRow
|
||||
for rows.Next() {
|
||||
var i GetTcpRoutersUsingMiddlewareRow
|
||||
if err := rows.Scan(
|
||||
@@ -238,7 +222,7 @@ func (q *Queries) GetTcpRoutersUsingMiddleware(ctx context.Context, arg GetTcpRo
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -275,7 +259,7 @@ type ListTcpRoutersParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTcpRouters(ctx context.Context, arg ListTcpRoutersParams) ([]TcpRouter, error) {
|
||||
func (q *Queries) ListTcpRouters(ctx context.Context, arg *ListTcpRoutersParams) ([]*TcpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listTcpRoutersStmt, listTcpRouters,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -286,7 +270,7 @@ func (q *Queries) ListTcpRouters(ctx context.Context, arg ListTcpRoutersParams)
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpRouter
|
||||
var items []*TcpRouter
|
||||
for rows.Next() {
|
||||
var i TcpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -301,7 +285,7 @@ func (q *Queries) ListTcpRouters(ctx context.Context, arg ListTcpRoutersParams)
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -322,13 +306,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListTcpRoutersEnabled(ctx context.Context, profileID int64) ([]TcpRouter, error) {
|
||||
func (q *Queries) ListTcpRoutersEnabled(ctx context.Context, profileID int64) ([]*TcpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listTcpRoutersEnabledStmt, listTcpRoutersEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpRouter
|
||||
var items []*TcpRouter
|
||||
for rows.Next() {
|
||||
var i TcpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -343,7 +327,7 @@ func (q *Queries) ListTcpRoutersEnabled(ctx context.Context, profileID int64) ([
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -372,7 +356,7 @@ type UpdateTcpRouterParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateTcpRouter(ctx context.Context, arg UpdateTcpRouterParams) (TcpRouter, error) {
|
||||
func (q *Queries) UpdateTcpRouter(ctx context.Context, arg *UpdateTcpRouterParams) (*TcpRouter, error) {
|
||||
row := q.queryRow(ctx, q.updateTcpRouterStmt, updateTcpRouter,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -390,5 +374,5 @@ func (q *Queries) UpdateTcpRouter(ctx context.Context, arg UpdateTcpRouterParams
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountTcpServersTransportsParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountTcpServersTransports(ctx context.Context, arg CountTcpServersTransportsParams) (int64, error) {
|
||||
func (q *Queries) CountTcpServersTransports(ctx context.Context, arg *CountTcpServersTransportsParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTcpServersTransportsStmt, countTcpServersTransports, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountTcpServersTransports(ctx context.Context, arg CountTcpSer
|
||||
|
||||
const createTcpServersTransport = `-- name: CreateTcpServersTransport :one
|
||||
INSERT INTO
|
||||
tcp_servers_transports (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_servers_transports (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateTcpServersTransportParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateTcpServersTransportParams struct {
|
||||
Config *schema.TCPServersTransport `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTcpServersTransport(ctx context.Context, arg CreateTcpServersTransportParams) (TcpServersTransport, error) {
|
||||
func (q *Queries) CreateTcpServersTransport(ctx context.Context, arg *CreateTcpServersTransportParams) (*TcpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.createTcpServersTransportStmt, createTcpServersTransport,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateTcpServersTransport(ctx context.Context, arg CreateTcpSe
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteTcpServersTransport = `-- name: DeleteTcpServersTransport :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpServersTransport(ctx context.Context, id string) (TcpServersTransport, error) {
|
||||
func (q *Queries) GetTcpServersTransport(ctx context.Context, id string) (*TcpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServersTransportStmt, getTcpServersTransport, id)
|
||||
var i TcpServersTransport
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetTcpServersTransport(ctx context.Context, id string) (TcpSer
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listTcpServersTransports = `-- name: ListTcpServersTransports :many
|
||||
@@ -151,7 +135,7 @@ type ListTcpServersTransportsParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTcpServersTransports(ctx context.Context, arg ListTcpServersTransportsParams) ([]TcpServersTransport, error) {
|
||||
func (q *Queries) ListTcpServersTransports(ctx context.Context, arg *ListTcpServersTransportsParams) ([]*TcpServersTransport, error) {
|
||||
rows, err := q.query(ctx, q.listTcpServersTransportsStmt, listTcpServersTransports,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -162,7 +146,7 @@ func (q *Queries) ListTcpServersTransports(ctx context.Context, arg ListTcpServe
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpServersTransport
|
||||
var items []*TcpServersTransport
|
||||
for rows.Next() {
|
||||
var i TcpServersTransport
|
||||
if err := rows.Scan(
|
||||
@@ -177,7 +161,7 @@ func (q *Queries) ListTcpServersTransports(ctx context.Context, arg ListTcpServe
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -198,13 +182,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListTcpServersTransportsEnabled(ctx context.Context, profileID int64) ([]TcpServersTransport, error) {
|
||||
func (q *Queries) ListTcpServersTransportsEnabled(ctx context.Context, profileID int64) ([]*TcpServersTransport, error) {
|
||||
rows, err := q.query(ctx, q.listTcpServersTransportsEnabledStmt, listTcpServersTransportsEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpServersTransport
|
||||
var items []*TcpServersTransport
|
||||
for rows.Next() {
|
||||
var i TcpServersTransport
|
||||
if err := rows.Scan(
|
||||
@@ -219,7 +203,7 @@ func (q *Queries) ListTcpServersTransportsEnabled(ctx context.Context, profileID
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -248,7 +232,7 @@ type UpdateTcpServersTransportParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateTcpServersTransport(ctx context.Context, arg UpdateTcpServersTransportParams) (TcpServersTransport, error) {
|
||||
func (q *Queries) UpdateTcpServersTransport(ctx context.Context, arg *UpdateTcpServersTransportParams) (*TcpServersTransport, error) {
|
||||
row := q.queryRow(ctx, q.updateTcpServersTransportStmt, updateTcpServersTransport,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -266,5 +250,5 @@ func (q *Queries) UpdateTcpServersTransport(ctx context.Context, arg UpdateTcpSe
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountTcpServicesParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountTcpServices(ctx context.Context, arg CountTcpServicesParams) (int64, error) {
|
||||
func (q *Queries) CountTcpServices(ctx context.Context, arg *CountTcpServicesParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countTcpServicesStmt, countTcpServices, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountTcpServices(ctx context.Context, arg CountTcpServicesPara
|
||||
|
||||
const createTcpService = `-- name: CreateTcpService :one
|
||||
INSERT INTO
|
||||
tcp_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateTcpServiceParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateTcpServiceParams struct {
|
||||
Config *schema.TCPService `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTcpService(ctx context.Context, arg CreateTcpServiceParams) (TcpService, error) {
|
||||
func (q *Queries) CreateTcpService(ctx context.Context, arg *CreateTcpServiceParams) (*TcpService, error) {
|
||||
row := q.queryRow(ctx, q.createTcpServiceStmt, createTcpService,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateTcpService(ctx context.Context, arg CreateTcpServicePara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteTcpService = `-- name: DeleteTcpService :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTcpService(ctx context.Context, id string) (TcpService, error) {
|
||||
func (q *Queries) GetTcpService(ctx context.Context, id string) (*TcpService, error) {
|
||||
row := q.queryRow(ctx, q.getTcpServiceStmt, getTcpService, id)
|
||||
var i TcpService
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetTcpService(ctx context.Context, id string) (TcpService, err
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getTcpServiceByName = `-- name: GetTcpServiceByName :one
|
||||
@@ -140,7 +124,7 @@ type GetTcpServiceByNameParams struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTcpServiceByName(ctx context.Context, arg GetTcpServiceByNameParams) (TcpService, error) {
|
||||
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(
|
||||
@@ -153,7 +137,7 @@ func (q *Queries) GetTcpServiceByName(ctx context.Context, arg GetTcpServiceByNa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listTcpServices = `-- name: ListTcpServices :many
|
||||
@@ -182,7 +166,7 @@ type ListTcpServicesParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTcpServices(ctx context.Context, arg ListTcpServicesParams) ([]TcpService, error) {
|
||||
func (q *Queries) ListTcpServices(ctx context.Context, arg *ListTcpServicesParams) ([]*TcpService, error) {
|
||||
rows, err := q.query(ctx, q.listTcpServicesStmt, listTcpServices,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -193,7 +177,7 @@ func (q *Queries) ListTcpServices(ctx context.Context, arg ListTcpServicesParams
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpService
|
||||
var items []*TcpService
|
||||
for rows.Next() {
|
||||
var i TcpService
|
||||
if err := rows.Scan(
|
||||
@@ -208,7 +192,7 @@ func (q *Queries) ListTcpServices(ctx context.Context, arg ListTcpServicesParams
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -229,13 +213,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListTcpServicesEnabled(ctx context.Context, profileID int64) ([]TcpService, error) {
|
||||
func (q *Queries) ListTcpServicesEnabled(ctx context.Context, profileID int64) ([]*TcpService, error) {
|
||||
rows, err := q.query(ctx, q.listTcpServicesEnabledStmt, listTcpServicesEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TcpService
|
||||
var items []*TcpService
|
||||
for rows.Next() {
|
||||
var i TcpService
|
||||
if err := rows.Scan(
|
||||
@@ -250,7 +234,7 @@ func (q *Queries) ListTcpServicesEnabled(ctx context.Context, profileID int64) (
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -279,7 +263,7 @@ type UpdateTcpServiceParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateTcpService(ctx context.Context, arg UpdateTcpServiceParams) (TcpService, error) {
|
||||
func (q *Queries) UpdateTcpService(ctx context.Context, arg *UpdateTcpServiceParams) (*TcpService, error) {
|
||||
row := q.queryRow(ctx, q.updateTcpServiceStmt, updateTcpService,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -297,5 +281,5 @@ func (q *Queries) UpdateTcpService(ctx context.Context, arg UpdateTcpServicePara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetTraefikInstanceByID(ctx context.Context, id string) (TraefikInstance, error) {
|
||||
func (q *Queries) GetTraefikInstanceByID(ctx context.Context, id string) (*TraefikInstance, error) {
|
||||
row := q.queryRow(ctx, q.getTraefikInstanceByIDStmt, getTraefikInstanceByID, id)
|
||||
var i TraefikInstance
|
||||
err := row.Scan(
|
||||
@@ -65,7 +65,7 @@ func (q *Queries) GetTraefikInstanceByID(ctx context.Context, id string) (Traefi
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getTraefikInstanceByName = `-- name: GetTraefikInstanceByName :one
|
||||
@@ -83,7 +83,7 @@ type GetTraefikInstanceByNameParams struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetTraefikInstanceByName(ctx context.Context, arg GetTraefikInstanceByNameParams) (TraefikInstance, error) {
|
||||
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(
|
||||
@@ -101,7 +101,7 @@ func (q *Queries) GetTraefikInstanceByName(ctx context.Context, arg GetTraefikIn
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listTraefikInstances = `-- name: ListTraefikInstances :many
|
||||
@@ -125,13 +125,13 @@ type ListTraefikInstancesParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListTraefikInstances(ctx context.Context, arg ListTraefikInstancesParams) ([]TraefikInstance, error) {
|
||||
func (q *Queries) ListTraefikInstances(ctx context.Context, arg *ListTraefikInstancesParams) ([]*TraefikInstance, error) {
|
||||
rows, err := q.query(ctx, q.listTraefikInstancesStmt, listTraefikInstances, arg.ProfileID, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []TraefikInstance
|
||||
var items []*TraefikInstance
|
||||
for rows.Next() {
|
||||
var i TraefikInstance
|
||||
if err := rows.Scan(
|
||||
@@ -151,7 +151,7 @@ func (q *Queries) ListTraefikInstances(ctx context.Context, arg ListTraefikInsta
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -186,26 +186,10 @@ INSERT INTO
|
||||
entrypoints,
|
||||
overview,
|
||||
config,
|
||||
version,
|
||||
created_at,
|
||||
updated_at
|
||||
version
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) ON CONFLICT (profile_id, name) DO
|
||||
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (profile_id, name) DO
|
||||
UPDATE
|
||||
SET
|
||||
url = EXCLUDED.url,
|
||||
@@ -233,7 +217,7 @@ type UpsertTraefikInstanceParams struct {
|
||||
Version *schema.Version `json:"version"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpsertTraefikInstance(ctx context.Context, arg UpsertTraefikInstanceParams) (TraefikInstance, error) {
|
||||
func (q *Queries) UpsertTraefikInstance(ctx context.Context, arg *UpsertTraefikInstanceParams) (*TraefikInstance, error) {
|
||||
row := q.queryRow(ctx, q.upsertTraefikInstanceStmt, upsertTraefikInstance,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -263,5 +247,5 @@ func (q *Queries) UpsertTraefikInstance(ctx context.Context, arg UpsertTraefikIn
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountUdpRoutersParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountUdpRouters(ctx context.Context, arg CountUdpRoutersParams) (int64, error) {
|
||||
func (q *Queries) CountUdpRouters(ctx context.Context, arg *CountUdpRoutersParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countUdpRoutersStmt, countUdpRouters, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountUdpRouters(ctx context.Context, arg CountUdpRoutersParams
|
||||
|
||||
const createUdpRouter = `-- name: CreateUdpRouter :one
|
||||
INSERT INTO
|
||||
udp_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
udp_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateUdpRouterParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateUdpRouterParams struct {
|
||||
Config *schema.UDPRouter `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateUdpRouter(ctx context.Context, arg CreateUdpRouterParams) (UdpRouter, error) {
|
||||
func (q *Queries) CreateUdpRouter(ctx context.Context, arg *CreateUdpRouterParams) (*UdpRouter, error) {
|
||||
row := q.queryRow(ctx, q.createUdpRouterStmt, createUdpRouter,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateUdpRouter(ctx context.Context, arg CreateUdpRouterParams
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteUdpRouter = `-- name: DeleteUdpRouter :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUdpRouter(ctx context.Context, id string) (UdpRouter, error) {
|
||||
func (q *Queries) GetUdpRouter(ctx context.Context, id string) (*UdpRouter, error) {
|
||||
row := q.queryRow(ctx, q.getUdpRouterStmt, getUdpRouter, id)
|
||||
var i UdpRouter
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetUdpRouter(ctx context.Context, id string) (UdpRouter, error
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getUdpRoutersUsingEntryPoint = `-- name: GetUdpRoutersUsingEntryPoint :many
|
||||
@@ -159,13 +143,13 @@ type GetUdpRoutersUsingEntryPointRow struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetUdpRoutersUsingEntryPoint(ctx context.Context, arg GetUdpRoutersUsingEntryPointParams) ([]GetUdpRoutersUsingEntryPointRow, error) {
|
||||
func (q *Queries) GetUdpRoutersUsingEntryPoint(ctx context.Context, arg *GetUdpRoutersUsingEntryPointParams) ([]*GetUdpRoutersUsingEntryPointRow, error) {
|
||||
rows, err := q.query(ctx, q.getUdpRoutersUsingEntryPointStmt, getUdpRoutersUsingEntryPoint, arg.ID, arg.ProfileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []GetUdpRoutersUsingEntryPointRow
|
||||
var items []*GetUdpRoutersUsingEntryPointRow
|
||||
for rows.Next() {
|
||||
var i GetUdpRoutersUsingEntryPointRow
|
||||
if err := rows.Scan(
|
||||
@@ -176,7 +160,7 @@ func (q *Queries) GetUdpRoutersUsingEntryPoint(ctx context.Context, arg GetUdpRo
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -213,7 +197,7 @@ type ListUdpRoutersParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListUdpRouters(ctx context.Context, arg ListUdpRoutersParams) ([]UdpRouter, error) {
|
||||
func (q *Queries) ListUdpRouters(ctx context.Context, arg *ListUdpRoutersParams) ([]*UdpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listUdpRoutersStmt, listUdpRouters,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -224,7 +208,7 @@ func (q *Queries) ListUdpRouters(ctx context.Context, arg ListUdpRoutersParams)
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []UdpRouter
|
||||
var items []*UdpRouter
|
||||
for rows.Next() {
|
||||
var i UdpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -239,7 +223,7 @@ func (q *Queries) ListUdpRouters(ctx context.Context, arg ListUdpRoutersParams)
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -260,13 +244,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListUdpRoutersEnabled(ctx context.Context, profileID int64) ([]UdpRouter, error) {
|
||||
func (q *Queries) ListUdpRoutersEnabled(ctx context.Context, profileID int64) ([]*UdpRouter, error) {
|
||||
rows, err := q.query(ctx, q.listUdpRoutersEnabledStmt, listUdpRoutersEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []UdpRouter
|
||||
var items []*UdpRouter
|
||||
for rows.Next() {
|
||||
var i UdpRouter
|
||||
if err := rows.Scan(
|
||||
@@ -281,7 +265,7 @@ func (q *Queries) ListUdpRoutersEnabled(ctx context.Context, profileID int64) ([
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -310,7 +294,7 @@ type UpdateUdpRouterParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUdpRouter(ctx context.Context, arg UpdateUdpRouterParams) (UdpRouter, error) {
|
||||
func (q *Queries) UpdateUdpRouter(ctx context.Context, arg *UpdateUdpRouterParams) (*UdpRouter, error) {
|
||||
row := q.queryRow(ctx, q.updateUdpRouterStmt, updateUdpRouter,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -328,5 +312,5 @@ func (q *Queries) UpdateUdpRouter(ctx context.Context, arg UpdateUdpRouterParams
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type CountUdpServicesParams struct {
|
||||
AgentID *string `json:"agentId"`
|
||||
}
|
||||
|
||||
func (q *Queries) CountUdpServices(ctx context.Context, arg CountUdpServicesParams) (int64, error) {
|
||||
func (q *Queries) CountUdpServices(ctx context.Context, arg *CountUdpServicesParams) (int64, error) {
|
||||
row := q.queryRow(ctx, q.countUdpServicesStmt, countUdpServices, arg.ProfileID, arg.AgentID)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
@@ -38,25 +38,9 @@ func (q *Queries) CountUdpServices(ctx context.Context, arg CountUdpServicesPara
|
||||
|
||||
const createUdpService = `-- name: CreateUdpService :one
|
||||
INSERT INTO
|
||||
udp_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
udp_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
(?, ?, ?, ?, ?) RETURNING id, profile_id, agent_id, name, config, enabled, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateUdpServiceParams struct {
|
||||
@@ -67,7 +51,7 @@ type CreateUdpServiceParams struct {
|
||||
Config *schema.UDPService `json:"config"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateUdpService(ctx context.Context, arg CreateUdpServiceParams) (UdpService, error) {
|
||||
func (q *Queries) CreateUdpService(ctx context.Context, arg *CreateUdpServiceParams) (*UdpService, error) {
|
||||
row := q.queryRow(ctx, q.createUdpServiceStmt, createUdpService,
|
||||
arg.ID,
|
||||
arg.ProfileID,
|
||||
@@ -86,7 +70,7 @@ func (q *Queries) CreateUdpService(ctx context.Context, arg CreateUdpServicePara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteUdpService = `-- name: DeleteUdpService :exec
|
||||
@@ -109,7 +93,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUdpService(ctx context.Context, id string) (UdpService, error) {
|
||||
func (q *Queries) GetUdpService(ctx context.Context, id string) (*UdpService, error) {
|
||||
row := q.queryRow(ctx, q.getUdpServiceStmt, getUdpService, id)
|
||||
var i UdpService
|
||||
err := row.Scan(
|
||||
@@ -122,7 +106,7 @@ func (q *Queries) GetUdpService(ctx context.Context, id string) (UdpService, err
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getUdpServiceByName = `-- name: GetUdpServiceByName :one
|
||||
@@ -140,7 +124,7 @@ type GetUdpServiceByNameParams struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetUdpServiceByName(ctx context.Context, arg GetUdpServiceByNameParams) (UdpService, error) {
|
||||
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(
|
||||
@@ -153,7 +137,7 @@ func (q *Queries) GetUdpServiceByName(ctx context.Context, arg GetUdpServiceByNa
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listUdpServices = `-- name: ListUdpServices :many
|
||||
@@ -182,7 +166,7 @@ type ListUdpServicesParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListUdpServices(ctx context.Context, arg ListUdpServicesParams) ([]UdpService, error) {
|
||||
func (q *Queries) ListUdpServices(ctx context.Context, arg *ListUdpServicesParams) ([]*UdpService, error) {
|
||||
rows, err := q.query(ctx, q.listUdpServicesStmt, listUdpServices,
|
||||
arg.ProfileID,
|
||||
arg.AgentID,
|
||||
@@ -193,7 +177,7 @@ func (q *Queries) ListUdpServices(ctx context.Context, arg ListUdpServicesParams
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []UdpService
|
||||
var items []*UdpService
|
||||
for rows.Next() {
|
||||
var i UdpService
|
||||
if err := rows.Scan(
|
||||
@@ -208,7 +192,7 @@ func (q *Queries) ListUdpServices(ctx context.Context, arg ListUdpServicesParams
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -229,13 +213,13 @@ WHERE
|
||||
AND enabled = TRUE
|
||||
`
|
||||
|
||||
func (q *Queries) ListUdpServicesEnabled(ctx context.Context, profileID int64) ([]UdpService, error) {
|
||||
func (q *Queries) ListUdpServicesEnabled(ctx context.Context, profileID int64) ([]*UdpService, error) {
|
||||
rows, err := q.query(ctx, q.listUdpServicesEnabledStmt, listUdpServicesEnabled, profileID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []UdpService
|
||||
var items []*UdpService
|
||||
for rows.Next() {
|
||||
var i UdpService
|
||||
if err := rows.Scan(
|
||||
@@ -250,7 +234,7 @@ func (q *Queries) ListUdpServicesEnabled(ctx context.Context, profileID int64) (
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -279,7 +263,7 @@ type UpdateUdpServiceParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUdpService(ctx context.Context, arg UpdateUdpServiceParams) (UdpService, error) {
|
||||
func (q *Queries) UpdateUdpService(ctx context.Context, arg *UpdateUdpServiceParams) (*UdpService, error) {
|
||||
row := q.queryRow(ctx, q.updateUdpServiceStmt, updateUdpService,
|
||||
arg.Name,
|
||||
arg.Config,
|
||||
@@ -297,5 +281,5 @@ func (q *Queries) UpdateUdpService(ctx context.Context, arg UpdateUdpServicePara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
@@ -26,16 +26,9 @@ func (q *Queries) CountUsers(ctx context.Context) (int64, error) {
|
||||
|
||||
const createUser = `-- name: CreateUser :one
|
||||
INSERT INTO
|
||||
users (
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
email,
|
||||
updated_at,
|
||||
created_at
|
||||
)
|
||||
users (id, username, password, email)
|
||||
VALUES
|
||||
(?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id, username, password, email, otp, otp_expiry, last_login, created_at, updated_at
|
||||
(?, ?, ?, ?) RETURNING id, username, password, email, otp, otp_expiry, last_login, created_at, updated_at
|
||||
`
|
||||
|
||||
type CreateUserParams struct {
|
||||
@@ -45,7 +38,7 @@ type CreateUserParams struct {
|
||||
Email *string `json:"email"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) {
|
||||
func (q *Queries) CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error) {
|
||||
row := q.queryRow(ctx, q.createUserStmt, createUser,
|
||||
arg.ID,
|
||||
arg.Username,
|
||||
@@ -64,7 +57,7 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const deleteUser = `-- name: DeleteUser :exec
|
||||
@@ -87,7 +80,7 @@ WHERE
|
||||
email = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserByEmail(ctx context.Context, email *string) (User, error) {
|
||||
func (q *Queries) GetUserByEmail(ctx context.Context, email *string) (*User, error) {
|
||||
row := q.queryRow(ctx, q.getUserByEmailStmt, getUserByEmail, email)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
@@ -101,7 +94,7 @@ func (q *Queries) GetUserByEmail(ctx context.Context, email *string) (User, erro
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getUserByID = `-- name: GetUserByID :one
|
||||
@@ -113,7 +106,7 @@ WHERE
|
||||
id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error) {
|
||||
func (q *Queries) GetUserByID(ctx context.Context, id string) (*User, error) {
|
||||
row := q.queryRow(ctx, q.getUserByIDStmt, getUserByID, id)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
@@ -127,7 +120,7 @@ func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error) {
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const getUserByUsername = `-- name: GetUserByUsername :one
|
||||
@@ -139,7 +132,7 @@ WHERE
|
||||
username = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error) {
|
||||
func (q *Queries) GetUserByUsername(ctx context.Context, username string) (*User, error) {
|
||||
row := q.queryRow(ctx, q.getUserByUsernameStmt, getUserByUsername, username)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
@@ -153,7 +146,7 @@ func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listUsers = `-- name: ListUsers :many
|
||||
@@ -174,13 +167,13 @@ type ListUsersParams struct {
|
||||
Limit *int64 `json:"limit"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) {
|
||||
func (q *Queries) ListUsers(ctx context.Context, arg *ListUsersParams) ([]*User, error) {
|
||||
rows, err := q.query(ctx, q.listUsersStmt, listUsers, arg.Offset, arg.Limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []User
|
||||
var items []*User
|
||||
for rows.Next() {
|
||||
var i User
|
||||
if err := rows.Scan(
|
||||
@@ -196,7 +189,7 @@ func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, e
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
@@ -223,7 +216,7 @@ type UpdateUserParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) {
|
||||
func (q *Queries) UpdateUser(ctx context.Context, arg *UpdateUserParams) (*User, error) {
|
||||
row := q.queryRow(ctx, q.updateUserStmt, updateUser, arg.Username, arg.Email, arg.ID)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
@@ -237,7 +230,7 @@ func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, e
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const updateUserLastLogin = `-- name: UpdateUserLastLogin :exec
|
||||
@@ -268,7 +261,7 @@ type UpdateUserPasswordParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error {
|
||||
func (q *Queries) UpdateUserPassword(ctx context.Context, arg *UpdateUserPasswordParams) error {
|
||||
_, err := q.exec(ctx, q.updateUserPasswordStmt, updateUserPassword, arg.Password, arg.ID)
|
||||
return err
|
||||
}
|
||||
@@ -288,7 +281,7 @@ type UpdateUserResetTokenParams struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateUserResetToken(ctx context.Context, arg UpdateUserResetTokenParams) error {
|
||||
func (q *Queries) UpdateUserResetToken(ctx context.Context, arg *UpdateUserResetTokenParams) error {
|
||||
_, err := q.exec(ctx, q.updateUserResetTokenStmt, updateUserResetToken, arg.Otp, arg.OtpExpiry, arg.ID)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- name: CreateAgent :one
|
||||
INSERT INTO
|
||||
agents (id, profile_id, token, created_at)
|
||||
agents (id, profile_id, token)
|
||||
VALUES
|
||||
(?, ?, ?, CURRENT_TIMESTAMP) RETURNING *;
|
||||
(?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetAgent :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateDnsProvider :one
|
||||
INSERT INTO
|
||||
dns_providers (
|
||||
id,
|
||||
name,
|
||||
type,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
dns_providers (id, name, type, config, is_default)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetDnsProvider :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateEntryPoint :one
|
||||
INSERT INTO
|
||||
entry_points (
|
||||
id,
|
||||
profile_id,
|
||||
name,
|
||||
address,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
entry_points (id, profile_id, name, address, is_default)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetEntryPoint :one
|
||||
SELECT
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
INSERT INTO
|
||||
errors (profile_id, category, message, details)
|
||||
VALUES
|
||||
(?, ?, ?, ?) ON CONFLICT (profile_id, category, details) DO
|
||||
UPDATE
|
||||
SET
|
||||
created_at = CURRENT_TIMESTAMP;
|
||||
(?, ?, ?, ?);
|
||||
|
||||
-- name: ListErrors :many
|
||||
SELECT
|
||||
|
||||
@@ -6,21 +6,10 @@ INSERT INTO
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
is_default
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetHttpMiddleware :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateHttpRouter :one
|
||||
INSERT INTO
|
||||
http_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetHttpRouter :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateHttpServersTransport :one
|
||||
INSERT INTO
|
||||
http_servers_transports (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_servers_transports (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetHttpServersTransport :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateHttpService :one
|
||||
INSERT INTO
|
||||
http_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
http_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetHttpService :one
|
||||
SELECT
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- name: CreateProfile :one
|
||||
INSERT INTO
|
||||
profiles (name, description, token, created_at, updated_at)
|
||||
profiles (name, description, token)
|
||||
VALUES
|
||||
(?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *;
|
||||
(?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetProfile :one
|
||||
SELECT
|
||||
|
||||
@@ -6,21 +6,10 @@ INSERT INTO
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
is_default,
|
||||
created_at,
|
||||
updated_at
|
||||
is_default
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetTcpMiddleware :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateTcpRouter :one
|
||||
INSERT INTO
|
||||
tcp_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetTcpRouter :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateTcpServersTransport :one
|
||||
INSERT INTO
|
||||
tcp_servers_transports (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_servers_transports (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetTcpServersTransport :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateTcpService :one
|
||||
INSERT INTO
|
||||
tcp_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
tcp_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetTcpService :one
|
||||
SELECT
|
||||
|
||||
@@ -50,26 +50,10 @@ INSERT INTO
|
||||
entrypoints,
|
||||
overview,
|
||||
config,
|
||||
version,
|
||||
created_at,
|
||||
updated_at
|
||||
version
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) ON CONFLICT (profile_id, name) DO
|
||||
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (profile_id, name) DO
|
||||
UPDATE
|
||||
SET
|
||||
url = EXCLUDED.url,
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateUdpRouter :one
|
||||
INSERT INTO
|
||||
udp_routers (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
udp_routers (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetUdpRouter :one
|
||||
SELECT
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
-- name: CreateUdpService :one
|
||||
INSERT INTO
|
||||
udp_services (
|
||||
id,
|
||||
profile_id,
|
||||
agent_id,
|
||||
name,
|
||||
config,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
udp_services (id, profile_id, agent_id, name, config)
|
||||
VALUES
|
||||
(
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
) RETURNING *;
|
||||
(?, ?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetUdpService :one
|
||||
SELECT
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
-- name: CreateUser :one
|
||||
INSERT INTO
|
||||
users (
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
email,
|
||||
updated_at,
|
||||
created_at
|
||||
)
|
||||
users (id, username, password, email)
|
||||
VALUES
|
||||
(?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING *;
|
||||
(?, ?, ?, ?) RETURNING *;
|
||||
|
||||
-- name: GetUserByID :one
|
||||
SELECT
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package schema
|
||||
|
||||
// import (
|
||||
// "database/sql/driver"
|
||||
// "encoding/json"
|
||||
// "time"
|
||||
// )
|
||||
|
||||
// type AgentPrivateIPs struct {
|
||||
// IPs []string `json:"privateIps,omitempty"`
|
||||
// }
|
||||
|
||||
// type AgentContainer struct {
|
||||
// ID string `json:"id,omitempty"`
|
||||
// Name string `json:"name,omitempty"`
|
||||
// Labels map[string]string `json:"labels,omitempty"`
|
||||
// Image string `json:"image,omitempty"`
|
||||
// Portmap map[int32]int32 `json:"portmap,omitempty"`
|
||||
// Status string `json:"status,omitempty"`
|
||||
// Created *time.Time `json:"created,omitempty"`
|
||||
// }
|
||||
|
||||
// type AgentContainers []AgentContainer
|
||||
|
||||
// func (c *AgentContainers) Scan(data any) error {
|
||||
// return scanJSON(data, &c)
|
||||
// }
|
||||
|
||||
// func (c *AgentContainers) Value() (driver.Value, error) {
|
||||
// return json.Marshal(c)
|
||||
// }
|
||||
@@ -86,16 +86,16 @@ func (s *Scheduler) cleanupAgents() {
|
||||
}
|
||||
|
||||
// List profiles
|
||||
profiles, err := s.cfg.Conn.GetQuery().ListProfiles(s.ctx, db.ListProfilesParams{})
|
||||
profiles, err := s.cfg.Conn.GetQuery().ListProfiles(s.ctx, &db.ListProfilesParams{})
|
||||
if err != nil {
|
||||
slog.Error("failed to list profiles", "error", err)
|
||||
continue
|
||||
}
|
||||
|
||||
var agents []db.Agent
|
||||
var agents []*db.Agent
|
||||
for _, profile := range profiles {
|
||||
a, err := s.cfg.Conn.GetQuery().
|
||||
ListAgents(s.ctx, db.ListAgentsParams{ProfileID: profile.ID})
|
||||
ListAgents(s.ctx, &db.ListAgentsParams{ProfileID: profile.ID})
|
||||
if err != nil {
|
||||
slog.Error("failed to list agents", "error", err)
|
||||
continue
|
||||
|
||||
@@ -43,7 +43,7 @@ func UpdateTraefikInstance(
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
params := db.UpsertTraefikInstanceParams{
|
||||
params := &db.UpsertTraefikInstanceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: instanceName,
|
||||
@@ -143,10 +143,10 @@ func UpdateTraefikInstance(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func fetch(instance db.UpsertTraefikInstanceParams, endpoint string) (io.ReadCloser, error) {
|
||||
func fetch(instance *db.UpsertTraefikInstanceParams, endpoint string) (io.ReadCloser, error) {
|
||||
if instance.Url == "" {
|
||||
return nil, fmt.Errorf("invalid URL or endpoint")
|
||||
}
|
||||
|
||||
@@ -139,13 +139,13 @@ func BuildDynamicConfig(
|
||||
}
|
||||
|
||||
func BackupDynamicConfigs(ctx context.Context, q *db.Queries, store storage.Backend) error {
|
||||
profiles, err := q.ListProfiles(ctx, db.ListProfilesParams{})
|
||||
profiles, err := q.ListProfiles(ctx, &db.ListProfilesParams{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, profile := range profiles {
|
||||
cfg, err := BuildDynamicConfig(ctx, q, profile)
|
||||
cfg, err := BuildDynamicConfig(ctx, q, *profile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -195,13 +195,13 @@ func DynamicToDB(
|
||||
return
|
||||
}
|
||||
|
||||
entryPointSet := make(map[string]db.CreateEntryPointParams)
|
||||
entryPointSet := make(map[string]*db.CreateEntryPointParams)
|
||||
addEP := func(pts []string) {
|
||||
for _, ep := range pts {
|
||||
if ep == "" {
|
||||
continue
|
||||
}
|
||||
entryPointSet[ep] = db.CreateEntryPointParams{
|
||||
entryPointSet[ep] = &db.CreateEntryPointParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: ep,
|
||||
@@ -216,7 +216,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateHttpRouter(ctx, db.CreateHttpRouterParams{
|
||||
if _, err := q.CreateHttpRouter(ctx, &db.CreateHttpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -230,7 +230,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateHttpService(ctx, db.CreateHttpServiceParams{
|
||||
if _, err := q.CreateHttpService(ctx, &db.CreateHttpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -243,7 +243,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateHttpMiddleware(ctx, db.CreateHttpMiddlewareParams{
|
||||
if _, err := q.CreateHttpMiddleware(ctx, &db.CreateHttpMiddlewareParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -258,7 +258,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateTcpRouter(ctx, db.CreateTcpRouterParams{
|
||||
if _, err := q.CreateTcpRouter(ctx, &db.CreateTcpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -272,7 +272,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateTcpService(ctx, db.CreateTcpServiceParams{
|
||||
if _, err := q.CreateTcpService(ctx, &db.CreateTcpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -285,7 +285,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateTcpMiddleware(ctx, db.CreateTcpMiddlewareParams{
|
||||
if _, err := q.CreateTcpMiddleware(ctx, &db.CreateTcpMiddlewareParams{
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
Config: schema.WrapTCPMiddleware(v),
|
||||
@@ -299,7 +299,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateUdpRouter(ctx, db.CreateUdpRouterParams{
|
||||
if _, err := q.CreateUdpRouter(ctx, &db.CreateUdpRouterParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
@@ -313,7 +313,7 @@ func DynamicToDB(
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, err := q.CreateUdpService(ctx, db.CreateUdpServiceParams{
|
||||
if _, err := q.CreateUdpService(ctx, &db.CreateUdpServiceParams{
|
||||
ID: uuid.New().String(),
|
||||
ProfileID: profileID,
|
||||
Name: k,
|
||||
|
||||
12
sqlc.yml
12
sqlc.yml
@@ -12,6 +12,8 @@ sql:
|
||||
emit_interface: true # Output a Querier interface in the generated package
|
||||
emit_prepared_queries: true
|
||||
emit_pointers_for_null_types: true # Pointers for null types
|
||||
emit_result_struct_pointers: true # Efficient for large result sets
|
||||
emit_params_struct_pointers: true # Efficient parameter passing
|
||||
overrides:
|
||||
- column: "http_routers.config"
|
||||
go_type:
|
||||
@@ -88,13 +90,3 @@ sql:
|
||||
import: "github.com/mizuchilabs/mantrae/server/internal/store/schema"
|
||||
type: "DNSProviderConfig"
|
||||
pointer: true
|
||||
# - column: "agents.private_ips"
|
||||
# go_type:
|
||||
# import: "github.com/mizuchilabs/mantrae/server/internal/store/schema"
|
||||
# type: "AgentPrivateIPs"
|
||||
# pointer: true
|
||||
# - column: "agents.containers"
|
||||
# go_type:
|
||||
# import: "github.com/mizuchilabs/mantrae/server/internal/store/schema"
|
||||
# type: "AgentContainers"
|
||||
# pointer: true
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
"mode-watcher": "^1.1.0",
|
||||
"oxlint": "^1.31.0",
|
||||
"oxlint-tsgolint": "^0.8.3",
|
||||
"prettier": "^3.7.3",
|
||||
"prettier": "^3.7.4",
|
||||
"prettier-plugin-svelte": "^3.4.0",
|
||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||
"shiki": "^3.18.0",
|
||||
"svelte": "^5.45.3",
|
||||
"shiki": "^3.19.0",
|
||||
"svelte": "^5.45.4",
|
||||
"svelte-check": "^4.3.4",
|
||||
"svelte-highlight": "^7.9.0",
|
||||
"svelte-sonner": "^1.0.7",
|
||||
|
||||
194
web/pnpm-lock.yaml
generated
194
web/pnpm-lock.yaml
generated
@@ -35,16 +35,16 @@ importers:
|
||||
version: 3.10.0
|
||||
'@lucide/svelte':
|
||||
specifier: ^0.555.0
|
||||
version: 0.555.0(svelte@5.45.3)
|
||||
version: 0.555.0(svelte@5.45.4)
|
||||
'@sveltejs/adapter-static':
|
||||
specifier: ^3.0.10
|
||||
version: 3.0.10(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))
|
||||
version: 3.0.10(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))
|
||||
'@sveltejs/kit':
|
||||
specifier: ^2.49.1
|
||||
version: 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
version: 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/vite-plugin-svelte':
|
||||
specifier: ^6.2.1
|
||||
version: 6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
version: 6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@tailwindcss/typography':
|
||||
specifier: ^0.5.19
|
||||
version: 0.5.19(tailwindcss@4.1.17)
|
||||
@@ -56,19 +56,19 @@ importers:
|
||||
version: 24.10.1
|
||||
bits-ui:
|
||||
specifier: 2.14.4
|
||||
version: 2.14.4(@internationalized/date@3.10.0)(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)
|
||||
version: 2.14.4(@internationalized/date@3.10.0)(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)
|
||||
clsx:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.1
|
||||
formsnap:
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1(svelte@5.45.3)(sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.3)(typescript@5.9.3))
|
||||
version: 2.0.1(svelte@5.45.4)(sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.4)(typescript@5.9.3))
|
||||
globals:
|
||||
specifier: ^16.5.0
|
||||
version: 16.5.0
|
||||
mode-watcher:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0(svelte@5.45.3)
|
||||
version: 1.1.0(svelte@5.45.4)
|
||||
oxlint:
|
||||
specifier: ^1.31.0
|
||||
version: 1.31.0(oxlint-tsgolint@0.8.3)
|
||||
@@ -76,32 +76,32 @@ importers:
|
||||
specifier: ^0.8.3
|
||||
version: 0.8.3
|
||||
prettier:
|
||||
specifier: ^3.7.3
|
||||
version: 3.7.3
|
||||
specifier: ^3.7.4
|
||||
version: 3.7.4
|
||||
prettier-plugin-svelte:
|
||||
specifier: ^3.4.0
|
||||
version: 3.4.0(prettier@3.7.3)(svelte@5.45.3)
|
||||
version: 3.4.0(prettier@3.7.4)(svelte@5.45.4)
|
||||
prettier-plugin-tailwindcss:
|
||||
specifier: ^0.7.2
|
||||
version: 0.7.2(prettier-plugin-svelte@3.4.0(prettier@3.7.3)(svelte@5.45.3))(prettier@3.7.3)
|
||||
version: 0.7.2(prettier-plugin-svelte@3.4.0(prettier@3.7.4)(svelte@5.45.4))(prettier@3.7.4)
|
||||
shiki:
|
||||
specifier: ^3.18.0
|
||||
specifier: ^3.19.0
|
||||
version: 3.19.0
|
||||
svelte:
|
||||
specifier: ^5.45.3
|
||||
version: 5.45.3
|
||||
specifier: ^5.45.4
|
||||
version: 5.45.4
|
||||
svelte-check:
|
||||
specifier: ^4.3.4
|
||||
version: 4.3.4(picomatch@4.0.3)(svelte@5.45.3)(typescript@5.9.3)
|
||||
version: 4.3.4(picomatch@4.0.3)(svelte@5.45.4)(typescript@5.9.3)
|
||||
svelte-highlight:
|
||||
specifier: ^7.9.0
|
||||
version: 7.9.0
|
||||
svelte-sonner:
|
||||
specifier: ^1.0.7
|
||||
version: 1.0.7(svelte@5.45.3)
|
||||
version: 1.0.7(svelte@5.45.4)
|
||||
sveltekit-superforms:
|
||||
specifier: ^2.28.1
|
||||
version: 2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.3)(typescript@5.9.3)
|
||||
version: 2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.4)(typescript@5.9.3)
|
||||
tailwind-merge:
|
||||
specifier: ^3.4.0
|
||||
version: 3.4.0
|
||||
@@ -132,11 +132,11 @@ importers:
|
||||
|
||||
packages:
|
||||
|
||||
'@ark/schema@0.55.0':
|
||||
resolution: {integrity: sha512-IlSIc0FmLKTDGr4I/FzNHauMn0MADA6bCjT1wauu4k6MyxhC1R9gz0olNpIRvK7lGGDwtc/VO0RUDNvVQW5WFg==}
|
||||
'@ark/schema@0.56.0':
|
||||
resolution: {integrity: sha512-ECg3hox/6Z/nLajxXqNhgPtNdHWC9zNsDyskwO28WinoFEnWow4IsERNz9AnXRhTZJnYIlAJ4uGn3nlLk65vZA==}
|
||||
|
||||
'@ark/util@0.55.0':
|
||||
resolution: {integrity: sha512-aWFNK7aqSvqFtVsl1xmbTjGbg91uqtJV7Za76YGNEwIO4qLjMfyY8flmmbhooYMuqPCO2jyxu8hve943D+w3bA==}
|
||||
'@ark/util@0.56.0':
|
||||
resolution: {integrity: sha512-BghfRC8b9pNs3vBoDJhcta0/c1J1rsoS1+HgVUreMFPdhz/CRAKReAu57YEllNaSy98rWAdY1gE+gFup7OXpgA==}
|
||||
|
||||
'@babel/runtime@7.28.4':
|
||||
resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==}
|
||||
@@ -802,11 +802,11 @@ packages:
|
||||
resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
arkregex@0.0.3:
|
||||
resolution: {integrity: sha512-bU21QJOJEFJK+BPNgv+5bVXkvRxyAvgnon75D92newgHxkBJTgiFwQxusyViYyJkETsddPlHyspshDQcCzmkNg==}
|
||||
arkregex@0.0.4:
|
||||
resolution: {integrity: sha512-biS/FkvSwQq59TZ453piUp8bxMui11pgOMV9WHAnli1F8o0ayNCZzUwQadL/bGIUic5TkS/QlPcyMuI8ZIwedQ==}
|
||||
|
||||
arktype@2.1.27:
|
||||
resolution: {integrity: sha512-enctOHxI4SULBv/TDtCVi5M8oLd4J5SVlPUblXDzSsOYQNMzmVbUosGBnJuZDKmFlN5Ie0/QVEuTE+Z5X1UhsQ==}
|
||||
arktype@2.1.28:
|
||||
resolution: {integrity: sha512-LVZqXl2zWRpNFnbITrtFmqeqNkPPo+KemuzbGSY6jvJwCb4v8NsDzrWOLHnQgWl26TkJeWWcUNUeBpq2Mst1/Q==}
|
||||
|
||||
axobject-query@4.1.0:
|
||||
resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==}
|
||||
@@ -1209,8 +1209,8 @@ packages:
|
||||
prettier-plugin-svelte:
|
||||
optional: true
|
||||
|
||||
prettier@3.7.3:
|
||||
resolution: {integrity: sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==}
|
||||
prettier@3.7.4:
|
||||
resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}
|
||||
engines: {node: '>=14'}
|
||||
hasBin: true
|
||||
|
||||
@@ -1340,8 +1340,8 @@ packages:
|
||||
peerDependencies:
|
||||
svelte: ^5.0.0
|
||||
|
||||
svelte@5.45.3:
|
||||
resolution: {integrity: sha512-ngKXNhNvwPzF43QqEhDOue7TQTrG09em1sd4HBxVF0Wr2gopAmdEWan+rgbdgK4fhBtSOTJO8bYU4chUG7VXZQ==}
|
||||
svelte@5.45.4:
|
||||
resolution: {integrity: sha512-1/Y6ZfAQ30GjebMrDFM8ktL1WZ0ylljLabotDAFN41MTrDOY4gGzDDYnIKV+p8YXcnxEEDpVfVWE+I6u69jJ7A==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
sveltekit-superforms@2.28.1:
|
||||
@@ -1538,12 +1538,12 @@ packages:
|
||||
|
||||
snapshots:
|
||||
|
||||
'@ark/schema@0.55.0':
|
||||
'@ark/schema@0.56.0':
|
||||
dependencies:
|
||||
'@ark/util': 0.55.0
|
||||
'@ark/util': 0.56.0
|
||||
optional: true
|
||||
|
||||
'@ark/util@0.55.0':
|
||||
'@ark/util@0.56.0':
|
||||
optional: true
|
||||
|
||||
'@babel/runtime@7.28.4':
|
||||
@@ -1703,9 +1703,9 @@ snapshots:
|
||||
'@jridgewell/resolve-uri': 3.1.2
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
|
||||
'@lucide/svelte@0.555.0(svelte@5.45.3)':
|
||||
'@lucide/svelte@0.555.0(svelte@5.45.4)':
|
||||
dependencies:
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
'@oxlint-tsgolint/darwin-arm64@0.8.3':
|
||||
optional: true
|
||||
@@ -1878,15 +1878,15 @@ snapshots:
|
||||
dependencies:
|
||||
acorn: 8.15.0
|
||||
|
||||
'@sveltejs/adapter-static@3.0.10(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))':
|
||||
'@sveltejs/adapter-static@3.0.10(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))':
|
||||
dependencies:
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
|
||||
'@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
'@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.0.0
|
||||
'@sveltejs/acorn-typescript': 1.0.8(acorn@8.15.0)
|
||||
'@sveltejs/vite-plugin-svelte': 6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/vite-plugin-svelte': 6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@types/cookie': 0.6.0
|
||||
acorn: 8.15.0
|
||||
cookie: 0.6.0
|
||||
@@ -1898,25 +1898,25 @@ snapshots:
|
||||
sade: 1.8.1
|
||||
set-cookie-parser: 2.7.2
|
||||
sirv: 3.0.2
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
vite: 7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)
|
||||
|
||||
'@sveltejs/vite-plugin-svelte-inspector@5.0.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
'@sveltejs/vite-plugin-svelte-inspector@5.0.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
dependencies:
|
||||
'@sveltejs/vite-plugin-svelte': 6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/vite-plugin-svelte': 6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
debug: 4.4.3
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
vite: 7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
'@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))':
|
||||
dependencies:
|
||||
'@sveltejs/vite-plugin-svelte-inspector': 5.0.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/vite-plugin-svelte-inspector': 5.0.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
debug: 4.4.3
|
||||
deepmerge: 4.3.1
|
||||
magic-string: 0.30.21
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
vite: 7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)
|
||||
vitefu: 1.1.1(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
transitivePeerDependencies:
|
||||
@@ -2064,29 +2064,29 @@ snapshots:
|
||||
|
||||
aria-query@5.3.2: {}
|
||||
|
||||
arkregex@0.0.3:
|
||||
arkregex@0.0.4:
|
||||
dependencies:
|
||||
'@ark/util': 0.55.0
|
||||
'@ark/util': 0.56.0
|
||||
optional: true
|
||||
|
||||
arktype@2.1.27:
|
||||
arktype@2.1.28:
|
||||
dependencies:
|
||||
'@ark/schema': 0.55.0
|
||||
'@ark/util': 0.55.0
|
||||
arkregex: 0.0.3
|
||||
'@ark/schema': 0.56.0
|
||||
'@ark/util': 0.56.0
|
||||
arkregex: 0.0.4
|
||||
optional: true
|
||||
|
||||
axobject-query@4.1.0: {}
|
||||
|
||||
bits-ui@2.14.4(@internationalized/date@3.10.0)(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3):
|
||||
bits-ui@2.14.4(@internationalized/date@3.10.0)(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4):
|
||||
dependencies:
|
||||
'@floating-ui/core': 1.7.3
|
||||
'@floating-ui/dom': 1.7.4
|
||||
'@internationalized/date': 3.10.0
|
||||
esm-env: 1.2.2
|
||||
runed: 0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)
|
||||
svelte: 5.45.3
|
||||
svelte-toolbelt: 0.10.6(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)
|
||||
runed: 0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)
|
||||
svelte: 5.45.4
|
||||
svelte-toolbelt: 0.10.6(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)
|
||||
tabbable: 6.3.0
|
||||
transitivePeerDependencies:
|
||||
- '@sveltejs/kit'
|
||||
@@ -2208,11 +2208,11 @@ snapshots:
|
||||
optionalDependencies:
|
||||
picomatch: 4.0.3
|
||||
|
||||
formsnap@2.0.1(svelte@5.45.3)(sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.3)(typescript@5.9.3)):
|
||||
formsnap@2.0.1(svelte@5.45.4)(sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.4)(typescript@5.9.3)):
|
||||
dependencies:
|
||||
svelte: 5.45.3
|
||||
svelte-toolbelt: 0.5.0(svelte@5.45.3)
|
||||
sveltekit-superforms: 2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.3)(typescript@5.9.3)
|
||||
svelte: 5.45.4
|
||||
svelte-toolbelt: 0.5.0(svelte@5.45.4)
|
||||
sveltekit-superforms: 2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.4)(typescript@5.9.3)
|
||||
|
||||
fsevents@2.3.3:
|
||||
optional: true
|
||||
@@ -2359,11 +2359,11 @@ snapshots:
|
||||
|
||||
micromark-util-types@2.0.2: {}
|
||||
|
||||
mode-watcher@1.1.0(svelte@5.45.3):
|
||||
mode-watcher@1.1.0(svelte@5.45.4):
|
||||
dependencies:
|
||||
runed: 0.25.0(svelte@5.45.3)
|
||||
svelte: 5.45.3
|
||||
svelte-toolbelt: 0.7.1(svelte@5.45.3)
|
||||
runed: 0.25.0(svelte@5.45.4)
|
||||
svelte: 5.45.4
|
||||
svelte-toolbelt: 0.7.1(svelte@5.45.4)
|
||||
|
||||
mri@1.2.0: {}
|
||||
|
||||
@@ -2420,18 +2420,18 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
prettier-plugin-svelte@3.4.0(prettier@3.7.3)(svelte@5.45.3):
|
||||
prettier-plugin-svelte@3.4.0(prettier@3.7.4)(svelte@5.45.4):
|
||||
dependencies:
|
||||
prettier: 3.7.3
|
||||
svelte: 5.45.3
|
||||
prettier: 3.7.4
|
||||
svelte: 5.45.4
|
||||
|
||||
prettier-plugin-tailwindcss@0.7.2(prettier-plugin-svelte@3.4.0(prettier@3.7.3)(svelte@5.45.3))(prettier@3.7.3):
|
||||
prettier-plugin-tailwindcss@0.7.2(prettier-plugin-svelte@3.4.0(prettier@3.7.4)(svelte@5.45.4))(prettier@3.7.4):
|
||||
dependencies:
|
||||
prettier: 3.7.3
|
||||
prettier: 3.7.4
|
||||
optionalDependencies:
|
||||
prettier-plugin-svelte: 3.4.0(prettier@3.7.3)(svelte@5.45.3)
|
||||
prettier-plugin-svelte: 3.4.0(prettier@3.7.4)(svelte@5.45.4)
|
||||
|
||||
prettier@3.7.3: {}
|
||||
prettier@3.7.4: {}
|
||||
|
||||
property-expr@2.0.6:
|
||||
optional: true
|
||||
@@ -2483,29 +2483,29 @@ snapshots:
|
||||
'@rollup/rollup-win32-x64-msvc': 4.53.3
|
||||
fsevents: 2.3.3
|
||||
|
||||
runed@0.23.4(svelte@5.45.3):
|
||||
runed@0.23.4(svelte@5.45.4):
|
||||
dependencies:
|
||||
esm-env: 1.2.2
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
runed@0.25.0(svelte@5.45.3):
|
||||
runed@0.25.0(svelte@5.45.4):
|
||||
dependencies:
|
||||
esm-env: 1.2.2
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
runed@0.28.0(svelte@5.45.3):
|
||||
runed@0.28.0(svelte@5.45.4):
|
||||
dependencies:
|
||||
esm-env: 1.2.2
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
runed@0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3):
|
||||
runed@0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4):
|
||||
dependencies:
|
||||
dequal: 2.0.3
|
||||
esm-env: 1.2.2
|
||||
lz-string: 1.5.0
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
optionalDependencies:
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
|
||||
sade@1.8.1:
|
||||
dependencies:
|
||||
@@ -2555,14 +2555,14 @@ snapshots:
|
||||
superstruct@2.0.2:
|
||||
optional: true
|
||||
|
||||
svelte-check@4.3.4(picomatch@4.0.3)(svelte@5.45.3)(typescript@5.9.3):
|
||||
svelte-check@4.3.4(picomatch@4.0.3)(svelte@5.45.4)(typescript@5.9.3):
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.31
|
||||
chokidar: 4.0.3
|
||||
fdir: 6.5.0(picomatch@4.0.3)
|
||||
picocolors: 1.1.1
|
||||
sade: 1.8.1
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
typescript: 5.9.3
|
||||
transitivePeerDependencies:
|
||||
- picomatch
|
||||
@@ -2571,34 +2571,34 @@ snapshots:
|
||||
dependencies:
|
||||
highlight.js: 11.11.1
|
||||
|
||||
svelte-sonner@1.0.7(svelte@5.45.3):
|
||||
svelte-sonner@1.0.7(svelte@5.45.4):
|
||||
dependencies:
|
||||
runed: 0.28.0(svelte@5.45.3)
|
||||
svelte: 5.45.3
|
||||
runed: 0.28.0(svelte@5.45.4)
|
||||
svelte: 5.45.4
|
||||
|
||||
svelte-toolbelt@0.10.6(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3):
|
||||
svelte-toolbelt@0.10.6(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4):
|
||||
dependencies:
|
||||
clsx: 2.1.1
|
||||
runed: 0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)
|
||||
runed: 0.35.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)
|
||||
style-to-object: 1.0.14
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
transitivePeerDependencies:
|
||||
- '@sveltejs/kit'
|
||||
|
||||
svelte-toolbelt@0.5.0(svelte@5.45.3):
|
||||
svelte-toolbelt@0.5.0(svelte@5.45.4):
|
||||
dependencies:
|
||||
clsx: 2.1.1
|
||||
style-to-object: 1.0.14
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
svelte-toolbelt@0.7.1(svelte@5.45.3):
|
||||
svelte-toolbelt@0.7.1(svelte@5.45.4):
|
||||
dependencies:
|
||||
clsx: 2.1.1
|
||||
runed: 0.23.4(svelte@5.45.3)
|
||||
runed: 0.23.4(svelte@5.45.4)
|
||||
style-to-object: 1.0.14
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
|
||||
svelte@5.45.3:
|
||||
svelte@5.45.4:
|
||||
dependencies:
|
||||
'@jridgewell/remapping': 2.3.5
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
@@ -2616,12 +2616,12 @@ snapshots:
|
||||
magic-string: 0.30.21
|
||||
zimmerframe: 1.1.4
|
||||
|
||||
sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.3)(typescript@5.9.3):
|
||||
sveltekit-superforms@2.28.1(@sveltejs/kit@2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(@types/json-schema@7.0.15)(esbuild@0.25.12)(svelte@5.45.4)(typescript@5.9.3):
|
||||
dependencies:
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.3)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
'@sveltejs/kit': 2.49.1(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2)))(svelte@5.45.4)(vite@7.2.6(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(yaml@2.8.2))
|
||||
devalue: 5.5.0
|
||||
memoize-weak: 1.0.2
|
||||
svelte: 5.45.3
|
||||
svelte: 5.45.4
|
||||
ts-deepmerge: 7.0.3
|
||||
optionalDependencies:
|
||||
'@exodus/schemasafe': 1.3.0
|
||||
@@ -2629,7 +2629,7 @@ snapshots:
|
||||
'@gcornut/valibot-json-schema': 0.42.0(esbuild@0.25.12)(typescript@5.9.3)
|
||||
'@typeschema/class-validator': 0.3.0(@types/json-schema@7.0.15)(class-validator@0.14.3)
|
||||
'@vinejs/vine': 3.0.1
|
||||
arktype: 2.1.27
|
||||
arktype: 2.1.28
|
||||
class-validator: 0.14.3
|
||||
effect: 3.19.8
|
||||
joi: 17.13.3
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
onlyBuiltDependencies:
|
||||
- '@tailwindcss/oxide'
|
||||
- esbuild
|
||||
- sharp
|
||||
@@ -34,10 +34,10 @@
|
||||
try {
|
||||
const stream = backupClient.downloadBackup({ name });
|
||||
|
||||
const chunks: Uint8Array[] = [];
|
||||
const chunks: ArrayBuffer[] = [];
|
||||
for await (const chunk of stream) {
|
||||
if (chunk.data.length > 0) {
|
||||
chunks.push(chunk.data);
|
||||
chunks.push(new Uint8Array(chunk.data).buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
...restProps
|
||||
}: Props = $props();
|
||||
|
||||
const items = Array.isArray(label) ? label : [label];
|
||||
const visible = items.slice(0, limit);
|
||||
const hidden = items.slice(limit);
|
||||
const items = $derived(Array.isArray(label) ? label : [label]);
|
||||
const visible = $derived(items.slice(0, limit));
|
||||
const hidden = $derived(items.slice(limit));
|
||||
|
||||
function truncateText(text: string, maxLength: number): string {
|
||||
return text?.length > maxLength ? `${text?.slice(0, maxLength)}...` : text;
|
||||
@@ -58,10 +58,10 @@
|
||||
{@const Icon = icon}
|
||||
<Icon size={12} class="shrink-0" {...iconProps} />
|
||||
{/if}
|
||||
<span class="max-w-[8rem] truncate sm:max-w-none">{truncated}</span>
|
||||
<span class="max-w-32 truncate sm:max-w-none">{truncated}</span>
|
||||
</Badge>
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Content side="top" class="max-w-xs break-words">
|
||||
<Tooltip.Content side="top" class="max-w-xs wrap-break-word">
|
||||
{item}
|
||||
</Tooltip.Content>
|
||||
</Tooltip.Root>
|
||||
@@ -78,7 +78,7 @@
|
||||
{@const Icon = icon}
|
||||
<Icon size={12} class="shrink-0" {...iconProps} />
|
||||
{/if}
|
||||
<span class="max-w-[8rem] truncate sm:max-w-none">{item}</span>
|
||||
<span class="max-w-32 truncate sm:max-w-none">{item}</span>
|
||||
</Badge>
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
...restProps
|
||||
}: Props = $props();
|
||||
|
||||
const shouldTruncate = truncate && label.length > maxLength;
|
||||
const displayLabel = shouldTruncate ? `${label.slice(0, maxLength)}...` : label;
|
||||
const shouldTruncate = $derived(truncate && label.length > maxLength);
|
||||
const displayLabel = $derived(shouldTruncate ? `${label.slice(0, maxLength)}...` : label);
|
||||
</script>
|
||||
|
||||
<div class="flex max-w-full min-w-0 items-center gap-2">
|
||||
@@ -38,7 +38,7 @@
|
||||
{displayLabel}
|
||||
</Label>
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Content side="top" class="max-w-xs break-words">
|
||||
<Tooltip.Content side="top" class="max-w-xs wrap-break-word">
|
||||
{label}
|
||||
</Tooltip.Content>
|
||||
</Tooltip.Root>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import * as Popover from '$lib/components/ui/popover/index.js';
|
||||
import { Button, type ButtonProps } from '$lib/components/ui/button/index.js';
|
||||
import { type Component } from 'svelte';
|
||||
import { AlertTriangle, Ellipsis, type IconProps } from '@lucide/svelte';
|
||||
import { TriangleAlert, Ellipsis, type IconProps } from '@lucide/svelte';
|
||||
|
||||
type IconComponent = Component<IconProps, Record<string, never>, ''>;
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
let popoverOpen = $state(false);
|
||||
|
||||
const inlineActions = actions.filter(
|
||||
(a) => ['button', 'popover'].includes(a.type) && !a.disabled
|
||||
const inlineActions = $derived(
|
||||
actions.filter((a) => ['button', 'popover'].includes(a.type) && !a.disabled)
|
||||
);
|
||||
const dropdownActions = actions.filter((a) => a.type === 'dropdown' && !a.disabled);
|
||||
const dropdownActions = $derived(actions.filter((a) => a.type === 'dropdown' && !a.disabled));
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row items-center">
|
||||
@@ -62,7 +62,7 @@
|
||||
<div
|
||||
class="mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-destructive/10"
|
||||
>
|
||||
<AlertTriangle class="h-4 w-4 text-destructive" />
|
||||
<TriangleAlert class="h-4 w-4 text-destructive" />
|
||||
</div>
|
||||
<div class="flex-1 space-y-2">
|
||||
<h4 class="text-sm leading-none font-semibold">
|
||||
|
||||
@@ -125,10 +125,10 @@
|
||||
try {
|
||||
const stream = backupClient.downloadBackup({ name });
|
||||
|
||||
const chunks: Uint8Array[] = [];
|
||||
const chunks: ArrayBuffer[] = [];
|
||||
for await (const chunk of stream) {
|
||||
if (chunk.data.length > 0) {
|
||||
chunks.push(chunk.data);
|
||||
chunks.push(new Uint8Array(chunk.data).buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
zod.go
4
zod.go
@@ -35,10 +35,10 @@ func main() {
|
||||
builder.WriteString(fmt.Sprintf("%s\n", schema))
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(filepath.Dir(output), 0o755); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(output), 0o750); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := os.WriteFile(output, []byte(builder.String()), 0o644); err != nil {
|
||||
if err := os.WriteFile(output, []byte(builder.String()), 0o600); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user