secretsformatter

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: EPL-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

Index

Constants

View Source
const (
	HEADER_SECRET_NAME        = "name"
	HEADER_SECRET_TYPE        = "type"
	HEADER_SECRET_DESCRIPTION = "description"
	HEADER_LAST_UPDATED_TIME  = "last-updated(UTC)"
	HEADER_LAST_UPDATED_BY    = "last-updated-by"
)

----------------------------------------------------- SecretsFormatter - implementations can take a collection of secrets and turn them into a string for display to the user.

View Source
const (
	SUMMARY_FORMATTER_NAME = "summary"
)

----------------------------------------------------- Summary format.

View Source
const (
	YAML_FORMATTER_NAME = "yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GalasaSecret

type GalasaSecret struct {
	ApiVersion *string               `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
	Kind       *string               `json:"kind,omitempty"       yaml:"kind,omitempty"`
	Metadata   *GalasaSecretMetadata `json:"metadata,omitempty"   yaml:"metadata,omitempty"`
	Data       *GalasaSecretData     `json:"data,omitempty"       yaml:"data,omitempty"`
}

The auto-generated OpenAPI structs don't include `yaml` annotations, which causes issues when it comes to marshalling data into GalasaSecret structs in order to display secrets in YAML format. This is a manually-maintained struct that includes `yaml` annotations.

func NewGalasaSecret

func NewGalasaSecret(secret galasaapi.GalasaSecret) *GalasaSecret

type GalasaSecretData

type GalasaSecretData struct {
	Username *string `json:"username,omitempty" yaml:"username,omitempty"`
	Password *string `json:"password,omitempty" yaml:"password,omitempty"`
	Token    *string `json:"token,omitempty"    yaml:"token,omitempty"`
}

func NewGalasaSecretData

func NewGalasaSecretData(data *galasaapi.GalasaSecretData) *GalasaSecretData

type GalasaSecretMetadata

type GalasaSecretMetadata struct {
	Name            *string                     `json:"name,omitempty"            yaml:"name,omitempty"`
	Description     *string                     `json:"description,omitempty"     yaml:"description,omitempty"`
	LastUpdatedTime *time.Time                  `json:"lastUpdatedTime,omitempty" yaml:"lastUpdatedTime,omitempty"`
	LastUpdatedBy   *string                     `json:"lastUpdatedBy,omitempty"   yaml:"lastUpdatedBy,omitempty"`
	Encoding        *string                     `json:"encoding,omitempty"        yaml:"encoding,omitempty"`
	Type            *galasaapi.GalasaSecretType `json:"type,omitempty"            yaml:"type,omitempty"`
}

func NewGalasaSecretMetadata

func NewGalasaSecretMetadata(metadata *galasaapi.GalasaSecretMetadata) *GalasaSecretMetadata

type SecretSummaryFormatter

type SecretSummaryFormatter struct {
}

func (*SecretSummaryFormatter) FormatSecrets

func (*SecretSummaryFormatter) FormatSecrets(secrets []galasaapi.GalasaSecret) (string, error)

func (*SecretSummaryFormatter) GetName

func (*SecretSummaryFormatter) GetName() string

type SecretYamlFormatter

type SecretYamlFormatter struct {
}

func (*SecretYamlFormatter) FormatSecrets

func (*SecretYamlFormatter) FormatSecrets(secrets []galasaapi.GalasaSecret) (string, error)

func (*SecretYamlFormatter) GetName

func (*SecretYamlFormatter) GetName() string

type SecretsFormatter

type SecretsFormatter interface {
	FormatSecrets(secrets []galasaapi.GalasaSecret) (string, error)
	GetName() string
}

func NewSecretSummaryFormatter

func NewSecretSummaryFormatter() SecretsFormatter

func NewSecretYamlFormatter

func NewSecretYamlFormatter() SecretsFormatter

Jump to

Keyboard shortcuts

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