template

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultMaxTemplateEventRate is the default maximum rate at which a
	// template event should be fired.
	DefaultMaxTemplateEventRate = 3 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskTemplateManager

type TaskTemplateManager struct {
	// contains filtered or unexported fields
}

TaskTemplateManager is used to run a set of templates for a given task

func NewTaskTemplateManager

func NewTaskTemplateManager(config *TaskTemplateManagerConfig) (*TaskTemplateManager, error)

func (*TaskTemplateManager) Stop

func (tm *TaskTemplateManager) Stop()

Stop is used to stop the consul-template runner

type TaskTemplateManagerConfig

type TaskTemplateManagerConfig struct {
	// UnblockCh is closed when the template has been rendered
	UnblockCh chan struct{}

	// Lifecycle is used to interact with the task the template manager is being
	// run for
	Lifecycle interfaces.TaskLifecycle

	// Events is used to emit events for the task
	Events interfaces.EventEmitter

	// Templates is the set of templates we are managing
	Templates []*structs.Template

	// ClientConfig is the Nomad Client configuration
	ClientConfig *config.Config

	// VaultToken is the Vault token for the task.
	VaultToken string

	// TaskDir is the task's directory
	TaskDir string

	// EnvBuilder is the environment variable builder for the task.
	EnvBuilder *taskenv.Builder

	// MaxTemplateEventRate is the maximum rate at which we should emit events.
	MaxTemplateEventRate time.Duration
	// contains filtered or unexported fields
}

TaskTemplateManagerConfig is used to configure an instance of the TaskTemplateManager

func (*TaskTemplateManagerConfig) Validate

func (c *TaskTemplateManagerConfig) Validate() error

Validate validates the configuration.

Jump to

Keyboard shortcuts

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