package meta import "glchat/internal/config" const APIVersion = "v1" type Features struct { RegistrationEnabled bool `json:"registration_enabled"` AntiBotEnabled bool `json:"anti_bot_enabled"` VoiceEnabled bool `json:"voice_enabled"` WebPushEnabled bool `json:"web_push_enabled"` OAuthEnabled bool `json:"oauth_enabled"` PasskeysEnabled bool `json:"passkeys_enabled"` } type Response struct { Name string `json:"name"` Version string `json:"version"` Commit string `json:"commit"` BuildDate string `json:"build_date"` APIVersion string `json:"api_version"` BaseURL string `json:"base_url"` FilesURL string `json:"files_url"` GatewayURL string `json:"gateway_url"` RTCPath string `json:"rtc_path"` MaxUploadSize int64 `json:"max_upload_size"` Features Features `json:"features"` } func New(cfg config.Config) Response { return Response{ Name: cfg.InstanceName, Version: cfg.Version, Commit: cfg.Commit, BuildDate: cfg.BuildDate, APIVersion: APIVersion, BaseURL: cfg.BaseURL(), FilesURL: cfg.FilesURL(), GatewayURL: "wss://" + cfg.Domain + "/gateway", RTCPath: "/rtc", MaxUploadSize: cfg.MaxUploadSize, Features: Features{ RegistrationEnabled: true, AntiBotEnabled: false, VoiceEnabled: false, WebPushEnabled: false, OAuthEnabled: false, PasskeysEnabled: false, }, } }