dispatcher

package
v0.0.0-...-9bec60d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChunkSize    = 1048576
	DefaultConfigPath   = "config.yaml"
	DefaultDatabasePath = "ali.db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseUploadRequest

type BaseUploadRequest struct {
	XSession   *ali_drive.UploadSession
	XFileName  string
	XSize      int64
	XChunkHint int64
}

func (*BaseUploadRequest) ChunkHint

func (b *BaseUploadRequest) ChunkHint() int64

func (*BaseUploadRequest) FileName

func (b *BaseUploadRequest) FileName() string

func (*BaseUploadRequest) Session

func (*BaseUploadRequest) Size

func (b *BaseUploadRequest) Size() int64

type ConfigManager

type ConfigManager struct {
	S suppress.ISuppress
}

func (*ConfigManager) ReadConfig

func (d *ConfigManager) ReadConfig(configPath string) *ali_notifier.Config

type DBManager

type DBManager struct {
	S suppress.ISuppress
}

func (*DBManager) OpenSqliteDB

func (d *DBManager) OpenSqliteDB(dsn string) *gorm.DB

type Dispatcher

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

func NewDispatcher

func NewDispatcher(options ...Option) *Dispatcher

func (*Dispatcher) GetConfig

func (d *Dispatcher) GetConfig() *ali_notifier.Config

func (*Dispatcher) GetDatabase

func (d *Dispatcher) GetDatabase() *gorm.DB

func (*Dispatcher) Loop

func (d *Dispatcher) Loop()

func (*Dispatcher) OnFsUpload

func (d *Dispatcher) OnFsUpload(req *ali_notifier.FsUploadRequest)

type Option

type Option = func(w *Dispatcher) *Dispatcher

func MockDB

func MockDB() Option

func WithConfig

func WithConfig(cfg *ali_notifier.Config) Option

func WithConfigPath

func WithConfigPath(cfgPath string) Option

func WithDBPath

func WithDBPath(dbPath string) Option

func WithNotifier

func WithNotifier(notifier ali_notifier.INotifier) Option

func WithServiceReplicate

func WithServiceReplicate(services ...service.IService) Option

type RandReaderUploadRequest

type RandReaderUploadRequest struct {
	BaseUploadRequest
	R ali_utils.RandReadCloser
	S suppress.ISuppress
}

func (*RandReaderUploadRequest) Done

func (f *RandReaderUploadRequest) Done()

func (*RandReaderUploadRequest) ReadAt

func (f *RandReaderUploadRequest) ReadAt(pos, maxLen int64) io.Reader

type ServiceContext

type ServiceContext struct {
	S suppress.ISuppress

	Impl service.IService
	// contains filtered or unexported fields
}

type ServiceSuppress

type ServiceSuppress struct {
	*Dispatcher
	*ServiceContext
}

func (*ServiceSuppress) Suppress

func (s *ServiceSuppress) Suppress(err error)

func (*ServiceSuppress) WarnOnce

func (s *ServiceSuppress) WarnOnce(err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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