Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*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.
Click to show internal directories.
Click to hide internal directories.