converge: github.com/asteris-llc/converge/resource/unarchive Index | Files

package unarchive

import "github.com/asteris-llc/converge/resource/unarchive"

Index

Package Files

preparer.go unarchive.go

type Hash Uses

type Hash string

Hash type for Unarchive

const (
    // HashMD5 indicates hash type md5
    HashMD5 Hash = "md5"

    // HashSHA1 indicates hash type sha1
    HashSHA1 Hash = "sha1"

    // HashSHA256 indicates hash type sha256
    HashSHA256 Hash = "sha256"

    // HashSHA512 indicates hash type sha512
    HashSHA512 Hash = "sha512"
)

type Preparer Uses

type Preparer struct {
    // Source to unarchive - must exist locally
    Source string `hcl:"source" required:"true" nonempty:"true"`

    // Destination for the unarchive - must be a directory
    Destination string `hcl:"destination" required:"true" nonempty:"true"`

    // HashType of the archive. It is the hash function used to generate the
    // checksum hash. Valid types are md5, sha1, sha256, and sha512.
    HashType *string `hcl:"hash_type"`

    // Hash of the archive. It is the checksum hash.
    Hash *string `hcl:"hash" nonempty:"true"`

    // Force indicates whether a file from the unarchived source will replace a
    // file in the destination if it already exists
    // If true, the file will be replaced if:
    // 1. no checksum is provided
    // 2. the checksum of the existing file differs from the checksum provided
    Force bool `hcl:"force"`
}

Preparer for Unarchive

Unarchive renders unarchive data

func (*Preparer) Prepare Uses

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a new task

type Unarchive Uses

type Unarchive struct {

    // the source
    Source string `export:"source"`

    // the destination
    Destination string `export:"destination"`

    // hash function used to generate the checksum hash of the source; value is
    // available for lookup if set in the hcl
    HashType string `export:"hash_type"`

    // the checksum hash of the source; value is available for lookup if set in
    // the hcl
    Hash string `export:"hash"`

    // whether a file from the unarchived source will replace a file in the
    // destination if it already exists
    Force bool `export:"force"`
    // contains filtered or unexported fields
}

Unarchive manages unarchive

func (*Unarchive) Apply Uses

func (u *Unarchive) Apply(ctx context.Context) (resource.TaskStatus, error)

Apply changes for unarchive

func (*Unarchive) Check Uses

func (u *Unarchive) Check(ctx context.Context, r resource.Renderer) (resource.TaskStatus, error)

Check if changes are needed for unarchive

Package unarchive imports 19 packages (graph) and is imported by 1 packages. Updated 2017-02-23. Refresh now. Tools for package owners.