plugin

package
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("PluginNotFound")
)

Functions

func Call

func Call(ctx context.Context, ps types.PlugScope, req *pluginapi.Request) (resp *pluginapi.Response, err error)

func Init

func Init(cfg *config.Plugin) error

func MustShutdown

func MustShutdown()

func Register

func Register(spec types.PluginSpec, builder Builder)

func SourceInfo

func SourceInfo(ctx context.Context, ps types.PlugScope) (info string, err error)

Types

type Builder

type Builder func(ctx context.Context, spec types.PluginSpec, scope types.PlugScope) (Plugin, error)

type DelayProcessPlugin

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

func (*DelayProcessPlugin) Name

func (d *DelayProcessPlugin) Name() string

func (*DelayProcessPlugin) Run

func (*DelayProcessPlugin) Type

func (*DelayProcessPlugin) Version

func (d *DelayProcessPlugin) Version() string

type MemFS

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

func NewMemFS

func NewMemFS() *MemFS

func (*MemFS) CreateEntry

func (m *MemFS) CreateEntry(parentPath string, attr pluginapi.EntryAttr) (*pluginapi.Entry, error)

func (*MemFS) FindEntry

func (m *MemFS) FindEntry(parentPath string, name string) (*pluginapi.Entry, error)

func (*MemFS) GetEntry

func (m *MemFS) GetEntry(enPath string) (*pluginapi.Entry, error)

func (*MemFS) ListChildren

func (m *MemFS) ListChildren(enPath string) ([]*pluginapi.Entry, error)

func (*MemFS) ReadAt

func (m *MemFS) ReadAt(filePath string, dest []byte, off int64) (int64, error)

func (*MemFS) RemoveEntry

func (m *MemFS) RemoveEntry(parentPath string, en *pluginapi.Entry) error

func (*MemFS) Trunc

func (m *MemFS) Trunc(filePath string) error

func (*MemFS) UpdateEntry

func (m *MemFS) UpdateEntry(parentPath string, en *pluginapi.Entry) error

func (*MemFS) WriteAt

func (m *MemFS) WriteAt(filePath string, data []byte, off int64) (int64, error)

type MemFSPlugin

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

func NewMemFSPlugin

func NewMemFSPlugin() *MemFSPlugin

func (*MemFSPlugin) Close

func (d *MemFSPlugin) Close(ctx context.Context) error

func (*MemFSPlugin) CreateEntry

func (d *MemFSPlugin) CreateEntry(ctx context.Context, attr pluginapi.EntryAttr) (*pluginapi.Entry, error)

func (*MemFSPlugin) FindEntry

func (d *MemFSPlugin) FindEntry(ctx context.Context, name string) (*pluginapi.Entry, error)

func (*MemFSPlugin) Fsync

func (d *MemFSPlugin) Fsync(ctx context.Context) error

func (*MemFSPlugin) IsGroup

func (d *MemFSPlugin) IsGroup(ctx context.Context) (bool, error)

func (*MemFSPlugin) ListChildren

func (d *MemFSPlugin) ListChildren(ctx context.Context) ([]*pluginapi.Entry, error)

func (*MemFSPlugin) Name

func (d *MemFSPlugin) Name() string

func (*MemFSPlugin) ReadAt

func (d *MemFSPlugin) ReadAt(ctx context.Context, dest []byte, off int64) (int64, error)

func (*MemFSPlugin) RemoveEntry

func (d *MemFSPlugin) RemoveEntry(ctx context.Context, en *pluginapi.Entry) error

func (*MemFSPlugin) Trunc

func (d *MemFSPlugin) Trunc(ctx context.Context) error

func (*MemFSPlugin) Type

func (d *MemFSPlugin) Type() types.PluginType

func (*MemFSPlugin) UpdateEntry

func (d *MemFSPlugin) UpdateEntry(ctx context.Context, en *pluginapi.Entry) error

func (*MemFSPlugin) Version

func (d *MemFSPlugin) Version() string

func (*MemFSPlugin) WriteAt

func (d *MemFSPlugin) WriteAt(ctx context.Context, data []byte, off int64) (int64, error)

type MirrorPlugin

type MirrorPlugin interface {
	Plugin

	IsGroup(ctx context.Context) (bool, error)
	FindEntry(ctx context.Context, name string) (*pluginapi.Entry, error)
	CreateEntry(ctx context.Context, attr pluginapi.EntryAttr) (*pluginapi.Entry, error)
	UpdateEntry(ctx context.Context, en *pluginapi.Entry) error
	RemoveEntry(ctx context.Context, en *pluginapi.Entry) error
	ListChildren(ctx context.Context) ([]*pluginapi.Entry, error)

	WriteAt(ctx context.Context, data []byte, off int64) (int64, error)
	ReadAt(ctx context.Context, dest []byte, off int64) (int64, error)
	Fsync(ctx context.Context) error
	Trunc(ctx context.Context) error
	Close(ctx context.Context) error
}

func NewMirrorPlugin

func NewMirrorPlugin(ctx context.Context, ps types.PlugScope) (MirrorPlugin, error)

type Plugin

type Plugin interface {
	Name() string
	Type() types.PluginType
	Version() string
}

func BuildPlugin

func BuildPlugin(ctx context.Context, ps types.PlugScope) (Plugin, error)

type ProcessPlugin

type ProcessPlugin interface {
	Plugin
	Run(ctx context.Context, request *pluginapi.Request) (*pluginapi.Response, error)
}

type SourcePlugin

type SourcePlugin interface {
	ProcessPlugin
	SourceInfo() (string, error)
}

type ThreeBodyPlugin

type ThreeBodyPlugin struct{}

func (*ThreeBodyPlugin) Name

func (d *ThreeBodyPlugin) Name() string

func (*ThreeBodyPlugin) Run

func (*ThreeBodyPlugin) SourceInfo

func (d *ThreeBodyPlugin) SourceInfo() (string, error)

func (*ThreeBodyPlugin) Type

func (d *ThreeBodyPlugin) Type() types.PluginType

func (*ThreeBodyPlugin) Version

func (d *ThreeBodyPlugin) Version() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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