Documentation ¶
Index ¶
- Variables
- func Helpers() map[string]govaluate.ExpressionFunction
- type Client
- func (c *Client) FilterExpression(attrs map[string]interface{}) (bool, error)
- func (c *Client) Generate() error
- func (c *Client) GroupExpression(attrs map[string]interface{}) (string, error)
- func (c *Client) HostExpression(attrs map[string]interface{}) (string, error)
- func (c *Client) NameExpression(attrs map[string]interface{}) (string, error)
- func (c *Client) PortExpression(attrs map[string]interface{}) (string, error)
- func (c *Client) Template(groups Groups) (string, error)
- func (c *Client) UserExpression(attrs map[string]interface{}) (string, error)
- func (c *Client) Writer(content string) error
- type Group
- type Groups
- type Host
- type Hosts
- type Option
- func WithFile(val string) Option
- func WithFilter(val string) Option
- func WithGroup(val string) Option
- func WithHost(val string) Option
- func WithName(val string) Option
- func WithPort(val string) Option
- func WithTargets(val []map[string]interface{}) Option
- func WithTemplate(val string) Option
- func WithUser(val string) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTemplate = `` /* 362-byte string literal not displayed */
DefaultTemplate defines the standard hosts config.
Functions ¶
func Helpers ¶
func Helpers() map[string]govaluate.ExpressionFunction
Helpers defines a list of helpers for Govaluate.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines an output client.
func (*Client) FilterExpression ¶
FilterExpression evaluates the filter expression.
func (*Client) GroupExpression ¶
GroupExpression evaluates the group expression.
func (*Client) HostExpression ¶
HostExpression evaluates the host expression.
func (*Client) NameExpression ¶
NameExpression evaluates the name expression.
func (*Client) PortExpression ¶
PortExpression evaluates the port expression.
func (*Client) UserExpression ¶
UserExpression evaluates the user expression.
type Groups ¶
type Groups []*Group
Groups is a collection of groups.
type Hosts ¶
type Hosts []*Host
Hosts is a collection of hosts.
type Option ¶
type Option func(*Client)
Option configures a client option.
func WithTargets ¶
WithTargets returns an option to set targets.
func WithTemplate ¶
WithTemplate returns an option to set template.
Click to show internal directories.
Click to hide internal directories.