testsupport

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProvisionAsm

func DefaultProvisionAsm() string

DefaultProvisionAsm provisions a test default environment for AWS Secrets Manager. Since the time to create / delete and when the value is available or may be re-created is lagging (e.g. the notorious the value is schedule for deletion) this function will check if exist, if so update the value, if missing it will create the secret. It will not delete the secrets by default.

func DefaultProvisionPms

func DefaultProvisionPms(stage string) error

DefaultProvisionPms sets up a default test environment for PMS

func DeleteAllUnittestSecrets

func DeleteAllUnittestSecrets() error

DeleteAllUnittestSecrets tries to delete all unit test secrets

func ListDeletePrms

func ListDeletePrms() error

ListDeletePrms lists and deletes all parameters that begins with /unittest

func ProvisionAsm

func ProvisionAsm(prms []secretsmanager.CreateSecretInput)

ProvisionAsm provision secrets

func Secrets

func Secrets(stage string) []secretsmanager.CreateSecretInput

Secrets generates all secrets managed by the test system

func ShortUUID

func ShortUUID() string

ShortUUID returns a short uuid

func UnittestStage

func UnittestStage() string

UnittestStage returns the name of the stage to use in unit test

Types

type MyContextPostgresSQL

type MyContextPostgresSQL struct {
	DbCtx    support.SecretsManagerRDSPostgreSQLRotationSingleUser `asm:"dbctx, strkey=password"`
	Settings struct {
		BatchSize int    `json:"batchsize"`
		Signer    string `json:"signer,omitempty"`
	} `pms:"settings"`
}

MyContextPostgresSQL demo context

type MyDbServiceConfig

type MyDbServiceConfig struct {
	Name       string `pms:"test, prefix=simple,tag1=nanna banna panna"`
	Connection struct {
		User     string `json:"user"`
		Password string `json:"password,omitempty"`
		Timeout  int    `json:"timeout"`
	} `pms:"bubbibobbo"`
}

MyDbServiceConfig is a fake test struct

type MyDbServiceConfigAsm

type MyDbServiceConfigAsm struct {
	Name       string
	Connection struct {
		User     string `json:"user"`
		Password string `json:"password,omitempty"`
		Timeout  int    `json:"timeout"`
	} `asm:"bubbibobbo, strkey=password"`
}

MyDbServiceConfigAsm is a fake test struct

type SingleStringAsmStruct

type SingleStringAsmStruct struct {
	Name string `asm:"test, prefix=simple"`
}

SingleStringAsmStruct with single string

type SingleStringPmsStruct

type SingleStringPmsStruct struct {
	Name string `pms:"test, prefix=simple,tag1=nanna banna panna"`
}

SingleStringPmsStruct with single string

type StructPmsWithNonExistantVariable

type StructPmsWithNonExistantVariable struct {
	Name string `pms:"test, prefix=simple"`
	Sub  struct {
		Apa     int    `pms:"ext"`
		Nu      string `pms:"myname"`
		Missing string `pms:"gonemissing"`
	}
	AsmSub struct {
		Apa2     int    `asm:"ext"`
		Nu2      string `asm:"myname"`
		Missing2 string `asm:"gonemissing"`
	}
}

StructPmsWithNonExistantVariable that has one var that is not backed in the PMS

type StructWithSubStruct

type StructWithSubStruct struct {
	Name string `pms:"test, prefix=simple"`
	Sub  struct {
		Apa int    `pms:"ext"`
		Nu  string `pms:"myname"`
	}
	AsmSub struct {
		Apa2 int    `asm:"ext"`
		Nu2  string `asm:"myname"`
	}
}

StructWithSubStruct with single sub-struct

Jump to

Keyboard shortcuts

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