util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownParameter      = fmt.Errorf("unknown parameter")
	ErrUnmodifiableParameter = fmt.Errorf("parameter is not modifiable")
)

Functions

func ComputeTagsDelta

func ComputeTagsDelta(
	a []*svcapitypes.Tag,
	b []*svcapitypes.Tag,
) (addedOrUpdated []*svcapitypes.Tag, removed []*string)

computeTagsDelta compares two Tag arrays and return two different list containing the addedOrupdated and removed tags. The removed tags array only contains the tags Keys.

func EqualTags

func EqualTags(
	a []*svcapitypes.Tag,
	b []*svcapitypes.Tag,
) bool

equalTags returns true if two Tag arrays are equal regardless of the order of their elements.

func NewErrUnknownParameter added in v1.1.0

func NewErrUnknownParameter(name string) error

NewErrUnknownParameter generates an ACK terminal error about an unknown parameter

func NewErrUnmodifiableParameter added in v1.1.0

func NewErrUnmodifiableParameter(name string) error

NewErrUnmodifiableParameter generates an ACK terminal error about a parameter that may not be modified

Types

type MetaFetcher added in v1.1.0

type MetaFetcher func(ctx context.Context, family string) (map[string]ParamMeta, error)

MetaFetcher is the functor we pass to the paramMetaCache that allows it to fetch engine default parameter information

type ParamMeta added in v1.1.0

type ParamMeta struct {
	IsModifiable bool
	IsDynamic    bool
}

ParamMeta stores metadata about a parameter in a parameter group

type ParamMetaCache added in v1.1.0

type ParamMetaCache struct {
	sync.RWMutex
	Hits   uint64
	Misses uint64
	Cache  map[string]map[string]ParamMeta
}

ParamMetaCache stores information about a parameter for a DB parameter group family. We use this cached information to determine whether a parameter is statically or dynamically defined (whether changes can be applied immediately or pending a reboot) and whether a parameter is modifiable.

Keeping things super simple for now and not adding any TTL or expiration behaviour to the cache. Engine defaults are pretty static information...

func (*ParamMetaCache) Get added in v1.1.0

func (c *ParamMetaCache) Get(
	ctx context.Context,
	family string,
	name string,
	fetcher MetaFetcher,
) (*ParamMeta, error)

Get retrieves the metadata for a named parameter group family and parameter name.

type Parameters added in v1.1.0

type Parameters map[string]*string

Parameters represents the elements of a DB Parameter Group or a DB Cluster Parameter Group

func ChunkParameters added in v1.1.0

func ChunkParameters(
	input Parameters,
	chunkSize int,
) []Parameters

ChunkParameters splits a supplied map of parameters into multiple slices of maps of parameters of a given size.

func GetParametersDifference added in v1.1.0

func GetParametersDifference(
	to, from Parameters,
) (added, unchanged, removed Parameters)

GetParametersDifference compares two Parameters maps and returns the parameters to add & update, the unchanged parameters, and the parameters to remove

Jump to

Keyboard shortcuts

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