Documentation ¶
Index ¶
- Variables
- func MergeMaps(m1, m2 map[string]string) map[string]string
- func RandomString(n int) string
- func RenderUserDataTemplate(config *config.Config, agent *woodpecker.Agent, tmpl *template.Template) (string, error)
- func SliceToMap(list []string, del string) (map[string]string, error)
- type Autoscaler
- type Provider
Constants ¶
This section is empty.
Variables ¶
var ( LabelPrefix = "wp.autoscaler/" LabelPool = fmt.Sprintf("%spool", LabelPrefix) LabelImage = fmt.Sprintf("%simage", LabelPrefix) // editorconfig-checker-disable CloudInitUserDataUbuntuDefault = `` /* 978-byte string literal not displayed */ )
Functions ¶
func MergeMaps ¶
MergeMaps merges two string maps m1 and m2 into a new map. It copies all key-value pairs from m1 into the result. It then copies all key-value pairs from m2 into the result, overwriting any keys that are present in both m1 and m2. The merged map is returned.
func RandomString ¶
RandomString generates a random string of length n using alphanumeric characters.
func RenderUserDataTemplate ¶
func RenderUserDataTemplate(config *config.Config, agent *woodpecker.Agent, tmpl *template.Template) (string, error)
RenderUserDataTemplate renders the user data template for an Agent using the provided configuration.
func SliceToMap ¶
SliceToMap converts a slice of strings in the format "key=value" into a string map, using the provided delimiter to split the pieces. Returns a map and nil error on success, or nil and an error if a slice element does not contain the delimiter.
Types ¶
type Autoscaler ¶
type Autoscaler struct {
// contains filtered or unexported fields
}
func NewAutoscaler ¶
NewAutoscaler creates a new Autoscaler instance. It takes in a Provider, Client and Config, and returns a configured Autoscaler struct.