config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

ConfigPath returns the full path to the config file.

func Exists

func Exists() bool

Exists checks if a config file exists.

func Save

func Save(cfg *AgentConfig) error

Save writes the config to disk atomically (write to .tmp, then rename).

Types

type AgentConfig

type AgentConfig struct {
	AgentID          string    `json:"agent_id"`
	AgentToken       string    `json:"agent_token"`
	APIBaseURL       string    `json:"api_base_url"`
	Name             string    `json:"name"`
	Debug            bool      `json:"debug"`
	InitializedRepos []string  `json:"initialized_repos,omitempty"`
	LastETag         string    `json:"last_etag,omitempty"`
	LastBackupAt     string    `json:"last_backup_at,omitempty"`
	StartedAt        time.Time `json:"started_at,omitempty"`
}

AgentConfig is the persistent agent configuration stored locally.

func Load

func Load() (*AgentConfig, error)

Load reads the config from disk.

func (*AgentConfig) IsRepoInitialized

func (c *AgentConfig) IsRepoInitialized(repoID string) bool

IsRepoInitialized checks if a repo has been initialized before.

func (*AgentConfig) MarkRepoInitialized

func (c *AgentConfig) MarkRepoInitialized(repoID string)

MarkRepoInitialized adds a repo to the initialized list.

Jump to

Keyboard shortcuts

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