mongodb

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseName = "keel"

DatabaseName is the database name in MongoDB, modify this variable to change database

Functions

This section is empty.

Types

type MongoDB

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

func New

func New(dsn string) (*MongoDB, error)

func (*MongoDB) ActivateTenants

func (m *MongoDB) ActivateTenants(ctx context.Context, opt types.ActivateTenantsOption) error

func (*MongoDB) Close

func (m *MongoDB) Close() error

func (*MongoDB) CountTenantPendingTasks

func (m *MongoDB) CountTenantPendingTasks(ctx context.Context, opt types.CountTenantPendingTasksOption) (int64, error)

func (*MongoDB) CreateTask

func (m *MongoDB) CreateTask(ctx context.Context, t entity.Task) error

func (*MongoDB) CreateTenant

func (m *MongoDB) CreateTenant(ctx context.Context, t entity.Tenant) error

func (*MongoDB) FindActiveTenants

func (m *MongoDB) FindActiveTenants(ctx context.Context, opt types.FindActiveTenantsOption) (tenants entity.Tenants, err error)

func (*MongoDB) FindPendingTasks added in v0.1.6

func (m *MongoDB) FindPendingTasks(ctx context.Context, opt types.FindPendingTasksOption) (entity.Tasks, error)

func (*MongoDB) GetTask

func (m *MongoDB) GetTask(ctx context.Context, opt types.GetTaskOption) (*entity.Task, error)

func (*MongoDB) GetTaskStatus

func (m *MongoDB) GetTaskStatus(ctx context.Context, opt types.GetTaskStatusOption) (enum.TaskStatus, error)

func (*MongoDB) GetTenant

func (m *MongoDB) GetTenant(ctx context.Context, opt types.GetTenantOption) (result *entity.Tenant, err error)

func (*MongoDB) UpdateTaskStatus

func (m *MongoDB) UpdateTaskStatus(ctx context.Context, opt types.UpdateTaskStatusOption) error

Jump to

Keyboard shortcuts

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