sync

package
v0.0.0-...-0227cab Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

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

func NewConfigManager

func NewConfigManager(client *kubernetes.Clientset, logger logr.Logger) (*ConfigManager, error)

func (*ConfigManager) Delete

func (m *ConfigManager) Delete(ctx context.Context, namespace, name string) error

Delete

func (*ConfigManager) Get

func (m *ConfigManager) Get(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error)

Get

func (*ConfigManager) Save

func (m *ConfigManager) Save(ctx context.Context, cm *corev1.ConfigMap) error

Save

type Controller

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

Controller

func NewController

func NewController(client *kubernetes.Clientset, options ControllerOptions, logger logr.Logger) (*Controller, error)

func (*Controller) Handler

func (c *Controller) Handler(ctx context.Context, fs *FileStat) error

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

type ControllerOptions

type ControllerOptions struct {
	Namespace       string
	ConfigMapName   string
	OwnerReferences []metav1.OwnerReference
	SyncInterval    time.Duration
	Filters         []Filter
}

type FileEventHandler

type FileEventHandler func(ctx context.Context, fs *FileStat) error

type FileStat

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

func (*FileStat) FilePath

func (fs *FileStat) FilePath() string

func (*FileStat) LastUpdateTimestamp

func (fs *FileStat) LastUpdateTimestamp() int64

type FileWatcher

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

func NewFileWatcher

func NewFileWatcher(handler FileEventHandler, logger logr.Logger) (*FileWatcher, error)

func (*FileWatcher) Add

func (w *FileWatcher) Add(filepath string) error

func (*FileWatcher) Run

func (w *FileWatcher) Run(ctx context.Context) error

type Filter

type Filter interface {
	Truncate(filename string, data string) (string, error)
}

type RedisClusterFilter

type RedisClusterFilter struct{}

func (*RedisClusterFilter) Truncate

func (v *RedisClusterFilter) Truncate(filename string, data string) (string, error)

type UpdateEvent

type UpdateEvent struct {
	FilePath  string
	Data      string
	Timestamp int64
}

Jump to

Keyboard shortcuts

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