db

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(db *Database)

func Init

func Init(db *Database)

Init function can perform some initialization work of different databases.

func TestClear

func TestClear() error

Types

type DBAdapter

type DBAdapter interface {
	//Policy
	CreatePolicy(ctx context.Context, pol *model.Policy) (*model.Policy, error)
	DeletePolicy(ctx context.Context, id string) error
	UpdatePolicy(ctx context.Context, pol *model.Policy) (*model.Policy, error)
	ListPolicy(ctx context.Context) ([]model.Policy, error)
	GetPolicy(ctx context.Context, id string) (*model.Policy, error)
	//Plan
	CreatePlan(ctx context.Context, conn *model.Plan) (*model.Plan, error)
	DeletePlan(ctx context.Context, name string) error
	UpdatePlan(ctx context.Context, conn *model.Plan) (*model.Plan, error)
	ListPlan(ctx context.Context, limit int, offset int, filter interface{}) ([]model.Plan, error)
	GetPlan(ctx context.Context, id string) (*model.Plan, error)
	GetPlanByPolicy(ctx context.Context, policyId string, limit int, offset int) ([]model.Plan, error)
	LockSched(tenantId, planId string) int
	UnlockSched(tenantId, planId string) int
	LockBucketLifecycleSched(bucketName string) int
	UnlockBucketLifecycleSched(bucketName string) int
	//Job
	CreateJob(ctx context.Context, job *model.Job) (*model.Job, error)
	GetJob(ctx context.Context, id string) (*model.Job, error)
	ListJob(ctx context.Context, limit int, offset int, filter interface{}) ([]model.Job, error)
}
var DbAdapter DBAdapter

C is a global variable that controls database module.

Directories

Path Synopsis
drivers

Jump to

Keyboard shortcuts

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