Skip to content

Commit ade9353

Browse files
Updated websocket streaming stuct
1 parent 8a20cd3 commit ade9353

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

internal/session/model.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,18 @@ type Session struct {
6363
Mutex sync.Mutex
6464
}
6565

66-
/* sessionView is a frontend-safe representation of a session */
67-
type SessionView struct {
68-
CompletedCount int `json:"completedCount"`
69-
FailedCount int `json:"failedCount"`
70-
PendingCount int `json:"pendingCount"`
71-
ID string `json:"id"`
72-
Username string `json:"username"`
73-
IP string `json:"ip"`
74-
UserAgent string `json:"userAgent"`
75-
Status string `json:"status"`
76-
CreatedAt time.Time `json:"createdAt"`
77-
LastActiveAt time.Time `json:"lastActiveAt"`
78-
Expiry time.Time `json:"expiry"`
66+
/* SessionStreamData is a frontend-safe representation of a session that goes through websocket */
67+
type SessionStreamData struct {
68+
ID string `json:"id"`
69+
Username string `json:"username"`
70+
IP string `json:"ip"`
71+
UserAgent string `json:"userAgent"`
72+
Status string `json:"status"`
73+
CreatedAt time.Time `json:"createdAt"`
74+
LastActiveAt time.Time `json:"lastActiveAt"`
75+
Expiry time.Time `json:"expiry"`
76+
CompletedCount int `json:"completed"`
77+
FailedCount int `json:"failed"`
7978
}
8079

8180
/* websocket stream message */

0 commit comments

Comments
 (0)