Documentation
¶
Index ¶
- Constants
- func AcceptTermsAndConditions(c *gin.Context)
- func AddCapacity(capacity models.Capacity, catalogCapacity pac.Capacity) (models.Capacity, error)
- func AdminChangeGroup(c *gin.Context)
- func AdminDeleteUser(c *gin.Context)
- func AdminEndConversation(c *gin.Context)
- func AdminReply(c *gin.Context)
- func AdminWatchAll(c *gin.Context)
- func AdminWatchConversation(c *gin.Context)
- func ApproveRequest(c *gin.Context)
- func CreateCatalog(c *gin.Context)
- func CreateFeedback(c *gin.Context)
- func CreateKey(c *gin.Context)
- func CreateMaintenanceWindow(c *gin.Context)
- func CreateQuota(c *gin.Context)
- func CreateService(c *gin.Context)
- func DeleteCatalog(c *gin.Context)
- func DeleteKeyHandler(c *gin.Context)
- func DeleteMaintenanceWindow(c *gin.Context)
- func DeleteQuota(c *gin.Context)
- func DeleteRequest(c *gin.Context)
- func DeleteServiceHandler(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func ExitGroup(c *gin.Context)
- func ExpiryNotification(ctx context.Context)
- func GetAdminConversationMessages(c *gin.Context)
- func GetAdminConversations(c *gin.Context)
- func GetAllCatalogs(c *gin.Context)
- func GetAllGroups(c *gin.Context)
- func GetAllKeysHandler(c *gin.Context)
- func GetAllRequests(c *gin.Context)
- func GetAllServicesHandler(c *gin.Context)
- func GetCatalog(c *gin.Context)
- func GetEvents(c *gin.Context)
- func GetFeedback(c *gin.Context)
- func GetGroup(c *gin.Context)
- func GetKey(c *gin.Context)
- func GetMaintenanceWindows(c *gin.Context)
- func GetQuota(c *gin.Context)
- func GetRequest(c *gin.Context)
- func GetService(c *gin.Context)
- func GetTermsAndConditionsStatus(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUserConversationMessages(c *gin.Context)
- func GetUserConversations(c *gin.Context)
- func GetUserQuota(c *gin.Context)
- func GetUsers(c *gin.Context)
- func HandleChatWebSocket(c *gin.Context)
- func ListUserServices(userId string) ([]models.Service, error)
- func NewGroupRequest(c *gin.Context)
- func RejectRequest(c *gin.Context)
- func RetireCatalog(c *gin.Context)
- func SetDB(db db.DB)
- func SetKubeClient(client kubernetes.Client)
- func StartAdminReplyWorker(ctx context.Context)
- func UpdateMaintenanceWindow(c *gin.Context)
- func UpdateQuota(c *gin.Context)
- func UpdateServiceExpiryRequest(c *gin.Context)
Constants ¶
const (
// FeedbackLimit describes maximum number of feedbacks a user can submit in a day.
FeedbackLimit = 3
)
Variables ¶
This section is empty.
Functions ¶
func AcceptTermsAndConditions ¶
AcceptTermsAndConditions godoc @Summary Accept terms and conditions @Description Accept terms and conditions @Tags tnc @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/tnc [post]
func AddCapacity ¶
TODO: Move to utils if needed
func AdminChangeGroup ¶
AdminChangeGroup godoc @Summary Change User Group @Description Change user group to provided group @Tags user @Accept json @Produce json @Param id path string true "user-id for user to be modified" @Param group path string true "new group to add user to" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/users/{id}/group/{group} [put]
func AdminDeleteUser ¶
func AdminEndConversation ¶
AdminEndConversation lets an admin close a conversation on behalf of the user. It notifies the user's live WebSocket session via the hub so the user's UI transitions to a fresh conversation immediately.
func AdminReply ¶
AdminReply posts an admin reply into an existing conversation.
func AdminWatchAll ¶
AdminWatchAll upgrades an admin request to a WebSocket that receives a notification for every incoming user message across ALL conversations. The admin panel uses this single connection to drive unread indicators in the sidebar without polling. Each frame contains user_id and conversation_id so the frontend can match the right sidebar entry.
func AdminWatchConversation ¶
AdminWatchConversation upgrades an admin request to a WebSocket and streams new user messages for the specified conversation in real time. The admin opens this connection after selecting a conversation; from that point on, every message the user sends is forwarded here immediately without polling.
func ApproveRequest ¶
ApproveRequest godoc @Summary Approve request @Description Approve request @Tags requests @Accept json @Produce json @Param id path string true "request-id for the request to be approved" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/requests/{id}/approve [post]
func CreateCatalog ¶
CreateCatalog godoc @Summary Create catalog @Description Create catalog resource @Tags catalogs @Accept json @Produce json @Param catalog body models.Catalog true "Create catalog" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/catalogs [post]
func CreateFeedback ¶
CreateFeedback godoc @Summary Create Feedback given by user @Description Create feedback resource @Tags feedbacks @Accept json @Produce json @Param feedback body models.Feedback true "Create feedback" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/feedbacks [post]
func CreateKey ¶
CreateKey godoc @Summary Create key @Description Create key @Tags keys @Accept json @Produce json @Param key body models.Key true "Create key" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/keys [post]
func CreateMaintenanceWindow ¶
CreateMaintenanceWindow godoc @Summary Create a new maintenance notification window @Description Create a new maintenance notification window (admin only) @Tags maintenance @Accept json @Produce json @Param maintenance body models.MaintenanceCreateRequest true "Maintenance window configuration" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 201 {object} models.MaintenanceResponse @Router /api/v1/maintenance [post]
func CreateQuota ¶
CreateQuota godoc @Summary Create quota @Description Create quota @Tags quota @Accept json @Produce json @Param quota body models.Quota true "Create quota" @Param id path string true "group-id where quota has to be created" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id}/quota [post]
func CreateService ¶
CreateService godoc @Summary Create service @Description Create service @Tags services @Accept json @Produce json @Param service body models.Service true "Create service" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1//services [post]
func DeleteCatalog ¶
DeleteCatalog godoc @Summary Delete catalog @Description Delete catalog resource @Tags catalogs @Accept json @Produce json @Param name path string true "catalog name to be deleted" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/catalogs/{name} [delete]
func DeleteKeyHandler ¶
DeleteKey godoc @Summary Delete key @Description Delete key @Tags keys @Accept json @Produce json @Param id path string true "key-id to be deleted" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/keys/{id} [delete]
func DeleteMaintenanceWindow ¶
DeleteMaintenanceWindow godoc @Summary Delete a maintenance notification window @Description Delete a maintenance notification window (admin only) @Tags maintenance @Accept json @Produce json @Param id path string true "Maintenance Window ID" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 204 "No Content" @Router /api/v1/maintenance/{id} [delete]
func DeleteQuota ¶
DeleteQuota godoc @Summary Delete quota @Description Delete quota @Tags quota @Accept json @Produce json @Param id path string true "group-id where quota has to be deleted" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id}/quota [delete]
func DeleteRequest ¶
DeleteRequest godoc @Summary Delete request @Description Delete request @Tags requests @Accept json @Produce json @Param id path string true "request-id for the request to be deleted" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/requests/{id} [delete]
func DeleteServiceHandler ¶
DeleteService godoc @Summary Delete service @Description Delete service @Tags services @Accept json @Produce json @Param name path string true "service name to be deleted" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/services/{name} [delete]
func DeleteUser ¶
func ExitGroup ¶
ExitGroup godoc @Summary Exit group request @Description Request to exit from group @Tags requests @Accept json @Produce json @Param id path string true "group-id for the group to be exited from" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id}/exit [post]
func ExpiryNotification ¶
ExpiryNotification raises notification for about-to-expire services. It blocks until ctx is cancelled, so callers must run it in a goroutine.
func GetAdminConversationMessages ¶
GetAdminConversationMessages returns all messages for a specific conversation.
func GetAdminConversations ¶
GetAdminConversations returns a list of all user conversations for the admin panel. For any conversation whose username was not stored in the DB (legacy data), the username is resolved from Keycloak by userID and backfilled in the response.
func GetAllCatalogs ¶
GetAllCatalogs godoc @Summary Get all catalogs @Description Get all catalogs resource @Tags catalogs @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/catalogs [get]
func GetAllGroups ¶
GetAllGroups godoc @Summary Get all groups @Description Get all groups @Tags groups @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups [get]
func GetAllKeysHandler ¶
GetAllKeys godoc @Summary Get all keys @Description Get all keys @Tags keys @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/keys [get] Get the Key values and update.
func GetAllRequests ¶
GetAllRequests godoc @Summary Get all requests @Description Get all requests @Tags requests @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/requests [get]
func GetAllServicesHandler ¶
GetAllServices godoc @Summary Get all services @Description Get all services @Tags services @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/services [get]
func GetCatalog ¶
GetCatalog godoc @Summary Get catalog as specified in request @Description Get catalog resource @Tags catalogs @Accept json @Produce json @Param name path string true "catalog name to be fetched" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/catalogs/{name} [get]
func GetEvents ¶
GetEvents godoc @Summary Get events @Description Get events @Tags events @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/events [get] GetEvents returns all events
func GetFeedback ¶
GetFeedback godoc @Summary Get feedbacks submitted by users @Description Get feedback resource @Tags feedbacks @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param page query int false "Page number for pagination" @Param per_page query int false "Number of items per page" @Success 200 @Router /api/v1/feedbacks [get]
func GetGroup ¶
GetGroup godoc @Summary Get group @Description Get group as specified in request @Tags groups @Accept json @Produce json @Param id path string true "group-id to be fetched" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id} [get]
func GetKey ¶
GetKey godoc @Summary Get key @Description Get key @Tags keys @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "key-id to be fetched" @Success 200 @Router /api/v1/keys/{id} [get]
func GetMaintenanceWindows ¶
GetMaintenanceWindows godoc @Summary Get maintenance notification windows @Description Get maintenance windows. Use ?all=true (admin only) to get all windows with audit details and pagination, otherwise returns only the earliest active window @Tags maintenance @Accept json @Produce json @Param all query bool false "Get all windows (admin only)" @Param page query int false "Page number for pagination (admin only)" @Param per_page query int false "Number of items per page (admin only)" @Success 200 {object} models.MaintenanceListResponse @Router /api/v1/maintenance [get]
func GetQuota ¶
GetQuota godoc @Summary Get quota @Description Get quota @Tags quota @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "group-id to be fetched" @Success 200 @Router /api/v1/groups/{id}/quota [get] Get the respective quota of the group ID passed.
func GetRequest ¶
GetRequest godoc @Summary Get request @Description Get request @Tags requests @Accept json @Produce json @Param id path string true "request-id for request to be fetched" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/requests/{id} [get]
func GetService ¶
GetService godoc @Summary Get service @Description Get service @Tags services @Accept json @Produce json @Param name path string true "service name" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/services/{name} [get]
func GetTermsAndConditionsStatus ¶
GetTermsAndConditionsStatus godoc @Summary Get terms and conditions @Description Get terms and conditions @Tags tnc @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/tnc [get]
func GetUser ¶
GetUser godoc @Summary Get user @Description Get user based on given id @Tags user @Accept json @Produce json @Param id path string true "user-id for user to be fetched" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/users/{id} [get]
func GetUserConversationMessages ¶
GetUserConversationMessages returns messages for one of the calling user's own conversations.
func GetUserConversations ¶
GetUserConversations returns the list of the calling user's own conversations.
func GetUserQuota ¶
GetUserQuota godoc @Summary Get user quota @Description Get user quota @Tags quota @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/quota [get]
func GetUsers ¶
GetUsers godoc @Summary Get all users @Description Get all users @Tags user @Accept json @Produce json @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/users [get]
func HandleChatWebSocket ¶
HandleChatWebSocket upgrades the connection to WebSocket and handles real-time chat messages for the authenticated user.
func NewGroupRequest ¶
NewGroupRequest godoc @Summary New group request @Description Request to switch to new group @Tags requests @Accept json @Produce json @Param id path string true "group-id for the requested group" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id}/request [post]
func RejectRequest ¶
RejectRequest godoc @Summary Reject request @Description Reject request @Tags requests @Accept json @Produce json @Param id path string true "request-id for the request to be rejected" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/requests/{id}/reject [post]
func RetireCatalog ¶
RetireCatalog godoc @Summary Reire catalog @Description Reire catalog resource @Tags catalogs @Accept json @Produce json @Param name path string true "catalog name to be retired" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/catalogs/{name}/retire [put]
func SetKubeClient ¶
func SetKubeClient(client kubernetes.Client)
func StartAdminReplyWorker ¶
StartAdminReplyWorker drains adminReplyQueue and persists each message to MongoDB. It must be started once from main() before the HTTP server begins accepting requests. It exits when ctx is cancelled (server shutdown).
func UpdateMaintenanceWindow ¶
UpdateMaintenanceWindow godoc @Summary Update a maintenance notification window @Description Update an existing maintenance notification window (admin only) @Tags maintenance @Accept json @Produce json @Param id path string true "Maintenance Window ID" @Param maintenance body models.MaintenanceUpdateRequest true "Maintenance window configuration" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 {object} models.MaintenanceResponse @Router /api/v1/maintenance/{id} [put]
func UpdateQuota ¶
UpdateQuota godoc @Summary Update quota @Description Update quota @Tags quota @Accept json @Produce json @Param quota body models.Quota true "Update quota" @Param id path string true "group-id where quota has to be updated" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/groups/{id}/quota [put]
func UpdateServiceExpiryRequest ¶
UpdateServiceExpiryRequest godoc @Summary Update service expiry request @Description Update service expiry for a particular service @Tags requests @Accept json @Produce json @Param name path string true "service name" @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Success 200 @Router /api/v1/services/{name}/expiry [put]
Types ¶
This section is empty.