server

package
v0.0.19-pre1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyAuthTokenErr = errors.New("empty auth token")
View Source
var GradientSeed = 71
View Source
var StaticFiles embed.FS

Functions

This section is empty.

Types

type AdminPortalData

type AdminPortalData struct {
	PopularKeywords  []string `json:"popular_keywords"`
	FavoriteProjects []any    `json:"favorite_projects"`
}

type AuthedFunc

type AuthedFunc func(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

type CreateDeviceRequest

type CreateDeviceRequest struct {
	Name string `json:"name" binding:"required"`
}

type CreateSpaceFolderRequest

type CreateSpaceFolderRequest struct {
	Name string `json:"name" binding:"required"`
	Path string `json:"path"`
}

type EmitSignalRequest

type EmitSignalRequest struct {
	SignalKey      string         `json:"signal_key"`
	EmitterSpaceID int64          `json:"emitter_space_id"`
	Payload        any            `json:"payload"`
	Metadata       map[string]any `json:"metadata"`
}

type Gradient

type Gradient struct {
	Start string
	End   string
}

type InstallPackageRequest

type InstallPackageRequest struct {
	URL string `json:"url"`
}

type InstallRequest

type InstallRequest struct {
	Name     string `json:"name"`
	RepoSlug string `json:"repo_slug,omitempty"`
	Version  string `json:"version,omitempty"`
}

type Option

type Option struct {
	ExecId      string
	Port        int
	Ctrl        *actions.Controller
	Signer      *signer.Signer
	Engine      *engine.Engine
	Hosts       []string
	GlobalJS    string
	SiteName    string
	LocalSocket string
	BaseRouter  *gin.Engine

	RunPortNoBind bool

	BuddyHub buddyhub.IBuddyHub
	CoreHub  *corehub.CoreHub

	Logger *slog.Logger

	OnStart func()
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opt Option) *Server

func (*Server) AuthorizeSpace

func (a *Server) AuthorizeSpace(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) BindRemoteBinds

func (s *Server) BindRemoteBinds(rg *gin.RouterGroup)

func (*Server) CreateSignal

func (a *Server) CreateSignal(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSignal creates a new signal

func (*Server) CreateSpaceCapability

func (a *Server) CreateSpaceCapability(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSpaceCapability creates a new capability Can be created at package level (space_id=0 or omitted) or space level (space_id>0)

func (*Server) CreateSpaceKV

func (a *Server) CreateSpaceKV(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSpaceKV creates a new KV entry

func (*Server) CreateSpacePlugin

func (a *Server) CreateSpacePlugin(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSpacePlugin attaches an AppPlugin to a space

func (*Server) CreateSpaceUser

func (a *Server) CreateSpaceUser(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSpaceUser creates a new space user

func (*Server) CreateSpaceUserGroup

func (a *Server) CreateSpaceUserGroup(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

CreateSpaceUserGroup creates a new space user group

func (*Server) DeletePackage

func (a *Server) DeletePackage(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) DeletePackageFile

func (a *Server) DeletePackageFile(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) DeleteSignal

func (a *Server) DeleteSignal(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSignal deletes a signal

func (*Server) DeleteSpaceCapability

func (a *Server) DeleteSpaceCapability(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSpaceCapability deletes a capability

func (*Server) DeleteSpaceKV

func (a *Server) DeleteSpaceKV(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSpaceKV deletes a KV entry

func (*Server) DeleteSpacePlugin

func (a *Server) DeleteSpacePlugin(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSpacePlugin unplugs a plugin from a space

func (*Server) DeleteSpaceUser

func (a *Server) DeleteSpaceUser(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSpaceUser deletes a space user

func (*Server) DeleteSpaceUserGroup

func (a *Server) DeleteSpaceUserGroup(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

DeleteSpaceUserGroup deletes a space user group

func (*Server) Doc

func (s *Server) Doc(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) DownloadPackageFile

func (a *Server) DownloadPackageFile(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) EmitSignal

func (a *Server) EmitSignal(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

EmitSignal publishes a signal for testing/triggering

func (*Server) ExportState

func (a *Server) ExportState(ctx *gin.Context)

func (*Server) GeneratePackageDevToken

func (a *Server) GeneratePackageDevToken(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetInstalledPackageInfo

func (a *Server) GetInstalledPackageInfo(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetPackageAvailableVersions

func (a *Server) GetPackageAvailableVersions(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetPackageEnvs

func (a *Server) GetPackageEnvs(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetPackageFile

func (a *Server) GetPackageFile(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetSignal

func (a *Server) GetSignal(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSignal gets a specific signal by ID

func (*Server) GetSpaceCapability

func (a *Server) GetSpaceCapability(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSpaceCapability gets a specific capability by ID

func (*Server) GetSpaceDataTable

func (a *Server) GetSpaceDataTable(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetSpaceKV

func (a *Server) GetSpaceKV(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSpaceKV gets a specific KV entry by ID

func (*Server) GetSpacePlugin

func (a *Server) GetSpacePlugin(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSpacePlugin gets a specific space plugin by ID

func (*Server) GetSpaceSpec

func (a *Server) GetSpaceSpec(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) GetSpaceUser

func (a *Server) GetSpaceUser(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSpaceUser gets a specific space user by ID

func (*Server) GetSpaceUserGroup

func (a *Server) GetSpaceUserGroup(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

GetSpaceUserGroup gets a specific space user group by ID

func (*Server) ImportState

func (a *Server) ImportState(ctx *gin.Context)

func (*Server) InstallPackage

func (a *Server) InstallPackage(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) InstallPackageRepo

func (a *Server) InstallPackageRepo(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) InstallPackageZip

func (a *Server) InstallPackageZip(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListAvailablePlugins

func (a *Server) ListAvailablePlugins(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListAvailablePlugins lists all AppPlugin spaces available to be plugged

func (*Server) ListCapabilityTypes

func (a *Server) ListCapabilityTypes(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListCapabilityTypes lists all available capability type definitions

func (*Server) ListEPackages

func (a *Server) ListEPackages(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListGradients

func (a *Server) ListGradients(ctx *gin.Context)

func (*Server) ListInstalledSpaces

func (a *Server) ListInstalledSpaces(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListPackageFiles

func (a *Server) ListPackageFiles(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListRepos

func (a *Server) ListRepos(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListSignalEvents

func (a *Server) ListSignalEvents(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSignalEvents lists signal event execution history (targets)

func (*Server) ListSignals

func (a *Server) ListSignals(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSignals lists all signals for a space/package

func (*Server) ListSpaceCapabilities

func (a *Server) ListSpaceCapabilities(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSpaceCapabilities lists all capabilities for a package/space Supports both package-level (space_id=0) and space-level (space_id>0) capabilities

func (*Server) ListSpaceDataTables

func (a *Server) ListSpaceDataTables(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListSpaceKV

func (a *Server) ListSpaceKV(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) ListSpacePlugins

func (a *Server) ListSpacePlugins(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSpacePlugins lists all plugins attached to a space/package

func (*Server) ListSpaceUserGroups

func (a *Server) ListSpaceUserGroups(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSpaceUserGroups lists all user groups for a space/package

func (*Server) ListSpaceUsers

func (a *Server) ListSpaceUsers(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

ListSpaceUsers lists all users for a space/package

func (*Server) PushPackage

func (a *Server) PushPackage(ctx *gin.Context)

func (*Server) QuerySQLDataTable

func (a *Server) QuerySQLDataTable(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) QuerySpaceDataTable

func (a *Server) QuerySpaceDataTable(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) RootRoute

func (s *Server) RootRoute() gin.HandlerFunc

func (*Server) ServePluginLoaders

func (a *Server) ServePluginLoaders(ctx *gin.Context)

ServePluginLoaders returns the concatenated plugin loader script for a space

func (*Server) Start

func (s *Server) Start() error

func (*Server) UpdatePackageEnvs

func (a *Server) UpdatePackageEnvs(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) UpdateSignal

func (a *Server) UpdateSignal(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSignal updates an existing signal

func (*Server) UpdateSignalTargetStatus

func (a *Server) UpdateSignalTargetStatus(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSignalTargetStatus updates the status of a signal target (e.g. block/unblock)

func (*Server) UpdateSpaceCapability

func (a *Server) UpdateSpaceCapability(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSpaceCapability updates an existing capability

func (*Server) UpdateSpaceKV

func (a *Server) UpdateSpaceKV(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSpaceKV updates an existing KV entry

func (*Server) UpdateSpacePlugin

func (a *Server) UpdateSpacePlugin(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSpacePlugin updates an existing space plugin connection

func (*Server) UpdateSpaceUser

func (a *Server) UpdateSpaceUser(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSpaceUser updates an existing space user

func (*Server) UpdateSpaceUserGroup

func (a *Server) UpdateSpaceUserGroup(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

UpdateSpaceUserGroup updates an existing space user group

func (*Server) UpgradePackageRepo

func (a *Server) UpgradePackageRepo(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) UpgradePackageZip

func (a *Server) UpgradePackageZip(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

func (*Server) UploadPackageFile

func (a *Server) UploadPackageFile(claim *signer.AccessClaim, ctx *gin.Context) (any, error)

type UNIXRpcRequest

type UNIXRpcRequest = xtypes.UNIXRpcRequest

type UNIXRpcResponse

type UNIXRpcResponse = xtypes.UNIXRpcResponse

type UpdateBioRequest

type UpdateBioRequest struct {
	Bio string `json:"bio"`
}

type UpdateRootRoutingReq

type UpdateRootRoutingReq struct {
	Routes map[string]*engine.RootRouteTarget `json:"routes"`
}

type UpdateTargetStatusRequest

type UpdateTargetStatusRequest struct {
	Status string `json:"status"` // blocked, new
	Reason string `json:"reason"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址