controller

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketSource

type BucketSource interface {
	// Sync returns (local dir path, bucketname , error)
	Sync(ctx context.Context) (string, string, error)
	GetBucket() string
}

type Controller

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

func NewController

func NewController(db *storage.KVStore, bucketSources map[string]config.Bucket, options ...OptionFunc) (*Controller, error)

func (*Controller) Close

func (c *Controller) Close() error

func (*Controller) Get

func (c *Controller) Get(ctx context.Context, bucket, key string) ([]byte, error)

func (*Controller) SaveDir

func (c *Controller) SaveDir(ctx context.Context, dir, bucketName string) error

func (*Controller) SyncJob

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

func (*Controller) SyncSource

func (c *Controller) SyncSource(ctx context.Context, s BucketSource) error

type DirSource

type DirSource struct {
	BucketName string
	Dir        string
	// contains filtered or unexported fields
}

func (*DirSource) GetBucket

func (s *DirSource) GetBucket() string

func (*DirSource) Sync

func (s *DirSource) Sync(ctx context.Context) (string, string, error)

type GitSource

type GitSource struct {
	BucketName string

	LocalDir        string
	GitRepo         string
	GitRelativePath string
	GitUsername     string
	GitPasswordEnv  string
	// contains filtered or unexported fields
}

func (*GitSource) GetBucket

func (s *GitSource) GetBucket() string

func (*GitSource) Sync

func (s *GitSource) Sync(ctx context.Context) (string, string, error)

func (*GitSource) WithLogger

func (s *GitSource) WithLogger(l *zap.Logger)

type OptionFunc

type OptionFunc func(c *Controller)

func WithLogger

func WithLogger(l *zap.Logger) OptionFunc

Jump to

Keyboard shortcuts

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