server

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserDataRender = errors.New("userdata render error")

	ImageNotFoundSuggestion = fmt.Sprintf(strings.Join([]string{
		"please provide image ID manually in configuration",
		"create image with `%s` selector",
	}, " or "), selector)
	ImageNotFoundMessage = strings.Join([]string{
		"can not obtain image ID automatically",
		"failed to get image",
	}, ": ")
)
View Source
var ErrMarshalYaml = errors.New("yaml marshal error")

Functions

This section is empty.

Types

type CloudInit

type CloudInit struct {
	SSHPwauth  bool `yaml:"ssh_pwauth"`
	Users      []*CloudInitUserCloud
	Hostname   string
	Chpasswd   *CloudInitChpasswd
	GrowPart   *CloudInitGrowPart
	WriteFiles []*CloudInitWriteFile `yaml:"write_files,omitempty"`
	RunCMD     []string              `yaml:"runcmd,omitempty"`
	// This is internal field for storing pulumi input
	Inputs *CloudInitPulumiInputs `yaml:"-"`
}

type CloudInitChpasswd

type CloudInitChpasswd struct {
	Expire bool
	Users  []*CloudInitChpasswdUser
}

type CloudInitChpasswdUser

type CloudInitChpasswdUser struct {
	Name     string
	Type     string
	Password string
}

type CloudInitGrowPart

type CloudInitGrowPart struct {
	Devices []string
}

type CloudInitPulumiInputs

type CloudInitPulumiInputs struct {
	Key *pulumi.StringOutput
}

type CloudInitUserCloud

type CloudInitUserCloud struct {
	Name              string
	Sudo              string
	SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
}

type CloudInitWriteFile

type CloudInitWriteFile struct {
	Content     string
	Path        string
	Permissions string
}

func RenameInterfaceScript

func RenameInterfaceScript() *CloudInitWriteFile

type Deployed

type Deployed struct {
	Resource *hcloud.Server
}

type Server

type Server struct {
	Config   *config.ServerConfig
	Userdata *CloudInit
	KeyName  pulumi.StringOutput
}

func New

func New(srv *config.ServerConfig, key *hcloud.SshKey) *Server

func (*Server) Up

func (s *Server) Up(ctx *program.Context, id string, internalIP string, netID pulumi.IntInput, deps []pulumi.Resource) (*Deployed, error)

func (*Server) Validate

func (s *Server) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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