service

package
v1.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseService

func GetBaseService(id interfaces.ModelId) (svc interfaces.ModelBaseService)

func GetBaseServiceByColName

func GetBaseServiceByColName(id interfaces.ModelId, colName string) (svc interfaces.ModelBaseService)

func NewBaseService

func NewBaseService(id interfaces.ModelId, opts ...BaseServiceOption) (svc2 interfaces.ModelBaseService)

func NewBasicBinder

func NewBasicBinder(id interfaces.ModelId, fr *mongo.FindResult) (b interfaces.ModelBinder)

Types

type BaseService

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

func (*BaseService) Count

func (svc *BaseService) Count(query bson.M) (total int, err error)

func (*BaseService) Delete

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

func (*BaseService) DeleteById

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

func (*BaseService) DeleteList

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

func (*BaseService) ForceDeleteList

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

func (*BaseService) Get

func (svc *BaseService) Get(query bson.M, opts *mongo.FindOptions) (res interfaces.Model, err error)

func (*BaseService) GetById

func (svc *BaseService) GetById(id primitive.ObjectID) (res interfaces.Model, err error)

func (*BaseService) GetCol

func (svc *BaseService) GetCol() (col *mongo.Col)

func (*BaseService) GetList

func (svc *BaseService) GetList(query bson.M, opts *mongo.FindOptions) (res arraylist.List, err error)

func (*BaseService) GetModelId

func (svc *BaseService) GetModelId() (id interfaces.ModelId)

func (*BaseService) Insert

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

func (*BaseService) SetCol

func (svc *BaseService) SetCol(col *mongo.Col)

func (*BaseService) SetModelId

func (svc *BaseService) SetModelId(id interfaces.ModelId)

func (*BaseService) Update

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

func (*BaseService) UpdateById

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

func (*BaseService) UpdateDoc

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

type BaseServiceOption

type BaseServiceOption func(svc interfaces.ModelBaseService)

func WithBaseServiceCol

func WithBaseServiceCol(col *mongo.Col) BaseServiceOption

func WithBaseServiceModelId

func WithBaseServiceModelId(id interfaces.ModelId) BaseServiceOption

type BasicBinder

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

func (*BasicBinder) AssignFields

func (b *BasicBinder) AssignFields(d interfaces.Model, fieldIds ...interfaces.ModelId) (res interfaces.Model, err error)

func (*BasicBinder) Bind

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

func (*BasicBinder) MustBind

func (b *BasicBinder) MustBind() (res interfaces.Model)

func (*BasicBinder) Process

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

func (*BasicBinder) ProcessWithFieldIds

func (b *BasicBinder) ProcessWithFieldIds(d interfaces.Model, fieldIds ...interfaces.ModelId) (res interfaces.Model, err error)

type ListBinder

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

func (*ListBinder) AssignListFields

func (b *ListBinder) AssignListFields(list interface{}, fieldIds ...interfaces.ModelId) (res arraylist.List, err error)

func (*ListBinder) AssignListFieldsAsPtr

func (b *ListBinder) AssignListFieldsAsPtr(list interface{}, fieldIds ...interfaces.ModelId) (res arraylist.List, err error)

func (*ListBinder) Bind

func (b *ListBinder) Bind() (list arraylist.List, err error)

func (*ListBinder) BindListAsPtr

func (b *ListBinder) BindListAsPtr() (res arraylist.List, err error)

func (*ListBinder) BindListWithNoFields

func (b *ListBinder) BindListWithNoFields() (res arraylist.List, err error)

func (*ListBinder) MustBindListAsPtr

func (b *ListBinder) MustBindListAsPtr() (res arraylist.List)

func (*ListBinder) MustBindListWithNoFields

func (b *ListBinder) MustBindListWithNoFields() (res arraylist.List)

func (*ListBinder) Process

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

func (*ListBinder) ProcessWithFieldIds

func (b *ListBinder) ProcessWithFieldIds(d interface{}, fieldIds ...interfaces.ModelId) (list arraylist.List, err error)

type ModelService

type ModelService interface {
	interfaces.ModelService
	GetNodeById(id primitive.ObjectID) (res *models.Node, err error)
	GetNode(query bson.M, opts *mongo.FindOptions) (res *models.Node, err error)
	GetNodeList(query bson.M, opts *mongo.FindOptions) (res []models.Node, err error)
	GetNodeByKey(key string, opts *mongo.FindOptions) (res *models.Node, err error)
	GetProjectById(id primitive.ObjectID) (res *models.Project, err error)
	GetProject(query bson.M, opts *mongo.FindOptions) (res *models.Project, err error)
	GetProjectList(query bson.M, opts *mongo.FindOptions) (res []models.Project, err error)
	GetArtifactById(id primitive.ObjectID) (res *models.Artifact, err error)
	GetArtifact(query bson.M, opts *mongo.FindOptions) (res *models.Artifact, err error)
	GetArtifactList(query bson.M, opts *mongo.FindOptions) (res []models.Artifact, err error)
	GetTagById(id primitive.ObjectID) (res *models.Tag, err error)
	GetTag(query bson.M, opts *mongo.FindOptions) (res *models.Tag, err error)
	GetTagList(query bson.M, opts *mongo.FindOptions) (res []models.Tag, err error)
	GetTagIds(colName string, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)
	UpdateTagsById(colName string, id primitive.ObjectID, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)
	UpdateTags(colName string, query bson.M, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)
	GetJobById(id primitive.ObjectID) (res *models.Job, err error)
	GetJob(query bson.M, opts *mongo.FindOptions) (res *models.Job, err error)
	GetJobList(query bson.M, opts *mongo.FindOptions) (res []models.Job, err error)
	GetScheduleById(id primitive.ObjectID) (res *models.Schedule, err error)
	GetSchedule(query bson.M, opts *mongo.FindOptions) (res *models.Schedule, err error)
	GetScheduleList(query bson.M, opts *mongo.FindOptions) (res []models.Schedule, err error)
	GetUserById(id primitive.ObjectID) (res *models.User, err error)
	GetUser(query bson.M, opts *mongo.FindOptions) (res *models.User, err error)
	GetUserList(query bson.M, opts *mongo.FindOptions) (res []models.User, err error)
	GetUserByUsername(username string, opts *mongo.FindOptions) (res *models.User, err error)
	GetUserByUsernameWithPassword(username string, opts *mongo.FindOptions) (res *models.User, err error)
	GetSettingById(id primitive.ObjectID) (res *models.Setting, err error)
	GetSetting(query bson.M, opts *mongo.FindOptions) (res *models.Setting, err error)
	GetSettingList(query bson.M, opts *mongo.FindOptions) (res []models.Setting, err error)
	GetSettingByKey(key string, opts *mongo.FindOptions) (res *models.Setting, err error)
	GetSpiderById(id primitive.ObjectID) (res *models.Spider, err error)
	GetSpider(query bson.M, opts *mongo.FindOptions) (res *models.Spider, err error)
	GetSpiderList(query bson.M, opts *mongo.FindOptions) (res []models.Spider, err error)
	GetTaskById(id primitive.ObjectID) (res *models.Task, err error)
	GetTask(query bson.M, opts *mongo.FindOptions) (res *models.Task, err error)
	GetTaskList(query bson.M, opts *mongo.FindOptions) (res []models.Task, err error)
	GetTokenById(id primitive.ObjectID) (res *models.Token, err error)
	GetToken(query bson.M, opts *mongo.FindOptions) (res *models.Token, err error)
	GetTokenList(query bson.M, opts *mongo.FindOptions) (res []models.Token, err error)
	GetVariableById(id primitive.ObjectID) (res *models.Variable, err error)
	GetVariable(query bson.M, opts *mongo.FindOptions) (res *models.Variable, err error)
	GetVariableList(query bson.M, opts *mongo.FindOptions) (res []models.Variable, err error)
	GetVariableByKey(key string, opts *mongo.FindOptions) (res *models.Variable, err error)
	GetTaskQueueItemById(id primitive.ObjectID) (res *models.TaskQueueItem, err error)
	GetTaskQueueItem(query bson.M, opts *mongo.FindOptions) (res *models.TaskQueueItem, err error)
	GetTaskQueueItemList(query bson.M, opts *mongo.FindOptions) (res []models.TaskQueueItem, err error)
	GetTaskStatById(id primitive.ObjectID) (res *models.TaskStat, err error)
	GetTaskStat(query bson.M, opts *mongo.FindOptions) (res *models.TaskStat, err error)
	GetTaskStatList(query bson.M, opts *mongo.FindOptions) (res []models.TaskStat, err error)
	GetPluginById(id primitive.ObjectID) (res *models.Plugin, err error)
	GetPlugin(query bson.M, opts *mongo.FindOptions) (res *models.Plugin, err error)
	GetPluginByName(name string) (res *models.Plugin, err error)
	GetPluginList(query bson.M, opts *mongo.FindOptions) (res []models.Plugin, err error)
	GetSpiderStatById(id primitive.ObjectID) (res *models.SpiderStat, err error)
	GetSpiderStat(query bson.M, opts *mongo.FindOptions) (res *models.SpiderStat, err error)
	GetSpiderStatList(query bson.M, opts *mongo.FindOptions) (res []models.SpiderStat, err error)
	GetDataSourceById(id primitive.ObjectID) (res *models.DataSource, err error)
	GetDataSource(query bson.M, opts *mongo.FindOptions) (res *models.DataSource, err error)
	GetDataSourceList(query bson.M, opts *mongo.FindOptions) (res []models.DataSource, err error)
	GetDataCollectionById(id primitive.ObjectID) (res *models.DataCollection, err error)
	GetDataCollection(query bson.M, opts *mongo.FindOptions) (res *models.DataCollection, err error)
	GetDataCollectionList(query bson.M, opts *mongo.FindOptions) (res []models.DataCollection, err error)
	GetDataCollectionByName(name string, opts *mongo.FindOptions) (res *models.DataCollection, err error)
	GetPasswordById(id primitive.ObjectID) (res *models.Password, err error)
	GetPassword(query bson.M, opts *mongo.FindOptions) (res *models.Password, err error)
	GetPasswordList(query bson.M, opts *mongo.FindOptions) (res []models.Password, err error)
	GetExtraValueById(id primitive.ObjectID) (res *models.ExtraValue, err error)
	GetExtraValue(query bson.M, opts *mongo.FindOptions) (res *models.ExtraValue, err error)
	GetExtraValueList(query bson.M, opts *mongo.FindOptions) (res []models.ExtraValue, err error)
	GetExtraValueByObjectIdModel(oid primitive.ObjectID, m string, opts *mongo.FindOptions) (res *models.ExtraValue, err error)
	GetPluginStatusById(id primitive.ObjectID) (res *models.PluginStatus, err error)
	GetPluginStatus(query bson.M, opts *mongo.FindOptions) (res *models.PluginStatus, err error)
	GetPluginStatusList(query bson.M, opts *mongo.FindOptions) (res []models.PluginStatus, err error)
	GetGitById(id primitive.ObjectID) (res *models.Git, err error)
	GetGit(query bson.M, opts *mongo.FindOptions) (res *models.Git, err error)
	GetGitList(query bson.M, opts *mongo.FindOptions) (res []models.Git, err error)
	DropAll() (err error)
}

func GetService

func GetService(opts ...Option) (svc ModelService, err error)

func NewService

func NewService(opts ...Option) (svc2 ModelService, err error)

type Option

type Option func(ModelService)

type Service

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

func (*Service) DropAll

func (svc *Service) DropAll() (err error)

func (*Service) GetArtifact

func (svc *Service) GetArtifact(query bson.M, opts *mongo.FindOptions) (res *models2.Artifact, err error)

func (*Service) GetArtifactById

func (svc *Service) GetArtifactById(id primitive.ObjectID) (res *models2.Artifact, err error)

func (*Service) GetArtifactList

func (svc *Service) GetArtifactList(query bson.M, opts *mongo.FindOptions) (res []models2.Artifact, err error)

func (*Service) GetBaseService

func (svc *Service) GetBaseService(id interfaces.ModelId) (svc2 interfaces.ModelBaseService)

func (*Service) GetDataCollection

func (svc *Service) GetDataCollection(query bson.M, opts *mongo.FindOptions) (res *models2.DataCollection, err error)

func (*Service) GetDataCollectionById

func (svc *Service) GetDataCollectionById(id primitive.ObjectID) (res *models2.DataCollection, err error)

func (*Service) GetDataCollectionByName

func (svc *Service) GetDataCollectionByName(name string, opts *mongo.FindOptions) (res *models2.DataCollection, err error)

func (*Service) GetDataCollectionList

func (svc *Service) GetDataCollectionList(query bson.M, opts *mongo.FindOptions) (res []models2.DataCollection, err error)

func (*Service) GetDataSource

func (svc *Service) GetDataSource(query bson.M, opts *mongo.FindOptions) (res *models2.DataSource, err error)

func (*Service) GetDataSourceById

func (svc *Service) GetDataSourceById(id primitive.ObjectID) (res *models2.DataSource, err error)

func (*Service) GetDataSourceList

func (svc *Service) GetDataSourceList(query bson.M, opts *mongo.FindOptions) (res []models2.DataSource, err error)

func (*Service) GetExtraValue

func (svc *Service) GetExtraValue(query bson.M, opts *mongo.FindOptions) (res *models.ExtraValue, err error)

func (*Service) GetExtraValueById

func (svc *Service) GetExtraValueById(id primitive.ObjectID) (res *models.ExtraValue, err error)

func (*Service) GetExtraValueByObjectIdModel

func (svc *Service) GetExtraValueByObjectIdModel(oid primitive.ObjectID, m string, opts *mongo.FindOptions) (res *models.ExtraValue, err error)

func (*Service) GetExtraValueList

func (svc *Service) GetExtraValueList(query bson.M, opts *mongo.FindOptions) (res []models.ExtraValue, err error)

func (*Service) GetGit

func (svc *Service) GetGit(query bson.M, opts *mongo.FindOptions) (res *models2.Git, err error)

func (*Service) GetGitById

func (svc *Service) GetGitById(id primitive.ObjectID) (res *models2.Git, err error)

func (*Service) GetGitList

func (svc *Service) GetGitList(query bson.M, opts *mongo.FindOptions) (res []models2.Git, err error)

func (*Service) GetJob

func (svc *Service) GetJob(query bson.M, opts *mongo.FindOptions) (res *models2.Job, err error)

func (*Service) GetJobById

func (svc *Service) GetJobById(id primitive.ObjectID) (res *models2.Job, err error)

func (*Service) GetJobList

func (svc *Service) GetJobList(query bson.M, opts *mongo.FindOptions) (res []models2.Job, err error)

func (*Service) GetNode

func (svc *Service) GetNode(query bson.M, opts *mongo.FindOptions) (res *models2.Node, err error)

func (*Service) GetNodeById

func (svc *Service) GetNodeById(id primitive.ObjectID) (res *models2.Node, err error)

func (*Service) GetNodeByKey

func (svc *Service) GetNodeByKey(key string, opts *mongo.FindOptions) (res *models2.Node, err error)

func (*Service) GetNodeList

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

func (*Service) GetPassword

func (svc *Service) GetPassword(query bson.M, opts *mongo.FindOptions) (res *models2.Password, err error)

func (*Service) GetPasswordById

func (svc *Service) GetPasswordById(id primitive.ObjectID) (res *models2.Password, err error)

func (*Service) GetPasswordList

func (svc *Service) GetPasswordList(query bson.M, opts *mongo.FindOptions) (res []models2.Password, err error)

func (*Service) GetPlugin

func (svc *Service) GetPlugin(query bson.M, opts *mongo.FindOptions) (res *models2.Plugin, err error)

func (*Service) GetPluginById

func (svc *Service) GetPluginById(id primitive.ObjectID) (res *models2.Plugin, err error)

func (*Service) GetPluginByName

func (svc *Service) GetPluginByName(name string) (res *models2.Plugin, err error)

func (*Service) GetPluginList

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

func (*Service) GetPluginStatus

func (svc *Service) GetPluginStatus(query bson.M, opts *mongo.FindOptions) (res *models2.PluginStatus, err error)

func (*Service) GetPluginStatusById

func (svc *Service) GetPluginStatusById(id primitive.ObjectID) (res *models2.PluginStatus, err error)

func (*Service) GetPluginStatusList

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

func (*Service) GetProject

func (svc *Service) GetProject(query bson.M, opts *mongo.FindOptions) (res *models2.Project, err error)

func (*Service) GetProjectById

func (svc *Service) GetProjectById(id primitive.ObjectID) (res *models2.Project, err error)

func (*Service) GetProjectList

func (svc *Service) GetProjectList(query bson.M, opts *mongo.FindOptions) (res []models2.Project, err error)

func (*Service) GetSchedule

func (svc *Service) GetSchedule(query bson.M, opts *mongo.FindOptions) (res *models2.Schedule, err error)

func (*Service) GetScheduleById

func (svc *Service) GetScheduleById(id primitive.ObjectID) (res *models2.Schedule, err error)

func (*Service) GetScheduleList

func (svc *Service) GetScheduleList(query bson.M, opts *mongo.FindOptions) (res []models2.Schedule, err error)

func (*Service) GetSetting

func (svc *Service) GetSetting(query bson.M, opts *mongo.FindOptions) (res *models2.Setting, err error)

func (*Service) GetSettingById

func (svc *Service) GetSettingById(id primitive.ObjectID) (res *models2.Setting, err error)

func (*Service) GetSettingByKey

func (svc *Service) GetSettingByKey(key string, opts *mongo.FindOptions) (res *models2.Setting, err error)

func (*Service) GetSettingList

func (svc *Service) GetSettingList(query bson.M, opts *mongo.FindOptions) (res []models2.Setting, err error)

func (*Service) GetSpider

func (svc *Service) GetSpider(query bson.M, opts *mongo.FindOptions) (res *models2.Spider, err error)

func (*Service) GetSpiderById

func (svc *Service) GetSpiderById(id primitive.ObjectID) (res *models2.Spider, err error)

func (*Service) GetSpiderList

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

func (*Service) GetSpiderStat

func (svc *Service) GetSpiderStat(query bson.M, opts *mongo.FindOptions) (res *models2.SpiderStat, err error)

func (*Service) GetSpiderStatById

func (svc *Service) GetSpiderStatById(id primitive.ObjectID) (res *models2.SpiderStat, err error)

func (*Service) GetSpiderStatList

func (svc *Service) GetSpiderStatList(query bson.M, opts *mongo.FindOptions) (res []models2.SpiderStat, err error)

func (*Service) GetTag

func (svc *Service) GetTag(query bson.M, opts *mongo.FindOptions) (res *models2.Tag, err error)

func (*Service) GetTagById

func (svc *Service) GetTagById(id primitive.ObjectID) (res *models2.Tag, err error)

func (*Service) GetTagIds

func (svc *Service) GetTagIds(colName string, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)

func (*Service) GetTagList

func (svc *Service) GetTagList(query bson.M, opts *mongo.FindOptions) (res []models2.Tag, err error)

func (*Service) GetTask

func (svc *Service) GetTask(query bson.M, opts *mongo.FindOptions) (res *models2.Task, err error)

func (*Service) GetTaskById

func (svc *Service) GetTaskById(id primitive.ObjectID) (res *models2.Task, err error)

func (*Service) GetTaskList

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

func (*Service) GetTaskQueueItem

func (svc *Service) GetTaskQueueItem(query bson.M, opts *mongo.FindOptions) (res *models2.TaskQueueItem, err error)

func (*Service) GetTaskQueueItemById

func (svc *Service) GetTaskQueueItemById(id primitive.ObjectID) (res *models2.TaskQueueItem, err error)

func (*Service) GetTaskQueueItemList

func (svc *Service) GetTaskQueueItemList(query bson.M, opts *mongo.FindOptions) (res []models2.TaskQueueItem, err error)

func (*Service) GetTaskStat

func (svc *Service) GetTaskStat(query bson.M, opts *mongo.FindOptions) (res *models2.TaskStat, err error)

func (*Service) GetTaskStatById

func (svc *Service) GetTaskStatById(id primitive.ObjectID) (res *models2.TaskStat, err error)

func (*Service) GetTaskStatList

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

func (*Service) GetToken

func (svc *Service) GetToken(query bson.M, opts *mongo.FindOptions) (res *models2.Token, err error)

func (*Service) GetTokenById

func (svc *Service) GetTokenById(id primitive.ObjectID) (res *models2.Token, err error)

func (*Service) GetTokenList

func (svc *Service) GetTokenList(query bson.M, opts *mongo.FindOptions) (res []models2.Token, err error)

func (*Service) GetUser

func (svc *Service) GetUser(query bson.M, opts *mongo.FindOptions) (res *models2.User, err error)

func (*Service) GetUserById

func (svc *Service) GetUserById(id primitive.ObjectID) (res *models2.User, err error)

func (*Service) GetUserByUsername

func (svc *Service) GetUserByUsername(username string, opts *mongo.FindOptions) (res *models2.User, err error)

func (*Service) GetUserByUsernameWithPassword

func (svc *Service) GetUserByUsernameWithPassword(username string, opts *mongo.FindOptions) (res *models2.User, err error)

func (*Service) GetUserList

func (svc *Service) GetUserList(query bson.M, opts *mongo.FindOptions) (res []models2.User, err error)

func (*Service) GetVariable

func (svc *Service) GetVariable(query bson.M, opts *mongo.FindOptions) (res *models2.Variable, err error)

func (*Service) GetVariableById

func (svc *Service) GetVariableById(id primitive.ObjectID) (res *models2.Variable, err error)

func (*Service) GetVariableByKey

func (svc *Service) GetVariableByKey(key string, opts *mongo.FindOptions) (res *models2.Variable, err error)

func (*Service) GetVariableList

func (svc *Service) GetVariableList(query bson.M, opts *mongo.FindOptions) (res []models2.Variable, err error)

func (*Service) UpdateTags

func (svc *Service) UpdateTags(colName string, query bson.M, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)

func (*Service) UpdateTagsById

func (svc *Service) UpdateTagsById(colName string, id primitive.ObjectID, tags []interfaces.Tag) (tagIds []primitive.ObjectID, err error)

Jump to

Keyboard shortcuts

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