payload

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 Payload

type Payload struct {
	sync.Mutex
	Value string `json:"value,omitempty"`

	//	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.
	Exposable bool `json:"exposable,omitempty"`
	// contains filtered or unexported fields
}

func (*Payload) Decode

func (p *Payload) Decode() error

Base64 decodes the value of the payload.

func (*Payload) Decrypt

func (p *Payload) Decrypt(key [32]byte) error

Decrypts the value of the payload with the supplied key.

func (*Payload) Decrypted

func (p *Payload) Decrypted(key [32]byte) (*Payload, error)

Decrypts the value of the payload and returns a new deep copy of the payload.

func (*Payload) DeleteValue

func (p *Payload) DeleteValue()

Empties the values from the payload.

func (*Payload) Encode

func (p *Payload) Encode()

Base64 encodes the value of the payload.

func (*Payload) Encrypt

func (p *Payload) Encrypt(key [32]byte) error

func (*Payload) Encrypted

func (p *Payload) Encrypted(key [32]byte) (*Payload, error)

Encrypts the value of the payload with the supplied key and returns a new deep copy of the payload.

func (*Payload) GetValue

func (p *Payload) GetValue() string

Returns the value of the payload.

func (*Payload) IsEmpty

func (p *Payload) IsEmpty() bool

Returns boolean indicating whether the value of the payload is empty or not.

func (*Payload) IsEncoded

func (p *Payload) IsEncoded() bool

Returns boolean whether the payload is already encoded or not.

func (*Payload) IsExposable

func (p *Payload) IsExposable() bool

Returns a boolean validating whether a value is exposable or not.

func (*Payload) MarkDecoded

func (p *Payload) MarkDecoded()

Marks the payload as "decoded."

func (*Payload) MarkEncoded

func (p *Payload) MarkEncoded()

Marks the payload as "exportable."

func (*Payload) MarkExposable

func (p *Payload) MarkExposable()

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 (*Payload) MarkNotExposable

func (p *Payload) MarkNotExposable()

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

Read the documentation of "MarkExposable" function.

func (*Payload) Set

func (p *Payload) Set(value string)

Sets the value of the payload.

func (*Payload) ToMap

func (p *Payload) ToMap() (result map[string]interface{}, err error)

Converts the payload to a map.

Jump to

Keyboard shortcuts

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