util

package
v0.0.0-...-809ce26 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionStringAuthUser = "username"
	ConnectionStringAuthPass = "password"
)
View Source
const (
	S3AccessKeyName = "ACCESS_KEY"
	S3SecretKeyName = "SECRET_KEY"
)

Variables

This section is empty.

Functions

func GetDatabaseDriver

func GetDatabaseDriver(dbType string) (string, error)

get database driver by database type

func GetDatabaseHost

func GetDatabaseHost(connectionString string) (host string, port string)

func RequeueOrError

func RequeueOrError(res ctrl.Result, err error) bool

func ServiceTypeToListenerClass

func ServiceTypeToListenerClass(serviceType corev1.ServiceType) (listenerClass constants.ListenerClass, err error)

func ToProperties

func ToProperties(properties map[string]string) string

Types

type ContainerComponent

type ContainerComponent string

type DataBaseExtractor

type DataBaseExtractor struct {
	ConnectionString    *string
	SecretReferenceName *string
	Namespace           *string
	Ctx                 context.Context
	Client              *client.Client
}

func NewDataBaseExtractor

func NewDataBaseExtractor(client *client.Client, connectionString *string) *DataBaseExtractor

func (*DataBaseExtractor) CredentialsInSecret

func (d *DataBaseExtractor) CredentialsInSecret(secretRefName string, namespace string) *DataBaseExtractor

func (*DataBaseExtractor) ExtractDatabaseInfo

func (d *DataBaseExtractor) ExtractDatabaseInfo(ctx context.Context) (*DatabaseConfig, error)

type DatabaseConfig

type DatabaseConfig struct {
	DbType   string
	Driver   string
	Username string
	Password string
	Host     string
	Port     string
	DbName   string
}

type Role

type Role string

type S3Config

type S3Config struct {
	BucketName      string
	Endpoint        string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	ForcePathStyle  bool
}

type S3ConfigExtractor

type S3ConfigExtractor struct {
	Namespace string
	S3Spec    *s3v1alpha1.S3BucketSpec
	// contains filtered or unexported fields
}

func NewS3ConfigExtractor

func NewS3ConfigExtractor(client *client.Client, s3Spec *s3v1alpha1.S3BucketSpec, namespace string) *S3ConfigExtractor

func (*S3ConfigExtractor) GetS3Config

func (s *S3ConfigExtractor) GetS3Config(ctx context.Context) (s3info *S3Config, err error)

func (*S3ConfigExtractor) GetS3ConfigFromConnectionInline

func (s *S3ConfigExtractor) GetS3ConfigFromConnectionInline(
	ctx context.Context,
	connRef *s3v1alpha1.S3BucketConnectionSpec) (s3Info *S3Config, err error)

get s3 connection info from inline

func (*S3ConfigExtractor) GetS3ConfigFromConnectionReferenceName

func (s *S3ConfigExtractor) GetS3ConfigFromConnectionReferenceName(
	ctx context.Context,
	connRefName string) (s3Info *S3Config, err error)

get s3 connection info from reference bane

func (*S3ConfigExtractor) GetS3ConfigFromConnectionSpec

func (s *S3ConfigExtractor) GetS3ConfigFromConnectionSpec(
	ctx context.Context,
	connSpec *s3v1alpha1.S3ConnectionSpec) (s3Info *S3Config, err error)

create s3 info with s3v1alpha1.S3ConnectionSpec

func (*S3ConfigExtractor) GetS3ConnectionInlineEndpoint

func (s *S3ConfigExtractor) GetS3ConnectionInlineEndpoint() string

endpoint

func (*S3ConfigExtractor) GetS3SecretData

func (s *S3ConfigExtractor) GetS3SecretData(ctx context.Context,
	creditial *commonsv1alpha1.Credentials) (accessKey, secretKey string, err error)

get sercret info

type SortedMap

type SortedMap map[string]interface{}

func NewSortedMap

func NewSortedMap(mapVal map[string]interface{}) SortedMap

func (SortedMap) Range

func (s SortedMap) Range(fn func(key string, value interface{}) bool)

range a sorted map

func (SortedMap) SortedKeys

func (s SortedMap) SortedKeys() []string

SortedKeys returns a sorted slice of keys in the map. The iteration order is sorted alphabetically.

Jump to

Keyboard shortcuts

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