Documentation ¶
Index ¶
- func New() (plugin.Plugin, error)
- type CloudConfig
- type DB
- func (d *DB) Close() (err error)
- func (d *DB) CountApplication(tx *sqlx.Tx, name, namespace string) (int, error)
- func (d DB) CountCertByParentId(parentId string) (int, error)
- func (d *DB) CountProperty(name string) (int, error)
- func (d *DB) CountTask(task *models.Task) (int, error)
- func (d *DB) Create(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) CreateApplication(app *specV1.Application) (sql.Result, error)
- func (d *DB) CreateApplicationWithTx(tx *sqlx.Tx, app *specV1.Application) (sql.Result, error)
- func (d DB) CreateCert(cert plugin.Cert) error
- func (d *DB) CreateIndex(namespace string, keyA, keyB common.Resource, valueA, valueB string) (sql.Result, error)
- func (d *DB) CreateIndexTx(tx *sqlx.Tx, namespace string, keyA, keyB common.Resource, ...) (sql.Result, error)
- func (d *DB) CreateProperty(property *models.Property) error
- func (d *DB) CreateShadowTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) CreateTask(task *models.Task) (sql.Result, error)
- func (d *DB) CreateTaskTx(tx *sqlx.Tx, task *models.Task) (sql.Result, error)
- func (d *DB) Delete(namespace, name string) error
- func (d *DB) DeleteApplication(name, namespace, version string) (sql.Result, error)
- func (d *DB) DeleteApplicationWithTx(tx *sqlx.Tx, name, namespace, version string) (sql.Result, error)
- func (d DB) DeleteCert(certId string) error
- func (d *DB) DeleteIndex(namespace string, keyA, byKeyB common.Resource, valueB string) (sql.Result, error)
- func (d *DB) DeleteIndexTx(tx *sqlx.Tx, namespace string, keyA, byKeyB common.Resource, valueB string) (sql.Result, error)
- func (d *DB) DeleteProperty(name string) error
- func (d *DB) DeleteShadowTx(tx *sqlx.Tx, namespace, name string) (sql.Result, error)
- func (d *DB) DeleteTask(traceId string) (sql.Result, error)
- func (d *DB) DeleteTaskTx(tx *sqlx.Tx, traceId string) (sql.Result, error)
- func (d *DB) Exec(tx *sqlx.Tx, sql string, args ...interface{}) (res sql.Result, err error)
- func (d *DB) Get(namespace, name string) (*models.Shadow, error)
- func (d *DB) GetApplication(name, namespace, version string) (*specV1.Application, error)
- func (d DB) GetCert(certId string) (*plugin.Cert, error)
- func (d *DB) GetProperty(name string) (*models.Property, error)
- func (d *DB) GetPropertyValue(name string) (string, error)
- func (d *DB) GetShadowTx(tx *sqlx.Tx, namespace, name string) (*models.Shadow, error)
- func (d *DB) GetTask(traceId string) (*models.Task, error)
- func (d *DB) GetTaskTx(tx *sqlx.Tx, traceId string) (*models.Task, error)
- func (d *DB) List(namespace string, nodeList *models.NodeList) (*models.ShadowList, error)
- func (d *DB) ListApplication(namespace string, filter *models.Filter) ([]specV1.Application, error)
- func (d *DB) ListIndex(namespace string, keyA, byKeyB common.Resource, valueB string) ([]string, error)
- func (d *DB) ListIndexTx(tx *sqlx.Tx, namespace string, keyA, byKeyB common.Resource, valueB string) ([]string, error)
- func (d *DB) ListProperty(filter *models.Filter) ([]models.Property, error)
- func (d *DB) ListShadowByNamesTx(tx *sqlx.Tx, namespace string, names []string) ([]entities.Shadow, error)
- func (d *DB) Query(tx *sqlx.Tx, sql string, data interface{}, args ...interface{}) (err error)
- func (d *DB) RefreshIndex(namespace string, keyA, keyB common.Resource, valueA string, valueBs []string) error
- func (d *DB) Transact(handler func(*sqlx.Tx) error) (err error)
- func (d *DB) UpdateApplication(app *specV1.Application, oldVersion string) (sql.Result, error)
- func (d *DB) UpdateApplicationWithTx(tx *sqlx.Tx, app *specV1.Application, oldVersion string) (sql.Result, error)
- func (d DB) UpdateCert(cert plugin.Cert) error
- func (d *DB) UpdateDesire(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) UpdateProperty(property *models.Property) error
- func (d *DB) UpdateReport(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) UpdateShadowDesireTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) UpdateShadowReportTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) UpdateTask(task *models.Task) (sql.Result, error)
- func (d *DB) UpdateTaskTx(tx *sqlx.Tx, task *models.Task) (sql.Result, error)
- type DBStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudConfig ¶
type CloudConfig struct { Database struct { Type string `yaml:"type" json:"type" validate:"nonzero"` URL string `yaml:"url" json:"url" validate:"nonzero"` MaxConns int `yaml:"maxConns" json:"maxConns" default:20` MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns" default:5` ConnMaxLifetime int `yaml:"connMaxLifetime" json:"connMaxLifetime" default:150` } `yaml:"database" json:"database" default:"{}"` }
CloudConfig baetyl-cloud config
type DB ¶ added in v2.1.1
type DB struct {
// contains filtered or unexported fields
}
DBStorage
func NewDB ¶ added in v2.1.1
func NewDB(cfg CloudConfig) (*DB, error)
func (*DB) CountApplication ¶ added in v2.1.1
func (DB) CountCertByParentId ¶ added in v2.1.1
func (*DB) CreateApplication ¶ added in v2.1.1
func (*DB) CreateApplicationWithTx ¶ added in v2.1.1
func (*DB) CreateIndex ¶ added in v2.1.1
func (*DB) CreateIndexTx ¶ added in v2.1.1
func (*DB) CreateProperty ¶ added in v2.1.1
func (*DB) CreateShadowTx ¶ added in v2.1.1
func (*DB) CreateTask ¶ added in v2.1.1
func (*DB) CreateTaskTx ¶ added in v2.1.1
func (*DB) DeleteApplication ¶ added in v2.1.1
func (*DB) DeleteApplicationWithTx ¶ added in v2.1.1
func (DB) DeleteCert ¶ added in v2.1.1
func (*DB) DeleteIndex ¶ added in v2.1.1
func (*DB) DeleteIndexTx ¶ added in v2.1.1
func (*DB) DeleteProperty ¶ added in v2.1.1
func (*DB) DeleteShadowTx ¶ added in v2.1.1
func (*DB) DeleteTaskTx ¶ added in v2.1.1
func (*DB) GetApplication ¶ added in v2.1.1
func (d *DB) GetApplication(name, namespace, version string) (*specV1.Application, error)
func (*DB) GetProperty ¶ added in v2.1.1
func (*DB) GetPropertyValue ¶ added in v2.1.1
func (*DB) GetShadowTx ¶ added in v2.1.1
func (*DB) ListApplication ¶ added in v2.1.1
func (*DB) ListIndexTx ¶ added in v2.1.1
func (*DB) ListProperty ¶ added in v2.1.1
func (*DB) ListShadowByNamesTx ¶ added in v2.1.1
func (*DB) RefreshIndex ¶ added in v2.1.1
func (*DB) UpdateApplication ¶ added in v2.1.1
func (*DB) UpdateApplicationWithTx ¶ added in v2.1.1
func (*DB) UpdateDesire ¶ added in v2.1.1
func (*DB) UpdateProperty ¶ added in v2.1.1
func (*DB) UpdateReport ¶ added in v2.1.1
func (*DB) UpdateShadowDesireTx ¶ added in v2.1.1
func (*DB) UpdateShadowReportTx ¶ added in v2.1.1
func (*DB) UpdateTask ¶ added in v2.1.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.