Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterPlugin ¶
func RegisterPlugin(name string, engineFunc dataSourceEngine)
Types ¶
type DataSource ¶
type DataSource interface { TaskDao() TaskDao TombstoneDao() TombstoneDao }
DataSource is the DAO layer
func GetDataSource ¶
func GetDataSource() DataSource
type TaskDao ¶
type TaskDao interface { // Create func is used for ut Create(ctx context.Context, task *sync.Task) (*sync.Task, error) Update(ctx context.Context, task *sync.Task) error Delete(ctx context.Context, tasks ...*sync.Task) error List(ctx context.Context, options ...TaskFindOption) ([]*sync.Task, error) }
TaskDao provide api of Task entity
func GetTaskDao ¶
func GetTaskDao() TaskDao
type TaskFindOption ¶
type TaskFindOption func(options *TaskFindOptions)
func WithDataType ¶
func WithDataType(dataType string) TaskFindOption
WithDataType find task with dataType
func WithProject ¶
func WithProject(project string) TaskFindOption
WithProject find task with project
type TaskFindOptions ¶
type TaskFindOptions struct { Domain string Project string Action string Status string ResourceType string }
func NewTaskFindOptions ¶
func NewTaskFindOptions() TaskFindOptions
type TombstoneDao ¶
type TombstoneDao interface { Get(ctx context.Context, req *model.GetTombstoneRequest) (*sync.Tombstone, error) // Create func is used for ut Create(ctx context.Context, tombstone *sync.Tombstone) (*sync.Tombstone, error) Delete(ctx context.Context, tombstones ...*sync.Tombstone) error List(ctx context.Context, options ...TombstoneFindOption) ([]*sync.Tombstone, error) }
TombstoneDao provide api of Tombstone entity
func GetTombstoneDao ¶
func GetTombstoneDao() TombstoneDao
type TombstoneFindOption ¶
type TombstoneFindOption func(options *TombstoneFindOptions)
func WithBeforeTimestamp ¶
func WithBeforeTimestamp(timestamp int64) TombstoneFindOption
WithBeforeTimestamp find tombstone with beforeTimestamp
func WithResourceType ¶
func WithResourceType(resourceType string) TombstoneFindOption
WithResourceType find tombstone with resource type
func WithTombstoneDomain ¶
func WithTombstoneDomain(domain string) TombstoneFindOption
WithTombstoneDomain find tombstone with domain
func WithTombstoneProject ¶
func WithTombstoneProject(project string) TombstoneFindOption
WithTombstoneProject find tombstone with project
type TombstoneFindOptions ¶
type TombstoneFindOptions struct { Domain string Project string ResourceType string BeforeTimestamp int64 }
func NewTombstoneFindOptions ¶
func NewTombstoneFindOptions() TombstoneFindOptions
Click to show internal directories.
Click to hide internal directories.