db

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 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 *c.Context, pol *model.Policy) (*model.Policy, error)
	DeletePolicy(ctx *c.Context, id string) error
	UpdatePolicy(ctx *c.Context, pol *model.Policy) (*model.Policy, error)
	ListPolicy(ctx *c.Context) ([]model.Policy, error)
	GetPolicy(ctx *c.Context, id string) (*model.Policy, error)
	//Plan
	CreatePlan(ctx *c.Context, conn *model.Plan) (*model.Plan, error)
	DeletePlan(ctx *c.Context, name string) error
	UpdatePlan(ctx *c.Context, conn *model.Plan) (*model.Plan, error)
	ListPlan(ctx *c.Context, limit int, offset int, filter interface{}) ([]model.Plan, error)
	GetPlan(ctx *c.Context, id string) (*model.Plan, error)
	GetPlanByPolicy(ctx *c.Context, policyId string, limit int, offset int) ([]model.Plan, error)
	LockSched(planId string) int
	UnlockSched(planId string) int
	//Job
	CreateJob(ctx *c.Context, job *model.Job) (*model.Job, error)
	GetJob(ctx *c.Context, id string) (*model.Job, error)
	ListJob(ctx *c.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