fsnotify

package
v0.0.131 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.

*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.

*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.

*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.

*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_fsnotify_fsnotify_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CompletedConfig

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

func (CompletedConfig) New

func (c CompletedConfig) New(ctx context.Context) (*FsnotifyService, error)

type Config

type Config struct {
	Proto Fsnotify
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(options ...ConfigOption) *Config

func (*Config) ApplyOptions

func (o *Config) ApplyOptions(options ...ConfigOption) *Config

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete set default ServerRunOptions.

type ConfigOption

type ConfigOption interface {
	// contains filtered or unexported methods
}

A ConfigOption sets options.

func WithViper

func WithViper(v *viper.Viper) ConfigOption

type ConfigOptionFunc

type ConfigOptionFunc func(*Config)

ConfigOptionFunc wraps a function that modifies Client into an implementation of the ConfigOption interface.

type EmptyConfigOption

type EmptyConfigOption struct{}

EmptyConfigOption does not alter the configuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

type EmptyFsnotifyOption

type EmptyFsnotifyOption struct{}

EmptyFsnotifyUrlOption does not alter the Fsnotifyuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

type EventCallbackFunc

type EventCallbackFunc func(ctx context.Context, path string)

type Fsnotify

type Fsnotify struct {
	Enabled   bool     `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	FilePaths []string `protobuf:"bytes,2,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"`
	// contains filtered or unexported fields
}

func (*Fsnotify) Descriptor deprecated

func (*Fsnotify) Descriptor() ([]byte, []int)

Deprecated: Use Fsnotify.ProtoReflect.Descriptor instead.

func (*Fsnotify) GetEnabled

func (x *Fsnotify) GetEnabled() bool

func (*Fsnotify) GetFilePaths

func (x *Fsnotify) GetFilePaths() []string

func (*Fsnotify) ProtoMessage

func (*Fsnotify) ProtoMessage()

func (*Fsnotify) ProtoReflect

func (x *Fsnotify) ProtoReflect() protoreflect.Message

func (*Fsnotify) Reset

func (x *Fsnotify) Reset()

func (*Fsnotify) String

func (x *Fsnotify) String() string

type FsnotifyOption

type FsnotifyOption interface {
	// contains filtered or unexported methods
}

A FsnotifyOption sets options.

func WithCreateCallbackFunc added in v0.0.111

func WithCreateCallbackFunc(fn EventCallbackFunc) FsnotifyOption

func WithRemoveCallbackFunc added in v0.0.111

func WithRemoveCallbackFunc(fn EventCallbackFunc) FsnotifyOption

func WithWriteCallbackFunc

func WithWriteCallbackFunc(fn EventCallbackFunc) FsnotifyOption

type FsnotifyOptionFunc

type FsnotifyOptionFunc func(*FsnotifyService)

FsnotifyOptionFunc wraps a function that modifies FsnotifyService into an implementation of the FsnotifyOption interface.

type FsnotifyOptions

type FsnotifyOptions struct {
	CreateCallbackFunc EventCallbackFunc
	WriteCallbackFunc  EventCallbackFunc
	RemoveCallbackFunc EventCallbackFunc
}

type FsnotifyService

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

func NewFsnotifyService

func NewFsnotifyService(paths []string, opts ...FsnotifyOption) (*FsnotifyService, error)

paths can also be dir or file or both of them

func (*FsnotifyService) Add

func (srv *FsnotifyService) Add(unWatch bool, path string) (err error)

Add starts watching the named directory (non-recursively).

func (*FsnotifyService) AddWatchPath

func (srv *FsnotifyService) AddWatchPath(unWatch bool, path string) error

Add starts watching the named directory (support recursively).

func (*FsnotifyService) AddWatchPaths

func (srv *FsnotifyService) AddWatchPaths(unWatch bool, paths ...string) error

func (*FsnotifyService) ApplyOptions

func (o *FsnotifyService) ApplyOptions(options ...FsnotifyOption) *FsnotifyService

func (*FsnotifyService) Run

func (srv *FsnotifyService) Run(ctx context.Context) error

func (*FsnotifyService) Serve

func (srv *FsnotifyService) Serve(ctx context.Context) error

func (*FsnotifyService) Shutdown

func (srv *FsnotifyService) Shutdown()

Jump to

Keyboard shortcuts

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