agent

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AgentCmd = &cobra.Command{
	Use:   "agent",
	Short: "Start the agent process",
	Args:  cobra.NoArgs,
	Run: func(cmd *cobra.Command, args []string) {
		config, err := config.GetConfig()
		if err != nil {
			log.Fatal(err)
		}

		git := &git.Service{
			ProjectDir:        config.ProjectDir,
			GitConfigFileName: path.Join(os.Getenv("HOME"), ".gitconfig"),
		}

		sshServer := &ssh.Server{
			ProjectDir:        config.ProjectDir,
			DefaultProjectDir: os.Getenv("HOME"),
		}

		tailscaleServer := &tailscale.Server{
			WorkspaceId: config.WorkspaceId,
			ProjectName: config.ProjectName,
			ServerUrl:   config.Server.Url,
		}

		agent := agent.Agent{
			Config:    config,
			Git:       git,
			Ssh:       sshServer,
			Tailscale: tailscaleServer,
		}

		err = agent.Start()
		if err != nil {
			log.Fatal(err)
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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