Versions in this module Expand all Collapse all v0 v0.2.0 Oct 31, 2023 Changes in this version type EventType + const ConfigSaved + const DeviceConnected + const DeviceDisconnected + const DeviceDiscovered + const DevicePaused + const DeviceResumed + const DownloadProgress + const Failure + const FolderErrors + const FolderPaused + const FolderResumed + const FolderScanProgress + const FolderSummary + const FolderWatchStateChanged + const ItemFinished + const ItemStarted + const ListenAddressesChanged + const LocalIndexUpdated + const LoginAttempt + const PendingDevicesChanged + const PendingFoldersChanged + const RemoteChangeDetected + const RemoteDownloadProgress + const RemoteIndexUpdated + const Starting + const StartupComplete + const StateChanged v0.1.0 Oct 28, 2023 Changes in this version + var ErrInvalidActionType = errors.New("invalid action type") + var ErrNotValidNativeEventType = errors.New("not a valid native event type") + func DestroyHandlerChain(handlerChain EventHandler) + type ActionExecutorCreator interface + CreateExecutor func(action *HookAction, hookDef *HookDefinition) (EventHandler, error) + type AppProfile struct + Hooks []Hook + Log LogConfig + Syncthing SyncthingConfig + type ConnectionServiceStatus struct + Error *string + LanAddresses []string + WanAddresses []string + type DiscoveryStatus struct + Error *string + type Event struct + Data interface{} + Time time.Time + Type EventType + func NewEventFromStEvent(event events.Event) *Event + func (e *Event) String() string + type EventCh = <-chan *Event + func ConvertNativeEventChannel(nativeEventCh <-chan events.Event) EventCh + type EventHandler interface + Destroy func() + GetNext func() EventHandler + Handle func(event *Event) + SetNext func(next EventHandler) + func BuildEventHandlerChain(handlers ...EventHandler) EventHandler + type EventSource interface + Subscribe func(eventType EventType, params *HookParameters, hookDef *HookDefinition) (EventCh, error) + Unsubscribe func(eventCh EventCh) + type EventType string + const FolderCompletion + const LocalChangeDetected + const LocalFolderContentChangeDetected + const UnknownEventType + func UnmarshalEventType(evType string) EventType + func (t EventType) ConvertToNative() (events.EventType, error) + func (t EventType) IsNativeEvent() bool + type Hook struct + Action HookAction + Conditions []struct{ ... } + EventType string + Name string + Parameter HookParameters + type HookAction struct + Cmd []string + Type string + type HookDefinition struct + Index int + Name string + func NewHookDefinition(name string, index int) *HookDefinition + func (d *HookDefinition) AddToLogger(logger *zap.SugaredLogger) *zap.SugaredLogger + type HookManager interface + RegisterHook func(hook *Hook, hookDef *HookDefinition) error + UnregisterAll func() + type HookParameters map[string]any + func (p HookParameters) ContainsKey(key string) (ex bool) + func (p HookParameters) ExtractInt64IfExist(key string, target *int64) + func (p HookParameters) ExtractIntIfExist(key string, target *int) + func (p HookParameters) ExtractStringIfExist(key string, target *string) + func (p HookParameters) GetInt64(key string, defaultValue int64) int64 + func (p HookParameters) GetString(key string, defaultValue string) string + type IllegalEventParamError struct + Message string + func NewIllegalEventParamError(message string) *IllegalEventParamError + func (e *IllegalEventParamError) Error() string + type LastDialStatus struct + Error *string + When time.Time + type LogConfig struct + File LogFileConfig + Stdout struct{ ... } + type LogFileConfig struct + Dir string + Enabled bool + Level string + MaxBackups int + MaxSize int + type StApiError struct + Err error + HttpStatusCode int + func NewStApiHttpError(resp *resty.Response) StApiError + func NewStApiReqError(err error) StApiError + func (e StApiError) Error() string + func (e StApiError) Unwrap() error + type SyncthingClient interface + GetDiskEvents func(since int, timeout int, limit int) ([]events.Event, error) + GetEvents func(eventTypes []events.EventType, since int, timeout int, limit int) ([]events.Event, error) + GetSystemStatus func() (*SystemStatus, error) + SubscribeEvent func(eventTypes []events.EventType, since int) <-chan events.Event + UnsubscribeEvent func(eventCh <-chan events.Event) + type SyncthingConfig struct + ApiKey string + Url string + type SystemStatus struct + Alloc int + ConnectionServiceStatus map[string]ConnectionServiceStatus + DiscoveryEnabled bool + DiscoveryErrors map[string]string + DiscoveryMethods int + DiscoveryStatus map[string]DiscoveryStatus + Goroutines int + LastDialStatus map[string]LastDialStatus + MyID string + PathSeparator string + StartTime time.Time + Sys int + Themes []string + Tilde string + Uptime int + type TimeProvider interface + NowUnixMilli func() int64