pack

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentFunction

type ComponentFunction struct {
	ID          string `json:"id"`
	Version     string `json:"version"`
	Enabled     bool   `json:"enabled"`
	Description string `json:"description,omitempty"`
}

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.

Jump to

Keyboard shortcuts

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