Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func EmbeddedFile ¶
EmbeddedFile is a small helper function to helper reading embedded files
Types ¶
type Apt ¶
type Apt struct { // Name is the name of the resource, and is what the file written to // disk will be based on Name string // URI is the source URI of the repository URI string // Distribution is normally the codename of the distribution. Defaults to // the Ubuntu codename. Distribution string // Source is repository type. Defaults to main. Source string // Parameters is a map of optional parameters that gets represented as key // value pairs, eg "[arch=amd64]" Parameters map[string]string // SigningKey will use the legacy apt-key command to retrieve a key SigningKey string // SigningKeyURL will retrieve the signing key for the package, // and include it as part of the source list SigningKeyURL string // Delete will remove the apt repository if set to true. Delete bool // Update will perform an apt update after adding the repository. Update bool // UpdateOnly will only perform an apt update. UpdateOnly bool // contains filtered or unexported fields }
Apt configures Ubuntu apt repositories. It will automatically use sudo if the user is not root.
func (*Apt) OperationName ¶
func (*Apt) Params ¶
func (a *Apt) Params() *viaduct.ResourceParams
Params allows the resource to dynamically set options that will be passed at compile time
func (*Apt) PreflightChecks ¶
PreflightChecks sets default values for the parameters for a particular resource
type Directory ¶
type Directory struct { // Path is the path of the directory Path string // Delete removes the directory if set to true. Delete bool // Permissions manages permissions for the directory Permissions }
Directory manages a directory on the filesystem
func (*Directory) OperationName ¶
func (*Directory) Params ¶
func (d *Directory) Params() *viaduct.ResourceParams
func (*Directory) PreflightChecks ¶
PreflightChecks sets default values for the parameters for a particular resource
type Download ¶ added in v0.3.1
type Download struct { // URL is where to download the data from URL string // Path is where to store the downloaded data Path string // NotIfExists will not download the file if it already exists NotIfExists bool // Permissions manages permissions for the downloaded content Permissions }
Download will fetch data from the given URL, and write it to the given path.
func (*Download) OperationName ¶ added in v0.3.1
func (*Download) Params ¶ added in v0.3.1
func (a *Download) Params() *viaduct.ResourceParams
func (*Download) PreflightChecks ¶ added in v0.3.1
type Execute ¶
type Execute struct { // Command is the command to run Command string // WorkingDirectory is where to run the command. Optional. WorkingDirectory string // Unless is another command to run, which if exits cleanly signifies // that we should not run the execute command. Optional. Unless string }
func ExecUnless ¶
ExecUnless is like Exec, but will only run conditionally
func (*Execute) OperationName ¶
func (*Execute) Params ¶
func (e *Execute) Params() *viaduct.ResourceParams
type File ¶
type File struct { // Path is the path of the file Path string // Content is the content of the file Content string // Delete will delete the file rather than create it if set to true. Delete bool // Permissions manages permissions for the file Permissions }
File manages files on the filesystem
func CreateFile ¶
CreateFile writes content to the specified path
func (*File) OperationName ¶
func (*File) Params ¶
func (f *File) Params() *viaduct.ResourceParams
type Git ¶
type Git struct { // Path specifies where to clone the repository to. Required. Path string // URL is the URL of the Git repository. Required. URL string // Reference specifies the reference to fetch. Defaults to "refs/heads/main". Reference string // Remote specifies the remote name. Defaults to "origin". RemoteName string // Ensure will continue to pull the latest changes. Optional. Ensure bool // Delete will remove the Git directory. Delete bool // Permissions manages permissions for the repository Permissions }
Git manages a Git repository
func (*Git) OperationName ¶
func (*Git) Params ¶
func (g *Git) Params() *viaduct.ResourceParams
func (*Git) PreflightChecks ¶
PreflightChecks sets default values for the parameters for a particular resource
type Link ¶
type Link struct { // Path is the path of the symlinked file/directory Path string // Source is the original file/directory we are linking to Source string // Delete will delete the symlink. Delete bool }
Link creates a symlink. If the file exists and is not a symlink, it will be created and replaced with the link. If the file exists, is a symlink but does not have the right source, it will be replaced.
func DeleteLink ¶
CreateLink will delete a symlink if it exists.
func (*Link) OperationName ¶
func (*Link) Params ¶
func (l *Link) Params() *viaduct.ResourceParams
func (*Link) PreflightChecks ¶
PreflightChecks sets default values for the parameters for a particular resource
type Package ¶
type Package struct { // Names are the package names Names []string // Verbose displays output from STDOUT. Optional. Verbose bool // Uninstall will uninstall the specified packages. Uninstall bool }
Package installs one or more packages. Specify the package names.
func (*Package) OperationName ¶
func (*Package) Params ¶
func (p *Package) Params() *viaduct.ResourceParams
func (*Package) PreflightChecks ¶
PreflightChecks sets default values for the parameters for a particular resource
type Permissions ¶ added in v0.3.3
type Permissions struct { // Mode is the permissions set of the file Mode os.FileMode // User sets the user permissions by user name User string // Group sets the group permissions by group name Group string // UID sets the user permissions by UID UID int // GID sets the group permissions by GID GID int // Root enforces using the root user Root bool }
Permissions can be used with some resources to manage how they set permissions on files