sync

package
v0.0.0-...-3430a5a Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 {
	ResourceKind    string
	Namespace       string
	Name            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 PersistentObject

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

func LoadPersistentObject

func LoadPersistentObject(ctx context.Context, client *kubernetes.Clientset, kind, namespace, name string) (*PersistentObject, error)

func NewObject

func NewObject() *PersistentObject

func (*PersistentObject) Get

func (obj *PersistentObject) Get(key string) []byte

func (*PersistentObject) Save

func (obj *PersistentObject) Save(ctx context.Context, client *kubernetes.Clientset, kind, namespace, name string,
	owners []metav1.OwnerReference, logger logr.Logger) error

func (*PersistentObject) Set

func (obj *PersistentObject) Set(key string, val []byte)

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