Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package pluginapi
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/mattermost/mattermost/server/public/plugin"
|
|
)
|
|
|
|
// SessionService exposes methods to manipulate groups.
|
|
type SessionService struct {
|
|
api plugin.API
|
|
}
|
|
|
|
// Get returns the session object for the Session ID
|
|
//
|
|
// Minimum server version: 5.2
|
|
func (s *SessionService) Get(id string) (*model.Session, error) {
|
|
session, appErr := s.api.GetSession(id)
|
|
|
|
return session, normalizeAppErr(appErr)
|
|
}
|
|
|
|
// Create creates a new user session.
|
|
//
|
|
// Minimum server version: 6.2
|
|
func (s *SessionService) Create(session *model.Session) (*model.Session, error) {
|
|
session, appErr := s.api.CreateSession(session)
|
|
|
|
return session, normalizeAppErr(appErr)
|
|
}
|
|
|
|
// ExtendSessionExpiry extends the duration of an existing session.
|
|
//
|
|
// Minimum server version: 6.2
|
|
func (s *SessionService) ExtendExpiry(sessionID string, newExpiry int64) error {
|
|
return normalizeAppErr(s.api.ExtendSessionExpiry(sessionID, newExpiry))
|
|
}
|
|
|
|
// RevokeSession revokes an existing user session.
|
|
//
|
|
// Minimum server version: 6.2
|
|
func (s *SessionService) Revoke(sessionID string) error {
|
|
return normalizeAppErr(s.api.RevokeSession(sessionID))
|
|
}
|