daemon

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "dev"
	GitCommit = "unknown"
	BuildDate = "unknown"
)

Version info (set by ldflags during build)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Storage
	StoragePath string `json:"storage_path,omitempty"`

	// Network
	SocketPath string `json:"socket_path,omitempty"`
	Port       int    `json:"port,omitempty"`

	// Logging
	LogLevel string `json:"log_level,omitempty"`
	LogFile  string `json:"log_file,omitempty"`

	// Behavior
	IdleTimeout   time.Duration `json:"idle_timeout,omitempty"`
	EnableSystemd bool          `json:"enable_systemd,omitempty"`

	// Security
	AllowedClients []string `json:"allowed_clients,omitempty"`
}

Config holds daemon configuration

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(path string) error

LoadFromFile loads config from JSON file

func (*Config) SaveToFile

func (c *Config) SaveToFile(path string) error

SaveToFile saves config to JSON file

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults sets default values for config

type Daemon

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

Daemon represents the agent-master daemon

func New

func New(config Config) (*Daemon, error)

New creates a new daemon instance

func (*Daemon) Run

func (d *Daemon) Run(ctx context.Context) error

Run starts the daemon and blocks until shutdown

type FlatFormatTransformer added in v0.1.10

type FlatFormatTransformer struct{}

FlatFormatTransformer transforms config to flat format (mcpServers at root)

func (*FlatFormatTransformer) Format added in v0.1.10

func (f *FlatFormatTransformer) Format() string

func (*FlatFormatTransformer) Transform added in v0.1.10

func (f *FlatFormatTransformer) Transform(config *engine.Config) (interface{}, error)

type LockFile

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

LockFile provides file-based locking using flock

func NewLockFile

func NewLockFile(path string) *LockFile

NewLockFile creates a new lock file instance

func (*LockFile) Release

func (l *LockFile) Release() error

Release releases the lock

func (*LockFile) TryAcquire

func (l *LockFile) TryAcquire() error

TryAcquire attempts to acquire an exclusive lock

type Service

type Service struct {
	pb.UnimplementedAgentMasterDaemonServer
	// contains filtered or unexported fields
}

Service implements the gRPC service

func NewService

func NewService(d *Daemon) *Service

NewService creates a new service instance

func (*Service) AddServer

func (s *Service) AddServer(ctx context.Context, req *pb.AddServerRequest) (*pb.ServerResponse, error)

func (*Service) DisableServer

func (s *Service) DisableServer(ctx context.Context, req *pb.DisableServerRequest) (*pb.ServerResponse, error)

func (*Service) EnableServer

func (s *Service) EnableServer(ctx context.Context, req *pb.EnableServerRequest) (*pb.ServerResponse, error)

Enable/Disable server methods (using proper engine methods)

func (*Service) GetAutoSyncStatus

func (s *Service) GetAutoSyncStatus(ctx context.Context, req *emptypb.Empty) (*pb.AutoSyncStatus, error)

func (*Service) GetConfig added in v0.1.8

func (s *Service) GetConfig(ctx context.Context, req *emptypb.Empty) (*pb.Config, error)

func (*Service) GetProjectConfig added in v0.1.10

func (s *Service) GetProjectConfig(ctx context.Context, req *pb.GetProjectConfigRequest) (*pb.ProjectConfigResponse, error)

func (*Service) GetServer

func (s *Service) GetServer(ctx context.Context, req *pb.GetServerRequest) (*pb.ServerResponse, error)

func (*Service) GetStatus

func (s *Service) GetStatus(ctx context.Context, req *emptypb.Empty) (*pb.DaemonStatus, error)

func (*Service) ListProjects added in v0.1.10

func (s *Service) ListProjects(ctx context.Context, req *emptypb.Empty) (*pb.ListProjectsResponse, error)

func (*Service) ListServers

func (s *Service) ListServers(ctx context.Context, req *pb.ListServersRequest) (*pb.ListServersResponse, error)

ListServers is implemented in service_fixes.go as ListServersCorrected

func (*Service) ListServersCorrected

func (s *Service) ListServersCorrected(ctx context.Context, req *pb.ListServersRequest) (*pb.ListServersResponse, error)

Fixed ListServers to match actual field names

func (*Service) LoadConfig added in v0.1.8

func (s *Service) LoadConfig(ctx context.Context, req *pb.LoadConfigRequest) (*emptypb.Empty, error)

func (*Service) RegisterProject added in v0.1.10

func (s *Service) RegisterProject(ctx context.Context, req *pb.RegisterProjectRequest) (*emptypb.Empty, error)

func (*Service) RemoveServer

func (s *Service) RemoveServer(ctx context.Context, req *pb.RemoveServerRequest) (*emptypb.Empty, error)

func (*Service) SaveConfig added in v0.1.8

func (s *Service) SaveConfig(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)

func (*Service) ScanForProjects added in v0.1.10

func (s *Service) ScanForProjects(ctx context.Context, req *pb.ScanForProjectsRequest) (*pb.ScanForProjectsResponse, error)

Project management methods

func (*Service) SetConfig added in v0.1.8

func (s *Service) SetConfig(ctx context.Context, req *pb.Config) (*emptypb.Empty, error)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)

func (*Service) StartAutoSync

func (s *Service) StartAutoSync(ctx context.Context, req *pb.AutoSyncConfig) (*emptypb.Empty, error)

func (*Service) StopAutoSync

func (s *Service) StopAutoSync(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)

func (*Service) SyncTo

func (s *Service) SyncTo(ctx context.Context, req *pb.SyncToRequest) (*pb.SyncResult, error)

func (*Service) SyncToMultiple

func (s *Service) SyncToMultiple(ctx context.Context, req *pb.SyncToMultipleRequest) (*pb.MultiSyncResult, error)

func (*Service) UpdateServer

func (s *Service) UpdateServer(ctx context.Context, req *pb.UpdateServerRequest) (*pb.ServerResponse, error)

type VersionInfo added in v0.1.10

type VersionInfo struct {
	Version   string
	GitCommit string
	BuildDate string
}

GetVersionInfo returns version information as a struct

func GetVersionInfo added in v0.1.10

func GetVersionInfo() VersionInfo

GetVersionInfo returns the current version information

type ZedFormatTransformer added in v0.1.10

type ZedFormatTransformer struct{}

ZedFormatTransformer transforms config to Zed's format (under context_servers)

func (*ZedFormatTransformer) Format added in v0.1.10

func (z *ZedFormatTransformer) Format() string

func (*ZedFormatTransformer) Transform added in v0.1.10

func (z *ZedFormatTransformer) Transform(config *engine.Config) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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