zip

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README


{ "image": "direktiv/zip", "desc": "Prints all the information that direktiv sends to the container" }

Zip

Create a zip file with the files provided.

Direktiv

An example workflow of using the container on Direktiv.

id: zip-file
functions:
- id: zip
  image: direktiv/zip:v3
states:
- id: zip-data
  type: action
  action:
    function: zip
    input:
      password: jq(.password) # password encrypts the zip
      files:   # files to zip
      - name: mypdf.pdf 
        data: workflow/pdffile 
        type: var
      - name: hellworld.txt
        type: plain
        data: this is plain text
      - name: base64.txt
        type: base64
        data: aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==
      - name: secondpdf.pdf
        type: file
        data: /test.pdf
      scope: workflow # stores the zip as variable
      name: myzip 
      return: true # returns zip as base64 if true

Input

  • password: the string that will encrypt the zip file
  • files
    • name: the name of the file
    • data: the data for the file
    • type: plain, var, basse64, file

Output

Zip file as base64 in return and zip can be stored as variable.

Error

In the case that an error is encountered it will present in the following format:

{
    "errorCode": "com.zip.%s.error",
    "errorMsg": "Something went wrong"
}

Replacing '%s' contextually with where the error occurred.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL