driver

package
v0.0.0-...-a1208dc Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CRDDriverType = "crd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDDriver

type CRDDriver struct {
	Ctx context.Context
	*Config
	ConfigMapLister listers.ConfigMapLister
}

func (*CRDDriver) DeleteConfig

func (d *CRDDriver) DeleteConfig(ctx context.Context, keys []string) error

func (*CRDDriver) GetConfig

func (d *CRDDriver) GetConfig(ctx context.Context, key string) (string, bool, error)

func (*CRDDriver) ListConfig

func (d *CRDDriver) ListConfig(ctx context.Context, keys []string) (map[string]string, error)

func (*CRDDriver) SetConfig

func (d *CRDDriver) SetConfig(ctx context.Context, data map[string]string) error

type Config

type Config struct {
	Driver     string
	DomainID   string
	ConfigName string
	// enable cache means getting data in local cache with k8s configmap lister
	// otherwise will use kubeClient to get configmap
	// for kuscia config command, will disable cache
	DisableCache bool
	KubeClient   kubernetes.Interface
	DomainKey    *rsa.PrivateKey
}

type Driver

type Driver interface {
	GetConfig(ctx context.Context, key string) (string, bool, error)
	SetConfig(ctx context.Context, data map[string]string) error
	ListConfig(ctx context.Context, keys []string) (map[string]string, error)
	DeleteConfig(ctx context.Context, keys []string) error
}

func NewCRDDriver

func NewCRDDriver(ctx context.Context, conf *Config) (Driver, error)

func NewDriver

func NewDriver(ctx context.Context, conf *Config) (Driver, error)

Jump to

Keyboard shortcuts

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