client

package
v0.6.0-3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: BSD-3-Clause Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBasicBinder

func NewBasicBinder(id interfaces.ModelId, res *grpc.Response) (b interfaces.GrpcModelBinder)

func NewServiceDelegate

func NewServiceDelegate(opts ...ModelServiceDelegateOption) (svc2 interfaces.GrpcClientModelService, err error)

func ProvideBaseServiceDelegate

func ProvideBaseServiceDelegate(id interfaces.ModelId) func() (svc interfaces.GrpcClientModelBaseService, err error)

func ProvideNodeServiceDelegate

func ProvideNodeServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelNodeService, err error)

func ProvidePluginServiceDelegate

func ProvidePluginServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelPluginService, err error)

func ProvidePluginStatusServiceDelegate

func ProvidePluginStatusServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelPluginStatusService, err error)

func ProvideServiceDelegate

func ProvideServiceDelegate(path string) func() (svc interfaces.GrpcClientModelService, err error)

func ProvideSpiderServiceDelegate

func ProvideSpiderServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelSpiderService, err error)

func ProvideTaskServiceDelegate

func ProvideTaskServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelTaskService, err error)

func ProvideTaskStatServiceDelegate

func ProvideTaskStatServiceDelegate(path string, opts ...ModelBaseServiceDelegateOption) func() (svc interfaces.GrpcClientModelTaskStatService, err error)

Types

type BaseServiceDelegate

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

func (*BaseServiceDelegate) Count

func (d *BaseServiceDelegate) Count(query bson.M) (total int, err error)

func (*BaseServiceDelegate) Delete

func (d *BaseServiceDelegate) Delete(query bson.M, args ...interface{}) (err error)

func (*BaseServiceDelegate) DeleteById

func (d *BaseServiceDelegate) DeleteById(id primitive.ObjectID, args ...interface{}) (err error)

func (*BaseServiceDelegate) DeleteList

func (d *BaseServiceDelegate) DeleteList(query bson.M, args ...interface{}) (err error)

func (*BaseServiceDelegate) ForceDeleteList

func (d *BaseServiceDelegate) ForceDeleteList(query bson.M, args ...interface{}) (err error)

func (*BaseServiceDelegate) Get

func (d *BaseServiceDelegate) Get(query bson.M, opts *mongo.FindOptions) (doc interfaces.Model, err error)

func (*BaseServiceDelegate) GetById

func (d *BaseServiceDelegate) GetById(id primitive.ObjectID) (doc interfaces.Model, err error)

func (*BaseServiceDelegate) GetConfigPath

func (d *BaseServiceDelegate) GetConfigPath() (path string)

func (*BaseServiceDelegate) GetList

func (d *BaseServiceDelegate) GetList(query bson.M, opts *mongo.FindOptions) (l interfaces.List, err error)

func (*BaseServiceDelegate) GetModelId

func (d *BaseServiceDelegate) GetModelId() (id interfaces.ModelId)

func (*BaseServiceDelegate) Insert

func (d *BaseServiceDelegate) Insert(u interfaces.User, docs ...interface{}) (err error)

func (*BaseServiceDelegate) SetConfigPath

func (d *BaseServiceDelegate) SetConfigPath(path string)

func (*BaseServiceDelegate) SetModelId

func (d *BaseServiceDelegate) SetModelId(id interfaces.ModelId)

func (*BaseServiceDelegate) Update

func (d *BaseServiceDelegate) Update(query bson.M, update bson.M, fields []string, args ...interface{}) (err error)

func (*BaseServiceDelegate) UpdateById

func (d *BaseServiceDelegate) UpdateById(id primitive.ObjectID, update bson.M, args ...interface{}) (err error)

func (*BaseServiceDelegate) UpdateDoc

func (d *BaseServiceDelegate) UpdateDoc(query bson.M, doc interfaces.Model, fields []string, args ...interface{}) (err error)

type BasicBinder

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

func (*BasicBinder) Bind

func (b *BasicBinder) Bind() (res interfaces.Model, err error)

func (*BasicBinder) Process

func (b *BasicBinder) Process(d interfaces.Model) (res interfaces.Model, err error)

type ListBinder

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

func (*ListBinder) Bind

func (b *ListBinder) Bind() (l interfaces.List, err error)

func (*ListBinder) MustBind

func (b *ListBinder) MustBind() (res interface{})

func (*ListBinder) Process

func (b *ListBinder) Process(d interface{}) (l interfaces.List, err error)

type ModelBaseServiceDelegateOption

type ModelBaseServiceDelegateOption func(delegate interfaces.GrpcClientModelBaseService)

func WithBaseServiceConfigPath

func WithBaseServiceConfigPath(path string) ModelBaseServiceDelegateOption

type ModelDelegate

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

func (*ModelDelegate) Add

func (d *ModelDelegate) Add() (err error)

func (*ModelDelegate) Close

func (d *ModelDelegate) Close() (err error)

func (*ModelDelegate) Delete

func (d *ModelDelegate) Delete() (err error)

func (*ModelDelegate) GetArtifact

func (d *ModelDelegate) GetArtifact() (res interfaces.ModelArtifact, err error)

func (*ModelDelegate) GetConfigPath

func (d *ModelDelegate) GetConfigPath() (path string)

func (*ModelDelegate) GetModel

func (d *ModelDelegate) GetModel() (res interfaces.Model)

func (*ModelDelegate) Refresh

func (d *ModelDelegate) Refresh() (err error)

func (*ModelDelegate) Save

func (d *ModelDelegate) Save() (err error)

func (*ModelDelegate) SetConfigPath

func (d *ModelDelegate) SetConfigPath(path string)

func (*ModelDelegate) ToBytes

func (d *ModelDelegate) ToBytes(m interface{}) (bytes []byte, err error)

type ModelDelegateOption

type ModelDelegateOption func(delegate interfaces.GrpcClientModelDelegate)

func WithDelegateConfigPath

func WithDelegateConfigPath(path string) ModelDelegateOption

type ModelNodeDelegate

type ModelNodeDelegate struct {
	interfaces.GrpcClientModelDelegate
	// contains filtered or unexported fields
}

func (*ModelNodeDelegate) UpdateStatus

func (d *ModelNodeDelegate) UpdateStatus(active bool, activeTs *time.Time, status string) (err error)

func (*ModelNodeDelegate) UpdateStatusOffline

func (d *ModelNodeDelegate) UpdateStatusOffline() (err error)

func (*ModelNodeDelegate) UpdateStatusOnline

func (d *ModelNodeDelegate) UpdateStatusOnline() (err error)

type ModelServiceDelegateOption

type ModelServiceDelegateOption func(delegate interfaces.GrpcClientModelService)

func WithServiceConfigPath

func WithServiceConfigPath(path string) ModelServiceDelegateOption

type NodeServiceDelegate

type NodeServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*NodeServiceDelegate) GetNode

func (svc *NodeServiceDelegate) GetNode(query bson.M, opts *mongo.FindOptions) (n interfaces.Node, err error)

func (*NodeServiceDelegate) GetNodeById

func (svc *NodeServiceDelegate) GetNodeById(id primitive.ObjectID) (n interfaces.Node, err error)

func (*NodeServiceDelegate) GetNodeByKey

func (svc *NodeServiceDelegate) GetNodeByKey(key string) (n interfaces.Node, err error)

func (*NodeServiceDelegate) GetNodeList

func (svc *NodeServiceDelegate) GetNodeList(query bson.M, opts *mongo.FindOptions) (res []interfaces.Node, err error)

type PluginServiceDelegate

type PluginServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*PluginServiceDelegate) GetPlugin

func (svc *PluginServiceDelegate) GetPlugin(query bson.M, opts *mongo.FindOptions) (n interfaces.Plugin, err error)

func (*PluginServiceDelegate) GetPluginById

func (svc *PluginServiceDelegate) GetPluginById(id primitive.ObjectID) (n interfaces.Plugin, err error)

func (*PluginServiceDelegate) GetPluginByName

func (svc *PluginServiceDelegate) GetPluginByName(name string) (n interfaces.Plugin, err error)

func (*PluginServiceDelegate) GetPluginList

func (svc *PluginServiceDelegate) GetPluginList(query bson.M, opts *mongo.FindOptions) (res []interfaces.Plugin, err error)

type PluginStatusServiceDelegate

type PluginStatusServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*PluginStatusServiceDelegate) GetPluginStatus

func (svc *PluginStatusServiceDelegate) GetPluginStatus(query bson.M, opts *mongo.FindOptions) (t interfaces.PluginStatus, err error)

func (*PluginStatusServiceDelegate) GetPluginStatusById

func (svc *PluginStatusServiceDelegate) GetPluginStatusById(id primitive.ObjectID) (t interfaces.PluginStatus, err error)

func (*PluginStatusServiceDelegate) GetPluginStatusList

func (svc *PluginStatusServiceDelegate) GetPluginStatusList(query bson.M, opts *mongo.FindOptions) (res []interfaces.PluginStatus, err error)

type ServiceDelegate

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

func (*ServiceDelegate) GetConfigPath

func (d *ServiceDelegate) GetConfigPath() string

func (*ServiceDelegate) NewBaseServiceDelegate

func (d *ServiceDelegate) NewBaseServiceDelegate(id interfaces.ModelId) (svc interfaces.GrpcClientModelBaseService, err error)

func (*ServiceDelegate) SetConfigPath

func (d *ServiceDelegate) SetConfigPath(path string)

type SpiderServiceDelegate

type SpiderServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*SpiderServiceDelegate) GetSpider

func (svc *SpiderServiceDelegate) GetSpider(query bson.M, opts *mongo.FindOptions) (s interfaces.Spider, err error)

func (*SpiderServiceDelegate) GetSpiderById

func (svc *SpiderServiceDelegate) GetSpiderById(id primitive.ObjectID) (s interfaces.Spider, err error)

func (*SpiderServiceDelegate) GetSpiderList

func (svc *SpiderServiceDelegate) GetSpiderList(query bson.M, opts *mongo.FindOptions) (res []interfaces.Spider, err error)

type TaskServiceDelegate

type TaskServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*TaskServiceDelegate) GetTask

func (svc *TaskServiceDelegate) GetTask(query bson.M, opts *mongo.FindOptions) (t interfaces.Task, err error)

func (*TaskServiceDelegate) GetTaskById

func (svc *TaskServiceDelegate) GetTaskById(id primitive.ObjectID) (t interfaces.Task, err error)

func (*TaskServiceDelegate) GetTaskList

func (svc *TaskServiceDelegate) GetTaskList(query bson.M, opts *mongo.FindOptions) (res []interfaces.Task, err error)

type TaskStatServiceDelegate

type TaskStatServiceDelegate struct {
	interfaces.GrpcClientModelBaseService
}

func (*TaskStatServiceDelegate) GetTaskStat

func (svc *TaskStatServiceDelegate) GetTaskStat(query bson.M, opts *mongo.FindOptions) (t interfaces.TaskStat, err error)

func (*TaskStatServiceDelegate) GetTaskStatById

func (svc *TaskStatServiceDelegate) GetTaskStatById(id primitive.ObjectID) (t interfaces.TaskStat, err error)

func (*TaskStatServiceDelegate) GetTaskStatList

func (svc *TaskStatServiceDelegate) GetTaskStatList(query bson.M, opts *mongo.FindOptions) (res []interfaces.TaskStat, err error)

Jump to

Keyboard shortcuts

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