store

package
v0.0.0-...-183c8bc Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMysqlConfig

func DefaultMysqlConfig() *mysql.MysqlStoreConfig

Types

type AddressConfig

type AddressConfig struct {
	Address string   `json:"address,omitempty"`
	Url     *url.URL `json:"-"`
}

func (*AddressConfig) GetAddress

func (c *AddressConfig) GetAddress() string

func (*AddressConfig) GetProtocol

func (c *AddressConfig) GetProtocol() string

func (*AddressConfig) GetUrlMap

func (c *AddressConfig) GetUrlMap() url.Values

func (*AddressConfig) PostProcess

func (a *AddressConfig) PostProcess() error

func (*AddressConfig) Sanitize

func (a *AddressConfig) Sanitize()

func (*AddressConfig) ToURL

func (c *AddressConfig) ToURL() (*common.URL, error)

func (*AddressConfig) Validate

func (a *AddressConfig) Validate() error

type CacheStoreConfig

type CacheStoreConfig struct {
	config.BaseConfig

	Enabled        bool                  `json:"enabled" envconfig:"DUBBO_STORE_CACHE_ENABLED"`
	ExpirationTime config_types.Duration `json:"expirationTime" envconfig:"DUBBO_STORE_CACHE_EXPIRATION_TIME"`
}

func DefaultCacheStoreConfig

func DefaultCacheStoreConfig() CacheStoreConfig

type Registry

type Registry struct {
	ConfigCenter   string        `json:"config_center,omitempty"`
	MetadataReport AddressConfig `json:"metadata_report,omitempty"`
	Registry       AddressConfig `json:"registry,omitempty"`
}

func DefaultTraditionalConfig

func DefaultTraditionalConfig() Registry

func (*Registry) Decode

func (r *Registry) Decode(val string) error

func (*Registry) PostProcess

func (r *Registry) PostProcess() error

func (*Registry) Sanitize

func (r *Registry) Sanitize()

func (*Registry) Validate

func (r *Registry) Validate() error

type StoreConfig

type StoreConfig struct {
	// Type of Store used in the Control Plane. Can be either "kubernetes", "postgres" or "memory"
	Type StoreType `json:"type" envconfig:"DUBBO_STORE_TYPE"`
	// Kubernetes Store configuration
	Kubernetes *k8s.KubernetesStoreConfig `json:"kubernetes"`
	// Zookeeper Store configuration
	Zookeeper *zookeeper.ZookeeperStoreConfig `json:"zookeeper"`
	// Mysql Store configuration
	Mysql       *mysql.MysqlStoreConfig `json:"mysql"`
	Traditional Registry                `json:"traditional" envconfig:"DUBBO_STORE_TRADITIONAL_REGISTRY"`
	// Cache configuration
	Cache CacheStoreConfig `json:"cache"`
	// Upsert configuration
	Upsert UpsertConfig `json:"upsert"`
	// UnsafeDelete skips validation of resource delete.
	// For example you don't have to delete all Dataplane objects before you delete a Mesh
	UnsafeDelete bool `json:"unsafeDelete" envconfig:"DUBBO_STORE_UNSAFE_DELETE"`
}

StoreConfig defines Resource Store configuration

func DefaultStoreConfig

func DefaultStoreConfig() *StoreConfig

func (*StoreConfig) PostProcess

func (s *StoreConfig) PostProcess() error

func (*StoreConfig) Sanitize

func (s *StoreConfig) Sanitize()

func (*StoreConfig) Validate

func (s *StoreConfig) Validate() error

type StoreType

type StoreType = string
const (
	KubernetesStore StoreType = "kubernetes"
	MemoryStore     StoreType = "memory"
	MyStore         StoreType = "mysql"
	Traditional     StoreType = "traditional"
)

type UpsertConfig

type UpsertConfig struct {
	config.BaseConfig

	// Base time for exponential backoff on upsert (get and update) operations when retry is enabled
	ConflictRetryBaseBackoff config_types.Duration `json:"conflictRetryBaseBackoff" envconfig:"DUBBO_STORE_UPSERT_CONFLICT_RETRY_BASE_BACKOFF"`
	// Max retries on upsert (get and update) operation when retry is enabled
	ConflictRetryMaxTimes uint `json:"conflictRetryMaxTimes" envconfig:"DUBBO_STORE_UPSERT_CONFLICT_RETRY_MAX_TIMES"`
	// Percentage of jitter. For example: if backoff is 20s, and this value 10, the backoff will be between 18s and 22s.
	ConflictRetryJitterPercent uint `json:"conflictRetryJitterPercent" envconfig:"DUBBO_STORE_UPSERT_CONFLICT_RETRY_JITTER_PERCENT"`
}

func DefaultUpsertConfig

func DefaultUpsertConfig() UpsertConfig

func (*UpsertConfig) Validate

func (u *UpsertConfig) Validate() error

Jump to

Keyboard shortcuts

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