Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 76 additions & 7 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,85 @@
module github.com/streamspace/streamspace/api

go 1.21
go 1.24.0

toolchain go1.24.7

require (
github.com/crewjam/saml v0.5.1
github.com/gin-gonic/gin v1.9.1
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/google/uuid v1.5.0
github.com/gorilla/websocket v1.5.1
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674
github.com/lib/pq v1.10.9
github.com/prometheus/client_golang v1.18.0
github.com/microcosm-cc/bluemonday v1.0.27
github.com/redis/go-redis/v9 v9.16.0
golang.org/x/crypto v0.36.0
golang.org/x/time v0.9.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
k8s.io/api v0.34.2
k8s.io/apimachinery v0.34.2
k8s.io/client-go v0.34.2
k8s.io/metrics v0.34.2
)

require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beevik/etree v1.5.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russellhaering/goxmldsig v1.4.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
250 changes: 250 additions & 0 deletions api/go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/internal/activity/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func (t *Tracker) CheckIdleSessions(ctx context.Context, namespace string) ([]*k
continue
}

status := t.GetActivityStatus(&session)
status := t.GetActivityStatus(session)
if status.IsIdle {
idleSessions = append(idleSessions, &session)
idleSessions = append(idleSessions, session)
}
}

Expand Down
1 change: 0 additions & 1 deletion api/internal/cache/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"net/http"
"time"

Expand Down
1 change: 0 additions & 1 deletion api/internal/handlers/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"database/sql"
"net/http"
"strconv"
"strings"

"github.com/gin-gonic/gin"
"github.com/streamspace/streamspace/api/internal/db"
Expand Down
13 changes: 2 additions & 11 deletions api/internal/handlers/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/gin-gonic/gin"
"streamspace/internal/nodes"
"github.com/streamspace/streamspace/api/internal/nodes"
)

// NodeHandler handles node-related API requests
Expand Down Expand Up @@ -334,7 +334,7 @@ func (h *NodeHandler) DrainNode(c *gin.Context) {
})
}

// Request/Response types
// Request types

type LabelRequest struct {
Key string `json:"key" binding:"required"`
Expand All @@ -344,12 +344,3 @@ type LabelRequest struct {
type DrainRequest struct {
GracePeriodSeconds int64 `json:"grace_period_seconds"`
}

type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message,omitempty"`
}

type SuccessResponse struct {
Message string `json:"message"`
}
12 changes: 12 additions & 0 deletions api/internal/handlers/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package handlers

// ErrorResponse represents an error response
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message,omitempty"`
}

// SuccessResponse represents a success response
type SuccessResponse struct {
Message string `json:"message"`
}
11 changes: 0 additions & 11 deletions api/internal/handlers/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,3 @@ func (h *UserHandler) DeleteAdminUserQuota(c *gin.Context) {
Message: fmt.Sprintf("Quota deleted for user %s", username),
})
}

// ErrorResponse represents an error response
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
}

// SuccessResponse represents a success response
type SuccessResponse struct {
Message string `json:"message"`
}
12 changes: 12 additions & 0 deletions api/internal/models/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ import (
"time"
)

// Repository represents a plugin repository
type Repository struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Type string `json:"type"` // git, http
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}

// CatalogPlugin represents a plugin available in the catalog
type CatalogPlugin struct {
ID int `json:"id"`
Expand Down
1 change: 1 addition & 0 deletions api/internal/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type User struct {
// UserQuota represents resource quotas for a user
type UserQuota struct {
UserID string `json:"userId" db:"user_id"`
Username string `json:"username" db:"username"`
MaxSessions int `json:"maxSessions" db:"max_sessions"`
MaxCPU string `json:"maxCpu" db:"max_cpu"`
MaxMemory string `json:"maxMemory" db:"max_memory"`
Expand Down
Loading