keypayload

package
v1.1.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KPMap

type KPMap map[string]*payload.Payload

Key-Payload Map

func (KPMap) ChangeKey

func (m KPMap) ChangeKey(old, new string)

Updates a key name in the map from "old" to "new."

func (KPMap) Decode

func (m KPMap) Decode() error

Base64 decodes all the pairs in the map.

func (KPMap) Decrypt

func (m KPMap) Decrypt(key [32]byte) error

Decrypts all the key=value pairs with the provided key.

func (KPMap) Decrypted

func (m KPMap) Decrypted(key [32]byte) (KPMap, error)

Decrypts all the key=value pairs with the provided key and returns a new deep copy of the map.

func (KPMap) Delete

func (m KPMap) Delete(key string)

Deletes a key=value pair from the map.

func (KPMap) DeleteValues

func (m KPMap) DeleteValues()

Empties the values from the payloads of all key=value pairs.

func (KPMap) Encode

func (m KPMap) Encode()

Base64 encodes all the pairs in the map.

func (KPMap) Encrypt

func (m KPMap) Encrypt(key [32]byte) error

Encrypts all the key=value pairs with the provided key.

func (KPMap) Encrypted

func (m KPMap) Encrypted(key [32]byte) (KPMap, error)

Encrypts all the key=value pairs with the provided key and returns a new deep copy of the map.

func (KPMap) FmtString

func (m KPMap) FmtString(key string) string

Returns string representation in the form of "key=value"

func (KPMap) Get

func (m KPMap) Get(key string) *payload.Payload

Fetches the payload for a specific key from the map.

func (KPMap) GetValue

func (m KPMap) GetValue(key string) string

Fetches the value from the payload for a specific key in the map.

func (KPMap) IsEmpty

func (m KPMap) IsEmpty() bool

Returns a boolean validating whether the length of the map is 0.

func (KPMap) Load

func (m KPMap) Load(value KPMap)

func (KPMap) MarkAllDecoded

func (m KPMap) MarkAllDecoded()

Marks all payload values as Base64 decoded.

func (KPMap) MarkAllEncoded

func (m KPMap) MarkAllEncoded()

Marks all payload values as Base64 encoded.

func (KPMap) MarkDecoded

func (m KPMap) MarkDecoded(key string)

Marks payload value for specified key as Base64 decoded.

func (KPMap) MarkEncoded

func (m KPMap) MarkEncoded(key string)

Marks payload value for specified key as Base64 encoded.

func (KPMap) MarkExposable

func (m KPMap) MarkExposable(key string)

Marks the "exposable" value of the payload as "true."

Exposability allows the value to be synced as an exposable one
on platforms which differentiate between decryptable and non-decryptable secrets.
For example, Github and Vercel.
In Github actions, this value will be synced as a "variable" and NOT a secret, once it is marked "exposable" over here.

func (KPMap) MarkNotExposable

func (m KPMap) MarkNotExposable(key string)

func (*KPMap) Marshal

func (m *KPMap) Marshal() ([]byte, error)

Returns JSON Marshalled map.

func (KPMap) Overwrite

func (m KPMap) Overwrite(source *KPMap)

Ovewrites or replaces values in the map for respective keys from supplied map.

func (KPMap) Set

func (m KPMap) Set(key string, value *payload.Payload)

Sets a key=payload pair to the map.

func (KPMap) SetValue

func (m KPMap) SetValue(key, value string)

Sets the value for the payload belong the the specified key in the map.

func (KPMap) ToKVMap

func (m KPMap) ToKVMap() *keyvalue.KVMap

Returns a new key=value mapping.

Jump to

Keyboard shortcuts

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