template

package
v1.3.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package template is responsible for rendering user supplied templates to disk. The Server type accepts configuration to communicate to a Vault server and a Vault token for authentication. Internally, the Server creates a Consul Template Runner which manages reading secrets from Vault and rendering templates to disk at configured locations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// UnblockCh is used to block until a template is rendered
	UnblockCh chan struct{}

	// Templates holds the parsed Consul Templates
	Templates []*ctconfig.TemplateConfig

	// TODO: remove donech?
	DoneCh chan struct{}
	// contains filtered or unexported fields
}

Server manages the Consul Template Runner which renders templates

func NewServer

func NewServer(conf *ServerConfig) *Server

NewServer returns a new configured server

func (*Server) Run

func (ts *Server) Run(ctx context.Context, incoming chan string, templates []*ctconfig.TemplateConfig)

Run kicks off the internal Consul Template runner, and listens for changes to the token from the AuthHandler. If Done() is called on the context, shut down the Runner and return

type ServerConfig

type ServerConfig struct {
	Logger hclog.Logger
	// Client        *api.Client
	VaultConf     *config.Vault
	ExitAfterAuth bool

	Namespace string
}

ServerConfig is a config struct for setting up the basic parts of the Server

Jump to

Keyboard shortcuts

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