Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHCLConfigFile ¶
func CreateHCLConfigFile(ctx context.Context, tr it.Transport, req *CreateHCLConfigFileRequest) error
CreateHCLConfigFile takes a context, transport, and create request and creates the config file.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder can be used to build structured hcl content, supporting appending attributes and blocks.
func (*Builder) AppendAttribute ¶
AppendAttribute appends a new attribute to the current block, returning the Builder for that block.
func (*Builder) AppendAttributes ¶
AppendAttributes appends the provided attributes to the current block and returns the Builder for the current block.
func (*Builder) AppendBlock ¶
AppendBlock constructs a new block given the provided name and labels, appends it to current block and returns the Builder for the new block.
type CreateHCLConfigFileOpt ¶
type CreateHCLConfigFileOpt func(*CreateHCLConfigFileRequest) *CreateHCLConfigFileRequest
CreateHCLConfigFileOpt is a functional option for a config create request.
func WithHCLConfigChmod ¶
func WithHCLConfigChmod(chmod string) CreateHCLConfigFileOpt
WithHCLConfigChmod sets config file permissions.
func WithHCLConfigChown ¶
func WithHCLConfigChown(chown string) CreateHCLConfigFileOpt
WithHCLConfigChown sets config file ownership.
func WithHCLConfigFile ¶
func WithHCLConfigFile(unit *Builder) CreateHCLConfigFileOpt
WithHCLConfigFile sets the config file to use.
func WithHCLConfigFilePath ¶
func WithHCLConfigFilePath(path string) CreateHCLConfigFileOpt
WithHCLConfigFilePath sets the config file path.
type CreateHCLConfigFileRequest ¶
type CreateHCLConfigFileRequest struct { HCLConfig *Builder FilePath string Chmod string Chown string }
CreateHCLConfigFileRequest is an HCL config create request.
func NewCreateHCLConfigFileRequest ¶
func NewCreateHCLConfigFileRequest(opts ...CreateHCLConfigFileOpt) *CreateHCLConfigFileRequest
NewCreateHCLConfigFileRequest takes functional options and returns a new config file request.