rivertypes

package
v0.34.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 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 OptionalSecret

type OptionalSecret struct {
	IsSecret bool
	Value    string
}

OptionalSecret holds a potentially sensitive value. When IsSecret is true, the OptionalSecret's Value will be treated as sensitive and will be hidden from users when rendering River.

OptionalSecrets may be converted from river strings and the Secret type, which will set IsSecret accordingly.

Additionally, OptionalSecrets may be converted into the Secret type regardless of the value of IsSecret. OptionalSecret can be converted into a string as long as IsSecret is false.

func (*OptionalSecret) ConvertFrom

func (s *OptionalSecret) ConvertFrom(src interface{}) error

ConvertFrom converts the src value and stores it into the OptionalSecret s. Secrets and strings can be converted into an OptionalSecret. In other cases, this method will return river.ErrNoConversion.

func (OptionalSecret) ConvertInto

func (s OptionalSecret) ConvertInto(dst interface{}) error

ConvertInto converts the OptionalSecret and stores it into the Go value pointed at by dst. OptionalSecrets can always be converted into *Secret. OptionalSecrets can only be converted into *string if IsSecret is false. In other cases, this method will return an explicit error or river.ErrNoConversion.

func (OptionalSecret) RiverCapsule

func (s OptionalSecret) RiverCapsule()

RiverCapsule marks OptionalSecret as a RiverCapsule.

func (OptionalSecret) RiverTokenize

func (s OptionalSecret) RiverTokenize() []builder.Token

RiverTokenize returns a set of custom tokens to represent this value in River text.

type Secret

type Secret string

Secret is a River capsule holding a sensitive string. The contents of a Secret are never displayed to the user when rendering River.

Secret allows itself to be converted from a string River value, but never the inverse. This ensures that a user can't accidentally leak a sensitive value.

func (*Secret) ConvertFrom

func (s *Secret) ConvertFrom(src interface{}) error

ConvertFrom converts the src value and stores it into the Secret s. OptionalSecrets and strings can be converted into a Secret. In other cases, this method will return river.ErrNoConversion.

func (Secret) ConvertInto

func (s Secret) ConvertInto(dst interface{}) error

ConvertInto converts the Secret and stores it into the Go value pointed at by dst. Secrets can be converted into *OptionalSecret. In other cases, this method will return an explicit error or river.ErrNoConversion.

func (Secret) RiverCapsule

func (s Secret) RiverCapsule()

RiverCapsule marks Secret as a RiverCapsule.

func (Secret) RiverTokenize

func (s Secret) RiverTokenize() []builder.Token

RiverTokenize returns a set of custom tokens to represent this value in River text.

Jump to

Keyboard shortcuts

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