server

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: BSD-3-Clause Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(workspace string) error

func ServeContext

func ServeContext(ctx context.Context, workspace string, opts ServeOptions) (err error)

func ServeWithOptions

func ServeWithOptions(workspace string, opts ServeOptions) error

Types

type AgentHostConfig

type AgentHostConfig struct {
	RuntimeStore string                      `yaml:"runtime_store"`
	Persistence  *AgentHostPersistenceConfig `yaml:"persistence"`
}

AgentHostConfig binds AgentHost persistence capabilities to logical Stores. A non-nil value selects explicit mode, including when every field is omitted.

type AgentHostPersistenceConfig added in v0.26.1

type AgentHostPersistenceConfig struct {
	StateStore   string `yaml:"state_store"`
	HistoryStore string `yaml:"history_store"`
}

AgentHostPersistenceConfig binds shared Agent state and internal history to logical Stores owned by the command-layer Store Registry.

type CmdServer

type CmdServer struct {
	*gizclaw.Server
	AdminPublicKey giznet.PublicKey
	// contains filtered or unexported fields
}

CmdServer owns the command-layer store registry for a gizclaw server.

func New

func New(cfg Config) (srv *CmdServer, err error)

func (*CmdServer) Close

func (s *CmdServer) Close() error

func (*CmdServer) ServeHTTP

func (s *CmdServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Config

type Config struct {
	// PeerAdmission selects open (default) or registration-token admission.
	PeerAdmission   string
	Monitor         monitor.Config
	WorkspaceRoot   string `yaml:"-"`
	KeyPair         *giznet.KeyPair
	WebRTC          WebRTCConfig
	HTTP            HTTPConfig
	EdgeNodes       []giznet.PublicKey
	ICEServers      []gizwebrtc.ICEServer
	AdminPublicKey  giznet.PublicKey
	Storage         map[string]storage.Config
	Stores          map[string]store.Config
	Services        *ServicesConfig
	Friends         FriendsConfig
	FriendGroups    FriendGroupsConfig
	Speech          SpeechConfig
	PendingDeletion PendingDeletionConfig
	Profiling       ProfilingConfig
}

func DefaultConfig

func DefaultConfig() Config

func (Config) ICEListenAddr

func (cfg Config) ICEListenAddr() string

func (Config) PublicAPIListenAddr

func (cfg Config) PublicAPIListenAddr() string

type ConfigFile

type ConfigFile struct {
	PeerAdmission   string                       `yaml:"peer-admission"`
	Monitor         monitor.Config               `yaml:"monitor"`
	Identity        IdentityConfig               `yaml:"identity"`
	WebRTC          *WebRTCConfig                `yaml:"webrtc"`
	HTTP            *HTTPConfig                  `yaml:"http"`
	EdgeNodes       []giznet.PublicKey           `yaml:"edge-nodes"`
	ICEServers      []gizwebrtc.ICEServer        `yaml:"ice-servers"`
	AdminPublicKey  giznet.PublicKey             `yaml:"admin-public-key"`
	Storage         map[string]storageFileConfig `yaml:"storage"`
	Stores          map[string]storeFileConfig   `yaml:"stores"`
	Services        *ServicesConfig              `yaml:"services"`
	Friends         FriendsConfig                `yaml:"friends"`
	FriendGroups    FriendGroupsConfig           `yaml:"friend_groups"`
	Speech          SpeechConfig                 `yaml:"speech"`
	PendingDeletion PendingDeletionConfig        `yaml:"pending_deletion"`
	Profiling       ProfilingConfig              `yaml:"profiling"`
}

func LoadConfig

func LoadConfig(path string) (ConfigFile, error)

type FriendGroupsConfig

type FriendGroupsConfig struct{}

type FriendsConfig

type FriendsConfig struct{}

type HTTPConfig added in v0.13.0

type HTTPConfig struct {
	Listeners []HTTPListenerConfig `yaml:"listeners"`
}

HTTPConfig defines the ordered Server HTTP and HTTPS listeners.

type HTTPListenerConfig added in v0.13.0

type HTTPListenerConfig struct {
	Listen string                `yaml:"listen"`
	TLS    HTTPListenerTLSConfig `yaml:"tls"`
}

HTTPListenerConfig defines one Server HTTP bind address and optional TLS files.

type HTTPListenerTLSConfig added in v0.13.0

type HTTPListenerTLSConfig struct {
	CertFile string `yaml:"cert-file"`
	KeyFile  string `yaml:"key-file"`
}

HTTPListenerTLSConfig enables TLS when both certificate files are set.

type IdentityConfig

type IdentityConfig struct {
	PrivateKey giznet.Key `yaml:"private-key"`
}

type PendingDeletionConfig

type PendingDeletionConfig struct {
	ScanInterval     string `yaml:"scan_interval"`
	PageSize         int    `yaml:"page_size"`
	DispatchCapacity int    `yaml:"dispatch_capacity"`
	Workers          int    `yaml:"workers"`
	LeaseDuration    string `yaml:"lease_duration"`
	AttemptTimeout   string `yaml:"attempt_timeout"`
	RetryInitial     string `yaml:"retry_initial"`
	RetryMax         string `yaml:"retry_max"`
	MaxAttempts      int    `yaml:"max_attempts"`
}

type ProfilingConfig added in v0.4.0

type ProfilingConfig struct {
	Enabled bool   `yaml:"enabled"`
	Store   string `yaml:"store"`
}

ProfilingConfig controls persistent Go runtime snapshots for the Server process.

type SFUConfig added in v0.15.0

type SFUConfig struct {
	URL              string `yaml:"url"`
	APIKeyFile       string `yaml:"api_key_file"`
	APISecretFile    string `yaml:"api_secret_file"`
	RecheckInterval  string `yaml:"recheck_interval"`
	ReconnectTimeout string `yaml:"reconnect_timeout"`
	// TalkHangover closes a Peer's talk utterance after that long without a
	// voiced Opus frame; FloorIdle releases the downlink floor after that
	// long without a voiced packet from its holder.
	TalkHangover string `yaml:"talk_hangover"`
	FloorIdle    string `yaml:"floor_idle"`
}

SFUConfig binds the Server to one SFU signaling endpoint. Credentials are only ever loaded from files at startup; a missing section disables SFU Workspaces on this Server.

type ServeOptions

type ServeOptions struct {
	Force bool
}

type ServicesConfig added in v0.2.0

type ServicesConfig struct {
	Peer            *SingleStoreConfig     `yaml:"peer"`
	PeerUsage       *SingleStoreConfig     `yaml:"peer_usage"`
	PeerRun         *SingleStoreConfig     `yaml:"peer_run"`
	APIKey          *SingleStoreConfig     `yaml:"api_key"`
	Credential      *SingleStoreConfig     `yaml:"credential"`
	Firmware        *SingleStoreConfig     `yaml:"firmware"`
	RuntimeProfile  *SingleStoreConfig     `yaml:"runtime_profile"`
	Model           *SingleStoreConfig     `yaml:"model"`
	Voice           *SingleStoreConfig     `yaml:"voice"`
	MemoryLayout    *SingleStoreConfig     `yaml:"memory_layout"`
	ProviderTenants *SingleStoreConfig     `yaml:"provider_tenants"`
	Workflow        *SingleStoreConfig     `yaml:"workflow"`
	Workspace       *WorkspaceStoresConfig `yaml:"workspace"`
	SFU             *SFUConfig             `yaml:"sfu"`
	Toolkit         *SingleStoreConfig     `yaml:"toolkit"`
	Contact         *SingleStoreConfig     `yaml:"contact"`
	Friend          *SingleStoreConfig     `yaml:"friend"`
	FriendGroup     *SingleStoreConfig     `yaml:"friend_group"`
	AgentHost       *AgentHostConfig       `yaml:"agent_host"`
	Metrics         *SingleStoreConfig     `yaml:"metrics"`
	SystemLog       *gizlog.Config         `yaml:"system_log"`
}

ServicesConfig is the fixed service-to-Store binding schema. Unlike the storage and stores registries, service names are not operator-defined.

type SingleStoreConfig added in v0.2.0

type SingleStoreConfig struct {
	Store string `yaml:"store"`
}

type SpeechConfig

type SpeechConfig struct {
	Transcription SpeechTranscriptionConfig `yaml:"transcription"`
	Extraction    SpeechExtractionConfig    `yaml:"extraction"`
	Synthesis     SpeechSynthesisConfig     `yaml:"synthesis"`
}

type SpeechExtractionConfig

type SpeechExtractionConfig struct {
	MaxSchemaBytes      int64  `yaml:"max_schema_bytes"`
	MaxSchemaDepth      int64  `yaml:"max_schema_depth"`
	MaxSchemaProperties int64  `yaml:"max_schema_properties"`
	MaxInstructionBytes int64  `yaml:"max_instruction_bytes"`
	MaxResultBytes      int64  `yaml:"max_result_bytes"`
	RequestTimeout      string `yaml:"request_timeout"`
}

type SpeechSynthesisConfig

type SpeechSynthesisConfig struct {
	MaxTextBytes   int64  `yaml:"max_text_bytes"`
	MaxOutputBytes int64  `yaml:"max_output_bytes"`
	RequestTimeout string `yaml:"request_timeout"`
}

type SpeechTranscriptionConfig

type SpeechTranscriptionConfig struct {
	MaxAudioBytes    int64  `yaml:"max_audio_bytes"`
	MaxAudioDuration string `yaml:"max_audio_duration"`
	RequestTimeout   string `yaml:"request_timeout"`
}

type WebRTCConfig added in v0.13.0

type WebRTCConfig struct {
	Listen   string `yaml:"listen"`
	Endpoint string `yaml:"endpoint"`
}

WebRTCConfig defines the Server WebRTC transport bind and published tuples.

type WorkspaceStoresConfig added in v0.2.0

type WorkspaceStoresConfig struct {
	Store              string `yaml:"store"`
	HistoryStore       string `yaml:"history_store"`
	HistoryAssetsStore string `yaml:"history_assets_store"`
	AssetsStore        string `yaml:"assets_store"`
}

Jump to

Keyboard shortcuts

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