store

package
v1.160.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactoryClient added in v1.148.1

type ArtifactoryClient interface {
	DownloadFiles(...services.DownloadParams) (int, int, error)
	UploadFiles(artifactory.UploadServiceOptions, ...services.UploadParams) (int, int, error)
}

ArtifactoryClient interface allows us to mock the Artifactory Services Managernager in test with only the methods we are using in the ArtifactoryStore.

type ArtifactoryStore added in v1.148.1

type ArtifactoryStore struct {
	// contains filtered or unexported fields
}

func (*ArtifactoryStore) Get added in v1.148.1

func (s *ArtifactoryStore) Get(stack string, component string, key string) (interface{}, error)

func (*ArtifactoryStore) Set added in v1.148.1

func (s *ArtifactoryStore) Set(stack string, component string, key string, value interface{}) error

type ArtifactoryStoreOptions added in v1.148.1

type ArtifactoryStoreOptions struct {
	AccessToken    *string `mapstructure:"access_token"`
	Prefix         *string `mapstructure:"prefix"`
	RepoName       string  `mapstructure:"repo_name"`
	StackDelimiter *string `mapstructure:"stack_delimiter"`
	URL            string  `mapstructure:"url"`
}

type RedisClient added in v1.159.0

type RedisClient interface {
	Get(ctx context.Context, key string) *redis.StringCmd
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
}

RedisClient interface allows us to mock the Redis Client in test with only the methods we are using in the RedisStore.

type RedisStore added in v1.159.0

type RedisStore struct {
	// contains filtered or unexported fields
}

func (*RedisStore) Get added in v1.159.0

func (s *RedisStore) Get(stack string, component string, key string) (interface{}, error)

func (*RedisStore) Set added in v1.159.0

func (s *RedisStore) Set(stack string, component string, key string, value interface{}) error

type RedisStoreOptions added in v1.159.0

type RedisStoreOptions struct {
	Prefix         *string `mapstructure:"prefix"`
	StackDelimiter *string `mapstructure:"stack_delimiter"`
	URL            *string `mapstructure:"url"`
}

type SSMClient

type SSMClient interface {
	PutParameter(ctx context.Context, params *ssm.PutParameterInput, optFns ...func(*ssm.Options)) (*ssm.PutParameterOutput, error)
	GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
}

SSMClient interface allows us to mock the AWS SSM client

type SSMStore

type SSMStore struct {
	// contains filtered or unexported fields
}

SSMStore is an implementation of the Store interface for AWS SSM Parameter Store.

func (*SSMStore) Get

func (s *SSMStore) Get(stack string, component string, key string) (interface{}, error)

Get retrieves a value by key from AWS SSM Parameter Store.

func (*SSMStore) Set

func (s *SSMStore) Set(stack string, component string, key string, value interface{}) error

Set stores a key-value pair in AWS SSM Parameter Store.

type SSMStoreOptions

type SSMStoreOptions struct {
	Prefix         *string `mapstructure:"prefix"`
	Region         string  `mapstructure:"region"`
	StackDelimiter *string `mapstructure:"stack_delimiter"`
}

type Store

type Store interface {
	Set(stack string, component string, key string, value interface{}) error
	Get(stack string, component string, key string) (interface{}, error)
}

Store defines the common interface for all store implementations.

func NewArtifactoryStore added in v1.148.1

func NewArtifactoryStore(options ArtifactoryStoreOptions) (Store, error)

func NewRedisStore added in v1.159.0

func NewRedisStore(options RedisStoreOptions) (Store, error)

func NewSSMStore

func NewSSMStore(options SSMStoreOptions) (Store, error)

NewInMemoryStore initializes a new MemoryStore.

type StoreConfig

type StoreConfig struct {
	Type    string                 `yaml:"type"`
	Options map[string]interface{} `yaml:"options"`
}

type StoreFactory

type StoreFactory func(options map[string]interface{}) (Store, error)

StoreFactory is a function type to initialize a new store.

type StoreRegistry

type StoreRegistry map[string]Store

func NewStoreRegistry

func NewStoreRegistry(config *StoresConfig) (StoreRegistry, error)

type StoresConfig

type StoresConfig = map[string]StoreConfig

Jump to

Keyboard shortcuts

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