Documentation
¶
Index ¶
- type ComponentFunction
- type ComponentManager
- func (cm *ComponentManager) DisableComponent(componentID string) error
- func (cm *ComponentManager) EnableComponent(componentID string) error
- func (cm *ComponentManager) InstallComponent(componentPath string) error
- func (cm *ComponentManager) ListByCategory(category string) []*ComponentManifest
- func (cm *ComponentManager) ListDisabled() map[string]*ComponentManifest
- func (cm *ComponentManager) ListInstalled() map[string]*ComponentManifest
- func (cm *ComponentManager) LoadRegistry() error
- func (cm *ComponentManager) SaveRegistry() error
- func (cm *ComponentManager) UninstallComponent(componentID string) error
- type ComponentManifest
- type ComponentRegistry
- type TypeRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentFunction ¶
type ComponentManager ¶
type ComponentManager struct {
// contains filtered or unexported fields
}
ComponentManager manages function components only Backend core functions (auth, users, roles, audit) are not managed here
func NewComponentManager ¶
func NewComponentManager(dataDir string) *ComponentManager
func (*ComponentManager) DisableComponent ¶
func (cm *ComponentManager) DisableComponent(componentID string) error
func (*ComponentManager) EnableComponent ¶
func (cm *ComponentManager) EnableComponent(componentID string) error
func (*ComponentManager) InstallComponent ¶
func (cm *ComponentManager) InstallComponent(componentPath string) error
func (*ComponentManager) ListByCategory ¶
func (cm *ComponentManager) ListByCategory(category string) []*ComponentManifest
func (*ComponentManager) ListDisabled ¶
func (cm *ComponentManager) ListDisabled() map[string]*ComponentManifest
func (*ComponentManager) ListInstalled ¶
func (cm *ComponentManager) ListInstalled() map[string]*ComponentManifest
func (*ComponentManager) LoadRegistry ¶
func (cm *ComponentManager) LoadRegistry() error
func (*ComponentManager) SaveRegistry ¶
func (cm *ComponentManager) SaveRegistry() error
func (*ComponentManager) UninstallComponent ¶
func (cm *ComponentManager) UninstallComponent(componentID string) error
type ComponentManifest ¶
type ComponentManifest struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Category string `json:"category"` // player, item, economy, social, etc.
Dependencies []string `json:"dependencies,omitempty"`
Functions []ComponentFunction `json:"functions"`
Author string `json:"author,omitempty"`
License string `json:"license,omitempty"`
}
type ComponentRegistry ¶
type ComponentRegistry struct {
Installed map[string]*ComponentManifest `json:"installed"`
Disabled map[string]*ComponentManifest `json:"disabled"`
}
type TypeRegistry ¶
type TypeRegistry struct {
// contains filtered or unexported fields
}
TypeRegistry wraps protobuf descriptor registries for dynamic (un)marshal.
func NewTypeRegistry ¶
func NewTypeRegistry() *TypeRegistry
func (*TypeRegistry) JSONToProtoBin ¶
func (r *TypeRegistry) JSONToProtoBin(typeFQN string, jsonBytes []byte) ([]byte, error)
JSONToProtoBin converts JSON payload into binary protobuf for the given FQN.
func (*TypeRegistry) LoadFDS ¶
func (r *TypeRegistry) LoadFDS(b []byte) error
LoadFDS loads a FileDescriptorSet bytes into the registry.
func (*TypeRegistry) LoadFDSFromDir ¶
func (r *TypeRegistry) LoadFDSFromDir(dir string) error
LoadFDSFromDir reads all *.pb files in dir and loads as FileDescriptorSet.
func (*TypeRegistry) ProtoBinToJSON ¶
func (r *TypeRegistry) ProtoBinToJSON(typeFQN string, bin []byte) ([]byte, error)
ProtoBinToJSON converts binary protobuf into JSON for the given FQN.
Click to show internal directories.
Click to hide internal directories.