base64

package
v0.10.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 10 Imported by: 0

README

---
title: "Base64"
lang: "en-US"
draft: false
description: "Learn about how to set up a VDP Base64 operator https://github.com/instill-ai/vdp"
---

The Base64 component is an operator that allows users to encode or decode a string in Base64 format.
It can carry out the following tasks:

- [Encode](#encode)
- [Decode](#decode)

## Release Stage

`Alpha`

## Configuration

The component configuration is defined and maintained [here](https://github.com/instill-ai/operator/blob/main/pkg/base64/v0/config/definitions.json).

## Supported Tasks

### Encode

Encode data into base64 string

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_ENCODE` |
| Data (required) | `data` | string | Data to be encoded |

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Data | `data` | string | Data |

### Decode

Decode the base64 string.

| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_DECODE` |
| Data (required) | `data` | string | Base64 string to be decoded |

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Data | `data` | string | Data |

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(str string) (string, error)

func Encode

func Encode(str string) string

func Init

func Init(logger *zap.Logger) base.IOperator

Types

type Base64

type Base64 struct {
	Data string `json:"data"`
}

type Execution

type Execution struct {
	base.Execution
}

func (*Execution) Execute

func (e *Execution) Execute(inputs []*structpb.Struct) ([]*structpb.Struct, error)

type Operator

type Operator struct {
	base.Operator
}

func (*Operator) CreateExecution

func (o *Operator) CreateExecution(defUID uuid.UUID, task string, config *structpb.Struct, logger *zap.Logger) (base.IExecution, error)

Jump to

Keyboard shortcuts

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