Categorygithub.com/hashicorp/hcat
modulepackage
0.2.0
Repository: https://github.com/hashicorp/hcat.git
Documentation: pkg.go.dev

# README

This package is unreleased, alpha quality that will have API breaking changes as we get it in shape. We'll do an official release when it is ready.

Hashicorp Configuration And Templating (hashicat) library

Go Documentation CircleCI

This library provides a means to fetch data managed by external services and render templates using that data. It also enables monitoring those services for data changes to trigger updates to the templates.

It currently supports Consul and Vault as data sources, but we expect to add more soon.

This library was originally based on the code from Consul-Template with a fair amount of refactoring.

Community Support

If you have questions about hashicat, its capabilities or anything other than a bug or feature request (use github's issue tracker for those), please see our community support resources.

Community portal: https://discuss.hashicorp.com/c/consul

Other resources: https://www.consul.io/community.html

Additionally, for issues and pull requests we'll be using the :+1: reactions as a rough voting system to help gauge community priorities. So please add :+1: to any issue or pull request you'd like to see worked on. Thanks.

# Packages

Public Dependency type information.
No description provided by the author
No description provided by the author

# Functions

Backup creates a [filename].bak copy, preserving the Mode Provided for convenience (to use as the BackupFunc) and an example.
NewClientSet is used to create the clients used.
NewDepSet returns an initialized DepSet (set of dependencies).
NewFileRenderer returns a new FileRenderer.
Basic constructor, here for consistency and future flexibility.
NewStore creates a new Store with empty values for each of the key structs.
NewTemplate creates a new Template and primes it for the initial run.
NewWatcher creates a new watcher using the given API client.

# Variables

ErrMissingValues is the error returned when a template doesn't completely render due to missing values (values that haven't been fetched yet).
No description provided by the author
standard error returned when you try to register the same notifier twice.

# Structs

ClientSet focuses only on external (consul/vault) dependencies at this point so we extend it here to include environment variables to meet the looker interface.
ConsulInput defines the inputs needed to configure the Consul client.
DepSet is a set (type) of Dependencies and is used with public template rendering interface.
FileRenderer will handle rendering the template text to a file.
FileRendererInput is the input structure for NewFileRenderer.
RenderResult is returned and stored.
ResolveEvent captures the whether the template dependencies have all been resolved and rendered in memory.
Resolver is responsible rendering Templates and invoking Commands.
Store is what Template uses to determine the values that are available for template parsing.
Template is the internal representation of an individual template to process.
TemplateInput is used as input when creating the template.
No description provided by the author
VaultInput defines the inputs needed to configure the Vault client.
Watcher is a manager for views that poll external sources for data.
No description provided by the author

# Interfaces

Cacher defines the interface required by the watcher for caching data retreived from external services.
Interface that indicates it implements Mark and Sweep "garbage" collection to track and collect (stop/dereference) dependencies and views that are no longer in use.
IDer an interface that supports and ID.
Looker is an interface for looking up data from Consul, Vault and the Environment.
Notifier indicates support for notifications.
Renderer defines the interface used to render (output) and template.
Templater the interface the Template provides.
Watcherer is the subset of the Watcher's API that the resolver needs.

# Type aliases

BackupFunc defines the function type passed in to make backups if previously rendered templates, if desired.
No description provided by the author
Temporarily raise these types to the top level via aliasing.
Recaller is the read interface for the cache Implemented by Store and Watcher (which wraps Store).
RetryFunc defines the function type used to determine how many and how often to retry calls to the external services.