nodeconfig

package
v2.0.0-...-54ff1d7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentsMsg

type EnvironmentsMsg struct {
	Status       string
	Message      string
	Environments []string
}

type NodeClassifier

type NodeClassifier struct {
	ResultChan    chan NodeConfigResult
	ListenerChans []reflect.SelectCase
	// contains filtered or unexported fields
}

func NewNodeClassifier

func NewNodeClassifier(nodesDir, nodesPrivateKey, nodesGitUser string, puppetConfig *puppetconfig.PuppetConfig, log *log.Logger, notifyCallback func(message string), webhookTimeout int64, execTimeout int64) (*NodeClassifier, error)

func (*NodeClassifier) Classify

func (ctx *NodeClassifier) Classify(hostname, environment, primary_role string, missingOK bool, requestorName, requestorEmail string) <-chan NodeConfigResult

func (*NodeClassifier) GetClassification

func (ctx *NodeClassifier) GetClassification(node string, missingOK bool) (*NodeConfig, error)

func (*NodeClassifier) GetEnvironments

func (ctx *NodeClassifier) GetEnvironments() EnvironmentsMsg

func (*NodeClassifier) GetRoles

func (ctx *NodeClassifier) GetRoles(environment string) RolesMsg

type NodeClassifierInterface

type NodeClassifierInterface interface {
	Classify(hostname, environment, primary_role string, missingOK bool, requestorName, requestorEmail string) <-chan NodeConfigResult
	GetClassification(node string, missingOK bool) (*NodeConfig, error)
	GetEnvironments() EnvironmentsMsg
	GetRoles(environment string) RolesMsg
}

type NodeConfig

type NodeConfig struct {
	Node        string
	Environment string
	PrimaryRole string
	RawContent  *yaml.Node
	EnvNode     *yaml.Node
	ParamsIndex int
	ParamsNode  *yaml.Node
	RoleIndex   int
	RoleNode    *yaml.Node
}

type NodeConfigResult

type NodeConfigResult struct {
	Action      string
	Success     bool
	Message     string
	Node        string
	Environment string
	PrimaryRole string
}

type RepositoryInterface

type RepositoryInterface interface {
	Push(o *git.PushOptions) error
	ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, error)
}

type RolesMsg

type RolesMsg struct {
	Status  string
	Message string
	Roles   []string
}

type WorktreeInterface

type WorktreeInterface interface {
	Add(path string) (plumbing.Hash, error)
	Commit(msg string, opts *git.CommitOptions) (plumbing.Hash, error)
	Pull(o *git.PullOptions) error
	Reset(opts *git.ResetOptions) error
}

Jump to

Keyboard shortcuts

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