schema

package
v0.0.0-...-deba36d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const AgentPath = "/usr/local/bin/dogoagent"

Variables

This section is empty.

Functions

This section is empty.

Types

type CalculateCommandsArgs

type CalculateCommandsArgs struct {
	Modules          interface{}
	State            interface{}
	LocalCommands    *commandtree.RootCommand
	RemoteCommands   *commandtree.RootCommand
	RemoteConnection ServerConnection
	Environment      *Environment
	Config           *Config
	Logf             func(format string, args ...interface{})
	Errf             func(format string, args ...interface{})
	Err              func(err error)
}

type CalculateGetStateQueryArgs

type CalculateGetStateQueryArgs struct {
	Modules interface{}
	Logf    func(format string, args ...interface{})
	Errf    func(format string, args ...interface{})
	Err     func(err error)
}

type Command

type Command struct {
	Local    bool       `` /* 144-byte string literal not displayed */
	Tunnels  []string   `description:"Tunnels required to execute this command. They'll be avalaible in the 'tunnels' template variable."`
	Commands []Template `required:"true" description:"The shell commands to run"`
	Target   Template   `` /* 159-byte string literal not displayed */
}

Command is a command added to a dogo configuration file

type Config

type Config struct {
	Environments   map[string]*Environment
	Packages       map[string]*Package
	TemplateSource TemplateSource
}

type ConsoleLogger

type ConsoleLogger struct{}

func (*ConsoleLogger) Err

func (l *ConsoleLogger) Err(err error)

func (*ConsoleLogger) Errf

func (l *ConsoleLogger) Errf(format string, args ...interface{})

func (*ConsoleLogger) Logf

func (l *ConsoleLogger) Logf(format string, args ...interface{})

func (*ConsoleLogger) SetProgress

func (l *ConsoleLogger) SetProgress(progress float64)

type DeploymentHook

type DeploymentHook struct {
	RunBeforeDeployment bool
	RunAfterDeployment  bool
	CommandPackage      string
	CommandName         string
	Command             *Command
}

type Environment

type Environment struct {
	Name               string
	Vars               map[string]interface{}
	ManagerGroups      map[string][]interface{} // managername => groups
	Resources          map[string]*Resource
	ResourcesByPackage map[string][]*Resource
	DeploymentHooks    []*DeploymentHook
}

type Logger

type Logger interface {
	Logf(format string, args ...interface{})
	Errf(format string, args ...interface{})
	Err(err error)
	SetProgress(progress float64)
}

type ModuleManager

type ModuleManager struct {
	Name                   string
	ModulePrototype        interface{}
	StatePrototype         interface{}
	CalculateGetStateQuery func(c *CalculateGetStateQueryArgs) (interface{}, error)
	GetState               func(query interface{}) (interface{}, error)
	CalculateCommands      func(c *CalculateCommandsArgs) error
	GobRegister            func()
}

ModuleManager manages state for a piece of software on a server

type Package

type Package struct {
	Name     string
	Tunnels  map[string]*Tunnel
	Commands map[string]*Command
	Modules  []*PackageModule
}

type PackageModule

type PackageModule struct {
	ModuleName       string
	Config           map[string]interface{}
	OriginalLocation string
}

type PrefixLogger

type PrefixLogger struct {
	Prefix string
	Output Logger
}

func (*PrefixLogger) Err

func (l *PrefixLogger) Err(err error)

func (*PrefixLogger) Errf

func (l *PrefixLogger) Errf(format string, args ...interface{})

func (*PrefixLogger) Logf

func (l *PrefixLogger) Logf(format string, args ...interface{})

func (*PrefixLogger) SetProgress

func (l *PrefixLogger) SetProgress(progress float64)

type Resource

type Resource struct {
	Name              string
	Manager           *ResourceManager
	ManagerGroup      interface{}
	Resource          interface{}
	ProvisioningGroup int
	Packages          map[string]bool // packagename => used on this resource
	Data              map[string]interface{}
	Modules           map[string]interface{}
}

Resource represents a resource in a deployment infrastructure, such as a server or load balancer or firewall

type ResourceManager

type ResourceManager struct {
	Name              string
	GroupPrototype    interface{}
	ResourcePrototype interface{}
	Provision         func(group interface{}, resource interface{}, l Logger) error
	FindUnused        func(shouldExist map[interface{}][]string, decommisionRoot *commandtree.Command, l Logger) ([]string, error)
}

type ServerConnection

type ServerConnection interface {
	Shell(cmd string, stderr, stdout io.Writer, stdin io.Reader, width, height int) error
	ExecutePipeCommand(command string, pipesFunc func(reader io.Reader, errorReader io.Reader, writer io.Writer) error) error
	ExecuteCommand(command string) (string, error)
	WriteFile(path string, mode os.FileMode, contentLength int64, content io.Reader, sudo bool, progress func(float64)) error
	StartTunnel(localPort int, remotePort int, remoteHost string, reverse bool) (listeningLocalPort int, err error)
	Close() error
}

ServerConnection is a connection to a ServerResource

type ServerResource

type ServerResource interface {
	OpenConnection() (ServerConnection, error)
}

ServerResource is a resource we can connect via SSH

type ServerState

type ServerState struct {
	Version string
	OS      string
	Arch    string
	UID     int
	Modules map[string]interface{}
}

ServerState is the current state of several modules on a server

type Template

type Template interface {
	Render(extraArgs map[string]interface{}) (string, error)
	RenderFile(extraArgs map[string]interface{}) (io.ReadCloser, int64, os.FileMode, error)
	RenderFileBytes(extraArgs map[string]interface{}) ([]byte, error)
}

type TemplateSource

type TemplateSource interface {
	NewTemplate(location string, template string, templateVars map[string]interface{}) (Template, error)
	AddGlobal(key string, value interface{})
}

type Tunnel

type Tunnel struct {
	Port int      `required:"true" description:"the local port to to use for the tunnel"`
	Host Template `` /* 263-byte string literal not displayed */
}

Tunnel represents information about a socket tunnel (typically SSH tunnel)

Jump to

Keyboard shortcuts

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