Documentation
¶
Overview ¶
File: hub/server.go
Index ¶
- type AgentFile
- type AgentVersions
- type Config
- type DefinationRegistry
- type InMemoryRegistry
- type SQLiteRegistry
- func (r *SQLiteRegistry) Close() error
- func (r *SQLiteRegistry) Get(name, version string) (*AgentFile, error)
- func (r *SQLiteRegistry) GetAgentDef(name, version string) (*types.AgentDefinition, error)
- func (r *SQLiteRegistry) GetJSON(name, version string) ([]byte, error)
- func (r *SQLiteRegistry) ListAgents() error
- func (r *SQLiteRegistry) Store(name, version string, agent *AgentFile) error
- type Server
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentFile ¶
type AgentFile struct {
Name string `json:"name"`
Version string `json:"version"`
Content string `json:"content"`
Metadata map[string]string `json:"metadata"`
CreateTime int64 `json:"create_time"`
}
AgentFile represents the metadata and content of an agent
type AgentVersions ¶
type Config ¶
type Config struct {
Address string // Server address (e.g., ":8080")
BaseURL string // Base URL for the server
Timeout time.Duration // Operation timeout
}
Config holds configuration for the AgentsHub
type DefinationRegistry ¶
type DefinationRegistry interface {
Store(name, version string, agent *AgentFile) error
Get(name, version string) (*AgentFile, error)
GetJSON(name, version string) ([]byte, error)
GetAgentDef(name, version string) (*types.AgentDefinition, error)
Close() error
}
DefinationRegistry defines the interface for agent defination registry
type InMemoryRegistry ¶
type InMemoryRegistry struct {
// contains filtered or unexported fields
}
func NewInMemoryRegistry ¶
func NewInMemoryRegistry() *InMemoryRegistry
func (*InMemoryRegistry) Close ¶
func (r *InMemoryRegistry) Close() error
func (*InMemoryRegistry) Get ¶
func (r *InMemoryRegistry) Get(name, version string) (*AgentFile, error)
type SQLiteRegistry ¶
type SQLiteRegistry struct {
// contains filtered or unexported fields
}
func GetSQLiteRegistry ¶
func GetSQLiteRegistry() (*SQLiteRegistry, error)
func (*SQLiteRegistry) Close ¶
func (r *SQLiteRegistry) Close() error
func (*SQLiteRegistry) GetAgentDef ¶
func (r *SQLiteRegistry) GetAgentDef(name, version string) (*types.AgentDefinition, error)
func (*SQLiteRegistry) GetJSON ¶
func (r *SQLiteRegistry) GetJSON(name, version string) ([]byte, error)
func (*SQLiteRegistry) ListAgents ¶
func (r *SQLiteRegistry) ListAgents() error
Click to show internal directories.
Click to hide internal directories.